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 <1389757243.15.0.949282322723.issue20226@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2014-01-15 03:40:44larrysetrecipients: + larry, georg.brandl, serhiy.storchaka
2014-01-15 03:40:43larrysetmessageid: <1389757243.15.0.949282322723.issue20226@psf.upfronthosting.co.za>
2014-01-15 03:40:43larrylinkissue20226 messages
2014-01-15 03:40:42larrycreate