This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Parser module doesn't understand function annotations.
Type: behavior Stage: patch review
Components: Extension Modules Versions: Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: amaury.forgeotdarc, mark.dickinson, python-dev
Priority: normal Keywords: patch

Created on 2010-07-04 19:03 by mark.dickinson, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
parser_annotations_kwonly.patch mark.dickinson, 2010-07-06 09:14 review
Messages (4)
msg109256 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-07-04 19:03
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]
msg109373 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-07-06 09:14
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.
msg111164 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-07-22 10:24
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.
msg159632 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-04-29 17:36
New changeset 9f57d66689ca by Mark Dickinson in branch '3.2':
Issue #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 #9154: Merge fix from 3.2.
http://hg.python.org/cpython/rev/cee5cb877631
History
Date User Action Args
2022-04-11 14:57:03adminsetgithub: 53400
2012-04-29 18:11:32mark.dickinsonsetstatus: open -> closed
resolution: fixed
2012-04-29 17:36:08python-devsetnosy: + python-dev
messages: + msg159632
2012-03-10 18:35:37mark.dickinsonsetversions: + Python 3.3, - Python 3.1
2010-07-22 10:24:09amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg111164
2010-07-06 09:14:54mark.dickinsonsetstage: test needed -> patch review
2010-07-06 09:14:44mark.dickinsonsetfiles: + parser_annotations_kwonly.patch
keywords: + patch
messages: + msg109373
2010-07-04 19:03:22mark.dickinsoncreate