Return an list of the results of a method applied to each element.
fl.method(name, *args, **kwargs) is equivalent to cf.List(f.name(*args, **kwargs) for f in fl).
Parameters: |
|
---|---|
Returns: |
|
See also
Examples: |
---|
>>> x = cf,List(['a, 'b', 'c'])
>>> x.method('upper)
['A, 'B', 'C']
>>> x.method('find', 'a')
[0, -1, -1]
>>> x
['a, 'b', 'c']
>>> x = cf.List([[3, 2, 1], [6, 5, 4]])
>>> x.method('sort')
[None, None, None]
>>> x
[[1, 2, 3], [4, 5, 6]]