-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Replace various Incompletes in stdlib #11673
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
Changes from 7 commits
14cfa62
c921c55
b552350
d51b3de
eefbc2d
2c76845
3e0bb77
48d2464
3d98255
35439f3
d60e8c9
def5de0
a0580f3
b77a5cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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: Any) -> Any: ... | ||
|
||
# Used for an undocumented mypy feature. Does not exist at runtime. | ||
_promote = object() | ||
|
@@ -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: Any, args: Any) -> tuple[Any, ...]: ... | ||
|
||
if sys.version_info >= (3, 10): | ||
@final | ||
|
@@ -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: Any) -> Any: ... | ||
def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ... | ||
Comment on lines
+273
to
+274
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These dunders are unfortunately completely undocumented, but it seems that only type forms etc. are passed through, so There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, these are very much implementation details that users should steer clear of... Possibly we could/should just remove them from the stubs and allowlist them. But I'm also fine with just using |
||
|
||
def __or__(self, right: Any) -> _SpecialForm: ... | ||
def __ror__(self, left: Any) -> _SpecialForm: ... | ||
|
Uh oh!
There was an error while loading. Please reload this page.