Operator Functions

operator.not_()

Negate the truth value of an object. Uses ordinary truth testing, not bitwise inversion. Unlike a hypothetical __not__ hook, this uses __bool__ or __len__.

Formal Syntax & Structure

python syntaxpython
operator.not_(obj, /)

Parameters & Attributes

NameTypeDescription
objobjectObject to inspect or copy.

Return Value

bool

The bool result described above.

Working Example

Example Snippetpython
import operatorprint(operator.not_([]))
Python Reference