Make support for type comments optional
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Dokumentation
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- documentation
Rechercherichtung
Lies die Behandlung von Typkommentaren in der Typing-Spezifikation zusammen mit PEP 484 und PEP 526 und prüfe anschließend die frühere Diskussion JelleZijlstra/typing-spec#1. Die Aufgabe ist erledigt, wenn die Spezifikation Typprüfern erlaubt, die gewöhnliche Unterstützung für Typkommentare wegzulassen, während die Anforderung für # type: ignore-Kommentare beibehalten und die Kompatibilitätshinweise erklärt werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
PEP 484 (and therefore the current typing spec) implies that type checkers must support the old "type comment" syntax. However, this syntax is unnecessary since Python 3.6 and PEP 526, so there is little reason for new type checkers to support it.
I think we should no longer make support for type comments mandatory. We can keep describing the intended semantics of type comments, but say that type checkers are free to drop support for them. Code that is intended to work across type checkers (e.g., library stubs) should not use them.
PEP 484 (and therefore this spec) imply that type checkers must support the old "type comment" syntax. However, this syntax is unnecessary since Python 3.6 and PEP 526, so there is little reason for new type checkers to support it.
I think we should no longer make support for type comments mandatory. We can keep describing the intended semantics of type comments, but say that type checkers are free to drop support for them. Code that is intended to work across type checkers (e.g., library stubs) should not use them.
(Note that this does not include # type: ignore comments. Those are still useful and should continue to work.)
This isn't urgent so I'll likely not pursue this very soon, but I'm filing this issue to keep track of the idea. I previously filed JelleZijlstra/typing-spec#1, where one person spoke up because they still like type comments, but I'm planning to archive that repo.
- Vorherrschende Sprache
- Python
- Sterne
- 1.8k
- Forks
- 302
- Ø Merge
- 4 Std. 16 Min.
- Gemergte PRs (30 T.)
- 7
Entwicklungsumgebung
Die Einrichtungsdateien dieses Projekts haben wir noch nicht geprüft. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus python/typing
-
topic: typing spec
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
python/typing#2356 · 2 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
topic: typing spec
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
topic: documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
python/typing#2227 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
topic: documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
python/typing#2150 · 2 Kommentare · 2 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
topic: conformance tests topic: typing spec
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
python/typing#2351 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
PedestrianDynamics/pyFDS-Evac#343 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
theskumar/python-dotenv#708 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Docs Timedelta
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
pandas-dev/pandas#69919 ·
Maintainer antworten meist innerhalb von 1 Tag
-
API documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
zephyrproject-rtos/west#1009 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 3 Tagen