Static variable vs Class variable
Duncan Booth
duncan.booth at invalid.invalid
Wed Oct 17 05:08:27 EDT 2007
More information about the Python-list mailing list
Wed Oct 17 05:08:27 EDT 2007
- Previous message (by thread): Static variable vs Class variable
- Next message (by thread): Static variable vs Class variable
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
paul.melis at gmail.com wrote: > Curious, do you have the relevant section in the docs that describes > this behaviour? Yes, but mostly by implication. In section 3.4.7 of the docs, the sentence before the one you quoted says: These methods should attempt to do the operation in-place (modifying self) and return the result (which could be, but does not have to be, self). The 'does not have to be self' tells you that the result of __iadd__ is used, i.e there is still an assignment going on. Just read all of that paragraph carefully. It says that if there is no __iadd__ method it considers calling __add__/__radd__. Nowhere does it say that it handles the result of calling the methods differently.
- Previous message (by thread): Static variable vs Class variable
- Next message (by thread): Static variable vs Class variable
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list