mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-01 20:31:57 +00:00
[ty] Simplify Any | (Any & T) to Any (#20593)
This commit is contained in:
parent
57e1ff8294
commit
e4de179cdd
3 changed files with 20 additions and 1 deletions
|
|
@ -133,6 +133,11 @@ class Single(Enum):
|
|||
VALUE = 1
|
||||
|
||||
static_assert(is_equivalent_to(P | Q | Single, Literal[Single.VALUE] | Q | P))
|
||||
|
||||
static_assert(is_equivalent_to(Any, Any | Intersection[Any, str]))
|
||||
static_assert(is_equivalent_to(Any, Intersection[str, Any] | Any))
|
||||
static_assert(is_equivalent_to(Any, Any | Intersection[Any, Not[None]]))
|
||||
static_assert(is_equivalent_to(Any, Intersection[Not[None], Any] | Any))
|
||||
```
|
||||
|
||||
## Tuples
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue