Removed imported symbols that are not accessed or re-exported from within third_party stubs (part 2). (#4389)

These were all identified as unused symbols by the pyright type checker and language server.

Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
Eric Traut
2020-08-05 18:50:31 -07:00
committed by GitHub
parent 94a7a62c65
commit b3929cbcc9
28 changed files with 20 additions and 59 deletions

View File

@@ -22,24 +22,11 @@ from typing import (
)
from .blueprints import Blueprint
from .config import Config, ConfigAttribute
from .ctx import AppContext, RequestContext, _AppCtxGlobals
from .helpers import (
_PackageBoundObject,
find_package,
get_debug_flag,
get_env,
get_flashed_messages,
get_load_dotenv,
locked_cached_property,
url_for,
)
from .logging import create_logger
from .sessions import SecureCookieSessionInterface
from .signals import appcontext_tearing_down, got_request_exception, request_finished, request_started, request_tearing_down
from .templating import DispatchingJinjaLoader, Environment
from .config import Config
from .ctx import AppContext, RequestContext
from .helpers import _PackageBoundObject
from .testing import FlaskClient
from .wrappers import Request, Response
from .wrappers import Response
def setupmethod(f: Any): ...

View File

@@ -6,9 +6,6 @@ from typing import Any, Optional
import click
from .globals import current_app
from .helpers import get_debug_flag, get_env, get_load_dotenv
class NoAppException(click.UsageError): ...
def find_best_app(script_info: Any, module: Any): ...

View File

@@ -4,9 +4,6 @@
from typing import Any, Optional
from .globals import _app_ctx_stack, _request_ctx_stack
from .signals import appcontext_popped, appcontext_pushed
class _AppCtxGlobals:
def get(self, name: Any, default: Optional[Any] = ...): ...
def pop(self, name: Any, default: Any = ...): ...

View File

@@ -4,10 +4,6 @@
from typing import Any
from .app import Flask
from .blueprints import Blueprint
from .globals import _request_ctx_stack
class UnexpectedUnicodeError(AssertionError, UnicodeError): ...
class DebugFilesKeyError(KeyError, AssertionError):

View File

@@ -5,8 +5,6 @@
from typing import Any, Optional
from .cli import AppGroup
from .globals import _app_ctx_stack, _request_ctx_stack, current_app, request, session
from .signals import message_flashed
from .wrappers import Response
def get_env(): ...

View File

@@ -4,8 +4,6 @@
from typing import Any
from .globals import request
def wsgi_errors_stream(): ...
def has_level_handler(logger: Any): ...

View File

@@ -6,9 +6,6 @@ from typing import Any, Iterable, Text, Union
from jinja2 import BaseLoader, Environment as BaseEnvironment
from .globals import _app_ctx_stack, _request_ctx_stack
from .signals import before_render_template, template_rendered
class Environment(BaseEnvironment):
app: Any = ...
def __init__(self, app: Any, **options: Any) -> None: ...

View File

@@ -4,8 +4,6 @@
from typing import Any
from .globals import request
http_method_funcs: Any
class View:

View File

@@ -1,4 +1,4 @@
from typing import Iterable, List, Optional, Text, Tuple, cast
from typing import Iterable, List, Optional, Text, Tuple
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message

View File

@@ -1,7 +1,6 @@
from typing import (
Any,
Callable,
Generic,
Iterable,
Iterator,
List,
@@ -17,7 +16,6 @@ from typing import (
from google.protobuf.descriptor import Descriptor
from google.protobuf.internal.message_listener import MessageListener
from google.protobuf.internal.python_message import GeneratedProtocolMessageType
from google.protobuf.message import Message
_T = TypeVar("_T")
_K = TypeVar("_K")

View File

@@ -1,4 +1,4 @@
from typing import Any, Generic, List, Tuple, TypeVar
from typing import Generic, List, Tuple, TypeVar
from google.protobuf.descriptor import EnumDescriptor

View File

@@ -1,4 +1,3 @@
import sys
from typing import Any, Dict, Text, TypeVar, Union
from google.protobuf.message import Message

View File

@@ -1,4 +1,4 @@
from typing import List, Mapping, MutableMapping, Optional, Text, Tuple, cast
from typing import List, Mapping, MutableMapping, Optional, Text, Tuple
from google.protobuf.message import Message
from google.protobuf.unittest_import_pb2 import ImportEnumForMap

View File

@@ -1,4 +1,4 @@
from typing import List, Mapping, MutableMapping, Optional, Text, Tuple, cast
from typing import List, Mapping, MutableMapping, Optional, Text, Tuple
from google.protobuf.message import Message
from google.protobuf.unittest_no_arena_pb2 import ForeignMessage

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, ByteString, Optional, Sequence, Tuple, Type, TypeVar, Union
from typing import Any, ByteString, Sequence, Tuple, Type, TypeVar, Union
from .descriptor import Descriptor, DescriptorBase, FieldDescriptor

View File

@@ -1,4 +1,4 @@
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple
from google.protobuf.internal import well_known_types
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer

View File

@@ -1,5 +1,4 @@
import builtins
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message

View File

@@ -1,4 +1,4 @@
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple
from google.protobuf.any_pb2 import Any
from google.protobuf.duration_pb2 import Duration

View File

@@ -1,4 +1,4 @@
from typing import Iterable, List, Optional, Text, Tuple, cast
from typing import Iterable, List, Optional, Text, Tuple
from google.protobuf.any_pb2 import Any
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer

View File

@@ -1,4 +1,4 @@
from typing import Iterable, List, Optional, Text, Tuple, cast
from typing import Iterable, List, Optional, Text, Tuple
from google.protobuf.descriptor_pb2 import FileOptions
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer

View File

@@ -1,4 +1,4 @@
from typing import List, Optional, Tuple, cast
from typing import List, Optional, Tuple
from google.protobuf.message import Message

View File

@@ -1,4 +1,3 @@
import builtins
from typing import Iterable, Optional, Text
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer

View File

@@ -1,4 +1,4 @@
from typing import Iterable, List, Optional, Text, Tuple, cast
from typing import Iterable, List, Optional, Text, Tuple
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message

View File

@@ -1,4 +1,4 @@
from typing import List, Optional, Tuple, cast
from typing import List, Optional, Tuple
from google.protobuf.message import Message

View File

@@ -1,4 +1,4 @@
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message

View File

@@ -1,4 +1,4 @@
from typing import Iterable, List, Optional, Text, Tuple, cast
from typing import Iterable, List, Optional, Text, Tuple
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message

View File

@@ -1,4 +1,4 @@
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple
from google.protobuf.any_pb2 import Any
from google.protobuf.duration_pb2 import Duration

View File

@@ -2,10 +2,8 @@ import sys
from typing import Any, Optional
if sys.version_info[0] >= 3:
from io import BytesIO
from urllib.parse import quote_from_bytes as url_quote
else:
from cStringIO import StringIO as BytesIO
from urllib import quote as url_quote
PY2: Any