Set a named attribute on each element of the list.
fl.setattr(attr, value) is equivalent to for f in fl: f.attr = value.
Parameters: |
|
---|---|
Returns: | None |
Examples: |
---|
>>> fl.setattr('foo', -99)
>>> fl.getattr('foo')
[-99, -99]
>>> fl.setattr('foo', [1, 2])
>>> fl.getattr('foo')
[[1, 2], [1, 2]]