New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basestring fixer is extremely disruptive #127
Comments
Wouldn't stage 2 imply that you're properly following Python 3 recommendations, and correctly segregating |
The code in question is a library that explicitly (and sloppily, and incorrectly... and unfixably) allows both native strings and text strings. For Python 2 that means I ran stage 2 because it includes a lot of fairly mundane fixes that are necessary for running on Python 3, e.g. fixing iterables that became lazier or imports that moved around. At worst, those just make the code slower. It's only a handful of fixes like |
Instead of stage 2, you could specify fixers explicitly, with |
I'll definitely try that next time, thanks. Seems a shame to not make any distinction between fixers that will break working Python 2 code. Perhaps a stage 1½ is in order. :) |
Thanks for your comments. @eevee: I see your point. It would be better if stage 2 didn't cause previously working code to break on Py2. If stage 2 imported Do you have any reason to prefer something like six's @QuLogic: would you agree to this change to The recent change in |
I'm pretty sure I use I don't think I've ever seen
I can think of one other case where |
Wouldn't it make more sense to replace
The intention is clear, works in both versions, and doesn't require anything from Perhaps this could be added as an alternative fixer for |
@eevee and @eestrada : thanks for your input. I've taken the conservative route to fixing this in v0.15.0 by importing the The main reason I chose this versus replacing I believe the issue is resolved now, but, if not, please feel free to reopen it. |
I'm cool with that, thank you :) |
futurize --stage2
replaces all uses ofbasestring
withstr
(and also makesstr
always be the text type), which breaksisinstance
checks on native strings on Python 2.If there were a
string_types
available, maybefuturize
could use that instead :)The text was updated successfully, but these errors were encountered: