mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-28 18:56:44 +08:00
Add @type_check_only to various typeshed-only procotols in stdlib (#14465)
Mark various typeshed-only protocols as `@type_check_only` in stdlib
This commit is contained in:
+2
-1
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Protocol, TypeVar
|
||||
from typing import Any, Protocol, TypeVar, type_check_only
|
||||
from typing_extensions import Self
|
||||
|
||||
__all__ = ["Error", "copy", "deepcopy"]
|
||||
@@ -7,6 +7,7 @@ __all__ = ["Error", "copy", "deepcopy"]
|
||||
_T = TypeVar("_T")
|
||||
_SR = TypeVar("_SR", bound=_SupportsReplace)
|
||||
|
||||
@type_check_only
|
||||
class _SupportsReplace(Protocol):
|
||||
# In reality doesn't support args, but there's no other great way to express this.
|
||||
def __replace__(self, *args: Any, **kwargs: Any) -> Self: ...
|
||||
|
||||
Reference in New Issue
Block a user