Message345709
The following code hangs forever instead of printing "called" 10 times:
from concurrent.futures import ProcessPoolExecutor
class A:
def f(self):
print("called")
class B(A):
def f(self):
executor = ProcessPoolExecutor(max_workers=2)
futures = [executor.submit(super(B, self).f)
for _ in range(10)]
if __name__ == "__main__":
B().f()
The same code with `super(B, self)` replaced with `super()` raises the following error:
> TypeError: super(type, obj): obj must be an instance or subtype of type
However, replacing `ProcessPoolExecutor` with `ThreadPoolExecutor` works as expected, but only with `super(B, self)` (with `super()` it still raises the same error). |
|
Date |
User |
Action |
Args |
2019-06-15 17:49:58 | maggyero | set | recipients:
+ maggyero, bquinlan, pitrou, ned.deily, asvetlov, methane, lukasz.langa, serhiy.storchaka |
2019-06-15 17:49:58 | maggyero | set | messageid: <1560620998.84.0.271411330169.issue37294@roundup.psfhosted.org> |
2019-06-15 17:49:58 | maggyero | link | issue37294 messages |
2019-06-15 17:49:58 | maggyero | create | |
|