Message208392
I think these shouldn't be "int", they should be "bool". "bool" will allow you to use a default of False. It maps to the "p" format unit, which was new in 3.3.
Back before 3.3, when someone wanted a boolean they just used "i", and relied on the fact that True turned into 1 and False turned into 0. (Even more so before 2.2, when we didn't even have True and False.) In theory it's a semantic change, because "i" only accepts ints (and True/False), whereas "p" will accept floats, lists, tuples, dicts, sets... anything with a __bool__. But the intent of code like this is clear, it's only interested in true/false. And Python has well-established rules for what is considered a true and false. So I feel like this change is an improvement. |
|
Date |
User |
Action |
Args |
2014-01-18 09:42:49 | larry | set | recipients:
+ larry, georg.brandl, serhiy.storchaka |
2014-01-18 09:42:49 | larry | set | messageid: <1390038169.27.0.791683243589.issue20282@psf.upfronthosting.co.za> |
2014-01-18 09:42:49 | larry | link | issue20282 messages |
2014-01-18 09:42:48 | larry | create | |
|