Tutorial document
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 1.8k
- Forks
- 302
- Ø Merge
- 23 Std.
- Gemergte PRs (30 T.)
- 8
Beschreibung
Thoughts on the tutorial document.
Basic Topics
- Set up a basic venv with a pinned mypy version. (For compatibility reasons.) Should add a note about using a current version in production.
- Annotating variables.
- Annotating functions and methods.
- Unions, using
| None Anycast()and# type: ignore- Using generics, variance
- Built-in collections
- Type aliases
int/floatNoReturn(not strictly necessary, but a fairly easy topic)- Installing third-party stubs
Advanced Topics
The are fairly complicated topics, but basically required when typing a non-trivial code base:
Callable- Writing generics
- Protocols
type[...]typing.TYPE_CHECKINGand circular importsTypeVarandAnyStr- overloads
Literal
What not to include
# typeannotations (except# type: ignore)
The following topics could arguably be included, but for simplicity's sake, I'd suggest to skip them in this basic tutorial:
NewTypeClassVarFinalAnnotatedNamedTupleTypedDict
Other Thoughts
- We can use a newer version of Python (e.g. 3.8+) for simplicity and add a note that not all features are available in older Python versions.
- We should probably just use
from __future__ import annotationsand skip the whole forward references/quoting types problem.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
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
In der Issue werden keine Tutorial-Datei, kein Einstiegspunkt und kein Test genannt. Beginne damit, die vorhandene Tutorial-Dokumentation zu finden und sie mit den vorgeschlagenen Listen grundlegender und fortgeschrittener Themen zu vergleichen. Als erledigt gilt die Aufgabe, wenn der Umfang des Tutorials, die Hinweise zur Python-Version, die enthaltenen Typing-Themen und die Ausschlüsse abgestimmt und diese Entscheidungen dokumentiert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- documentation
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100