Raymond Hettinger added the comment:

The principal use case for attrgetter() was to work with key-functions for 
sorted/min/max/groupby/nsmallest/nlargest.  Secondarily, it worked nicely with 
map() and filter() as a field extractor in a chain of iterators.  Neither these 
use cases would benefit from creating a namedtuple.

What are your use cases that are creating a need for a variant of attrgetter 
that returns namedtuples?

Also, how would this be useful with rename=True?  The user of the result 
wouldn't know the fields names in advance and hence wouldn't be able to access 
them.

Do you know of any cases where someone has used this recipe is real code?  Has 
it been tried out on users other than yourself?

----------
assignee:  -> rhettinger
nosy: +rhettinger

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31086>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to