[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584
Manjusaka
report at bugs.python.org
Sun Mar 1 04:51:46 EST 2020
Manjusaka <lizheao940510 at gmail.com> added the comment:
> Augmented assignment behaves identically to the update method called with a single positional argument, so it also accepts anything implementing the Mapping protocol (more specifically, anything with the keys and __getitem__ methods) or iterables of key-value pairs. This is analogous to list += and list.extend, which accept any iterable, not just lists. Continued from above:
But the __or__ in implementation doesn't restrict the type of the input data. But it's almost the same with __ior__. I think we should keep the behavior as same as possible. some lenient or same restrictive
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39806>
_______________________________________
More information about the Python-bugs-list
mailing list