@@ -204,8 +204,26 @@ _collections_abc\.ByteString
204204typing\.ByteString
205205
206206_collections_abc.Callable # Typing-related weirdness
207- _collections_abc.Mapping.get # Adding None to the Union messed up mypy
208- _collections_abc.Sequence.index # Supporting None in end is not mandatory
207+
208+ # While the implementation in _collections_abc.py uses positional-or-keyword args,
209+ # this is unsafe as canonical types list/dict/set etc. only support positional args.
210+ # See: https://github.com/python/typeshed/issues/14071
211+ # See: https://github.com/python/cpython/issues/135312
212+ _collections_abc.Mapping.get
213+ _collections_abc.MutableSequence.append
214+ _collections_abc.MutableSequence.extend
215+ _collections_abc.MutableSequence.insert
216+ _collections_abc.MutableSequence.pop
217+ _collections_abc.MutableSequence.remove
218+ _collections_abc.MutableSet.add
219+ _collections_abc.MutableSet.discard
220+ _collections_abc.MutableSet.remove
221+ _collections_abc.Sequence.count
222+ _collections_abc.Sequence.index
223+ _collections_abc.Set.isdisjoint
224+ _collections_abc.Set._from_iterable
225+ _collections_abc.ItemsView._from_iterable
226+ _collections_abc.KeysView._from_iterable
209227
210228_ctypes.CFuncPtr # stubtest erroneously thinks it can't be subclassed
211229
@@ -418,8 +436,11 @@ os._wrap_close.write # Methods that come from __getattr__() at runtime
418436os._wrap_close.writelines # Methods that come from __getattr__() at runtime
419437os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
420438
439+ _pickle.Pickler.reducer_override # Can be added by subclasses
440+ pickle.Pickler.reducer_override # Can be added by subclasses
421441pickle._Pickler\..* # Best effort typing for undocumented internals
422442pickle._Unpickler\..* # Best effort typing for undocumented internals
443+
423444shutil.rmtree # function with attributes, which we approximate with a callable protocol
424445socketserver.BaseServer.get_request # Not implemented, but expected to exist on subclasses.
425446ssl.PROTOCOL_SSLv2 # Depends on the existence and flags of SSL
0 commit comments