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

*args regression #68979

Closed
o11c mannequin opened this issue Aug 5, 2015 · 10 comments
Closed

*args regression #68979

o11c mannequin opened this issue Aug 5, 2015 · 10 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker type-bug An unexpected behavior, bug, or error

Comments

@o11c
Copy link
Mannequin

o11c mannequin commented Aug 5, 2015

BPO 24791
Nosy @ncoghlan, @larryhastings, @benjaminp, @zware, @1st1, @o11c
Files
  • issue24791.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-08-05.22:01:00.775>
    created_at = <Date 2015-08-05.03:42:24.872>
    labels = ['interpreter-core', 'type-bug', 'release-blocker']
    title = '*args regression'
    updated_at = <Date 2015-10-04.03:03:41.344>
    user = 'https://github.com/o11c'

    bugs.python.org fields:

    activity = <Date 2015-10-04.03:03:41.344>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-08-05.22:01:00.775>
    closer = 'yselivanov'
    components = ['Interpreter Core']
    creation = <Date 2015-08-05.03:42:24.872>
    creator = 'o11c'
    dependencies = []
    files = ['40128']
    hgrepos = []
    issue_num = 24791
    keywords = ['patch', '3.4regression']
    message_count = 10.0
    messages = ['248014', '248015', '248016', '248017', '248018', '248020', '248044', '248082', '248083', '252251']
    nosy_count = 7.0
    nosy_names = ['ncoghlan', 'larry', 'benjamin.peterson', 'python-dev', 'zach.ware', 'yselivanov', 'o11c']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue24791'
    versions = ['Python 3.5', 'Python 3.6']

    @o11c
    Copy link
    Mannequin Author

    o11c mannequin commented Aug 5, 2015

    The following code is allowed by the grammar of Python 3.4, but not Python 3.5:

    def f(): g(*a or b)

    where unary * has the lowest precedence, i.e. it is equivalent to:

    def f(): g(*(a or b))

    The cause of the regression that the 3.4 grammar for arglist uses '*' test but the 3.5 grammar uses '*' expr. This is likely an oversight due to the PEP-448 changes; the fix should most likely be applied to the new displays as well as fixing the regression.


    Thanks to zware on IRC for actually testing this for me, since I don't have a runnable python3.5, just docs.

    @o11c o11c mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Aug 5, 2015
    @o11c
    Copy link
    Mannequin Author

    o11c mannequin commented Aug 5, 2015

    Related: bug 24176 fixed this for the ** case.

    @zware zware added release-blocker type-bug An unexpected behavior, bug, or error labels Aug 5, 2015
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 5, 2015

    New changeset 3c170f68407f by Zachary Ware in branch '3.4':
    Issue bpo-24791: Add tests for things that regressed with PEP-448
    https://hg.python.org/cpython/rev/3c170f68407f

    @zware
    Copy link
    Member

    zware commented Aug 5, 2015

    Test committed on 3.4; I'm not comfortable enough with the grammar to actually fix the issue (the obvious change of star_expr => '*' test isn't enough, I tried :)).

    @1st1
    Copy link
    Member

    1st1 commented Aug 5, 2015

    The attached patch should fix that. Please review.

    @o11c
    Copy link
    Mannequin Author

    o11c mannequin commented Aug 5, 2015

    Also consider:

    *() or (), *() or ()
    [() or (), *() or ()]
    {
    () or (), *() or ()}
    {**{} or {}, **{} or {}}

    Note that the second-or-later argument is a separate part of the grammar so that's why I wrote it twice.

    Actually, I think star_expr will probably go away entirely.

    @1st1
    Copy link
    Member

    1st1 commented Aug 5, 2015

    Actually, I think star_expr will probably go away entirely.

    I'm not so concerned with supporting [*[] or []] stuff, but rather fixing the immediate regression in 3.5.0. I'd keep the patch size to the minimum.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 5, 2015

    New changeset e4cb64628673 by Yury Selivanov in branch '3.5':
    Issue bpo-24791: Fix grammar regression for call syntax: 'g(*a or b)'.
    https://hg.python.org/cpython/rev/e4cb64628673

    New changeset 4c89dd5199e5 by Yury Selivanov in branch 'default':
    Merge 3.5 (issue bpo-24791)
    https://hg.python.org/cpython/rev/4c89dd5199e5

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 5, 2015

    New changeset 40c391d12741 by Yury Selivanov in branch '3.5':
    Issue bpo-24791: More tests in test_parser
    https://hg.python.org/cpython/rev/40c391d12741

    New changeset a572137b4f05 by Yury Selivanov in branch 'default':
    Merge 3.5 (issue bpo-24791; more tests in test_parser)
    https://hg.python.org/cpython/rev/a572137b4f05

    @1st1 1st1 closed this as completed Aug 5, 2015
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 4, 2015

    New changeset 20e0906a808e by Terry Jan Reedy in branch '3.5':
    Issue bpo-24791: Escape rst markup char in NEWS entry to avoid Sphinx warning.
    https://hg.python.org/cpython/rev/20e0906a808e

    @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) release-blocker type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants