Skip to content

stubs/ directory: replace Any | None = ... with Incomplete | None = ... #9558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion stubs/Flask-Cors/flask_cors/extension.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from collections.abc import Callable, Iterable
from datetime import timedelta
from logging import Logger
Expand All @@ -10,7 +11,7 @@ LOG: Logger
class CORS:
def __init__(
self,
app: Any | None = ...,
app: Incomplete | None = ...,
*,
resources: dict[str, dict[str, Any]] | list[str] | str | None = ...,
origins: str | list[str] | None = ...,
Expand Down
30 changes: 15 additions & 15 deletions stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ before_models_committed: Any
class SignallingSession(Session):
app: Any
def __init__(self, db, autocommit: bool = ..., autoflush: bool = ..., **options) -> None: ...
def get_bind(self, mapper: Any | None = ..., clause: Any | None = ...): ... # type: ignore[override]
def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ...): ... # type: ignore[override]

def get_debug_queries(): ...

Expand Down Expand Up @@ -65,33 +65,33 @@ class SQLAlchemy:
app: Any
def __init__(
self,
app: Any | None = ...,
app: Incomplete | None = ...,
use_native_unicode: bool = ...,
session_options: Any | None = ...,
metadata: Any | None = ...,
session_options: Incomplete | None = ...,
metadata: Incomplete | None = ...,
query_class=...,
model_class=...,
engine_options: Any | None = ...,
engine_options: Incomplete | None = ...,
) -> None: ...
@property
def metadata(self): ...
def create_scoped_session(self, options: Any | None = ...): ...
def create_scoped_session(self, options: Incomplete | None = ...): ...
def create_session(self, options): ...
def make_declarative_base(self, model, metadata: Any | None = ...): ...
def make_declarative_base(self, model, metadata: Incomplete | None = ...): ...
def init_app(self, app): ...
def apply_pool_defaults(self, app, options): ...
def apply_driver_hacks(self, app, sa_url, options): ...
@property
def engine(self): ...
def make_connector(self, app: Any | None = ..., bind: Any | None = ...): ...
def get_engine(self, app: Any | None = ..., bind: Any | None = ...): ...
def make_connector(self, app: Incomplete | None = ..., bind: Incomplete | None = ...): ...
def get_engine(self, app: Incomplete | None = ..., bind: Incomplete | None = ...): ...
def create_engine(self, sa_url, engine_opts): ...
def get_app(self, reference_app: Any | None = ...): ...
def get_tables_for_bind(self, bind: Any | None = ...): ...
def get_binds(self, app: Any | None = ...): ...
def create_all(self, bind: str = ..., app: Any | None = ...) -> None: ...
def drop_all(self, bind: str = ..., app: Any | None = ...) -> None: ...
def reflect(self, bind: str = ..., app: Any | None = ...) -> None: ...
def get_app(self, reference_app: Incomplete | None = ...): ...
def get_tables_for_bind(self, bind: Incomplete | None = ...): ...
def get_binds(self, app: Incomplete | None = ...): ...
def create_all(self, bind: str = ..., app: Incomplete | None = ...) -> None: ...
def drop_all(self, bind: str = ..., app: Incomplete | None = ...) -> None: ...
def reflect(self, bind: str = ..., app: Incomplete | None = ...) -> None: ...
def __getattr__(self, name: str) -> Any: ... # exposes dynamically classes of SQLAlchemy

class FSADeprecationWarning(DeprecationWarning): ...
9 changes: 5 additions & 4 deletions stubs/Markdown/markdown/extensions/codehilite.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any

