Assignment operator: incorrect wording
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 36k
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 558
Beschreibung
Two quotes from The Python 3.11.0 Language Reference (emphasize is mine):
- Note: If the object is a class instance and the attribute reference occurs on both sides of the assignment operator
- Delimiters: The second half of the list, the augmented assignment operators, serve lexically as delimiters, but also perform an operation
As explained at the expression entry term in the glossary, an operator is a syntatical element involved in an expression. An expression has a value. The piece of syntax (a = expr) is not an expression because it cannot be evaluated. And as explained at the same entry, assignment are also statement, not expression.
In the same way there is no del/return operator, it is not correct to invoke an assignment operator, the correct wording being "assignment statement" as used in many places in The Python Language Reference Manual. The only "assignment operator" we can figure out is the walrus operator because (a := expr) has a value.
For consistency, we can observe that assignment symbols (=, +=, etc), contrary to the walrus symbol, are not listed in:
Thomas Wouters explains in a SO comment :
Assignment is actually not an expression in Python, and
=not an operator in the normal sense; operator precedence doesn't apply.
Related reference of interest: = is not an operator
EDIT:
- Alex Martelli agrees here:
...doesn't exist, since '=' is not an operator in Python (just like it isn't, say, in VB). But, OK, you mean "assignment".
- Another reference of interest: Is assignment an operator in Python?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Überprüfe die verlinkten Abschnitte der Language Reference zu einfachen Anweisungen und lexikalischer Analyse sowie den Glossareintrag zu Ausdrücken und die Tabelle zur Operatorpräzedenz. Durchsuche die Dokumentation nach Verwendungen von „assignment operator“ und bestimme, welche davon „assignment statement“ lauten sollten. Überprüfe anschließend, ob die Terminologie mit dem umgebenden Referenztext konsistent ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- documentation
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100