isinstance(..., str)
fails when applied to elements of sys.argv
#170
Labels
isinstance(..., str)
fails when applied to elements of sys.argv
#170
This bug is related to the issues with
isinstance(..., str)
described here.The following works in Python 2.7:
However, the following fails (also in Python 2.7):
The reason is that elements of
sys.argv
are still instances of the original typestr
, not offuture.types.newstr.newstr
. This makes working with command line arguments tricky in legacy Py2 code that is being upgraded for Py2/Py3 compatibility using python-future.For the record, both code snippets above work as expected in Python 3.4.
The text was updated successfully, but these errors were encountered: