PyDocs

Nav

Functional Programming Modules

attrgetter

operator

function
  • attrgetter(attr)
  • attrgetter(*attrs)
Return a callable object that fetches the given attribute(s) from its operand.
After f = attrgetter('name'), the call f(r) returns r.name.
After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).
After h = attrgetter('name.first', 'name.last'), the call h(r) returns
(r.name.first, r.name.last).
0 Examples
No examples for operator/attrgetter.
See Also
No see-alsos for operator/attrgetter
0 Notes
No notes for attrgetter