Skip to main content

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

Project description

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

Installation

pip install flake8-new-union-types

or if you use poetry:

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

Usage

Error list

  • NU001 Use "A | B" syntax instead of Union (PEP 604)
  • NU002 Use "A | None" syntax instead of Optional (PEP 604)

Configuration

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-new-union-types-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

flake8_new_union_types-0.2.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file flake8-new-union-types-0.2.0.tar.gz.

File metadata

File hashes

Hashes for flake8-new-union-types-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f06ac1aedf760d0c057603c3bf897089707e15a41a8d1cdc89afc365fce27f82
MD5 d93fff2025018826a7422f46f8dee96a
BLAKE2b-256 6c282184341a63d46eabfad4e7c3c38cbe7f2b9e47aa3fd09b79dca3d10e0d2f

See more details on using hashes here.

File details

Details for the file flake8_new_union_types-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_new_union_types-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74b5ab72b2b500c4ddcad0ba4bcc3b88adc5a556615b0746120890f4d1d2731e
MD5 44cb2f6303af633d4f9d91883a2f10a6
BLAKE2b-256 2387a98e9bbd10e08b4a08efda9deef00942a63cdb75f1f6121f106140e6dce6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page