python / python/cpython

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

Offen
#145,577 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

docs topic-typing
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem Abschnitt "Annotating callable objects" in der Python-Typing-Dokumentation und verwende die Formulierungsbeispiele sowie die verwandten Issues #145602, #145576 und #145598 als Kontext. Überprüfe die vorgeschlagenen Änderungen an Terminologie und Sätzen und bestätige anschließend, dass der Abschnitt durchgehend klare Unterscheidungen zwischen Parametern, Argumenten, Objekten und Typen verwendet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.