Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://gitlab.com/matthewhughes/flake-pep604
`flake8` plugin to enforce PEP-604
https://gitlab.com/matthewhughes/flake-pep604
Last synced: 3 months ago
JSON representation
`flake8` plugin to enforce PEP-604
- Host: gitlab.com
- URL: https://gitlab.com/matthewhughes/flake-pep604
- Owner: matthewhughes
- License: mit
- Created: 2022-05-08T14:29:40.336Z (over 2 years ago)
- Default Branch: main
- Last Synced: 2024-07-08T02:04:08.380Z (4 months ago)
- Stars: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flake8-extensions - flake8-pep604 - Forbids use of `typing.Union` (in favour of `|`), per [PEP 604][pep604]. (Type annotations)
README
# flake8-pep604
flake8 plugin which forbids use of `typing.Union` (in favour of `|`), per [PEP
604](https://www.python.org/dev/peps/pep-0604/).Note the `|` notation is a syntax error for Python \< 3.10. In this case you can
use the `annotations` feature (see [PEP 563](https://peps.python.org/pep-0563/)).## flake8 Codes
| Code | Description |
|--------|--------------------------------------------------|
| UNT001 | Use `\|` in place of `typing.Union`. See PEP-604 |## Motivation
Motivated by just wanting to make a codebase consistent in usage between
`typing.Union` and union types.Note you could also automate this via
[`pyupgrade`](https://github.com/asottile/pyupgrade#pep-604-typing-rewrites)