GeezerVison is showing github.com — Sync typeshed by cdce8p · Pull Request #20605 · python/mypy
Sync typeshed
#20605
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
Uh oh!
There was an error while loading. Please reload this page.
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter
Filter by extension
.pyi
(57)
All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Hide whitespace
Diff view
Hide whitespace
Sync typeshed
Loading branch information
Uh oh!
There was an error while loading. Please reload this page.
commit 3e09bb45b53b6dba277890ee6ba044baf3797735
There are no files selected for viewing
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
import sys
from asyncio.events import AbstractEventLoop
from collections.abc import Awaitable, Callable, Coroutine, Generator, Iterable
from collections.abc import Awaitable, Callable, Coroutine, Generator
from contextvars import Context
from types import FrameType, GenericAlias
from typing import Any, Literal, TextIO, TypeVar
Expand All
@@ -11,7 +11,7 @@ _T_co = TypeVar("_T_co", covariant=True)
_TaskYieldType: TypeAlias = Future[object] | None
@disjoint_base
class Future(Awaitable[_T], Iterable[_T] ):
class Future(Awaitable[_T]):
_state: str
@property
def _exception(self) -> BaseException | None: ...
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -320,7 +320,11 @@ class Array(_CData, Generic[_CT], metaclass=_PyCArrayType):
def _type_(self) -> type[_CT]: ...
@_type_.setter
def _type_(self, value: type[_CT]) -> None: ...
raw: bytes # Note: only available if _CT == c_char
# Note: only available if _CT == c_char
@property
def raw(self) -> bytes: ...
@raw.setter
def raw(self, value: ReadableBuffer) -> None: ...
value: Any # Note: bytes if _CT == c_char, str if _CT == c_wchar, unavailable otherwise
# TODO: These methods cannot be annotated correctly at the moment.
# All of these "Any"s stand for the array's element type, but it's not possible to use _CT
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -9,7 +9,7 @@ from _typeshed.importlib import LoaderProtocol
from collections.abc import Callable, Iterable, Iterator, Mapping, MutableSequence, Sequence
from importlib.machinery import ModuleSpec
from importlib.metadata import DistributionFinder, PathDistribution
from typing import Any, Final, Literal
from typing import Any, Final, Literal, overload
from typing_extensions import Self, deprecated
if sys.version_info >= (3, 10):
Expand All
@@ -26,7 +26,13 @@ else:
MAGIC_NUMBER: Final[bytes]
def cache_from_source(path: StrPath, debug_override: bool | None = None, *, optimization: Any | None = None) -> str: ...
@overload
@deprecated(
"The `debug_override` parameter is deprecated since Python 3.5; will be removed in Python 3.15. Use `optimization` instead."
)
def cache_from_source(path: StrPath, debug_override: bool, *, optimization: None = None) -> str: ...
@overload
def cache_from_source(path: StrPath, debug_override: None = None, *, optimization: Any | None = None) -> str: ...
def source_from_cache(path: StrPath) -> str: ...
def decode_source(source_bytes: ReadableBuffer) -> str: ...
def spec_from_file_location(
Expand Down
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
import sys
from _typeshed import FileDescriptorLike, Incomplete
from collections.abc import Callable
from typing import Any, ClassVar, Final, final
from typing import Any, ClassVar, Final, Literal, final, overload
from typing_extensions import TypeAlias, deprecated
# _tkinter is meant to be only used internally by tkinter, but some tkinter
Expand Down
Expand Up
@@ -54,22 +55,23 @@ _TkinterTraceFunc: TypeAlias = Callable[[tuple[str, ...]], object]
@final
class TkappType:
# Please keep in sync with tkinter.Tk
def adderrorinfo(self, msg: str, /): ...
def adderrorinfo(self, msg: str, /) -> None : ...
def call(self, command: Any, /, *args: Any) -> Any: ...
def createcommand(self, name: str, func, /): ...
# TODO: Figure out what arguments the following `func` callbacks should accept
def createcommand(self, name: str, func: Callable[..., object], /) -> None: ...
if sys.platform != "win32":
def createfilehandler(self, file, mask: int, func, /) : ...
def deletefilehandler(self, file, /) -> None: ...
def createfilehandler(self, file: FileDescriptorLike , mask: int, func: Callable[..., object], /) -> None : ...
def deletefilehandler(self, file: FileDescriptorLike , /) -> None: ...
def createtimerhandler(self, milliseconds: int, func, /): ...
def deletecommand(self, name: str, /): ...
def dooneevent(self, flags: int = 0, /): ...
def createtimerhandler(self, milliseconds: int, func: Callable[..., object] , /): ...
def deletecommand(self, name: str, /) -> None : ...
def dooneevent(self, flags: int = 0, /) -> int : ...
def eval(self, script: str, /) -> str: ...
def evalfile(self, fileName: str, /): ...
def exprboolean(self, s: str, /): ...
def exprdouble(self, s: str, /): ...
def exprlong(self, s: str, /): ...
def exprstring(self, s: str, /): ...
def evalfile(self, fileName: str, /) -> str : ...
def exprboolean(self, s: str, /) -> Literal[0, 1] : ...
def exprdouble(self, s: str, /) -> float : ...
def exprlong(self, s: str, /) -> int : ...
def exprstring(self, s: str, /) -> str : ...
def getboolean(self, arg, /) -> bool: ...
def getdouble(self, arg, /) -> float: ...
def getint(self, arg, /) -> int: ...
Expand All
@@ -81,15 +83,23 @@ class TkappType:
def loadtk(self) -> None: ...
def mainloop(self, threshold: int = 0, /) -> None: ...
def quit(self) -> None: ...
def record(self, script: str, /): ...
def record(self, script: str, /) -> str : ...
def setvar(self, *ags, **kwargs): ...
if sys.version_info < (3, 11):
@deprecated("Deprecated since Python 3.9; removed in Python 3.11. Use `splitlist()` instead.")
def split(self, arg, /): ...
def splitlist(self, arg, /): ...
def splitlist(self, arg, /) -> tuple[Incomplete, ...] : ...
def unsetvar(self, *args, **kwargs): ...
def wantobjects(self, *args, **kwargs): ...
if sys.version_info >= (3, 14):
@overload
def wantobjects(self) -> Literal[0, 1]: ...
else:
@overload
def wantobjects(self) -> bool: ...
@overload
def wantobjects(self, wantobjects: Literal[0, 1] | bool, /) -> None: ...
def willdispatch(self) -> None: ...
if sys.version_info >= (3, 12):
def gettrace(self, /) -> _TkinterTraceFunc | None: ...
Expand All
@@ -112,7 +122,7 @@ TK_VERSION: Final[str]
@final
class TkttType:
def deletetimerhandler(self): ...
def deletetimerhandler(self) -> None : ...
if sys.version_info >= (3, 13):
def create(
Expand All
@@ -125,7 +135,7 @@ if sys.version_info >= (3, 13):
sync: bool = False,
use: str | None = None,
/,
): ...
) -> TkappType : ...
else:
def create(
Expand All
@@ -138,7 +148,7 @@ else:
sync: bool = False,
use: str | None = None,
/,
): ...
) -> TkappType : ...
def getbusywaitinterval() -> int: ...
def setbusywaitinterval(new_val: int, /) -> None: ...
Original file line number
Diff line number
Diff line change
Expand Up
@@ -2,7 +2,7 @@ import sys
from _typeshed import SupportsWrite, sentinel
from collections.abc import Callable, Generator, Iterable, Sequence
from re import Pattern
from typing import IO, Any, ClassVar, Final, Generic, NewType, NoReturn, Protocol, TypeVar, overload, type_check_only
from typing import IO, Any, ClassVar, Final, Generic, NoReturn, Protocol, TypeVar, overload, type_check_only
from typing_extensions import Self, TypeAlias, deprecated
__all__ = [
Expand Down
Expand Up
@@ -36,9 +36,7 @@ ONE_OR_MORE: Final = "+"
OPTIONAL: Final = "?"
PARSER: Final = "A..."
REMAINDER: Final = "..."
_SUPPRESS_T = NewType("_SUPPRESS_T", str)
SUPPRESS: _SUPPRESS_T | str # not using Literal because argparse sometimes compares SUPPRESS with is
# the | str is there so that foo = argparse.SUPPRESS; foo = "test" checks out in mypy
SUPPRESS: Final = "==SUPPRESS=="
ZERO_OR_MORE: Final = "*"
_UNRECOGNIZED_ARGS_ATTR: Final = "_unrecognized_args" # undocumented
Expand Down
Expand Up
@@ -81,7 +79,7 @@ class _ActionsContainer:
# more precisely, Literal["?", "*", "+", "...", "A...", "==SUPPRESS=="],
# but using this would make it hard to annotate callers that don't use a
# literal argument and for subclasses to override this method.
nargs: int | str | _SUPPRESS_T | None = None,
nargs: int | str | None = None,
const: Any = ...,
default: Any = ...,
type: _ActionType = ...,
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -83,7 +83,16 @@ class BaseEventLoop(AbstractEventLoop):
# Future methods
def create_future(self) -> Future[Any]: ...
# Tasks methods
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 14):
def create_task(
self,
coro: _CoroutineLike[_T],
*,
name: object = None,
context: Context | None = None,
eager_start: bool | None = None,
) -> Task[_T]: ...
elif sys.version_info >= (3, 11):
def create_task(self, coro: _CoroutineLike[_T], *, name: object = None, context: Context | None = None) -> Task[_T]: ...
else:
def create_task(self, coro: _CoroutineLike[_T], *, name: object = None) -> Task[_T]: ...
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -161,7 +161,17 @@ class AbstractEventLoop:
@abstractmethod
def create_future(self) -> Future[Any]: ...
# Tasks methods
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 14):
@abstractmethod
def create_task(
self,
coro: _CoroutineLike[_T],
*,
name: str | None = None,
context: Context | None = None,
eager_start: bool | None = None,
) -> Task[_T]: ...
elif sys.version_info >= (3, 11):
@abstractmethod
def create_task(
self, coro: _CoroutineLike[_T], *, name: str | None = None, context: Context | None = None
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -22,5 +22,18 @@ class TaskGroup:
async def __aenter__(self) -> Self: ...
async def __aexit__(self, et: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None) -> None: ...
def create_task(self, coro: _CoroutineLike[_T], *, name: str | None = None, context: Context | None = None) -> Task[_T]: ...
if sys.version_info >= (3, 14):
def create_task(
self,
coro: _CoroutineLike[_T],
*,
name: str | None = None,
context: Context | None = None,
eager_start: bool | None = None,
) -> Task[_T]: ...
else:
def create_task(
self, coro: _CoroutineLike[_T], *, name: str | None = None, context: Context | None = None
) -> Task[_T]: ...
def _on_task_done(self, task: Task[object]) -> None: ...
Original file line number
Diff line number
Diff line change
Expand Up
@@ -413,7 +413,12 @@ else:
def all_tasks(loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ...
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 14):
def create_task(
coro: _CoroutineLike[_T], *, name: str | None = None, context: Context | None = None, eager_start: bool | None = None
) -> Task[_T]: ...
elif sys.version_info >= (3, 11):
def create_task(coro: _CoroutineLike[_T], *, name: str | None = None, context: Context | None = None) -> Task[_T]: ...
else:
Expand Down
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.