[flake8-pyi]: Stabilize: Provide more automated fixes for duplicate-union-members (PYI016) (#15342)

This commit is contained in:
Micha Reiser 2025-01-08 13:13:20 +01:00
parent 225dd0a027
commit 8e8a07144d
4 changed files with 1041 additions and 118 deletions

View file

@ -111,3 +111,12 @@ field33: typing.Union[typing.Union[int | int] | typing.Union[int | int]] # Error
# Test case for mixed union type
field34: typing.Union[list[int], str] | typing.Union[bytes, list[int]] # Error
field35: "int | str | int" # Error
# Technically, this falls into the domain of the rule but it is an unlikely edge case,
# only works if you have from `__future__ import annotations` at the top of the file,
# and stringified annotations are discouraged in stub files.
field36: "int | str" | int # Ok