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 eric.smith, larry, mark.dickinson, serhiy.storchaka
Date 2012-05-04.11:13:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1336130038.65.0.758967815908.issue14705@psf.upfronthosting.co.za>
In-reply-to
Content
I looked through the Python sources and couldn't find any instances of a  function or method with an argument that only allowed you to pass in either True or False.

Serily already said he would use 'P' over 'p', although I too am unconvinced that's a good idea.  Serily: why would you unhesitatingly prefer 'P' to 'p'?


Certainly I see loads of uses for 'p'.  For example, when converting code from Python to C that already relied on Python's standard definition of truthiness.

I did find some spots that took an object and converted to bool with PyObject_IsTrue, like _json.Encoder(allow_nan) and pickle._Pickler(fix_imports).  These too would be well-served by 'p'.

I also found some funny in-between cases.  For example, stat_float_times and the three-argument form of os.symlink both claim to take a boolean but actually take 'i' (integer).  This is relying on bool.__int__().  We certainly couldn't use 'P' here.  We could consider switching these to 'p', though in all likelyhood we'll just leave 'em alone.
History
Date User Action Args
2012-05-04 11:13:58larrysetrecipients: + larry, mark.dickinson, eric.smith, serhiy.storchaka
2012-05-04 11:13:58larrysetmessageid: <1336130038.65.0.758967815908.issue14705@psf.upfronthosting.co.za>
2012-05-04 11:13:58larrylinkissue14705 messages
2012-05-04 11:13:57larrycreate