[Python-Dev] cpython (3.2): don't mention implementation detail (original) (raw)
Xavier Morel python-dev at masklinn.net
Tue Dec 20 11:25:32 CET 2011
- Previous message: [Python-Dev] cpython (3.2): don't mention implementation detail
- Next message: [Python-Dev] cpython (3.2): don't mention implementation detail
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2011-12-20, at 11:08 , Antoine Pitrou wrote:
But that's basically the only reason to invoke the
operator.attrgetter("foo")
ugliness, instead of writing the explicit and obviouslambda x: x.foo
. I don't agree with this, an attrgetter in the current namespace can be clearer than an explicit lambda in place, and more importantly when trying to fetch more than one attribute attrgetter is far superior to lambdas as far as I'm concerned.
I don't think I've ever seen attrgetter
(or any of the other operator
functions) advocated on basis of speed. This mention does not even exist in the Python 2 docs, which does not prevent people from using operator
.
- Previous message: [Python-Dev] cpython (3.2): don't mention implementation detail
- Next message: [Python-Dev] cpython (3.2): don't mention implementation detail
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]