Return whether an attribute exists for each element of the list.
fl.hasattr(attr) is equivalent to cf.List(for f in fl: hasattr(f, attr)).
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> fl.getattr('foo')
['bar1', 'bar2']
>>> del fl[1].foo
>>> fl.getattr('foo', None)
['bar1', None]