make_callable

negmas.helpers.make_callable(x)[source]

Converts its input to a callable (i.e. can be called using () operator).

Examples

>>> make_callable(lambda  x: 2 * x) (4)
8
>>> make_callable(dict(a=1, b=3))("a")
1
>>> make_callable((3, 4, 5))(1)
4
Return type

Callable