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

Remove star imports #69

Open
phillbaker opened this issue Jan 19, 2022 · 0 comments
Open

Remove star imports #69

phillbaker opened this issue Jan 19, 2022 · 0 comments

Comments

@phillbaker
Copy link
Member

There are many star imports in the code, we should work to remove them because:

  • it pollutes the namespace and may shadow other objects (from previous imports)
  • it's poor readability/debugging -it's not clear what's imported where
  • much static analysis is not available (either typing or other linting)

This is a relatively straight forward change to make (e.g. can use https://www.asmeurer.com/removestar/), but it has the potential for being a "breaking change" for imports from suds. Since many modules do from suds import *, this has the potential to mean that prior imports like from suds.builder import Webfault will no longer work.

These internal imports are not documented, so in theory are not part of the public API. Python itself treats this as a non breaking change: https://docs.python.org/3/whatsnew/3.7.html#changes-in-the-python-api

Several undocumented internal imports were removed. One example is that os.errno is no longer available; use import errno directly instead. Note that such undocumented internal imports may be removed any time without notice, even in micro version releases.

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

No branches or pull requests

1 participant