multiprocessing.managers.SyncManager.list
返回ListProxy[Any]
,但我没有看到缩小Any
的方法?
作为解决方法,我可以:
int_list = cast("ListProxy[int]", m.list())
并且
int_list
是 ListProxy[int]
。
另请注意,类型上需要
"
,以避免:
TypeError: type 'ListProxy' is not subscriptable`:
有更好的方法吗?
results = m.list(cast(list[int], []))