flake8-typing-as-t-0.0.3
توضیحات
A flake8 plugin to check typing import style
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | flake8-typing-as-t-0.0.3 |
| نام | flake8-typing-as-t |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Stephen Rosen <sirosen@globus.org> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/flake8-typing-as-t/ |
| مجوز | - |
# flake8-typing-as-t
[](https://pypi.org/project/flake8-typing-as-t)
[](https://pypi.org/project/flake8-typing-as-t)
-----
**Table of Contents**
- [Overview](#overview)
- [Installation](#installation)
- [License](#license)
## Overview
This is a `flake8` plugin which ensures that imports from the `typing` library must be written using `import typing as t`.
## Installation
```console
pip install flake8-typing-as-t
```
## Checks
- `TYT01`: Bare `import typing` usage
- `TYT02`: `import typing as X` where `X` is not literal `t`
- `TYT03`: `from typing import X` usage
## Handling `typing-extensions`
A common pattern for compatibility is to do a `sys.version_info`-guarded
dispatch over `typing_extensions`. e.g.
```python
if sys.version_info < (3, 8):
from typing_extensions import Literal
else:
from typing import Literal
```
`flake8-typing-as-t` allows for this usage by checking if the import is inside
of a test on `sys.version_info` against a tuple.
## License
`flake8-typing-as-t` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl flake8-typing-as-t-0.0.3:
pip install flake8-typing-as-t-0.0.3.whl
نصب پکیج tar.gz flake8-typing-as-t-0.0.3:
pip install flake8-typing-as-t-0.0.3.tar.gz