1
0
mirror of https://github.com/satwikkansal/wtfpython synced 2024-11-21 18:54:20 +01:00

Merge pull request #170 from art049/master

Wild imports typo
This commit is contained in:
Satwik Kansal 2020-01-12 00:34:12 +05:30 committed by GitHub
commit de113d2491
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
README.md vendored
View File

@ -2651,7 +2651,7 @@ NameError: name '_another_weird_name_func' is not defined
#### 💡 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.
```py
>>> from module import some_weird_name_func_, _another_weird_name_func