Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 674
    • Issues 674
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyPy
  • pypypypy
  • Merge requests
  • !179

Fix wrong parsing of list comprehensions (py3k)

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Bitbucket Importer requested to merge bitbucket/merged-pr-179 into branch/py3k Aug 07, 2013
  • Overview 4
  • Commits 8
  • Changes 3

Created originally on Bitbucket by kostialopuhin (Konstantin Lopukhin)

Was already merged in Bitbucket before import, marked as merged by the import user

Fix an issue with parsing of list comprehensions - [x for x in a or b] used to misbehave. PyPy::

$ ~/opt/pypy3-2.1-beta1-osx64/bin/pypy
Python 3.2.3 (d63636b30cc0, Jul 30 2013, 07:02:48)
[PyPy 2.1.0-beta1 with GCC 4.2.1 Compatible Clang Compiler] on darwin
>>>> a, b = [1], []
>>>> [x for x in a or b]
[[1], []]

CPython::

$ python3
Python 3.2.4rc1 (v3.2.4rc1:b2cb7bc1edb8, Mar 25 2013, 00:39:29)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>>> a, b = [1], []
>>> [x for x in a or b]
[1]

The fix is one line, and two tests are added. I ran all astcompiler tests, all seems to be fine. On default branch this handle_testlist is really required (else it fails to parse some list comprehensions), but I don't know why this bug does not appear on default.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: bitbucket/merged-pr-179