Skip to content

Commit

Permalink
Remove bare incompletes (#11670)
Browse files Browse the repository at this point in the history
  • Loading branch information
srittau authored Mar 31, 2024
1 parent 33de888 commit 027115e
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 20 deletions.
9 changes: 9 additions & 0 deletions pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,28 @@
"stdlib/distutils/command",
"stdlib/distutils/dist.pyi",
"stdlib/importlib/readers.pyi",
"stdlib/importlib/resources/simple.pyi",
"stdlib/lib2to3/fixes/*.pyi",
"stdlib/multiprocessing/resource_tracker.pyi",
"stdlib/multiprocessing/util.pyi",
"stdlib/numbers.pyi",
"stdlib/optparse.pyi",
"stdlib/_tkinter.pyi",
"stdlib/tkinter/__init__.pyi",
"stdlib/tkinter/commondialog.pyi",
"stdlib/tkinter/filedialog.pyi",
"stdlib/tkinter/dialog.pyi",
"stdlib/tkinter/messagebox.pyi",
"stdlib/tkinter/scrolledtext.pyi",
"stdlib/tkinter/tix.pyi",
"stdlib/tkinter/ttk.pyi",
"stdlib/typing.pyi",
"stdlib/typing_extensions.pyi",
"stdlib/xml/dom/NodeFilter.pyi",
"stdlib/xml/dom/expatbuilder.pyi",
"stdlib/xml/dom/minidom.pyi",
"stdlib/xml/dom/pulldom.pyi",
"stdlib/xml/dom/xmlbuilder.pyi",
"stdlib/xml/sax",
"stubs/aiofiles/aiofiles/tempfile/__init__.pyi",
"stubs/aiofiles/aiofiles/tempfile/temptypes.pyi",
Expand Down
4 changes: 2 additions & 2 deletions stdlib/importlib/resources/simple.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ if sys.version_info >= (3, 11):
def is_file(self) -> Literal[True]: ...
def is_dir(self) -> Literal[False]: ...
@overload
def open(self, mode: OpenTextMode = "r", *args: Incomplete, **kwargs: Incomplete) -> TextIOWrapper: ...
def open(self, mode: OpenTextMode = "r", *args, **kwargs) -> TextIOWrapper: ...
@overload
def open(self, mode: OpenBinaryMode, *args: Unused, **kwargs: Unused) -> BinaryIO: ...
@overload
def open(self, mode: str, *args: Incomplete, **kwargs: Incomplete) -> IO[Any]: ...
def open(self, mode: str, *args: Incomplete, **kwargs) -> IO[Any]: ...
def joinpath(self, name: Never) -> NoReturn: ... # type: ignore[override]

class ResourceContainer(Traversable, metaclass=abc.ABCMeta):
Expand Down
6 changes: 3 additions & 3 deletions stdlib/multiprocessing/resource_tracker.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from _typeshed import FileDescriptorOrPath, Incomplete
from _typeshed import FileDescriptorOrPath
from collections.abc import Sized

__all__ = ["ensure_running", "register", "unregister"]

class ResourceTracker:
def getfd(self) -> int | None: ...
def ensure_running(self) -> None: ...
def register(self, name: Sized, rtype: Incomplete) -> None: ...
def unregister(self, name: Sized, rtype: Incomplete) -> None: ...
def register(self, name: Sized, rtype) -> None: ...
def unregister(self, name: Sized, rtype) -> None: ...

_resource_tracker: ResourceTracker
ensure_running = _resource_tracker.ensure_running
Expand Down
4 changes: 2 additions & 2 deletions stdlib/multiprocessing/util.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def is_abstract_socket_namespace(address: str | bytes | None) -> bool: ...
abstract_sockets_supported: bool

def get_temp_dir() -> str: ...
def register_after_fork(obj: Incomplete, func: Callable[[Incomplete], object]) -> None: ...
def register_after_fork(obj, func: Callable[[Incomplete], object]) -> None: ...

class Finalize:
def __init__(
Expand All @@ -59,7 +59,7 @@ class Finalize:
_finalizer_registry: MutableMapping[Incomplete, Incomplete] = {},
sub_debug: Callable[..., object] = ...,
getpid: Callable[[], int] = ...,
) -> Incomplete: ...
): ...
def cancel(self) -> None: ...
def still_active(self) -> bool: ...

