flake8 plugin to enforce use of `|` over `typing.Union`
Project description
flake8-pep604
flake8 plugin which forbids use of typing.Union
(in favour of |
), per PEP
604.
Note the |
notation is a syntax error for Python < 3.10. In this case you can
use the annotations
feature (see PEP 563).
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flake8_pep604-1.1.0.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file flake8_pep604-1.1.0.tar.gz
.
File metadata
- Download URL: flake8_pep604-1.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e533659d0eda50fa83cbca9dde4f3a3fc0b1593d8cd7134e494ccd71102d3fb4 |
|
MD5 | b4ea97b221a20f3b113d168c6565e4ff |
|
BLAKE2b-256 | 5c63cac97e101d81b3ed33d2234e508423234fd17442adaca5551d8e6267fb0e |
File details
Details for the file flake8_pep604-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: flake8_pep604-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e0c4ef8bfa6377eed47df382bde1519a1ddde6508d18b32281846f5a3f77301 |
|
MD5 | da41cf2bd0611e84b59ffc6efb7b5394 |
|
BLAKE2b-256 | 2ebf1a3b881e61338f3726286edb400fc5933be3c0419252d873f71c09b3db81 |