mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Use lowercase type everywhere (#6853)
This commit is contained in:
@@ -23,7 +23,7 @@ from types import (
|
||||
if sys.version_info >= (3, 7):
|
||||
from types import ClassMethodDescriptorType, WrapperDescriptorType, MemberDescriptorType, MethodDescriptorType
|
||||
|
||||
from typing import Any, ClassVar, Coroutine, NamedTuple, Protocol, Type, TypeVar, Union
|
||||
from typing import Any, ClassVar, Coroutine, NamedTuple, Protocol, TypeVar, Union
|
||||
from typing_extensions import Literal, TypeGuard
|
||||
|
||||
#
|
||||
@@ -58,7 +58,7 @@ modulesbyfile: dict[str, Any]
|
||||
def getmembers(object: object, predicate: Callable[[Any], bool] | None = ...) -> list[tuple[str, Any]]: ...
|
||||
def getmodulename(path: str) -> str | None: ...
|
||||
def ismodule(object: object) -> TypeGuard[ModuleType]: ...
|
||||
def isclass(object: object) -> TypeGuard[Type[Any]]: ...
|
||||
def isclass(object: object) -> TypeGuard[type[Any]]: ...
|
||||
def ismethod(object: object) -> TypeGuard[MethodType]: ...
|
||||
def isfunction(object: object) -> TypeGuard[FunctionType]: ...
|
||||
|
||||
@@ -125,7 +125,7 @@ def isdatadescriptor(object: object) -> TypeGuard[_SupportsSet[Any, Any] | _Supp
|
||||
#
|
||||
# Retrieving source code
|
||||
#
|
||||
_SourceObjectType = Union[ModuleType, Type[Any], MethodType, FunctionType, TracebackType, FrameType, CodeType, Callable[..., Any]]
|
||||
_SourceObjectType = Union[ModuleType, type[Any], MethodType, FunctionType, TracebackType, FrameType, CodeType, Callable[..., Any]]
|
||||
|
||||
def findsource(object: _SourceObjectType) -> tuple[list[str], int]: ...
|
||||
def getabsfile(object: _SourceObjectType, _filename: str | None = ...) -> str: ...
|
||||
@@ -172,7 +172,7 @@ class Signature:
|
||||
def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ...
|
||||
def bind_partial(self, *args: Any, **kwargs: Any) -> BoundArguments: ...
|
||||
def replace(
|
||||
self: Self, *, parameters: Sequence[Parameter] | Type[_void] | None = ..., return_annotation: Any = ...
|
||||
self: Self, *, parameters: Sequence[Parameter] | type[_void] | None = ..., return_annotation: Any = ...
|
||||
) -> Self: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@classmethod
|
||||
@@ -191,7 +191,7 @@ class Signature:
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def get_annotations(
|
||||
obj: Callable[..., Any] | Type[Any] | ModuleType,
|
||||
obj: Callable[..., Any] | type[Any] | ModuleType,
|
||||
*,
|
||||
globals: Mapping[str, Any] | None = ...,
|
||||
locals: Mapping[str, Any] | None = ...,
|
||||
@@ -230,8 +230,8 @@ class Parameter:
|
||||
def replace(
|
||||
self: Self,
|
||||
*,
|
||||
name: str | Type[_void] = ...,
|
||||
kind: _ParameterKind | Type[_void] = ...,
|
||||
name: str | type[_void] = ...,
|
||||
kind: _ParameterKind | type[_void] = ...,
|
||||
default: Any = ...,
|
||||
annotation: Any = ...,
|
||||
) -> Self: ...
|
||||
@@ -252,7 +252,7 @@ class BoundArguments:
|
||||
# seem to be supporting this at the moment:
|
||||
# _ClassTreeItem = list[_ClassTreeItem] | Tuple[type, Tuple[type, ...]]
|
||||
def getclasstree(classes: list[type], unique: bool = ...) -> list[Any]: ...
|
||||
def walktree(classes: list[type], children: dict[Type[Any], list[type]], parent: Type[Any] | None) -> list[Any]: ...
|
||||
def walktree(classes: list[type], children: dict[type[Any], list[type]], parent: type[Any] | None) -> list[Any]: ...
|
||||
|
||||
class Arguments(NamedTuple):
|
||||
args: list[str]
|
||||
|
||||
Reference in New Issue
Block a user