from markdown.extensions import Extension
Expand All @@ -21,16 +22,16 @@ class CodeHilite:
options: dict[str, Any]
def __init__(
self,
src: Any | None = ...,
src: Incomplete | None = ...,
*,
linenums: Any | None = ...,
linenums: Incomplete | None = ...,
guess_lang: bool = ...,
css_class: str = ...,
lang: Any | None = ...,
lang: Incomplete | None = ...,
style: str = ...,
noclasses: bool = ...,
tab_length: int = ...,
hl_lines: Any | None = ...,
hl_lines: Incomplete | None = ...,
use_pygments: bool = ...,
**options: Any,
) -> None: ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/Markdown/markdown/treeprocessors.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any

from . import util
Expand All @@ -14,6 +15,6 @@ class InlineProcessor(Treeprocessor):
def __init__(self, md) -> None: ...
stashed_nodes: Any
parent_map: Any
def run(self, tree, ancestors: Any | None = ...): ...
def run(self, tree, ancestors: Incomplete | None = ...): ...

class PrettifyTreeprocessor(Treeprocessor): ...
3 changes: 2 additions & 1 deletion stubs/Pillow/PIL/GifImagePlugin.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing_extensions import Literal

Expand All @@ -19,5 +20,5 @@ class GifImageFile(ImageFile):
RAWMODE: Any

def get_interlace(im): ...
def getheader(im, palette: Any | None = ..., info: Any | None = ...): ...
def getheader(im, palette: Incomplete | None = ..., info: Incomplete | None = ...): ...
def getdata(im, offset=..., **params): ...
3 changes: 2 additions & 1 deletion stubs/Pillow/PIL/IcnsImagePlugin.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing_extensions import Literal

Expand All @@ -20,7 +21,7 @@ class IcnsFile:
def itersizes(self): ...
def bestsize(self): ...
def dataforsize(self, size): ...
def getimage(self, size: Any | None = ...): ...
def getimage(self, size: Incomplete | None = ...): ...

class IcnsImageFile(ImageFile):
format: ClassVar[Literal["ICNS"]]
Expand Down
23 changes: 19 additions & 4 deletions stubs/Pillow/PIL/ImageCms.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any

from .Image import ImagePointHandler
Expand All @@ -24,18 +25,32 @@ class ImageCmsTransform(ImagePointHandler):
output_mode: Any
output_profile: Any
def __init__(
self, input, output, input_mode, output_mode, intent=..., proof: Any | None = ..., proof_intent=..., flags: int = ...
self,
input,
output,
input_mode,
output_mode,
intent=...,
proof: Incomplete | None = ...,
proof_intent=...,
flags: int = ...,
) -> None: ...
def point(self, im): ...
def apply(self, im, imOut: Any | None = ...): ...
def apply(self, im, imOut: Incomplete | None = ...): ...
def apply_in_place(self, im): ...

def get_display_profile(handle: Any | None = ...): ...
def get_display_profile(handle: Incomplete | None = ...): ...

class PyCMSError(Exception): ...

def profileToProfile(
im, inputProfile, outputProfile, renderingIntent=..., outputMode: Any | None = ..., inPlace: bool = ..., flags: int = ...
im,
inputProfile,
outputProfile,
renderingIntent=...,
outputMode: Incomplete | None = ...,
inPlace: bool = ...,
flags: int = ...,
): ...
def getOpenProfile(profileFilename): ...
def buildTransform(inputProfile, outputProfile, inMode, outMode, renderingIntent=..., flags: int = ...): ...
Expand Down
7 changes: 4 additions & 3 deletions stubs/Pillow/PIL/ImageDraw.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from collections.abc import Container, Sequence
from typing import Any, overload
from typing_extensions import Literal, TypeAlias
Expand Down Expand Up @@ -82,7 +83,7 @@ class ImageDraw:
spacing: float = ...,
align: Literal["left", "center", "right"] = ...,
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
features: Any | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: int = ...,
stroke_fill: _Ink | None = ...,
Expand Down Expand Up @@ -126,7 +127,7 @@ class ImageDraw:
spacing: float = ...,
align: Literal["left", "center", "right"] = ...,
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
features: Any | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: int = ...,
embedded_color: bool = ...,
Expand All @@ -140,7 +141,7 @@ class ImageDraw:
spacing: float = ...,
align: Literal["left", "center", "right"] = ...,
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
features: Any | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: int = ...,
embedded_color: bool = ...,
Expand Down
5 changes: 3 additions & 2 deletions stubs/Pillow/PIL/ImageDraw2.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any

