[New-bugs-announce] [issue30020] Make attrgetter use namedtuple

Isaac Morland report at bugs.python.org
Fri Apr 7 23:04:51 EDT 2017


New submission from Isaac Morland:

I would find it useful if the tuples returned by attrgetter functions were namedtuples.  An initial look at the code for attrgetter suggests that this would be an easy change and should make little difference to performance.  Giving a namedtuple where previously a tuple was returned seems unlikely to trigger bugs in existing code so I propose to simply change attrgetter rather than providing a parameter to specify whether or not to use the new behaviour.

Patch will be forthcoming but comments appreciated.

----------
components: Library (Lib)
messages: 291314
nosy: Isaac Morland
priority: normal
severity: normal
status: open
title: Make attrgetter use namedtuple
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30020>
_______________________________________


More information about the New-bugs-announce mailing list