Documentation needs a glossary
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Feature
I've realized lately that I lack a clear set of terms to discuss many typing concepts with my team, and I think the community as a whole suffers from this as well.
examples:
- how do we describe a generic class with a type var instead of a concrete type? e.g.
Foo[T]. abstract generic? unparameterized generic? just plain "generic"? - how do we describe a generic class with a concrete type? e.g.
Foo[int]concrete generic? parameterized generic? - what is the verb used to describe the act of converting a generic between these two states? parameterizing?
- how do we describe a generic class with more than one TypeVar?
- I think it's clear that
TypeVar('T', bound=...)can be described as a "bound type var", but how do we describe a TypeVar of the formTypeVar('T', int, float)?
We should be able to combine terms to form a clear taxonomy, for example:
T = TypeVar("T", bound=A)
class Foo(Generic[T]):
pass
FooB = Foo[B]
Foo is a "bound unparameterized user generic".
FooB is a "parameterized user type alias".
etc.
Pitch
I've looked around in the mypy documentation for clues to these questions and not found anything very definitive. In the absence of an authoritative source on this subject, members of the community stumble over these concepts in team meetings, github issues, and in the names and documentation of our python functions.
Thanks for reading!
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia esaminando la documentazione di mypy per individuare la terminologia esistente relativa a generics e TypeVars, quindi confrontala con gli esempi nell’issue. Il lavoro sarà completo quando un glossario autorevole definirà termini coerenti per i casi di generic e TypeVar elencati e potrà essere utilizzato in tutta la documentazione del progetto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Tranquilla
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100