Message284928
Run this a couple of times (it fails for me the first time, but it's a race, so YMMV):
```
import enum
from concurrent.futures import ThreadPoolExecutor
class MyEnum(enum.IntFlag):
one = 1
with ThreadPoolExecutor() as executor:
print(list(executor.map(MyEnum.one.__or__, range(1000))))
```
An easy fix would be:
```
diff --git a/Lib/enum.py b/Lib/enum.py
index e79b0382eb..eca56ec3a7 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -846,7 +846,7 @@ def _decompose(flag, value):
# check for named flags and powers-of-two flags
flags_to_check = [
(m, v)
- for v, m in flag._value2member_map_.items()
+ for v, m in list(flag._value2member_map_.items())
if m.name is not None or _power_of_two(v)
]
members = []
``` |
|
Date |
User |
Action |
Args |
2017-01-07 18:39:55 | simon.percivall | set | recipients:
+ simon.percivall, ethan.furman |
2017-01-07 18:39:54 | simon.percivall | set | messageid: <1483814394.92.0.80531432637.issue29167@psf.upfronthosting.co.za> |
2017-01-07 18:39:54 | simon.percivall | link | issue29167 messages |
2017-01-07 18:39:54 | simon.percivall | create | |
|