[Maintenance] Avoid from module import * #20

Closed
opened 2020-12-15 22:57:19 +01:00 by p.karagiannis · 1 comment
Member

Importing everything from a module is a major antipattern, and can lead to many, hard to trace, bugs. Instead the import statement should explicitly contain all the imported names

Importing everything from a module is a major antipattern, and can lead to many, hard to trace, bugs. Instead the import statement should explicitly contain all the imported names
p.karagiannis added the
Backend
label 2020-12-15 22:57:19 +01:00
Owner

I think in this particular instance it makes sense though since we want the entire contents of the core namespace to be available both in main and in init(import) mode because we essentially want to pretend core is both __init__ and __main__.

Although i could probably choose to just import app and it would be fine while also exposing less internals. Will try that sometime.

I think in this particular instance it makes sense though since we want the entire contents of the `core` namespace to be available both in `main` and in `init`(import) mode because we essentially want to pretend `core` is both `__init__` and `__main__`. Although i could probably choose to just import `app` and it would be fine while also exposing less internals. Will try that sometime.
Sign in to join this conversation.
No description provided.