On this page
  1. operator.call
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

operator.call

Prev: operator.attrgetter | Up: operator | Next: operator.concat
Rel: operator.abs, operator.add, operator.and_, operator.attrgetter
Ref: docs.python.org — operator.call
Tags: #public #python3 #stdlib #operator


Import

import operator
from operator import call

Signature & Overview

operator.call(obj, /, *args, **kwargs)

Same as obj(*args, **kwargs).

Usage

import operator

# Python 3.11+: functional form of obj(*args, **kwargs)
if hasattr(operator, "call"):
    assert operator.call(pow, 2, 5) == 32

Gotchas

REPL Inspect

from operator import call
help(call)

Linked from

Related notes