Skip to content

Commit 6ac24ed

Browse files
authored
Replace Any with Incomplete in many places (#9565)
1 parent a4e3cfe commit 6ac24ed

File tree

16 files changed

+55
-48
lines changed

16 files changed

+55
-48
lines changed

stubs/Pillow/PIL/ImageFile.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class StubImageFile(ImageFile):
3131
def load(self) -> None: ...
3232

3333
class Parser:
34-
incremental: Any | None
35-
image: Any | None
36-
data: Any | None
37-
decoder: Any | None
34+
incremental: Incomplete | None
35+
image: Incomplete | None
36+
data: Incomplete | None
37+
decoder: Incomplete | None
3838
offset: int
3939
finished: bool
4040
def reset(self) -> None: ...

stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def declarative_base(
7272
def declarative_base(
7373
bind: Connectable | None,
7474
metadata: MetaData | None,
75-
mapper: Any | None,
75+
mapper: Incomplete | None,
7676
cls: type[Any] | tuple[type[Any], ...],
7777
name: str,
7878
constructor: Callable[..., None],
@@ -109,7 +109,11 @@ class registry:
109109
) -> _DeclT: ...
110110
@overload
111111
def generate_base(
112-
self, mapper: Any | None, cls: type[Any] | tuple[type[Any], ...], name: str, metaclass: _DeclarativeBaseMeta[_DeclT]
112+
self,
113+
mapper: Incomplete | None,
114+
cls: type[Any] | tuple[type[Any], ...],
115+
name: str,
116+
metaclass: _DeclarativeBaseMeta[_DeclT],
113117
) -> type[_DeclarativeBase]: ...
114118
def mapped(self, cls: _ClsT) -> _ClsT: ...
115119
# Return type of the callable is a _DeclarativeBase class with the passed in class as base.

stubs/SQLAlchemy/sqlalchemy/sql/selectable.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class Values(Generative, FromClause):
191191
name: Any
192192
literal_binds: Any
193193
def __init__(self, *columns, **kw) -> None: ...
194-
def alias(self: Self, name: Any | None, **kw) -> Self: ... # type: ignore[override]
194+
def alias(self: Self, name: Incomplete | None, **kw) -> Self: ... # type: ignore[override]
195195
def lateral(self: Self, name: Incomplete | None = ...) -> Self: ...
196196
def data(self: Self, values) -> Self: ...
197197

@@ -261,10 +261,10 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase):
261261
def get_label_style(self): ...
262262
def set_label_style(self, style): ...
263263
def apply_labels(self): ...
264-
def limit(self: Self, limit: Any | None) -> Self: ...
265-
def fetch(self: Self, count: Any | None, with_ties: bool = ..., percent: bool = ...) -> Self: ...
266-
def offset(self: Self, offset: Any | None) -> Self: ...
267-
def slice(self: Self, start: Any | None, stop: Any | None) -> Self: ...
264+
def limit(self: Self, limit: Incomplete | None) -> Self: ...
265+
def fetch(self: Self, count: Incomplete | None, with_ties: bool = ..., percent: bool = ...) -> Self: ...
266+
def offset(self: Self, offset: Incomplete | None) -> Self: ...
267+
def slice(self: Self, start: Incomplete | None, stop: Incomplete | None) -> Self: ...
268268
def order_by(self: Self, *clauses) -> Self: ...
269269
def group_by(self: Self, *clauses) -> Self: ...
270270

stubs/SQLAlchemy/sqlalchemy/util/concurrency.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any
1+
from _typeshed import Incomplete
22

33
from ._compat_py3k import asynccontextmanager as asynccontextmanager
44
from ._concurrency_py3k import (
@@ -10,4 +10,4 @@ from ._concurrency_py3k import (
1010
)
1111

1212
have_greenlet: bool
13-
asyncio: Any | None
13+
asyncio: Incomplete | None

stubs/beautifulsoup4/bs4/dammit.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from _typeshed import Incomplete
12
from collections.abc import Iterable, Iterator
23
from logging import Logger
34
from typing import Any
@@ -29,7 +30,7 @@ class EncodingDetector:
2930
known_definite_encodings: list[str]
3031
user_encodings: list[str]
3132
exclude_encodings: set[str]
32-
chardet_encoding: Any | None
33+
chardet_encoding: Incomplete | None
3334
is_html: bool
3435
declared_encoding: str | None
3536
markup: Any
@@ -61,7 +62,7 @@ class UnicodeDammit:
6162
detector: EncodingDetector
6263
markup: Any
6364
unicode_markup: str
64-
original_encoding: Any | None
65+
original_encoding: Incomplete | None
6566
def __init__(
6667
self,
6768
markup,

stubs/caldav/caldav/elements/base.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from _typeshed import Self
1+
from _typeshed import Incomplete, Self
22
from collections.abc import Iterable
33
from typing import Any, ClassVar
44
from typing_extensions import TypeAlias
@@ -9,8 +9,8 @@ class BaseElement:
99
tag: ClassVar[str | None]
1010
children: list[BaseElement]
1111
value: str | None
12-
attributes: Any | None
13-
caldav_class: Any | None
12+
attributes: Incomplete | None
13+
caldav_class: Incomplete | None
1414
def __init__(self, name: str | None = ..., value: str | bytes | None = ...) -> None: ...
1515
def __add__(self: Self, other: BaseElement) -> Self: ...
1616
def xmlelement(self) -> _Element: ...

stubs/console-menu/consolemenu/items/function_item.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from _typeshed import Incomplete
12
from collections.abc import Callable, Mapping, Sequence
23
from typing import Any
34

@@ -8,7 +9,7 @@ class FunctionItem(ExternalItem):
89
function: Callable[..., Any]
910
args: Sequence[Any]
1011
kwargs: Mapping[str, Any]
11-
return_value: Any | None
12+
return_value: Incomplete | None
1213
def __init__(
1314
self,
1415
text: str,

stubs/mock/mock/mock.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ class _patch(Generic[_T]):
177177
getter: Callable[[], Any],
178178
attribute: str,
179179
new: _T,
180-
spec: Any | None,
180+
spec: Incomplete | None,
181181
create: bool,
182-
spec_set: Any | None,
183-
autospec: Any | None,
184-
new_callable: Any | None,
182+
spec_set: Incomplete | None,
183+
autospec: Incomplete | None,
184+
new_callable: Incomplete | None,
185185
kwargs: Mapping[str, Any],
186186
*,
187187
unsafe: bool = ...,

stubs/passlib/passlib/handlers/scram.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from _typeshed import Incomplete
2-
from typing import Any, ClassVar
2+
from typing import ClassVar
33

44
import passlib.utils.handlers as uh
55

@@ -13,7 +13,7 @@ class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler):
1313
max_rounds: ClassVar[int]
1414
rounds_cost: ClassVar[str]
1515
default_algs: ClassVar[list[str]]
16-
algs: Any | None
16+
algs: Incomplete | None
1717
@classmethod
1818
def extract_digest_info(cls, hash, alg): ...
1919
@classmethod

stubs/passlib/passlib/utils/handlers.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class HasEncodingContext(GenericHandler):
6666
def __init__(self, encoding: str | None = ..., **kwds) -> None: ...
6767

6868
class HasUserContext(GenericHandler):
69-
user: Any | None
69+
user: Incomplete | None
7070
def __init__(self, user: Incomplete | None = ..., **kwds) -> None: ...
7171
@classmethod
7272
def hash(cls, secret, user: Incomplete | None = ..., **context): ...

0 commit comments

Comments
 (0)