Expand Down
4 changes: 2 additions & 2 deletions stdlib/tkinter/commondialog.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ class Dialog:
command: ClassVar[str | None]
master: Incomplete | None
options: Mapping[str, Incomplete]
def __init__(self, master: Incomplete | None = None, **options: Incomplete) -> None: ...
def show(self, **options: Incomplete) -> Incomplete: ...
def __init__(self, master: Incomplete | None = None, **options) -> None: ...
def show(self, **options): ...
2 changes: 1 addition & 1 deletion stdlib/tkinter/dialog.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ DIALOG_ICON: str
class Dialog(Widget):
widgetName: str
num: int
def __init__(self, master: Incomplete | None = None, cnf: Mapping[str, Any] = {}, **kw: Incomplete) -> None: ...
def __init__(self, master: Incomplete | None = None, cnf: Mapping[str, Any] = {}, **kw) -> None: ...
def destroy(self) -> None: ...
3 changes: 1 addition & 2 deletions stdlib/tkinter/scrolledtext.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from _typeshed import Incomplete
from tkinter import Frame, Misc, Scrollbar, Text

__all__ = ["ScrolledText"]
Expand All @@ -7,4 +6,4 @@ __all__ = ["ScrolledText"]
class ScrolledText(Text):
frame: Frame
vbar: Scrollbar
def __init__(self, master: Misc | None = None, **kwargs: Incomplete) -> None: ...
def __init__(self, master: Misc | None = None, **kwargs) -> None: ...
10 changes: 5 additions & 5 deletions stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import collections # noqa: F401 # pyright: ignore
import sys
import typing_extensions
from _collections_abc import dict_items, dict_keys, dict_values
from _typeshed import IdentityFunction, Incomplete, ReadableBuffer, SupportsKeysAndGetItem
from _typeshed import IdentityFunction, ReadableBuffer, SupportsKeysAndGetItem
from abc import ABCMeta, abstractmethod
from contextlib import AbstractAsyncContextManager, AbstractContextManager
from re import Match as Match, Pattern as Pattern
Expand Down Expand Up @@ -170,7 +170,7 @@ class TypeVar:
def __or__(self, right: Any) -> _SpecialForm: ...
def __ror__(self, left: Any) -> _SpecialForm: ...
if sys.version_info >= (3, 11):
def __typing_subst__(self, arg: Incomplete) -> Incomplete: ...
def __typing_subst__(self, arg): ...

# Used for an undocumented mypy feature. Does not exist at runtime.
_promote = object()
Expand Down Expand Up @@ -221,7 +221,7 @@ if sys.version_info >= (3, 11):
def __init__(self, name: str) -> None: ...
def __iter__(self) -> Any: ...
def __typing_subst__(self, arg: Never) -> Never: ...
def __typing_prepare_subst__(self, alias: Incomplete, args: Incomplete) -> Incomplete: ...
def __typing_prepare_subst__(self, alias, args): ...

if sys.version_info >= (3, 10):
@final
Expand Down Expand Up @@ -270,8 +270,8 @@ if sys.version_info >= (3, 10):
@property
def kwargs(self) -> ParamSpecKwargs: ...
if sys.version_info >= (3, 11):
def __typing_subst__(self, arg: Incomplete) -> Incomplete: ...
def __typing_prepare_subst__(self, alias: Incomplete, args: Incomplete) -> Incomplete: ...
def __typing_subst__(self, arg): ...
def __typing_prepare_subst__(self, alias, args): ...

def __or__(self, right: Any) -> _SpecialForm: ...
def __ror__(self, left: Any) -> _SpecialForm: ...
Expand Down
4 changes: 2 additions & 2 deletions stdlib/typing_extensions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import abc
import sys
import typing
from _collections_abc import dict_items, dict_keys, dict_values
from _typeshed import IdentityFunction, Incomplete
from _typeshed import IdentityFunction
from typing import ( # noqa: Y022,Y037,Y038,Y039
IO as IO,
TYPE_CHECKING as TYPE_CHECKING,
Expand Down Expand Up @@ -413,7 +413,7 @@ class TypeVar:
def __or__(self, right: Any) -> _SpecialForm: ...
def __ror__(self, left: Any) -> _SpecialForm: ...
if sys.version_info >= (3, 11):
def __typing_subst__(self, arg: Incomplete) -> Incomplete: ...
def __typing_subst__(self, arg): ...

@final
class ParamSpec:
Expand Down
2 changes: 1 addition & 1 deletion stdlib/xml/dom/xmlbuilder.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class DOMBuilder:
def supportsFeature(self, name: str) -> bool: ...
def canSetFeature(self, name: str, state: int) -> bool: ...
# getFeature could return any attribute from an instance of `Options`
def getFeature(self, name: str) -> Incomplete: ...
def getFeature(self, name: str): ...
def parseURI(self, uri: str) -> ExpatBuilder | ExpatBuilderNS: ...
def parse(self, input: DOMInputSource) -> ExpatBuilder | ExpatBuilderNS: ...
# `input` and `cnode` argtypes for `parseWithContext` are unknowable
Expand Down

0 comments on commit 027115e

Please sign in to comment.