mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
remove quoted strings (#6933)
This commit is contained in:
@@ -60,7 +60,7 @@ _T2 = TypeVar("_T2")
|
||||
_T3 = TypeVar("_T3")
|
||||
_T4 = TypeVar("_T4")
|
||||
_T5 = TypeVar("_T5")
|
||||
_TT = TypeVar("_TT", bound="type")
|
||||
_TT = TypeVar("_TT", bound=type)
|
||||
|
||||
class object:
|
||||
__doc__: str | None
|
||||
|
||||
@@ -60,7 +60,7 @@ _T2 = TypeVar("_T2")
|
||||
_T3 = TypeVar("_T3")
|
||||
_T4 = TypeVar("_T4")
|
||||
_T5 = TypeVar("_T5")
|
||||
_TT = TypeVar("_TT", bound="type")
|
||||
_TT = TypeVar("_TT", bound=type)
|
||||
|
||||
class object:
|
||||
__doc__: str | None
|
||||
|
||||
@@ -101,9 +101,9 @@ class EventType(str, Enum):
|
||||
VirtualEvent: str
|
||||
Visibility: str
|
||||
|
||||
_W = TypeVar("_W", bound="Misc")
|
||||
_W = TypeVar("_W", bound=Misc)
|
||||
# Events considered covariant because you should never assign to event.widget.
|
||||
_W_co = TypeVar("_W_co", covariant=True, bound="Misc")
|
||||
_W_co = TypeVar("_W_co", covariant=True, bound=Misc)
|
||||
|
||||
class Event(Generic[_W_co]):
|
||||
serial: int
|
||||
|
||||
@@ -64,8 +64,6 @@ LambdaType = FunctionType
|
||||
|
||||
@final
|
||||
class CodeType:
|
||||
"""Create a code object. Not for the faint of heart."""
|
||||
|
||||
co_argcount: int
|
||||
if sys.version_info >= (3, 8):
|
||||
co_posonlyargcount: int
|
||||
@@ -262,19 +260,15 @@ class CoroutineType(Coroutine[_T_co, _T_contra, _V_co]):
|
||||
def throw(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ...
|
||||
|
||||
class _StaticFunctionType:
|
||||
"""Fictional type to correct the type of MethodType.__func__.
|
||||
|
||||
FunctionType is a descriptor, so mypy follows the descriptor protocol and
|
||||
converts MethodType.__func__ back to MethodType (the return type of
|
||||
FunctionType.__get__). But this is actually a special case; MethodType is
|
||||
implemented in C and its attribute access doesn't go through
|
||||
__getattribute__.
|
||||
|
||||
By wrapping FunctionType in _StaticFunctionType, we get the right result;
|
||||
similar to wrapping a function in staticmethod() at runtime to prevent it
|
||||
being bound as a method.
|
||||
"""
|
||||
|
||||
# Fictional type to correct the type of MethodType.__func__.
|
||||
# FunctionType is a descriptor, so mypy follows the descriptor protocol and
|
||||
# converts MethodType.__func__ back to MethodType (the return type of
|
||||
# FunctionType.__get__). But this is actually a special case; MethodType is
|
||||
# implemented in C and its attribute access doesn't go through
|
||||
# __getattribute__.
|
||||
# By wrapping FunctionType in _StaticFunctionType, we get the right result;
|
||||
# similar to wrapping a function in staticmethod() at runtime to prevent it
|
||||
# being bound as a method.
|
||||
def __get__(self, obj: object | None, type: type | None) -> FunctionType: ...
|
||||
|
||||
@final
|
||||
|
||||
@@ -3,7 +3,7 @@ from _typeshed import Self, StrPath
|
||||
from datetime import tzinfo
|
||||
from typing import Any, Iterable, Protocol, Sequence
|
||||
|
||||
_T = typing.TypeVar("_T", bound="ZoneInfo")
|
||||
_T = typing.TypeVar("_T", bound=ZoneInfo)
|
||||
|
||||
class _IOBytes(Protocol):
|
||||
def read(self, __size: int) -> bytes: ...
|
||||
|
||||
@@ -282,7 +282,7 @@ class UniformResourceIdentifier(GeneralName):
|
||||
class ExtensionType(metaclass=ABCMeta):
|
||||
oid: ObjectIdentifier
|
||||
|
||||
_T = TypeVar("_T", bound="ExtensionType")
|
||||
_T = TypeVar("_T", bound=ExtensionType)
|
||||
|
||||
class Extension(Generic[_T]):
|
||||
critical: bool
|
||||
|
||||
@@ -2,9 +2,9 @@ import textwrap
|
||||
from typing import IO, Any, Callable, Generic, Text, TypeVar, overload
|
||||
from typing_extensions import SupportsIndex
|
||||
|
||||
_TB = TypeVar("_TB", bound="_BaseEntry")
|
||||
_TP = TypeVar("_TP", bound="POFile")
|
||||
_TM = TypeVar("_TM", bound="MOFile")
|
||||
_TB = TypeVar("_TB", bound=_BaseEntry)
|
||||
_TP = TypeVar("_TP", bound=POFile)
|
||||
_TM = TypeVar("_TM", bound=MOFile)
|
||||
|
||||
default_encoding: str
|
||||
|
||||
|
||||
Reference in New Issue
Block a user