mypy
mypy copied to clipboard
Optional static typing for Python
Source commit: https://github.com/python/typeshed/commit/a92da58328aa259184ff45bb7408e82426fb563e
This implements some constraint tests for type var tuples. We only test SUPERTYPE_OF right now because the SUBTYPE_OF path doesn't actually seem to work yet. We also have to make...
I am planning to make a 0.980 release around late August. Please post here any issues you'd like to see fixed in the release, or PRs you'd like to have...
This looks a bit messy. Suggestions on implementation are welcome. All python versions starting from 3.7 allow runtime subscription of `Union`, `Tuple`, `Callable` types (probably something else). So, I think...
### Description Alternative implementation of #11666. This piggy backs off of TypeVar but doesn't add a new node for TypeVar (which was the original issue with this idea yonks ago)...
```py def f(): a try: pass except Exception as ex: # error: Expression has type "Any" [misc] pass a = 1 + 1 ``` [playground](https://mypy-play.net/?mypy=latest&python=3.10&flags=strict%2Cdisallow-any-expr&gist=717ff04546bfcc3139e433ad8399273c)
Fix daemon crash when using fine-grained caching and ParamSpec, with traceback like this (when using a compiled mypy): ``` Traceback (most recent call last): File "mypy/dmypy_server.py", line 230, in serve...
**Bug Report** Standalone subscripted alias expression raises the error "Type application is only supported for generic classes" **To Reproduce** Here's a reproducible playground link: https://mypy-play.net/?mypy=0.971&python=3.10&gist=e262d3dd99f2a708e96eb28338792632 Code: ``` T = TypeVar("T")...
- Add type inference for `dict.keys` membership Also for containership checks on `typing.KeysView.` This is to bring the following cases into alignment: from typing import KeysView key: str | None...
Now this passes: ```python # STUB class Meta(type): ... class Y(metaclass=Meta): ... class Z: foo: type[Y] # RUNTIME: class Meta(type): ... class Y(metaclass=Meta): ... class Z: foo = Y ```...