Tutorial document
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Documentation
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- documentation
Piste de recherche
L’issue ne nomme aucun fichier de tutoriel, point d’entrée ni test. Commencez par localiser la documentation existante du tutoriel et comparez-la aux listes proposées de sujets de base et avancés. La tâche est considérée comme terminée lorsque le périmètre du tutoriel, les indications concernant la version de Python, les sujets de typing inclus et les exclusions ont été convenus, puis que ces décisions ont été documentées.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 1.8k
- Forks
- 302
- Merge moyen
- 23 h
- PR mergées (30 j)
- 8
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de python/typing
-
topic: typing spec
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
topic: typing spec
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
topic: documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
topic: documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
topic: conformance tests topic: typing spec
Difficulté 3/5 1-2 jours Accessibilité débutants 72/100
Toutes les issues de python/typing
Issues similaires
-
essnmx good first issue
Difficulté 1/5 Moins d'une heure Accessibilité débutants 95/100
-
[Feature] 奇物选择添加优先级 Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Giskard-AI/giskard-oss#2840 · 1 commentaire ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Ouvertearea: repo bug perceived difficulty: 2
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
yeti-platform/yeti#1380 ·