Skip to content
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

WIP: __builtin__ -> builtins & add aliases for Python 2. #294

Closed
wants to merge 1 commit into from

Conversation

JLTastet
Copy link
Contributor

futurize -wn --fix=future_standard_library **/*.py and select relevant fixes.

It seems like this should be a simple rename, so I would expect it to be safe.

NEEDS REVIEW (and testing): Not sure why we use __builtin__ in the first place. Someone who is familiar with this usage should have a look to make sure that builtins is indeed equivalent.

`futurize -wn --fix=future_standard_library **/*.py` and select relevant fixes.

It seems like this should be a simple rename, so I would expect it to be safe.

**NEEDS REVIEW**: Not sure why we use `__builtin__` in the first place. Someone
  who is familiar with this usage should have a look to make sure that
  `builtins` is indeed equivalent.
@JLTastet JLTastet mentioned this pull request Sep 26, 2019
46 tasks
@olantwin
Copy link
Contributor

As far as I can tell, we use builtin exclusively to create global variables. There must be a better way to do this...

@JLTastet
Copy link
Contributor Author

As far as I can tell, we use builtin exclusively to create global variables. There must be a better way to do this...

Apparently, the "canonical" way to create globals is to do exactly this, except with a custom module of ours (e.g. globals.py) instead of using builtin.

Ref: https://docs.python.org/3/faq/programming.html#how-do-i-share-global-variables-across-modules

@olantwin
Copy link
Contributor

How about creating a ship.globals module then? That would also avoid possible collisions with actual builtin values or functions.

@JLTastet
Copy link
Contributor Author

How about creating a ship.globals module then?

This seems to be the best solution indeed.
Do you want to do it? Finding the globals should be straightforward (at least for those using builtin).
In the meantime I'll test the other changes.

@olantwin
Copy link
Contributor

I'll look into it.

@ThomasRuf
Copy link
Contributor

Can I close this request?

@JLTastet
Copy link
Contributor Author

JLTastet commented Oct 9, 2019

Yes, this is now superseded by #295.

@JLTastet JLTastet closed this Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants