[Python-ideas] Add .= as a method return value assignment operator

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Sep 28 01:34:58 EDT 2018


Steven D'Aprano wrote:
> Think about a more complex assignment:
> 
>     text .= encode(spam) + str(eggs)

I think the only sane thing would be to disallow that, and
require the RHS to have the form of a function call, which is
always interpreted as a method of the LHS.

-- 
Greg


More information about the Python-ideas mailing list