@@ -210,6 +210,8 @@ _?ast.stmt.__init__
210210
211211_ast.ImportFrom.level # None on the class, but never None on instances
212212
213+ argparse.Namespace.__setattr__ # should allow setting any attribute
214+
213215ast.ImportFrom.level # None on the class, but never None on instances
214216ast.NodeVisitor.visit_\w+ # Methods are discovered dynamically, see #3796
215217_?asyncio.Future.__init__ # Usually initialized from c object
@@ -272,7 +274,9 @@ _?ctypes.Array._length_ # _length_ is abstract, https://github.com/python/types
272274_?ctypes.Array.raw # exists but stubtest can't see it; only available if _CT == c_char
273275ctypes.CDLL._FuncPtr # None at class level but initialized in __init__ to this value
274276_?ctypes.Structure.__getattr__ # doesn't exist, but makes things easy if we pretend it does
277+ _?ctypes.Structure.__setattr__ # doesn't exist, but makes things easy if we pretend it does
275278_?ctypes.Union.__getattr__ # doesn't exist, but makes things easy if we pretend it does
279+ _?ctypes.Union.__setattr__ # doesn't exist, but makes things easy if we pretend it does
276280
277281# Iterable classes that don't define __iter__ at runtime (usually iterable via __getitem__)
278282# These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220
@@ -323,6 +327,8 @@ inspect.Signature.__init__
323327inspect.Parameter.empty # set as private marker _empty
324328inspect.Signature.empty # set as private marker _empty
325329
330+ logging.LogRecord.__setattr__ # doesn't exist, but makes things easy if we pretend it does
331+
326332# Iterable classes that don't define __iter__ at runtime (usually iterable via __getitem__)
327333# These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220
328334mmap.mmap.__iter__
@@ -380,7 +386,9 @@ multiprocessing.synchronize.SemLock.acquire
380386multiprocessing.synchronize.SemLock.release
381387
382388numbers.Number.__hash__ # typeshed marks this as abstract but code just sets this as None
389+
383390optparse.Values.__getattr__ # Some attributes are set in __init__ using setattr
391+ optparse.Values.__setattr__ # doesn't exist, but makes things easy if we pretend it does
384392
385393os._wrap_close.read # Methods that come from __getattr__() at runtime
386394os._wrap_close.readable # Methods that come from __getattr__() at runtime
0 commit comments