ManimCommunity / ManimCommunity/manim

[meta] Missing type system features

Open
#4,404 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

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](https://peps.python.org/pep-0728/#allowing-extra-items-of-a-certain-type) has been [accepted](https://discuss.python.org/t/pep-728-typeddict-with-typed-extra-items/45443/159) but we need:
- support by mypy https://github.com/python/mypy/issues/18176
- pyright support to stabilize (it's currently marked as experimental) https://github.com/microsoft/pyright/issues/10803
- **Optional features** that would improve ergonomics/maintainability:
- in-line `TypedDict` definitions: there's a draft PEP for this ([PEP 764](https://peps.python.org/pep-0764/))
- **Notes**: encountered in #4398, discussion [on Discord](https://discord.com/channels/581738731934056449/1406957940329676830).

---
Related work:
- #3375

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the issue's references to PEP 728, mypy issue #18176, and pyright issue #10803, along with related issues #4398 and #3375. The issue is complete only when the required type-system support and its impact on the public library interface are defined and implemented, but it does not name project files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.