【发布时间】:2022-01-05 20:01:14
【问题描述】:
我有以下代码:
from multiprocessing.managers import ValueProxy
def test(value: ValueProxy[int]):
print("foo")
test(None)
它会抛出这个错误:
Traceback (most recent call last):
File ".../test.py", line 4, in <module>
def test(value: ValueProxy[int]):
TypeError: 'type' object is not subscriptable
如何键入提示ValueProxy[int]?
【问题讨论】:
标签: python types python-multiprocessing type-hinting