disallow-import-star-0.4.1
توضیحات
-
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | disallow-import-star-0.4.1 |
| نام | disallow-import-star |
| نسخه کتابخانه | 0.4.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Trey Hunner <trey@treyhunner.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/disallow-import-star/ |
| مجوز | - |
# Stop your users from doing whatever they want
[](https://pypi.org/project/disallow-import-star)
[](https://pypi.org/project/disallow-import-star)
Are you a meanie?
Do you feel your users shouldn't be allowed to to use `from your_module import *` whenever they want?
This is the package for you!
Just `pip install disallow-import-star` and add this magical lines to your module:
```python
from disallow_import_star import __all__
```
## Would you like to impose your will on *other* packages?
If you really want your users to stop using `import *` in *other* their packages, you can monkey patch your user's favorite packages, like this:
```python
from disallow_import_star import __all__
import math
import numpy
import tkinter
# Why should our users be able to use import * ANYWHERE?
math.__all__ == __all__
numpy.__all__ == __all__
tkinter.__all__ == __all__
```
## Want to control *all* the packages?
To really upset your `import *`-using users, run this:
```python
from disallow_import_star
disallow_import_star.disallow_import_star_EVERYWHERE()
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl disallow-import-star-0.4.1:
pip install disallow-import-star-0.4.1.whl
نصب پکیج tar.gz disallow-import-star-0.4.1:
pip install disallow-import-star-0.4.1.tar.gz