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 <>
| 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}
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: <>
2021-01-31 16:14:39Siy_Vlinkissue43085 messages
2021-01-31 16:14:39Siy_Vcreate