class Pen:
Expand All @@ -18,9 +19,9 @@ class Draw:
draw: Any
image: Any
transform: Any
def __init__(self, image, size: Any | None = ..., color: Any | None = ...) -> None: ...
def __init__(self, image, size: Incomplete | None = ..., color: Incomplete | None = ...) -> None: ...
def flush(self): ...
def render(self, op, xy, pen, brush: Any | None = ...) -> None: ...
def render(self, op, xy, pen, brush: Incomplete | None = ...) -> None: ...
def settransform(self, offset) -> None: ...
def arc(self, xy, start, end, *options) -> None: ...
def chord(self, xy, start, end, *options) -> None: ...
Expand Down
6 changes: 3 additions & 3 deletions stubs/Pillow/PIL/ImageFile.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ImageFile(Image):
decodermaxblock: Any
fp: Any
filename: Any
def __init__(self, fp: Any | None = ..., filename: Any | None = ...) -> None: ...
def __init__(self, fp: Incomplete | None = ..., filename: Incomplete | None = ...) -> None: ...
def get_format_mimetype(self): ...
def verify(self) -> None: ...
map: Any
Expand Down Expand Up @@ -64,5 +64,5 @@ class PyDecoder:
def decode(self, buffer) -> None: ...
def cleanup(self) -> None: ...
def setfd(self, fd) -> None: ...
def setimage(self, im, extents: Any | None = ...) -> None: ...
def set_as_raw(self, data, rawmode: Any | None = ...) -> None: ...
def setimage(self, im, extents: Incomplete | None = ...) -> None: ...
def set_as_raw(self, data, rawmode: Incomplete | None = ...) -> None: ...
6 changes: 3 additions & 3 deletions stubs/Pillow/PIL/ImageFilter.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from _typeshed import Self
from _typeshed import Incomplete, Self
from collections.abc import Callable, Iterable, Sequence
from typing import Any
from typing_extensions import Literal, TypeAlias
Expand All @@ -18,7 +18,7 @@ class BuiltinFilter(MultibandFilter):
class Kernel(BuiltinFilter):
name: str
filterargs: _FilterArgs
def __init__(self, size: Sequence[int], kernel: Sequence[int], scale: Any | None = ..., offset: int = ...) -> None: ...
def __init__(self, size: Sequence[int], kernel: Sequence[int], scale: Incomplete | None = ..., offset: int = ...) -> None: ...

class RankFilter(Filter):
name: str
Expand Down Expand Up @@ -133,6 +133,6 @@ class Color3DLUT(MultibandFilter):
callback: Callable[..., Iterable[float]],
with_normals: bool = ...,
channels: Literal[3, 4] | None = ...,
target_mode: Any | None = ...,
target_mode: Incomplete | None = ...,
) -> Self: ...
def filter(self, image) -> Image: ...
12 changes: 6 additions & 6 deletions stubs/Pillow/PIL/ImageFont.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from _typeshed import StrOrBytesPath, SupportsRead
from _typeshed import Incomplete, StrOrBytesPath, SupportsRead
from typing import Any, Protocol
from typing_extensions import Literal

