Home

Awesome

⛔️ This package is deprecated!

Consider using https://github.com/astral-sh/ruff as it supports this check and a lot more

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

Configuration

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