New submission from Géry <[email protected]>:
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).
----------
components: Library (Lib)
messages: 345709
nosy: asvetlov, bquinlan, inada.naoki, lukasz.langa, maggyero, ned.deily,
pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: ProcessPoolExecutor fails with super
type: crash
versions: Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37294>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com