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

Created on 2010-07-04 19:03 by mark.dickinson, last changed 2010-07-22 10:24 by amaury.forgeotdarc.

Files
File name Uploaded Description Edit
parser_annotations_kwonly.patch mark.dickinson, 2010-07-06 09:14 review
Messages (3)
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.
History
Date User Action Args
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