mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
remove _types (#4220)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from typing import Any, Union, IO
|
||||
import io
|
||||
from _types import FileDescriptorLike
|
||||
from typing import Any, Union
|
||||
from _typeshed import FileDescriptorLike
|
||||
|
||||
FASYNC: int
|
||||
FD_CLOEXEC: int
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# These types are for typeshed-only objects that don't exist at runtime
|
||||
|
||||
from typing import type_check_only, Protocol, Union
|
||||
|
||||
@type_check_only
|
||||
class HasFileno(Protocol):
|
||||
def fileno(self) -> int: ...
|
||||
|
||||
FileDescriptor = int
|
||||
FileDescriptorLike = Union[int, HasFileno]
|
||||
@@ -13,7 +13,7 @@
|
||||
# is not used, types from this module must be quoted.
|
||||
|
||||
import sys
|
||||
from typing import Text, Union
|
||||
from typing import Protocol, Text, Union, type_check_only
|
||||
from typing_extensions import Literal
|
||||
|
||||
# StrPath and AnyPath can be used in places where a
|
||||
@@ -51,3 +51,10 @@ OpenBinaryModeReading = Literal[
|
||||
'rbU', 'rUb', 'Urb', 'brU', 'bUr', 'Ubr',
|
||||
]
|
||||
OpenBinaryMode = Union[OpenBinaryModeUpdating, OpenBinaryModeReading, OpenBinaryModeWriting]
|
||||
|
||||
@type_check_only
|
||||
class HasFileno(Protocol):
|
||||
def fileno(self) -> int: ...
|
||||
|
||||
FileDescriptor = int
|
||||
FileDescriptorLike = Union[int, HasFileno]
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import Tuple, Union, Any, Dict, overload
|
||||
import sys
|
||||
from socket import SocketType
|
||||
from typing import Optional
|
||||
from _types import FileDescriptorLike
|
||||
from _typeshed import FileDescriptorLike
|
||||
|
||||
# cyclic dependence with asynchat
|
||||
_maptype = Dict[int, Any]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from typing import Any, Iterable, List, Optional, Tuple, Type
|
||||
from types import TracebackType
|
||||
from _types import FileDescriptorLike
|
||||
from _typeshed import FileDescriptorLike
|
||||
|
||||
|
||||
if sys.platform != "win32":
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# Stubs for termios
|
||||
|
||||
from typing import IO, List, Union
|
||||
from _types import FileDescriptorLike
|
||||
from typing import List, Union
|
||||
from _typeshed import FileDescriptorLike
|
||||
|
||||
_Attr = List[Union[int, List[bytes]]]
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from asyncio.events import AbstractEventLoop, AbstractServer, Handle, TimerHandl
|
||||
from asyncio.protocols import BaseProtocol
|
||||
from asyncio.tasks import Task
|
||||
from asyncio.transports import BaseTransport
|
||||
from _types import FileDescriptorLike
|
||||
from _typeshed import FileDescriptorLike
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
|
||||
@@ -11,7 +11,7 @@ from asyncio.unix_events import AbstractChildWatcher
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
|
||||
from _types import FileDescriptorLike
|
||||
from _typeshed import FileDescriptorLike
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_Context = Dict[str, Any]
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import io
|
||||
import sys
|
||||
from typing import Union, Protocol
|
||||
from _types import FileDescriptorLike
|
||||
from _typeshed import FileDescriptorLike
|
||||
|
||||
def cancel_dump_traceback_later() -> None: ...
|
||||
def disable() -> None: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from array import array
|
||||
from typing import Any, Union, overload
|
||||
from _types import FileDescriptorLike
|
||||
from typing_extensions import Literal
|
||||
from _typeshed import FileDescriptorLike
|
||||
|
||||
FASYNC: int
|
||||
FD_CLOEXEC: int
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
# Stubs for selector
|
||||
# See https://docs.python.org/3/library/selectors.html
|
||||
|
||||
import sys
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import Any, List, Mapping, NamedTuple, Optional, Tuple
|
||||
from _types import FileDescriptor, FileDescriptorLike
|
||||
from _typeshed import FileDescriptor, FileDescriptorLike
|
||||
|
||||
_EventMask = int
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ _dummy_threading
|
||||
_importlib_modulespec
|
||||
_operator.methodcaller
|
||||
_threading_local.local.__new__
|
||||
_types
|
||||
_typeshed.* # Utility types for typeshed, doesn't exist at runtime
|
||||
_weakref.CallableProxyType.__getattr__
|
||||
_weakref.ProxyType.__getattr__
|
||||
|
||||
Reference in New Issue
Block a user