This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Isaac Morland, rhettinger
Date 2017-07-31.09:23:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501492982.45.0.110240109166.issue31086@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2017-07-31 09:23:02rhettingersetrecipients: + rhettinger, Isaac Morland
2017-07-31 09:23:02rhettingersetmessageid: <1501492982.45.0.110240109166.issue31086@psf.upfronthosting.co.za>
2017-07-31 09:23:02rhettingerlinkissue31086 messages
2017-07-31 09:23:02rhettingercreate