MagicStack / MagicStack/MagicPython
Support for PEP 695 (Type parameters / generics)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
Related to #229: when writing a generic class/function that uses type parameters, the syntax is incorrectly highlighted. This syntax was introduced in 3.12 via [PEP 695](https://peps.python.org/pep-0695/).
Currently these are incorrectly scoped as attribute access (see attached screenshots). MVP to reproduce is simply
```python
class Foo[T]:
pass
```
* **Editor name and version**: Sublime text 4169
* **Platform**: Windows 10
* **Color scheme**: Monokai
* **MagicPython version**: 1.1.1



Contributor guide
No contributing guide indexed for this repository
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 with the PEP 695 examples and reproduce the issue using `class Foo[T]: pass` in a supported editor. Inspect the syntax-highlighting rules that assign attribute-access scopes to type-parameter syntax. Done means the PEP 695 forms receive appropriate scopes and the regression is covered by the project's existing tests, if available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100