Replace Any with Incomplete in many places (#9565)

This commit is contained in:
Avasam
2023-01-18 14:12:46 -05:00
committed by GitHub
parent a4e3cfefac
commit 6ac24ed923
16 changed files with 55 additions and 48 deletions

View File

@@ -31,10 +31,10 @@ class StubImageFile(ImageFile):
def load(self) -> None: ...
class Parser:
incremental: Any | None
image: Any | None
data: Any | None
decoder: Any | None
incremental: Incomplete | None
image: Incomplete | None
data: Incomplete | None
decoder: Incomplete | None
offset: int
finished: bool
def reset(self) -> None: ...

View File

@@ -72,7 +72,7 @@ def declarative_base(
def declarative_base(
bind: Connectable | None,
metadata: MetaData | None,
mapper: Any | None,
mapper: Incomplete | None,
cls: type[Any] | tuple[type[Any], ...],
name: str,
constructor: Callable[..., None],
@@ -109,7 +109,11 @@ class registry:
) -> _DeclT: ...
@overload
def generate_base(
self, mapper: Any | None, cls: type[Any] | tuple[type[Any], ...], name: str, metaclass: _DeclarativeBaseMeta[_DeclT]
self,
mapper: Incomplete | None,
cls: type[Any] | tuple[type[Any], ...],
name: str,
metaclass: _DeclarativeBaseMeta[_DeclT],
) -> type[_DeclarativeBase]: ...
def mapped(self, cls: _ClsT) -> _ClsT: ...
# Return type of the callable is a _DeclarativeBase class with the passed in class as base.

View File

@@ -191,7 +191,7 @@ class Values(Generative, FromClause):
name: Any
literal_binds: Any
def __init__(self, *columns, **kw) -> None: ...
def alias(self: Self, name: Any | None, **kw) -> Self: ... # type: ignore[override]
def alias(self: Self, name: Incomplete | None, **kw) -> Self: ... # type: ignore[override]
def lateral(self: Self, name: Incomplete | None = ...) -> Self: ...
def data(self: Self, values) -> Self: ...
@@ -261,10 +261,10 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase):
def get_label_style(self): ...
def set_label_style(self, style): ...
def apply_labels(self): ...
def limit(self: Self, limit: Any | None) -> Self: ...
def fetch(self: Self, count: Any | None, with_ties: bool = ..., percent: bool = ...) -> Self: ...
def offset(self: Self, offset: Any | None) -> Self: ...
def slice(self: Self, start: Any | None, stop: Any | None) -> Self: ...
def limit(self: Self, limit: Incomplete | None) -> Self: ...
def fetch(self: Self, count: Incomplete | None, with_ties: bool = ..., percent: bool = ...) -> Self: ...
def offset(self: Self, offset: Incomplete | None) -> Self: ...
def slice(self: Self, start: Incomplete | None, stop: Incomplete | None) -> Self: ...
def order_by(self: Self, *clauses) -> Self: ...
def group_by(self: Self, *clauses) -> Self: ...

View File

@@ -1,4 +1,4 @@
from typing import Any
from _typeshed import Incomplete
from ._compat_py3k import asynccontextmanager as asynccontextmanager
from ._concurrency_py3k import (
@@ -10,4 +10,4 @@ from ._concurrency_py3k import (
)
have_greenlet: bool
asyncio: Any | None
asyncio: Incomplete | None

View File

@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from collections.abc import Iterable, Iterator
from logging import Logger
from typing import Any
@@ -29,7 +30,7 @@ class EncodingDetector:
known_definite_encodings: list[str]
user_encodings: list[str]
exclude_encodings: set[str]
chardet_encoding: Any | None
chardet_encoding: Incomplete | None
is_html: bool
declared_encoding: str | None
markup: Any
@@ -61,7 +62,7 @@ class UnicodeDammit:
detector: EncodingDetector
markup: Any
unicode_markup: str
original_encoding: Any | None
original_encoding: Incomplete | None
def __init__(
self,
markup,

View File

@@ -1,4 +1,4 @@
from _typeshed import Self
from _typeshed import Incomplete, Self
from collections.abc import Iterable
from typing import Any, ClassVar
from typing_extensions import TypeAlias
@@ -9,8 +9,8 @@ class BaseElement:
tag: ClassVar[str | None]
children: list[BaseElement]
value: str | None
attributes: Any | None
caldav_class: Any | None
attributes: Incomplete | None
caldav_class: Incomplete | None
def __init__(self, name: str | None = ..., value: str | bytes | None = ...) -> None: ...
def __add__(self: Self, other: BaseElement) -> Self: ...
def xmlelement(self) -> _Element: ...

View File

@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from collections.abc import Callable, Mapping, Sequence
from typing import Any
@@ -8,7 +9,7 @@ class FunctionItem(ExternalItem):
function: Callable[..., Any]
args: Sequence[Any]
kwargs: Mapping[str, Any]
return_value: Any | None
return_value: Incomplete | None
def __init__(
self,
text: str,

View File

@@ -177,11 +177,11 @@ class _patch(Generic[_T]):
getter: Callable[[], Any],
attribute: str,
new: _T,
spec: Any | None,
spec: Incomplete | None,
create: bool,
spec_set: Any | None,
autospec: Any | None,
new_callable: Any | None,
spec_set: Incomplete | None,
autospec: Incomplete | None,
new_callable: Incomplete | None,
kwargs: Mapping[str, Any],
*,
unsafe: bool = ...,

View File

@@ -1,5 +1,5 @@
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing import ClassVar
import passlib.utils.handlers as uh
@@ -13,7 +13,7 @@ class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
max_rounds: ClassVar[int]
rounds_cost: ClassVar[str]
default_algs: ClassVar[list[str]]
algs: Any | None
algs: Incomplete | None
@classmethod
def extract_digest_info(cls, hash, alg): ...
@classmethod

View File

@@ -66,7 +66,7 @@ class HasEncodingContext(GenericHandler):
def __init__(self, encoding: str | None = ..., **kwds) -> None: ...
class HasUserContext(GenericHandler):
user: Any | None
user: Incomplete | None
def __init__(self, user: Incomplete | None = ..., **kwds) -> None: ...
@classmethod
def hash(cls, secret, user: Incomplete | None = ..., **context): ...

View File

@@ -1,4 +1,4 @@
from _typeshed import StrOrBytesPath
from _typeshed import Incomplete, StrOrBytesPath
from collections.abc import Callable, Iterable, Sequence
from datetime import datetime
from typing import Any
@@ -18,7 +18,7 @@ TYPE_RSA: int
TYPE_DSA: int
class _EllipticCurve:
def __init__(self, lib: Any | None, nid: int, name: str) -> None: ...
def __init__(self, lib: Incomplete | None, nid: int, name: str) -> None: ...
class Error(Exception): ...

View File

@@ -8,7 +8,7 @@ class JSON(JSONCommands):
MODULE_CALLBACKS: dict[str, Any]
client: Any
execute_command: Any
MODULE_VERSION: Any | None
MODULE_VERSION: Incomplete | None
def __init__(self, client, version: Incomplete | None = ..., decoder=..., encoder=...) -> None: ...
def pipeline(self, transaction: bool = ..., shard_hint: Incomplete | None = ...) -> Pipeline: ...

View File

@@ -1,17 +1,18 @@
from _typeshed import Incomplete
from typing import Any
class TSInfo:
rules: list[Any]
labels: list[Any]
sourceKey: Any | None
chunk_count: Any | None
memory_usage: Any | None
total_samples: Any | None
retention_msecs: Any | None
last_time_stamp: Any | None
first_time_stamp: Any | None
sourceKey: Incomplete | None
chunk_count: Incomplete | None
memory_usage: Incomplete | None
total_samples: Incomplete | None
retention_msecs: Incomplete | None
last_time_stamp: Incomplete | None
first_time_stamp: Incomplete | None
max_samples_per_chunk: Any | None
chunk_size: Any | None
duplicate_policy: Any | None
max_samples_per_chunk: Incomplete | None
chunk_size: Incomplete | None
duplicate_policy: Incomplete | None
def __init__(self, args) -> None: ...

View File

@@ -145,13 +145,13 @@ class SSLConnection(Connection):
certfile: Any
cert_reqs: Any
ca_certs: Any
ca_path: Any | None
ca_path: Incomplete | None
check_hostname: bool
certificate_password: Any | None
certificate_password: Incomplete | None
ssl_validate_ocsp: bool
ssl_validate_ocsp_stapled: bool # added in 4.1.1
ssl_ocsp_context: Any | None # added in 4.1.1
ssl_ocsp_expected_cert: Any | None # added in 4.1.1
ssl_ocsp_context: Incomplete | None # added in 4.1.1
ssl_ocsp_expected_cert: Incomplete | None # added in 4.1.1
def __init__(
self,
ssl_keyfile=...,

View File

@@ -1,7 +1,7 @@
import importlib.abc
import types
import zipimport
from _typeshed import Self
from _typeshed import Incomplete, Self
from abc import ABCMeta
from collections.abc import Callable, Generator, Iterable, Sequence
from typing import IO, Any, TypeVar, overload
@@ -79,7 +79,7 @@ class Requirement:
specs: list[tuple[str, str]]
# TODO: change this to packaging.markers.Marker | None once we can import
# packaging.markers
marker: Any | None
marker: Incomplete | None
@staticmethod
def parse(s: str | Iterable[str]) -> Requirement: ...
def __contains__(self, item: Distribution | str | tuple[str, ...]) -> bool: ...

View File

@@ -15,9 +15,9 @@ _V = TypeVar("_V", bound=VBase)
_W = TypeVar("_W", bound=SupportsWrite[bytes])
class VBase:
group: Any | None
behavior: Any | None
parentBehavior: Any | None
group: Incomplete | None
behavior: Incomplete | None
parentBehavior: Incomplete | None
isNative: bool
def __init__(self, group: Incomplete | None = ...) -> None: ...
def copy(self, copyit: VBase) -> None: ...