mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
[flake8-pyi
]: Stabilize: Provide more automated fixes for duplicate-union-members
(PYI016
) (#15342)
This commit is contained in:
parent
225dd0a027
commit
8e8a07144d
4 changed files with 1041 additions and 118 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue