Message266493
Better to continue discussion here.
Attached is my second, simpler version of the feature. A context manager is included:
with string.StrBytesRaises():
str(b'bytes')
# raises an exception
In a normal program, you might just set the flag to True, but in a library that has no hope of setting the -bb flag you might use it during serialization rather than checking isinstance() on all input. |
|
Date |
User |
Action |
Args |
2016-05-27 12:54:45 | dholth | set | recipients:
+ dholth, pitrou, vstinner, jwilk, Arfrever, r.david.murray, martin.panter, serhiy.storchaka |
2016-05-27 12:54:45 | dholth | set | messageid: <1464353685.08.0.10021136992.issue18373@psf.upfronthosting.co.za> |
2016-05-27 12:54:44 | dholth | link | issue18373 messages |
2016-05-27 12:54:44 | dholth | create | |
|