Message51438
This patch implements optional argument syntax for Python 3000. The patch still has issues:
1. test_ast and test_scope fail.
2. Running the test suite after compiling the library with the compiler package causes failures
3. no docs
4. C-code reference counts and error checking needs a review
The syntax implemented is roughly:
def f(arg:expr, (nested1:expr, nested2:expr)) -> expr:
suite
The function object has a new attribute, func_annotations that maps from argument names to the result of the expression. The return annotation is stored with a key of 'return'.
Lambda's syntax doesn't support annotations.
The ast format has changed for the builtin compiler and the compiler package. A new token was added, '->' (called RARROW in token.h). token.py lost ERRORTOKEN after re-generating, I don't know why. I added it back manually.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:55:32 | admin | link | issue1607548 messages |
2007-08-23 15:55:32 | admin | create | |
|