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 Yury.Selivanov, brett.cannon, georg.brandl, larry, serhiy.storchaka, vajrasky, zach.ware
Date 2014-01-22.03:17:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390360681.97.0.808723930218.issue20341@psf.upfronthosting.co.za>
In-reply-to
Content
Attached is a *preliminary* patch for Argument Clinic that adds nullable ints.  If you use the converter "int(nullable=True), then:

* The type you get back is not int but "nullable_int_t", a structure
  containing three fields: "error", "is_null", and "i".  "error" is 1 if
  there was an error in parsing, else 0.  "is_null" is 1 if None was
  passed in, else 0.  "i" is the integer value if an integer was
  passed in, else undefined.
* You may now use a default value of None.  If you do, "is_null" is 1.
* You may still use a default integer.  If you do, "i" will be set
  to that.
* If you use neither then obviously it's a required argument.


I'd appreciate just a preliminary review, saying something like
"this is a good idea, keep going," or
"you should change your approach," or
"this is a bad idea and should not be committed," or
"you look very handsome today Larry".

I don't remember who specifically needed the nullable ints, so I just added a bunch of Derby contestants.

Serhiy: I also added a fix for the bug you mentioned in #20294 after it was closed: the docstring for __new__ and __init__ methods now uses the class name instead of the name of the method.  Note that this fix doesn't matter much; once I commit a fix for #20189, that signature will always be hidden.
History
Date User Action Args
2014-01-22 03:18:02larrysetrecipients: + larry, brett.cannon, georg.brandl, Yury.Selivanov, zach.ware, serhiy.storchaka, vajrasky
2014-01-22 03:18:01larrysetmessageid: <1390360681.97.0.808723930218.issue20341@psf.upfronthosting.co.za>
2014-01-22 03:18:01larrylinkissue20341 messages
2014-01-22 03:18:01larrycreate