F
Partial function with operator support.
Usage
F()Builds partially-bound callables via operator overloading. In a binary expression, the other operand is bound and a callable is returned.
The module singleton _ is an instance of this class.
Supported Operators
All applicable double-underscore methods are supported, including arithmetic (+, -, *, /, //, %, **, @), bitwise (&, |, ^, <<, >>), unary (-, +, ~, abs, round, trunc, floor, ceil, reversed), and comparison (==, !=, <, >, <=, >=).
Unsupported Operators
len, bool, and in coerce the output type.
Methods
| Name | Description |
|---|---|
| __getattribute__() |
Return an attrgetter-based callable for name.
|
| __getitem__() |
Return an itemgetter-based callable for key.
|
| __iter__() | Yield the underlying function and bound arguments. |
| __round__() |
Return a callable that applies round.
|
__getattribute__()
Return an attrgetter-based callable for name.
Usage
__getattribute__(name)__getitem__()
Return an itemgetter-based callable for key.
Usage
__getitem__(key)__iter__()
Yield the underlying function and bound arguments.
Usage
__iter__()__round__()
Return a callable that applies round.
Usage
__round__(ndigits=None)