Fix various stubtest complaints on Python 3.12 (#10691)

This commit is contained in:
Alex Waygood
2023-09-10 22:54:43 +01:00
committed by GitHub
parent 6dda2fe9c8
commit a570fb6ced
5 changed files with 31 additions and 15 deletions

View File

@@ -129,6 +129,9 @@ __all__ = [
"Terminator",
]
if sys.version_info >= (3, 12):
__all__ += ["teleport"]
# Note: '_Color' is the alias we use for arguments and _AnyColor is the
# alias we use for return types. Really, these two aliases should be the
# same, but as per the "no union returns" typeshed policy, we'll return
@@ -648,6 +651,9 @@ def shape(name: None = None) -> str: ...
@overload
def shape(name: str) -> None: ...
if sys.version_info >= (3, 12):
def teleport(x: float | None = None, y: float | None = None, *, fill_gap: bool = False) -> None: ...
# Unsafely overlaps when no arguments are provided
@overload
def shapesize() -> tuple[float, float, float]: ... # type: ignore[misc]