Get a named attribute from each element of the list.
fl.getattr(attr, *default) is equivalent to cf.List(for f in fl: getattr(f, attr, *default)).
Parameters: |
|
---|---|
Returns: |
|
Examples: |
---|
>>> fl.getattr('foo')
['bar1', 'bar2']
>>> del fl[1].foo
>>> fl.getattr('foo', None)
['bar1', None]