# Examples


# [F](../reference/F.md#placeholder.F) and `_` (singleton)


``` python
from placeholder import _

_.real
```


    F(operator.attrgetter('real'))


``` python
nums = (0 + 2j), (1 + 1j), (2 + 0j)
min(nums, key=_.real)
```


    2j


``` python
min(nums, key=_.imag)
```


    (2+0j)


``` python
_[0]
```


    F(operator.itemgetter(0))


``` python
pairs = "ac", "bb", "ca"
min(pairs, key=_[0])
```


    'ac'


``` python
min(pairs, key=_[-1])
```


    'ca'


``` python
import itertools

list(itertools.accumulate(range(1, 6), _ * _))
```


    [1, 2, 6, 24, 120]


``` python
list(itertools.filterfalse(_ % 2, range(10)))
```


    [0, 2, 4, 6, 8]


``` python
list(filter(_ % 2 == 0, range(10)))
```


    [0, 2, 4, 6, 8]


``` python
list(filter(abs(_) < 1, [-1, 0, 1]))
```


    [0]


# [M](../reference/M.md#placeholder.M) and `m` (singleton)

Support for `attrgetter(*)`, `itemgetter(*)`, and `methodcaller`.


``` python
from placeholder import m

m("real", "imag")
```


    F(operator.attrgetter('real', 'imag'))


``` python
m[0, -1]
```


    F(operator.itemgetter(0, -1))


``` python
m.split("-")
```


    operator.methodcaller('split', '-')
