Skip to main content

flake8-new-union-types

Build Status PyPI PyPI - Python Version PyPI - License

Flake8 plugin to enforce the new Union and Optional annotation syntax defined in PEP 604.

Union[X, Y] = X | Y

Optional[X] = X | None

Note that it's impossible to use forward references in the new syntax, like this:

"X" | int

such a case can be expressed as a string containing both union terms:

"X | int"

Installation

pip install flake8-new-union-types

or if you use poetry:

poetry add --dev flake8-new-union-types

Usage

Error list

  • NU001 Use Foo | Bar syntax instead of Union (PEP 604)
  • NU002 Use Foo | None syntax instead of Optional (PEP 604)
  • NU003 Present the whole expression as a string to annotate forward refs, e.g. "int | Foo" (PEP 604)

Configuration

There is no way to configure the plugin at the moment.

Metadata

Release files for flake8-new-union-types 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-new-union-types 0.4.1
File Size Uploaded Provenance Actions
flake8-new-union-types-0.4.1.tar.gz 4.4 kB Without provenance Details for flake8-new-union-types-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flake8-new-union-types 0.4.1
File Interpreter ABI Platform Actions
flake8_new_union_types-0.4.1-py3-none-any.whl Python 3 none any Details for flake8_new_union_types-0.4.1-py3-none-any.whl

Total release size: 9.0 kB

Release files / flake8-new-union-types-0.4.1.tar.gz

Download URL flake8-new-union-types-0.4.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0a9dd421099f2525f8be525977ff6632b13b68719a7b0807cf49028d4287b0aa
BLAKE2b-256 checksum
How to use checksums
0bf0b07ec2ded79aec3f95e676d5fbffc5c7e7ce6fe7640cd69d2ce109daca41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.3

Release files / flake8_new_union_types-0.4.1-py3-none-any.whl

Download URL flake8_new_union_types-0.4.1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92737a2f598772d5aedd05b5450c5dd200e0f1acd42b3c1f95dbbe3211af2009
BLAKE2b-256 checksum
How to use checksums
c32f487aeffaab826bb3d23b51c20059c5b9519bca456748652f536df274ac6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.3

Security for flake8-new-union-types 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page