This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Siy_V
Recipients Siy_V, brandtbucher, ezio.melotti, mrabarnett, steven.daprano
Date 2021-01-31.16:14:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612109679.82.0.693593534177.issue43085@roundup.psfhosted.org>
In-reply-to
Content
| and |= operators work only if the operands are of 'dict' type. This means that they can't be used with some of the user defined mapping objects.

The case that especially caught my attention was 'SignalDict' type in decimal standard library. While 'SignalDict' has got an update method like 'dict', it can not be updated with |= operator. The following code results in a TypeError:

decimal.getcontext().traps |= {decimal.DivisionByZero:False}
History
Date User Action Args
2021-01-31 16:14:39Siy_Vsetrecipients: + Siy_V, ezio.melotti, mrabarnett, steven.daprano, brandtbucher
2021-01-31 16:14:39Siy_Vsetmessageid: <1612109679.82.0.693593534177.issue43085@roundup.psfhosted.org>
2021-01-31 16:14:39Siy_Vlinkissue43085 messages
2021-01-31 16:14:39Siy_Vcreate