[Python-de] Re: for unpacking
"Peter J. Holzer" <[email protected]> Wed, 7 Aug 2024 13:24:49 +0200
| Newsgroups | gmane.comp.python.general.german |
|---|---|
| Organization | LUGA |
| Message-ID | <[email protected]> |
On 2024-08-07 10:03, Stefan Ram <[email protected]> wrote: > [email protected] (Stefan Ram) schrieb oder zitierte: >>Dieses Nichtvorkommen legt es für mich nahe, daß die Frage >>der Veränderbarkeit des Ziels für die Bedeutung von "+=" >>nur eine begrenzte Bedeutung hat! >>|An augmented assignment evaluates the target (which, unlike >>|normal assignment statements, cannot be an unpacking) and the >>|expression list, performs the binary operation specific to >>|the type of assignment on the two operands, and assigns the >>|result to the original target. >>aus Abschnitt 7.2.1 > > Ich hatte gestern etwas übersehen! Und zwar (in bezug auf > Operatoren wie "+="): > >|Also, when possible, the actual operation is performed >|in-place, meaning that rather than creating a new object and >|assigning that to the target, the old object is modified >|instead. > 7.2.1 [...] > > (In "7.2.1" besagt "assigns the result to the original target" > eigentlich, daß "+=" sich hier wie "=" verhält. Exakt. Der Unterschied liegt in der Implementation der Methode __iadd__, nicht in der Zuweisung. hp _______________________________________________ python-de Mailingliste -- [email protected] Zur Abmeldung von dieser Mailingliste senden Sie eine Nachricht an [email protected] https://mail.python.org/mailman3/lists/python-de.python.org/ Mitgliedsadresse: [email protected]