I agree this needs to be reframed but suggest that assignment in place
isn't the most useful mental model.

Instead, something like "generically apply a value to another" (dunder
apply) or "update an object with another" (dunder update) might have a
prayer of making sense. Perhaps there are other situations where having a
*generic* operator meant to communicate the concept of sending and object
into another makes sense. A few come to mind:

my_dict.update
my_gen.send
my_list.append
my_list.extend
my_stream.write

It's worth considering whether there would be benefit in providing a
generic operator that provides nice syntax, intended for general use
dependent entirely on that the user wants to make it mean. And whether some
of the existing functionality above might benefit from some prettier syntax
as well.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to