[Python-ideas] Type hints for text/binary data in Python 2+3 code

Andrew Barnert abarnert at yahoo.com
Thu Mar 24 21:07:13 EDT 2016


On Mar 24, 2016, at 17:00, Andrey Vlasovskikh <andrey.vlasovskikh at gmail.com> wrote:
> 
> The only problematic conversions that may result in errors are `Text` to `str`
> and vice versa in Python 2.

So any time you use Text strings together with strings from sys.argv, sys.stdin/raw_input(), os.listdir(), ZipFile, csv.reader, etc., all of which are native str, they'll pass as valid in a 2+3 test, even though they're not actually valid in 2.x?



More information about the Python-ideas mailing list