Expand Down Expand Up @@ -33,7 +33,7 @@ class FreeTypeFont:
text: str | bytes,
mode: str = ...,
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
features: Any | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
) -> int: ...
def getbbox(
Expand All @@ -50,7 +50,7 @@ class FreeTypeFont:
self,
text: str | bytes,
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
features: Any | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: int = ...,
) -> tuple[int, int]: ...
Expand All @@ -59,7 +59,7 @@ class FreeTypeFont:
text: str | bytes,
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
spacing: float = ...,
features: Any | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: float = ...,
) -> tuple[int, int]: ...
Expand All @@ -69,7 +69,7 @@ class FreeTypeFont:
text: str | bytes,
mode: str = ...,
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
features: Any | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: float = ...,
anchor: str | None = ...,
Expand All @@ -82,7 +82,7 @@ class FreeTypeFont:
mode: str = ...,
fill=...,
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
features: Any | None = ...,
features: Incomplete | None = ...,
language: str | None = ...,
stroke_width: float = ...,
anchor: str | None = ...,
Expand Down
4 changes: 2 additions & 2 deletions stubs/Pillow/PIL/ImageGrab.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Any
from _typeshed import Incomplete

from .Image import Image, _Box

def grab(
bbox: _Box | None = ..., include_layered_windows: bool = ..., all_screens: bool = ..., xdisplay: Any | None = ...
bbox: _Box | None = ..., include_layered_windows: bool = ..., all_screens: bool = ..., xdisplay: Incomplete | None = ...
) -> Image: ...
def grabclipboard() -> Image | None: ...
3 changes: 2 additions & 1 deletion stubs/Pillow/PIL/ImageMath.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from _typeshed import Incomplete
from typing import Any

class _Operand:
im: Any
def __init__(self, im) -> None: ...
def apply(self, op, im1, im2: Any | None = ..., mode: Any | None = ...): ...
def apply(self, op, im1, im2: Incomplete | None = ..., mode: Incomplete | None = ...): ...
def __bool__(self) -> bool: ...
def __abs__(self): ...
def __pos__(self): ...
Expand Down
11 changes: 8 additions & 3 deletions stubs/Pillow/PIL/ImageOps.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from _typeshed import Incomplete
from collections.abc import Iterable
from typing import Any, Protocol, Union
from typing import Protocol, Union
from typing_extensions import TypeAlias

from .Image import Image, Resampling, _Resample, _Size
Expand All @@ -24,12 +25,16 @@ def colorize(
) -> Image: ...
def contain(image: Image, size: _Size, method: Resampling | _Resample = ...) -> Image: ...
def pad(
image: Image, size: _Size, method: Resampling | _Resample = ..., color: Any | None = ..., centering: Iterable[float] = ...
image: Image,
size: _Size,
method: Resampling | _Resample = ...,
color: Incomplete | None = ...,
centering: Iterable[float] = ...,
) -> Image: ...
def crop(image: Image, border: _Border = ...) -> Image: ...
def scale(image: Image, factor: float, resample: Resampling | _Resample = ...) -> Image: ...
def deform(image: Image, deformer: _Deformer, resample: Resampling | _Resample = ...) -> Image: ...
def equalize(image: Image, mask: Any | None = ...) -> Image: ...
def equalize(image: Image, mask: Incomplete | None = ...) -> Image: ...
def expand(image: Image, border: _Border = ..., fill: _Ink = ...) -> Image: ...
def fit(
image: Image, size: _Size, method: Resampling | _Resample = ..., bleed: float = ..., centering: Iterable[float] = ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/Pillow/PIL/ImagePalette.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any

from .Image import Image
Expand All @@ -8,7 +9,7 @@ class ImagePalette:
palette: Any
colors: Any
dirty: Any
def __init__(self, mode: str = ..., palette: Any | None = ..., size: int = ...) -> None: ...
def __init__(self, mode: str = ..., palette: Incomplete | None = ..., size: int = ...) -> None: ...
def copy(self) -> ImagePalette: ...
def getdata(self): ...
def tobytes(self) -> bytes: ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/Pillow/PIL/ImageSequence.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any

class Iterator:
Expand All @@ -8,4 +9,4 @@ class Iterator:
def __iter__(self): ...
def __next__(self): ...

def all_frames(im, func: Any | None = ...): ...
def all_frames(im, func: Incomplete | None = ...): ...
Loading