diff --git a/src/msgspec/json.pyi b/src/msgspec/json.pyi index a77e656d..456b96a6 100644 --- a/src/msgspec/json.pyi +++ b/src/msgspec/json.pyi @@ -1,4 +1,5 @@ from collections.abc import Callable, Iterable +from types import GenericAlias from typing import ( Any, Generic, @@ -67,6 +68,7 @@ class Decoder(Generic[_T]): ) -> None: ... def decode(self, buf: Buffer | str, /) -> _T: ... def decode_lines(self, buf: Buffer | str, /) -> list[_T]: ... + def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... @overload def decode( diff --git a/src/msgspec/msgpack.pyi b/src/msgspec/msgpack.pyi index f76c9503..87307665 100644 --- a/src/msgspec/msgpack.pyi +++ b/src/msgspec/msgpack.pyi @@ -1,4 +1,5 @@ from collections.abc import Callable +from types import GenericAlias from typing import ( Any, Generic, @@ -49,6 +50,7 @@ class Decoder(Generic[_T]): ext_hook: _ExtHookSig = None, ) -> None: ... def decode(self, buf: Buffer, /) -> _T: ... + def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... @final class Encoder: