Message386028
| 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:39 | Siy_V | set | recipients:
+ Siy_V, ezio.melotti, mrabarnett, steven.daprano, brandtbucher |
2021-01-31 16:14:39 | Siy_V | set | messageid: <1612109679.82.0.693593534177.issue43085@roundup.psfhosted.org> |
2021-01-31 16:14:39 | Siy_V | link | issue43085 messages |
2021-01-31 16:14:39 | Siy_V | create | |
|