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 <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1826>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to