KotlinIsland
KotlinIsland
#12286 would be a good solution to this.
I think if you are using basedmypy you can write ```py print("based") # type: ignore[operator, unused-ignore] ```
Here's a wacky idea: pretend that `type` doesn't have `__init__`, and that each instance of `type` has a structural type for it's `__init__`. Given the following pseudo code: ```py class...
That would obviously break a bunch of stuff, but something more reasonable for this exact situation could be invented. This seems like the same issue as with `__hash__`.
```py from typing import Init class A: def __init__(self): ... class B(A): def __init__(self, b: bool): ... class C(B): def __init__(self): ... def foo(a: Init[A]) -> A: return a() foo(A)...
This has changed in master I think: ``` test.py:5:12: error: Invalid location for ParamSpec "P" [misc] test.py:5:12: note: You can use ParamSpec as the first argument to Callable, e.g., 'Callable[P,...
So what is the type of `bar` after the `try` block? Is it `str`, or is it `int` in the case of the block exiting early? ```py try: bar =...
@DetachHead That seems very different to the current implementation of `allow-redefinition`, and as far as I know, there is no mechanism in mypy that 'widens' a type. Perhaps you could...
Related #11469
I think a `type[T]` where the upper bound of `T` produces a `Hashable` `type[T]` (default upper bound is `object`, and `type[object]` is hashable) should be considered `Hashable`.