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

Parser module doesn't understand function annotations. #53400

Closed
mdickinson opened this issue Jul 4, 2010 · 4 comments
Closed

Parser module doesn't understand function annotations. #53400

mdickinson opened this issue Jul 4, 2010 · 4 comments
Assignees
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@mdickinson
Copy link
Member

BPO 9154
Nosy @amauryfa, @mdickinson
Files
  • parser_annotations_kwonly.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 = 'https://github.com/mdickinson'
    closed_at = <Date 2012-04-29.18:11:32.753>
    created_at = <Date 2010-07-04.19:03:22.288>
    labels = ['extension-modules', 'type-bug']
    title = "Parser module doesn't understand function annotations."
    updated_at = <Date 2012-04-29.18:11:32.753>
    user = 'https://github.com/mdickinson'

    bugs.python.org fields:

    activity = <Date 2012-04-29.18:11:32.753>
    actor = 'mark.dickinson'
    assignee = 'mark.dickinson'
    closed = True
    closed_date = <Date 2012-04-29.18:11:32.753>
    closer = 'mark.dickinson'
    components = ['Extension Modules']
    creation = <Date 2010-07-04.19:03:22.288>
    creator = 'mark.dickinson'
    dependencies = []
    files = ['17880']
    hgrepos = []
    issue_num = 9154
    keywords = ['patch']
    message_count = 4.0
    messages = ['109256', '109373', '111164', '159632']
    nosy_count = 3.0
    nosy_names = ['amaury.forgeotdarc', 'mark.dickinson', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue9154'
    versions = ['Python 3.2', 'Python 3.3']

    @mdickinson
    Copy link
    Member Author

    Python 3.2a0 (py3k:82529M, Jul  4 2010, 17:35:10) 
    [GCC 4.2.1 (Apple Inc. build 5659)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import parser
    [38213 refs]
    >>> parser.sequence2st(parser.suite("def f(a:int) -> int: pass").totuple())
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    parser.ParserError: VALIDATION FAILURE: report this to the maintainer!
    [38264 refs]

    @mdickinson mdickinson self-assigned this Jul 4, 2010
    @mdickinson mdickinson added extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels Jul 4, 2010
    @mdickinson
    Copy link
    Member Author

    Patch fixing validation of function annotations and keyword-only arguments.

    There's still the issue of false positives: annotations on lambda arguments should raise an exception, but don't.

    @amauryfa
    Copy link
    Member

    The extra space in Grammar was already removed in r82624.
    The remaining part of the patch looks good to me.
    The lambda thing is not important, if you get an error when trying to compile the resulting st.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 29, 2012

    New changeset 9f57d66689ca by Mark Dickinson in branch '3.2':
    Issue bpo-9154: Fix parser module to understand function annotations.
    http://hg.python.org/cpython/rev/9f57d66689ca

    New changeset cee5cb877631 by Mark Dickinson in branch 'default':
    Issue bpo-9154: Merge fix from 3.2.
    http://hg.python.org/cpython/rev/cee5cb877631

    @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
    extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants