Summary
from ty_extensions import static_assert, is_subtype_of, Intersection
from typing import Protocol
class Foo:
x: int
class Bar:
y: int
class FooBar(Foo, Bar): ...
class HasXAndY(Protocol):
x: int
y: int
static_assert(is_subtype_of(FooBar, HasXAndY)) # passes
static_assert(is_subtype_of(Intersection[Foo, Bar], HasXAndY)) # incorrectly fails
The first assertion here correctly passes; the second incorrectly fails.
Version
No response
Summary
The first assertion here correctly passes; the second incorrectly fails.
Version
No response