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
| Name | Type | Description |
|---|---|---|
| obj | object | Object to inspect or copy. |
Return Value
bool
The bool result described above.
Working Example
Example Snippetpython
import operatorprint(operator.not_([]))