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.0.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for flake8_pep604-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0b554b0f7e9ac3eab7c97b3af364984c749a9c5e5e2940b2024507f2239d465 |
|
MD5 | 6b68c648897f91b466d9c883723235de |
|
BLAKE2b-256 | b31237ada32665f3dd2bf0d6447917705f168599efaf01e9874a2de762a87498 |