mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-26 05:41:11 +08:00
Simplify Traversable signature (#10934)
Simplify Traversable.open() signature. This is necessary so that implentors can reasonanbly implement this method. For example `zipfile.Path.open()` (which is considered a `Traversable`) only supports this subset. Make `Traversable.__truediv__` and `joinpath` arguments pos-only. The arguments are named differently in both `pathlib.Path` and `zipfile.Path`.
This commit is contained in:
@@ -152,6 +152,10 @@ typing.ParamSpec(Args|Kwargs).__origin__
|
||||
# https://github.com/python/mypy/issues/15302
|
||||
typing.NewType.__call__
|
||||
|
||||
# Problematic protocol signatures at runtime, see source code comments.
|
||||
importlib.abc.Traversable.joinpath
|
||||
importlib.abc.Traversable.open
|
||||
|
||||
# Super-special typing primitives
|
||||
typing\.NamedTuple
|
||||
typing\.Annotated
|
||||
|
||||
@@ -107,6 +107,10 @@ platform.uname_result.processor
|
||||
unittest.TestCase.__init_subclass__
|
||||
unittest.case.TestCase.__init_subclass__
|
||||
|
||||
# Problematic protocol signature at runtime, see source code comments.
|
||||
importlib.abc.Traversable.open
|
||||
importlib.resources.abc.Traversable.open
|
||||
|
||||
# Super-special typing primitives
|
||||
typing\._SpecialForm.*
|
||||
typing\.NamedTuple
|
||||
|
||||
@@ -96,6 +96,10 @@ platform.uname_result.processor
|
||||
unittest.TestCase.__init_subclass__
|
||||
unittest.case.TestCase.__init_subclass__
|
||||
|
||||
# Problematic protocol signature at runtime, see source code comments.
|
||||
importlib.abc.Traversable.open
|
||||
importlib.resources.abc.Traversable.open
|
||||
|
||||
# Super-special typing primitives
|
||||
typing\._SpecialForm.*
|
||||
typing\.NamedTuple
|
||||
|
||||
@@ -141,6 +141,9 @@ types.MemberDescriptorType.__get__
|
||||
types.MethodDescriptorType.__get__
|
||||
types.WrapperDescriptorType.__get__
|
||||
|
||||
# Problematic protocol signature at runtime, see source code comments.
|
||||
importlib.abc.Traversable.open
|
||||
|
||||
# Super-special typing primitives
|
||||
typing\.NamedTuple
|
||||
typing\.Annotated
|
||||
|
||||
Reference in New Issue
Block a user