mypy
mypy copied to clipboard
Optional static typing for Python
This PR adds new mypyc primitives for all variations of `str.count`
Silly little PR, but this note could have saved me some debugging time. I also opened [an issue](https://github.com/mypyc/mypyc/issues/1110) and will make an attempt to solve the problem sometime in Q3.
Fixes https://github.com/python/mypy/issues/10399 This is another smaller cleanup for https://github.com/python/mypy/issues/7724. The current logic as documented is IMO correct, for attributes (either properties or custom descriptors) with setter type different from getter...
Fixes https://github.com/python/mypy/issues/19003 This PR fixes the issue by handling the case where the __init__ method can be an OverloadedFuncDef with CallableType items.
Fixes #19312. Fixes #18327. Only accept `@current_prop_name.{setter,deleter}` as property-related decorators.
Fixes https://github.com/python/mypy/issues/5144 Fixes https://github.com/python/mypy/issues/15223 This is related to the work on https://github.com/python/mypy/issues/7724 Now that all attribute access goes through `checkmember.py` there is not much benefit in giving an error at...
**Bug Report** Given: ```python def f1(*, __kw): pass def f2(x, /, *, __kw): pass ``` stubgen generates: ```python def f1(*, /, __kw) -> None: ... # invalid syntax def f2(x,...
Fixes #18009 Modelling the runtime behavior of `isinstance` (which erases generic type arguments) isn't applicable to `TypeIs`. This PR adds a flag so that we can skip that logic deep...
(Explain how this PR changes mypy.)
This implements a suggestion in https://github.com/python/mypy/issues/9153#issuecomment-1837446187, which I thought was a good idea.