Message242140
If I was writing a function/method with a conceptually boolean parameter (True/False), I wouldn't want that to accept any Python object. For example, I would want passing a tuple or list to raise a TypeError. But according to the docs[1], that's what the 'p' converter does.
If Python had a separate boolean type, this would be simple, but bool is a subclass of int, and it is easy to get a 0 or a 1 instead of True or False without noticing. So it seems reasonable when using the C API to accept an int when you want to get a boolean. I'd want a converter to convert it to a C bool, of course. |
|
Date |
User |
Action |
Args |
2015-04-27 17:53:07 | taleinat | set | recipients:
+ taleinat, larry, serhiy.storchaka |
2015-04-27 17:53:07 | taleinat | set | messageid: <1430157187.69.0.962543386529.issue24037@psf.upfronthosting.co.za> |
2015-04-27 17:53:07 | taleinat | link | issue24037 messages |
2015-04-27 17:53:07 | taleinat | create | |
|