Skip to content

duplicate-literal-member (PYI062)#

Derived from the flake8-pyi linter.

Fix is sometimes available.

This rule is unstable and in preview. The --preview flag is required for use.

What it does#

Checks for duplicate members in a typing.Literal[] slice.

Why is this bad?#

Duplicate literal members are redundant and should be removed.

Example#

foo: Literal["a", "b", "a"]

Use instead:

foo: Literal["a", "b"]

References#