Use `TypeForm` in __class_getitem__ for generics?
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 2.1k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 82
Description
Now that TypeForm is in 3.15+ and typing_extensions, would it be reasonable to start using it in the __class_getitem__ stubs for generic classes? That way, we could reject constructs like list[3] without triggering false positives on things that are valid type expressions but not types.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the TypeForm documentation linked in the issue and inspecting the class_getitem stubs for generic classes. Determine the scope of applying TypeForm so invalid expressions such as list[3] can be rejected without false positives on valid type expressions; the issue names no specific files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100