mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-11-06 10:42:52 +08:00
Make multiprocessing.Namespace accept any attribute (#4204)
Update multiprocessing.dummy.Namespace as well Closes: #4186
This commit is contained in:
1 parent
72c8907760
commit
afe1e543b3
3 files changed
+11
-4
No files matched your search
@@ -25,10 +25,12 @@ class DummyProcess(threading.Thread):
|
||||
|
||||
Process = DummyProcess
|
||||
|
||||
class Namespace(object):
|
||||
def __init__(self, **kwds) -> None: ...
|
||||
class Namespace:
|
||||
def __init__(self, **kwds: Any) -> None: ...
|
||||
def __getattr__(self, __name: str) -> Any: ...
|
||||
def __setattr__(self, __name: str, __value: Any) -> None: ...
|
||||
|
||||
class Value(object):
|
||||
class Value:
|
||||
_typecode: Any
|
||||
_value: Any
|
||||
value: Any
|
||||
|
||||
@@ -18,7 +18,10 @@ _T = TypeVar('_T')
|
||||
_KT = TypeVar('_KT')
|
||||
_VT = TypeVar('_VT')
|
||||
|
||||
class Namespace: ...
|
||||
class Namespace:
|
||||
def __init__(self, **kwds: Any) -> None: ...
|
||||
def __getattr__(self, __name: str) -> Any: ...
|
||||
def __setattr__(self, __name: str, __value: Any) -> None: ...
|
||||
|
||||
_Namespace = Namespace
|
||||
|
||||
|
||||
@@ -523,6 +523,8 @@ typing.[A-Z]\w+
|
||||
# We can't distinguish not having a default value from having a default value of inspect.Parameter.empty
|
||||
inspect.Parameter.__init__
|
||||
inspect.Signature.__init__
|
||||
# Any field can be set on Namespace
|
||||
multiprocessing.(dummy|managers).Namespace.__[gs]etattr__
|
||||
os.[a-z]+_(param|result)._(asdict|make|replace) # NamedTuple like, but not actually NamedTuples
|
||||
# sys attributes that are not always defined
|
||||
sys.last_traceback
|
||||
|
||||
Reference in new issue
Block a user