You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue attempts to collect and document missing or upcoming type system features that would be necessary to better type the public library interface, as well as mypy bugs preventing us to make use of existing features.
Function (and method) **kwargs
To correctly and extensively type **kwargs, we would need at the very least the ability to tell type checkers that additional keyword arguments are allowed (and of type Any).
Current status:
The codebase is currently typed with **kwargs: Any, but this disallows IDEs from discovering extra keyword arguments that are forwarded to other functions. For example, this is a very common pattern across the Mobject and OpenGLMobject inheritance trees.
Required features:
Allowing extra items in TypedDict: PEP 728 has been accepted but we need:
This issue attempts to collect and document missing or upcoming type system features that would be necessary to better type the public library interface, as well as mypy bugs preventing us to make use of existing features.
**kwargsTo correctly and extensively type
**kwargs, we would need at the very least the ability to tell type checkers that additional keyword arguments are allowed (and of typeAny).The codebase is currently typed with
**kwargs: Any, but this disallows IDEs from discovering extra keyword arguments that are forwarded to other functions. For example, this is a very common pattern across theMobjectandOpenGLMobjectinheritance trees.TypedDict: PEP 728 has been accepted but we need:TypedDictdefinitions: there's a draft PEP for this (PEP 764)opengl_mobject.py#4398, discussion on Discord.Related work: