typing
typing copied to clipboard
Python static typing home. Hosts the documentation and a user help forum.
We had several typeshed issues and pull requests lately that try to work around the fact that there is no way to express that a method receives any object following...
This idea is similar to [stricter stubs](https://github.com/python/typing/issues/1096) idea, but a bit more general and focused more on new typing features. Typing features are produced at pretty quick pace. We're currently...
**Problems**: - You want define a type that is not possible to define in python at the moment of writing. - You can define a type but you choose to...
When trying to fix an [issue](https://github.com/python/typeshed/issues/7516) in `typeshed` we found that both `mypy` and `pyright` raised incorrect errors that were also inconsistent with one another so I'm creating this issue...
Take the following class: ``` python class Base: pass class Derived(Base): pass T = TypeVar('T', bound=Base) class MyType(Generic[T]): pass myvar: MyType = None # type of `myvar` is `MyType[Any]` ```...
Some functions can return different types depending on passed arguments. For example: * `open(name, 'rb')` returns `io.BufferedReader`, whereas * `open(name, 'wb')` returns `io.BufferedWriter`. The typeshed accurately models this using `@typing.overload`...
PEP-0561 does not mention extension packages, packages that consist of just an .so file. Given that PEP-484 mentions extension modules as a use case for stub files, could the typing...
I would like to be able to type a Dataframe like object with MyPy, where different columns have different types and you can get each as column as an attribute...
Hi. TIL that [pylance](https://github.com/microsoft/pylance-release/) by default does not check the types of class/instance variables that are not unnotated, see microsoft/pylance-release#1983. Via this issue I became aware of the guidelines at...
I think that `Final` is a very based idea, but I feel that it's current restrictions make using it painful. I think that split assignments should be allowed: ```py def...