mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Preparations for the Big Reformat (#4228)
A few comments between imports were removed or moved to the top of the import block, due to behavioral differences between black and isort. See psf/black#251 for details. In two instances @overloads at the top of the file needed to be moved due to psf/black#1490.
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
# Stubs for contextlib
|
||||
|
||||
# ContextManager aliased here for backwards compatibility; TODO eventually remove this
|
||||
from typing import (
|
||||
Any, Callable, Generator, IO, Iterable, Iterator, Optional, Type,
|
||||
Generic, TypeVar, overload
|
||||
)
|
||||
from types import TracebackType
|
||||
import sys
|
||||
# Aliased here for backwards compatibility; TODO eventually remove this
|
||||
from typing import ContextManager as ContextManager
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# 'bytes' paths are not properly supported: they don't work with all functions,
|
||||
# sometimes they only work partially (broken exception messages), and the test
|
||||
# cases don't use them.
|
||||
|
||||
from typing import (
|
||||
List, Iterable, Callable, Any, Tuple, Sequence, NamedTuple,
|
||||
AnyStr, Optional, Union, Set, TypeVar, overload, Type, Protocol, Text
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
# Stubs for sysconfig
|
||||
|
||||
from typing import overload, Any, Dict, IO, List, Optional, Tuple, Union
|
||||
|
||||
def get_config_var(name: str) -> Optional[str]: ...
|
||||
@overload
|
||||
def get_config_vars() -> Dict[str, Any]: ...
|
||||
@overload
|
||||
def get_config_vars(arg: str, *args: str) -> List[Any]: ...
|
||||
def get_config_var(name: str) -> Optional[str]: ...
|
||||
def get_scheme_names() -> Tuple[str, ...]: ...
|
||||
def get_path_names() -> Tuple[str, ...]: ...
|
||||
def get_path(name: str, scheme: str = ..., vars: Optional[Dict[str, Any]] = ..., expand: bool = ...) -> Optional[str]: ...
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import sys
|
||||
# Rename typing to _typing, as not to conflict with typing imported
|
||||
# from _ast below when loaded in an unorthodox way by the Dropbox
|
||||
# internal Bazel integration.
|
||||
import typing as _typing
|
||||
from typing import Any, Iterator, Optional, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
# The same unorthodox Bazel integration causes issues with sys, which
|
||||
# is imported in both modules. unfortunately we can't just rename sys,
|
||||
# since mypy only supports version checks with a sys that is named
|
||||
# sys.
|
||||
import sys
|
||||
import typing as _typing
|
||||
from typing import Any, Iterator, Optional, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from _ast import * # type: ignore
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
|
||||
@@ -8,11 +8,11 @@ from asyncio.protocols import BaseProtocol
|
||||
from asyncio.tasks import Task
|
||||
from asyncio.transports import BaseTransport
|
||||
from asyncio.unix_events import AbstractChildWatcher
|
||||
from _typeshed import FileDescriptorLike
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
|
||||
from _typeshed import FileDescriptorLike
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_Context = Dict[str, Any]
|
||||
_ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any]
|
||||
|
||||
@@ -7,7 +7,6 @@ from typing import (
|
||||
)
|
||||
from _typeshed import AnyPath
|
||||
|
||||
# Re-exported names from other modules.
|
||||
from builtins import OSError as error
|
||||
from . import path as path
|
||||
|
||||
|
||||
3
third_party/2/six/__init__.pyi
vendored
3
third_party/2/six/__init__.pyi
vendored
@@ -1,5 +1,3 @@
|
||||
# Stubs for six (Python 2.7)
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import types
|
||||
@@ -10,7 +8,6 @@ from typing import (
|
||||
import typing
|
||||
import unittest
|
||||
|
||||
# Exports
|
||||
from __builtin__ import unichr as unichr
|
||||
from StringIO import StringIO as StringIO, StringIO as BytesIO
|
||||
from functools import wraps as wraps
|
||||
|
||||
3
third_party/2and3/bleach/__init__.pyi
vendored
3
third_party/2and3/bleach/__init__.pyi
vendored
@@ -1,6 +1,6 @@
|
||||
from typing import Any, Container, Iterable, Optional, Text
|
||||
|
||||
from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker
|
||||
from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker, _Callback
|
||||
from bleach.sanitizer import (
|
||||
ALLOWED_ATTRIBUTES as ALLOWED_ATTRIBUTES,
|
||||
ALLOWED_PROTOCOLS as ALLOWED_PROTOCOLS,
|
||||
@@ -9,7 +9,6 @@ from bleach.sanitizer import (
|
||||
Cleaner as Cleaner,
|
||||
)
|
||||
|
||||
from .linkifier import _Callback
|
||||
|
||||
__releasedate__: Text
|
||||
__version__: Text
|
||||
|
||||
2
third_party/2and3/bleach/utils.pyi
vendored
2
third_party/2and3/bleach/utils.pyi
vendored
@@ -1,8 +1,8 @@
|
||||
from collections import OrderedDict
|
||||
from typing import overload, Mapping, Any, Text
|
||||
|
||||
def force_unicode(text: Text) -> Text: ...
|
||||
@overload
|
||||
def alphabetize_attributes(attrs: None) -> None: ...
|
||||
@overload
|
||||
def alphabetize_attributes(attrs: Mapping[Any, Text]) -> OrderedDict[Any, Text]: ...
|
||||
def force_unicode(text: Text) -> Text: ...
|
||||
|
||||
5
third_party/2and3/boto/compat.pyi
vendored
5
third_party/2and3/boto/compat.pyi
vendored
@@ -1,13 +1,14 @@
|
||||
import sys
|
||||
|
||||
from typing import Any
|
||||
|
||||
from six.moves import http_client
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
from base64 import encodebytes as encodebytes
|
||||
else:
|
||||
from base64 import encodestring as encodebytes
|
||||
|
||||
from six.moves import http_client
|
||||
|
||||
expanduser: Any
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
|
||||
17
third_party/2and3/click/__init__.pyi
vendored
17
third_party/2and3/click/__init__.pyi
vendored
@@ -14,7 +14,6 @@
|
||||
:license: BSD, see LICENSE for more details.
|
||||
"""
|
||||
|
||||
# Core classes
|
||||
from .core import (
|
||||
Context as Context,
|
||||
BaseCommand as BaseCommand,
|
||||
@@ -26,11 +25,7 @@ from .core import (
|
||||
Option as Option,
|
||||
Argument as Argument,
|
||||
)
|
||||
|
||||
# Globals
|
||||
from .globals import get_current_context as get_current_context
|
||||
|
||||
# Decorators
|
||||
from .decorators import (
|
||||
pass_context as pass_context,
|
||||
pass_obj as pass_obj,
|
||||
@@ -44,8 +39,6 @@ from .decorators import (
|
||||
version_option as version_option,
|
||||
help_option as help_option,
|
||||
)
|
||||
|
||||
# Types
|
||||
from .types import (
|
||||
ParamType as ParamType,
|
||||
File as File,
|
||||
@@ -62,8 +55,6 @@ from .types import (
|
||||
UUID as UUID,
|
||||
UNPROCESSED as UNPROCESSED,
|
||||
)
|
||||
|
||||
# Utilities
|
||||
from .utils import (
|
||||
echo as echo,
|
||||
get_binary_stream as get_binary_stream,
|
||||
@@ -73,8 +64,6 @@ from .utils import (
|
||||
get_app_dir as get_app_dir,
|
||||
get_os_args as get_os_args,
|
||||
)
|
||||
|
||||
# Terminal functions
|
||||
from .termui import (
|
||||
prompt as prompt,
|
||||
confirm as confirm,
|
||||
@@ -90,8 +79,6 @@ from .termui import (
|
||||
getchar as getchar,
|
||||
pause as pause,
|
||||
)
|
||||
|
||||
# Exceptions
|
||||
from .exceptions import (
|
||||
ClickException as ClickException,
|
||||
UsageError as UsageError,
|
||||
@@ -103,11 +90,7 @@ from .exceptions import (
|
||||
BadArgumentUsage as BadArgumentUsage,
|
||||
MissingParameter as MissingParameter,
|
||||
)
|
||||
|
||||
# Formatting
|
||||
from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text
|
||||
|
||||
# Parsing
|
||||
from .parser import OptionParser as OptionParser
|
||||
|
||||
# Controls if click should emit the warning about the use of unicode
|
||||
|
||||
3
third_party/3/six/__init__.pyi
vendored
3
third_party/3/six/__init__.pyi
vendored
@@ -1,5 +1,3 @@
|
||||
# Stubs for six (Python 3.5)
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from typing import (
|
||||
@@ -26,7 +24,6 @@ import types
|
||||
import typing
|
||||
import unittest
|
||||
|
||||
# Exports
|
||||
from io import StringIO as StringIO, BytesIO as BytesIO
|
||||
from builtins import next as next
|
||||
from functools import wraps as wraps
|
||||
|
||||
Reference in New Issue
Block a user