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 dholth
Recipients Arfrever, dholth, jwilk, martin.panter, pitrou, r.david.murray, serhiy.storchaka, vstinner
Date 2016-05-27.12:54:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1464353685.08.0.10021136992.issue18373@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-05-27 12:54:45dholthsetrecipients: + dholth, pitrou, vstinner, jwilk, Arfrever, r.david.murray, martin.panter, serhiy.storchaka
2016-05-27 12:54:45dholthsetmessageid: <1464353685.08.0.10021136992.issue18373@psf.upfronthosting.co.za>
2016-05-27 12:54:44dholthlinkissue18373 messages
2016-05-27 12:54:44dholthcreate