python / python/cpython

The explanation of "Annotating callable objects" section should be made better

Aperta
#145,577 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

docs topic-typing
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
  • Related: #145602

In the explanation of Annotating callable objects section, some words or sentence aren't clear, distinct, specific, concise and less common, and the word argument is misused, etc. So they should be corrected:

<Some examples>
The 1st one:

*Notes:

  • "has" is better than "takes" because "takes" sounds taking an argument but not parameter:

... a function that takes a single parameter of type int and returns a str.

... a function that has a single parameter of type int and returns a str.

The 2nd one:

*Notes:

  • Naming and calling [] "type specification" is more understandable than "subscription syntax".
  • "must" is enough for emphasis so "always" and "exactly" aren't needed, emphasizing too much.
  • "two objects" are better than "two values" because "two values" sounds actual values like v = "Hello"'s "Hello" so it's confusing while talking about types.
  • "parameter type list" is better than "argument list" because "parameter" is correct and "type list" is more specific and understandable.

The subscription syntax must always be used with exactly two values: the
argument list and the return type.

The type specification [] must have two objects, a parameter type list and return type.

etc.
Linked PRs
  • gh-145576
  • gh-145598

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la sezione "Annotating callable objects" della documentazione Python typing, usando come contesto gli esempi di formulazione e le issue correlate #145602, #145576 e #145598. Esamina le modifiche proposte alla terminologia e alle frasi, quindi conferma che la sezione utilizzi in modo coerente distinzioni chiare tra parametri, argomenti, oggetti e tipi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.