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 larry
Recipients georg.brandl, larry, serhiy.storchaka
Date 2014-01-15.03:40:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The attached patch extends Argument Clinic and the inspect module: now you may use simple (!) expressions as default values.  So for example "sys.maxsize - 1" should now work fine.

* Names may be in the current module; as a backup they will also be looked up in sys.modules.
* You may look up attributes of names.
* You may subscript into names.
* You may use math operators, both unary and binary.
* int/float/string literals are (still) fine.
* You may not use: function calls, list/set/dict/tuple/bytes literals, generator expressions or comprehensions, if expressions, anything fun.

Other changes in this diff:
* "doc_default" is gone, it no longer makes sense.
* "py_default" and "c_default" handling is simpler and more predictable.
* Minor doc fix suggested on tracker.

The docs still need work.  More tests would be good too but I'm already overwhelmed by work--could one of you guys contribute some tests?
Date User Action Args
2014-01-15 03:40:44larrysetrecipients: + larry, georg.brandl, serhiy.storchaka
2014-01-15 03:40:43larrysetmessageid: <>
2014-01-15 03:40:43larrylinkissue20226 messages
2014-01-15 03:40:42larrycreate