[issue1826] operator.attrgetter() should accept dotted attribute paths
Barry A. Warsaw
report at bugs.python.org
Mon Jan 14 20:22:21 CET 2008
New submission from Barry A. Warsaw:
operator.attrgetter() is neutered because it only accepts a single
attribute name, but it would really be much more useful if it accepted,
and followed a dotted attribute path, e.g.:
sorted(seq, key=operator.attrgetter('person.displayname'))
Of course attrgetter() would raise AttributeError if the entire path
could not be traversed.
----------
components: Library (Lib)
keywords: easy
messages: 59911
nosy: barry
severity: normal
status: open
title: operator.attrgetter() should accept dotted attribute paths
type: rfe
versions: Python 2.6, Python 3.0
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1826>
__________________________________
More information about the Python-bugs-list
mailing list