From d057b490d582412543930385e032ac6f08cca4fc Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Wed, 20 Aug 2025 16:56:16 -0700 Subject: [PATCH] xml.etree: remove pytype workaround (#14602) --- stdlib/xml/etree/ElementTree.pyi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stdlib/xml/etree/ElementTree.pyi b/stdlib/xml/etree/ElementTree.pyi index 1d7e1725d..e6b094963 100644 --- a/stdlib/xml/etree/ElementTree.pyi +++ b/stdlib/xml/etree/ElementTree.pyi @@ -78,9 +78,8 @@ def canonicalize( ) -> None: ... # The tag for Element can be set to the Comment or ProcessingInstruction -# functions defined in this module. _ElementCallable could be a recursive -# type, but defining it that way uncovered a bug in pytype. -_ElementCallable: TypeAlias = Callable[..., Element[Any]] +# functions defined in this module. +_ElementCallable: TypeAlias = Callable[..., Element[_ElementCallable]] _CallableElement: TypeAlias = Element[_ElementCallable] _Tag = TypeVar("_Tag", default=str, bound=str | _ElementCallable)