Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing of unpacked expressions in call #68364

Closed
tacaswell mannequin opened this issue May 13, 2015 · 2 comments
Closed

Incorrect parsing of unpacked expressions in call #68364

tacaswell mannequin opened this issue May 13, 2015 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@tacaswell
Copy link
Mannequin

tacaswell mannequin commented May 13, 2015

BPO 24176
Nosy @benjaminp, @1st1, @tacaswell
Files
  • unpack_grammar.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-05-16.13:45:05.663>
    created_at = <Date 2015-05-13.14:07:25.523>
    labels = ['interpreter-core', 'type-bug']
    title = 'Incorrect parsing of unpacked expressions in call'
    updated_at = <Date 2015-05-16.13:45:05.661>
    user = 'https://github.com/tacaswell'

    bugs.python.org fields:

    activity = <Date 2015-05-16.13:45:05.661>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-05-16.13:45:05.663>
    closer = 'python-dev'
    components = ['Interpreter Core']
    creation = <Date 2015-05-13.14:07:25.523>
    creator = 'tcaswell'
    dependencies = []
    files = ['39359']
    hgrepos = []
    issue_num = 24176
    keywords = ['patch']
    message_count = 2.0
    messages = ['243087', '243316']
    nosy_count = 4.0
    nosy_names = ['benjamin.peterson', 'python-dev', 'yselivanov', 'tcaswell']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue24176'
    versions = ['Python 3.5']

    @tacaswell
    Copy link
    Mannequin Author

    tacaswell mannequin commented May 13, 2015

    On the current tip (changeset: 96023:4b5461dcd190) the following results in a syntax error

    def test(a='a', b='b'):
        print(a, b)
    
    opta = dict()
    optb = dict(a=1, b=2)
    test(**(opta or {}))  # <- works on all python
    test(**optb or {})    # <- fails on current hg tip

    This is suspected to be a result of https://hg.python.org/cpython/rev/a65f685ba8c0

    This was reported as an issue against sphinx (sphinx-doc/sphinx#1889) and I was redirected here.

    As suggested by Robert Lehmann suggests the issue is https://hg.python.org/cpython/rev/a65f685ba8c0#l1.33 which should be ** test. Making this change prevents the syntax error (patch attached).

    @tacaswell tacaswell mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels May 13, 2015
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 16, 2015

    New changeset 38b2307372bf by Benjamin Peterson in branch 'default':
    allow test node after ** in calls (closes bpo-24176)
    https://hg.python.org/cpython/rev/38b2307372bf

    @python-dev python-dev mannequin closed this as completed May 16, 2015
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants