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.

Author tonylownds
Recipients
Date 2006-12-02.20:53:33
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This patch implements optional argument syntax for Python 3000. The patch still has issues; I am posting so that Collin Winters can add a link to the PEP.

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.

This patch alters the MAKE_FUNCTION opcode. I have an implementation that built the func_annotations dictionary in bytecode as well but it was bigger and slower.
History
Date User Action Args
2007-08-23 15:55:32adminlinkissue1607548 messages
2007-08-23 15:55:32admincreate