Remove type checker-specific symbols from builtins.pyi and typing.pyi
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 5.1k
- Forks
- 2.1k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 82
Beschreibung
I'm working to get rid of the type checker-specific symbols that currently are in our core stubs but don't exist at runtime. I'll use this issue to track the work needed. This involves changes both to typeshed and to type checkers.
Affected names:
typing._TypedDict. Suggesting to rename to_typeshed.TypedDictFallback. (mypy and pyright)typing._promote->_typeshed._promote(mypy only)typing.AwaitableGenerator->_typeshed.AwaitableGenerator(mypy and pyright)builtins.function(mypy and pyright). Need to look more into why we can't just usetypes.FunctionType.- Working on this in mypy but it requires updating a ton of test cases
builtins.ellipsis(mypy and pyright). Should add a new name to _typeshed, similar toNoneType.
builtins.module was also mentioned in the past but it's been fixed already (mypy PR: https://github.com/python/mypy/pull/3107).
Linked issues and PRs:
- #2999
- #3556
- #3932
- python/mypy#11564
- python/mypy#8240
- https://github.com/python/mypy/issues/2765
- https://github.com/python/mypy/issues/8699
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit builtins.pyi und typing.pyi und sieh dir anschließend die verknüpften typeshed- und type-checker-Issues an, um die erforderlichen Ersetzungen zu verstehen. Überprüfe das Verhalten und die Testfälle von mypy und pyright, insbesondere die builtins.function-Fälle. Die Aufgabe ist abgeschlossen, wenn die spezifischen Symbole des type-checker aus den Core-Stubs entfernt wurden und die betroffenen Tests des type-checker erfolgreich sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Refactoring
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100