From b01e7aa9d24014855c3d45b7d671a7f6b427b4c2 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 27 May 2025 14:38:04 +0200 Subject: [PATCH] Remove old compatibility alias `_BufferWithLen` (#14151) --- stdlib/_typeshed/__init__.pyi | 3 --- stubs/python-xlib/Xlib/protocol/display.pyi | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/stdlib/_typeshed/__init__.pyi b/stdlib/_typeshed/__init__.pyi index c37d55a7d..f32224401 100644 --- a/stdlib/_typeshed/__init__.pyi +++ b/stdlib/_typeshed/__init__.pyi @@ -298,9 +298,6 @@ class SupportsGetItemBuffer(SliceableBuffer, IndexableBuffer, Protocol): class SizedBuffer(Sized, Buffer, Protocol): ... -# for compatibility with third-party stubs that may use this -_BufferWithLen: TypeAlias = SizedBuffer # not stable # noqa: Y047 - ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, TracebackType] OptExcInfo: TypeAlias = ExcInfo | tuple[None, None, None] diff --git a/stubs/python-xlib/Xlib/protocol/display.pyi b/stubs/python-xlib/Xlib/protocol/display.pyi index 1808ea600..04f7be303 100644 --- a/stubs/python-xlib/Xlib/protocol/display.pyi +++ b/stubs/python-xlib/Xlib/protocol/display.pyi @@ -1,4 +1,4 @@ -from _typeshed import _BufferWithLen +from _typeshed import SizedBuffer from socket import socket from typing import Literal, TypeVar, overload @@ -16,7 +16,7 @@ class bytesview: @overload def __init__(self, data: bytes | bytesview, offset: int, size: int) -> None: ... @overload - def __init__(self, data: _BufferWithLen, offset: int = 0, size: int | None = None) -> None: ... + def __init__(self, data: SizedBuffer, offset: int = 0, size: int | None = None) -> None: ... @overload def __getitem__(self, key: slice) -> bytes: ... @overload