mirror of
https://github.com/satwikkansal/wtfpython
synced 2024-11-25 04:24:23 +01:00
Wild imports typo
This commit is contained in:
parent
83cac75f41
commit
30a6623ccd
2
README.md
vendored
2
README.md
vendored
@ -2651,7 +2651,7 @@ NameError: name '_another_weird_name_func' is not defined
|
|||||||
|
|
||||||
#### 💡 Explanation:
|
#### 💡 Explanation:
|
||||||
|
|
||||||
- It is often advisable to not use wildcard imports. The first obvious reason for this is, in wildcard imports, the names with a leading underscore get imported. This may lead to errors during runtime.
|
- It is often advisable to not use wildcard imports. The first obvious reason for this is, in wildcard imports, the names with a leading underscore don't get imported. This may lead to errors during runtime.
|
||||||
- Had we used `from ... import a, b, c` syntax, the above `NameError` wouldn't have occurred.
|
- Had we used `from ... import a, b, c` syntax, the above `NameError` wouldn't have occurred.
|
||||||
```py
|
```py
|
||||||
>>> from module import some_weird_name_func_, _another_weird_name_func
|
>>> from module import some_weird_name_func_, _another_weird_name_func
|
||||||
|
Loading…
Reference in New Issue
Block a user