python-dev
[Prev] Thread [Next] | [Prev] Date [Next]
Re: [Python-Dev] In-place operators Martin v. Löwis Tue Mar 17 16:01:04 2009
> I'm sure that consistency/completeness/safe_vs_sorry was the reason they > were added. But, if they aren't useful, they never should have been > (IMO). Why is that? [you are then giving a reason:] > It wastes the time of people who try to use them and then > find-out that they don't act as expected What people in particular? Certainly, the doc string is wrong: isub(a, b) -- Same as a -= b. That's not quite the same - you would have to write a = isub(a, b) -- Same as a -= b. (right?) However, anybody who understands what isub does already knows that property. I can't imagine users browsing through the operator module and thinking "hmm, what might that isub function do?". > or that you can't use them with containers s[k] += x etc.) Why not? s[k] = iadd(s[k], x) works fine, no? > Maybe someone somewhere has some interesting use for > these in-place operator function. I hope so. It could be important if you want apply it to mutable objects, i.e. where the assignment doesn't do anything. Regards, Martin _______________________________________________ Python-Dev mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/alexiscircle%40gmail.com
- [Python-Dev] In-place operators Raymond Hettinger
- Re: [Python-Dev] In-place operators Benjamin Peterson
- Re: [Python-Dev] In-place operators Guido van Rossum
- Re: [Python-Dev] In-place operators Raymond Hettinger
- Re: [Python-Dev] In-place operators Antoine Pitrou
- Re: [Python-Dev] In-place operators Martin v. Löwis <=
- Re: [Python-Dev] In-place operators Raymond Hettinger
- Re: [Python-Dev] In-place operators Martin v. Löwis
- Re: [Python-Dev] In-place operators Raymond Hettinger
- Re: [Python-Dev] In-place operators Nick Coghlan
- Message not available
- Re: [Python-Dev] In-place operators Hrvoje Niksic
Re: [Python-Dev] In-place operators Terry Reedy