[issue40702] frozensets should not allow the |= operator

Serhiy Storchaka report at bugs.python.org
Wed May 20 15:34:22 EDT 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It is okay. In this case `a |= b` is equivalent to `a = a | b`.

The same behavior is for tuples, strings, and other non-mutable collections:

t = (1, 2)
t += (3, 4)
s = 'ab'
s += 'cd'

And even for numbers!

i = 5
i += 1

----------
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40702>
_______________________________________


More information about the Python-bugs-list mailing list