What type `bound` parameter of `typing.TypeVar` accepts should be explained more clearly
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Documentation
*Notes:
- Python 3.14.3
For T and A, what type is accepted is clearly explained in the example of typing.TypeVar while for S isn't explained clearly even though str itself is also accepted as shown below:
T = TypeVar('T') # Can be anything
S = TypeVar('S', bound=str) # Can be any subtype of str <- Here
A = TypeVar('A', str, bytes) # Must be exactly str or bytes
So, S should be explained more clearly as shown below:
S = TypeVar('S', bound=str) # Can be str or any subtype of str
Linked PRs
- gh-145525
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 dalla documentazione di typing.TypeVar e dai relativi esempi T, S e A collegati nell’issue. Chiarisci l’esempio bound=str in modo da indicare esplicitamente che str stesso e i suoi sottotipi sono accettati, quindi controlla che la documentazione renderizzata utilizzi una formulazione coerente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 30/100