Message159923
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. |
|
Date |
User |
Action |
Args |
2012-05-04 11:13:58 | larry | set | recipients:
+ larry, mark.dickinson, eric.smith, serhiy.storchaka |
2012-05-04 11:13:58 | larry | set | messageid: <1336130038.65.0.758967815908.issue14705@psf.upfronthosting.co.za> |
2012-05-04 11:13:58 | larry | link | issue14705 messages |
2012-05-04 11:13:57 | larry | create | |
|