On this page
operator.ior
Prev: operator.invert | Up: operator | Next: operator.ipow
Rel: operator.abs, operator.add, operator.and_, operator.attrgetter
Ref: docs.python.org — operator.ior
Tags: #public #python3 #stdlib #operator
Import
import operator
from operator import ior
Signature & Overview
operator.ior(a, b, /)
Same as a |= b.
Usage
import operator
d = {"a": 1}
assert operator.ior(d, {"b": 2}) is d and d == {"a": 1, "b": 2}
Gotchas
- In-place
|=: Works ondict(Python 3.9+),set, andint.
REPL Inspect
from operator import ior
help(ior)
Linked from
Related notes
- tuts/python3/stdlib_module/operator/invert Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/ipow Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/operator/abs Linked here; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/add Linked here; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/and_ Linked here; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/attrgetter Linked here; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/call shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/concat shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/contains shared tags: #operator, #stdlib