python-dev
[Prev] Thread [Next] | [Prev] Date [Next]
Re: [Python-Dev] In-place operators Raymond Hettinger Tue Mar 17 16:00:38 2009
Right. Since Python doesn't have a notation like "operator +" for turning operators into functions, the operator module provides this functionality. Better safe than sorry.
It doesn't really expose this functionality because some of the functionality is buried in ceval.c and is not exposed by operator.isub() for example.I don't see that it offers anything useful that can't be accomplished by calling a magic method directly.
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). It wastes the time of people who try to use them and then find-out that they don't act as expected (the assignment doesn't take place) or that you can't use them with containers s[k] += x etc.)
Maybe someone somewhere has some interesting use for these in-place operator function. I hope so. Raymond _______________________________________________ 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