-
Notifications
You must be signed in to change notification settings - Fork 283
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
Add six imports #1675
Add six imports #1675
Conversation
the tests have fallen over. I suspect they will fail due to an unrelated upgrade to proj4. If this occurs, rebasing to master ought to fix this please may you explain the benefit of importing six into every module, I don't understand why this helps? |
Well, by itself, nothing. But in order to implement #1658, it will be needed in the vast majority of files. In the interest of consistency, I think it's best to include it everywhere. That way, you don't need to go changing imports when you refactor things. |
I can see both sides of the argument for including six in every module. The two things that push me off the fence though are:
For that reason, I'm kind of falling for the only import six where it is needed approach. @QuLogic - would that make #1658 much harder? Do you have a feeling for how many modules will need six when it comes to Py3 compatibility? |
Ah, that's why I split it into two commits for you. The first is solely
That being said, it's actually turning out to be a quite a few less than I expected. At this point, it's:
|
Soo, decisions? I have more PRs that could be opened based on/off this (as you can see above). |
NB. Doing (1) doesn't get rid of the need for Python 3 testing to ensure compatibility - just because a module imports six doesn't mean the code uses it where necessary. Given all that, I'm inclined towards only adding the imports when and where they're used. @pelson ? |
I'm siding with 2. These aren't like the future imports where there are implicit behaviour changes due to the import alone. I think we would be better off with six imports only where necessary. |
I think @pelson was leaning towards 2 as well. Though if you were looking for behavioural changes, one could import, e.g., |
I'm going to do this a smaller bit at a time. Hopefully that'll work out a bit faster. |
This is a boring, but rather large change.
All it is is imports, no code change (except for the new test).