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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4