-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Open
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
I was designing the following:
from functools import reduce
from operator import or_
dicts = [
{"a": 1, "b": 2},
{"c": 99, "d": 3},
{"e": 4}
]
merged = reduce(or_, dicts, {})
print(merged)And from reading:
cpython/Doc/library/operator.rst
Line 414 in ed73c90
| | Bitwise Or | ``a | b`` | ``or_(a, b)`` | |
And:
cpython/Doc/library/operator.rst
Lines 174 to 177 in ed73c90
| .. function:: or_(a, b) | |
| __or__(a, b) | |
| Return the bitwise or of *a* and *b*. |
I wasn't sure if or_ applies also to dictionaries, but according to the trivial implementation, of course it does :). Anyway, I thought it would be nice to rephrase the above 2 parts of the document somehow - not sure exactly how to do phrase it myself.
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Projects
Status
Todo