KotlinIsland
KotlinIsland
```py def f[T, T2](t: T, t2: T2) -> T | T2: return t print(f"{f("", "")}") # The string for "object" isn't helpful in a user-facing or semantic string ```
tell mypy which ones are extras, then it could warn you on usages and understand that they might not exist
```py from typing import TypeVar, Collection T = TypeVar('T') L = TypeVar('L', bound=Collection[T]) def foo(l: L) -> T: return l[0] reveal_type(foo([1])) # int def bar[T2, L2: Collection[T2]](l: L2) -> T:...
```py from basedtyping import Intersection class A: ... class B: ... class C(A, B): ... AB = Intersection[A, B] print(isinstance(C(), AB)) ```
```py a = {1: 1} b = {'a': 1, **a} ```
```py a = [1] if bool() else [""] # fail b = [1] or [""]# fail ``` this should be `list[int] | list[str]` but, it's epic fail instead
```py from enum import Enum from typing import final class A(Enum): a = 1 class B: ... a: A if a or 1: print("hi") if isinstance(a, B): ... @final class...