Raymond Hettinger wrote:
Does anyone think it was not a good idea to put in-place operations in the operator module? For some objects, they don't map() as well as their regular counterparts. Some in-place operations rely on the interpreter to take care of the actual assignment. I've not yet seen good use cases for operator.isub() for example.

Given that Python has augmented assignment delimiters, but no 'in-place operators', and that the 'in-place operations' used to partially implemented them cannot be 'in-place' for immutables (and hence are actually aliases for the corresponding 'regular' operations, I agree that they are a bit odd and mostly useless. About the only use case I can think of is something like map(operator.iadd, mutable_seqs, items), where mutable_seqs includes instances of user classes than defind .__iadd__ but not .append ;-)

On the other hand, the kitchen-sink policy saves debate.

tjr

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to