88 7 files changed, 63 insertions(+), 63 deletions(-)
99
1010diff --git a/pyproject.toml b/pyproject.toml
11- index 86ed27d..57b9561 100644
11+ index fde935a..ab3da97 100644
1212--- a/pyproject.toml
1313+++ b/pyproject.toml
1414@@ -5,7 +5,7 @@ requires = ['pdm-backend ~= 2.4']
@@ -55,10 +55,10 @@ index 51e7c0f..f4e4072 100644
5555- ) -> list[_ET]: ...
5656+ ) -> list[_Element]: ...
5757diff --git a/src/lxml-stubs/etree/_element.pyi b/src/lxml-stubs/etree/_element.pyi
58- index f114265..ff59370 100644
58+ index bcb5d96..8425502 100644
5959--- a/src/lxml-stubs/etree/_element.pyi
6060+++ b/src/lxml-stubs/etree/_element.pyi
61- @@ -19 ,9 +19 ,9 @@ from ._parser import CustomTargetParser
61+ @@ -20 ,9 +20 ,9 @@ from ._parser import CustomTargetParser
6262 from ._xslt import XSLTAccessControl, XSLTExtension, _Stylesheet_Param, _XSLTResultTree
6363
6464 if sys.version_info >= (3, 11):
@@ -70,7 +70,7 @@ index f114265..ff59370 100644
7070
7171 if sys.version_info >= (3, 13):
7272 from warnings import deprecated
73- @@ -170 ,11 +170 ,11 @@ class _Element:
73+ @@ -181 ,11 +181 ,11 @@ class _Element:
7474 #
7575 def __delitem__(self, __k: int | slice) -> None: ...
7676 @overload
@@ -85,7 +85,7 @@ index f114265..ff59370 100644
8585 # An element itself can be treated as container of other elements. When used
8686 # like elem[:] = new_elem, only subelements within new_elem will be
8787 # inserted, but not new_elem itself. If there is none, the whole slice would
88- @@ -184 ,13 +184 ,13 @@ class _Element:
88+ @@ -195 ,13 +195 ,13 @@ class _Element:
8989 # doesn't apply to magic methods, at least for Pylance. Thus we create
9090 # additional overload for extend() but not here.
9191 @overload
@@ -102,7 +102,7 @@ index f114265..ff59370 100644
102102 def set(self, key: _t._AttrName, value: _t._AttrVal) -> None:
103103 """Sets an element attribute.
104104
105- @@ -198 ,7 +198 ,7 @@ class _Element:
105+ @@ -209 ,7 +209 ,7 @@ class _Element:
106106 --------
107107 - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Element.set)
108108 """
@@ -111,7 +111,7 @@ index f114265..ff59370 100644
111111 """Adds a subelement to the end of this element.
112112
113113 See Also
114- @@ -220 ,7 +220 ,7 @@ class _Element:
114+ @@ -231 ,7 +231 ,7 @@ class _Element:
115115 - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Element.extend)
116116 """
117117 @overload
@@ -120,7 +120,7 @@ index f114265..ff59370 100644
120120 """Extends the current children by the elements in the iterable.
121121
122122 See Also
123- @@ -234 ,14 +234 ,14 @@ class _Element:
123+ @@ -245 ,14 +245 ,14 @@ class _Element:
124124 --------
125125 - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Element.clear)
126126 """
@@ -137,7 +137,7 @@ index f114265..ff59370 100644
137137 """Removes a matching subelement.
138138
139139 See Also
140- @@ -250 ,7 +250 ,7 @@ class _Element:
140+ @@ -261 ,7 +261 ,7 @@ class _Element:
141141 """
142142 def index(
143143 self,
@@ -146,7 +146,7 @@ index f114265..ff59370 100644
146146 start: int | None = None,
147147 stop: int | None = None,
148148 ) -> int:
149- @@ -308 ,49 +308 ,49 @@ class _Element:
149+ @@ -319 ,49 +319 ,49 @@ class _Element:
150150 #
151151 # extra Element / ET methods
152152 #
@@ -203,7 +203,7 @@ index f114265..ff59370 100644
203203 """Return an ElementTree for the root node of the document that
204204 contains this element.
205205
206- @@ -361 ,7 +361 ,7 @@ class _Element:
206+ @@ -372 ,7 +372 ,7 @@ class _Element:
207207 @overload
208208 def itersiblings(
209209 self, *tags: _t._TagSelector, preceding: bool = False
@@ -212,7 +212,7 @@ index f114265..ff59370 100644
212212 """Iterate over the following or preceding siblings of this element.
213213
214214 Annotation
215- @@ -380 ,7 +380 ,7 @@ class _Element:
215+ @@ -391 ,7 +391 ,7 @@ class _Element:
216216 tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None,
217217 *,
218218 preceding: bool = False,
@@ -221,7 +221,7 @@ index f114265..ff59370 100644
221221 """Iterate over the following or preceding siblings of this element.
222222
223223 Annotation
224- @@ -395 ,7 +395 ,7 @@ class _Element:
224+ @@ -406 ,7 +406 ,7 @@ class _Element:
225225 - [Possible tag values in `iter()`](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Element.iter)
226226 """
227227 @overload
@@ -230,7 +230,7 @@ index f114265..ff59370 100644
230230 """Iterate over the ancestors of this element (from parent to parent).
231231
232232 Annotation
233- @@ -411 ,7 +411 ,7 @@ class _Element:
233+ @@ -422 ,7 +422 ,7 @@ class _Element:
234234 @overload
235235 def iterancestors(
236236 self, tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None
@@ -239,7 +239,7 @@ index f114265..ff59370 100644
239239 """Iterate over the ancestors of this element (from parent to parent).
240240
241241 Annotation
242- @@ -426 ,7 +426 ,7 @@ class _Element:
242+ @@ -437 ,7 +437 ,7 @@ class _Element:
243243 - [Possible tag values in `iter()`](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Element.iter)
244244 """
245245 @overload
@@ -248,7 +248,7 @@ index f114265..ff59370 100644
248248 """Iterate over the descendants of this element in document order.
249249
250250 Annotation
251- @@ -442 ,7 +442 ,7 @@ class _Element:
251+ @@ -453 ,7 +453 ,7 @@ class _Element:
252252 @overload
253253 def iterdescendants(
254254 self, tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None
@@ -257,7 +257,7 @@ index f114265..ff59370 100644
257257 """Iterate over the descendants of this element in document order.
258258
259259 Annotation
260- @@ -459 ,7 +459 ,7 @@ class _Element:
260+ @@ -470 ,7 +470 ,7 @@ class _Element:
261261 @overload
262262 def iterchildren(
263263 self, *tags: _t._TagSelector, reversed: bool = False
@@ -266,7 +266,7 @@ index f114265..ff59370 100644
266266 """Iterate over the children of this element.
267267
268268 Annotation
269- @@ -478 ,7 +478 ,7 @@ class _Element:
269+ @@ -489 ,7 +489 ,7 @@ class _Element:
270270 tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None,
271271 *,
272272 reversed: bool = False,
@@ -275,7 +275,7 @@ index f114265..ff59370 100644
275275 """Iterate over the children of this element.
276276
277277 Annotation
278- @@ -493 ,7 +493 ,7 @@ class _Element:
278+ @@ -504 ,7 +504 ,7 @@ class _Element:
279279 - [Possible tag values in `iter()`](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Element.iter)
280280 """
281281 @overload
@@ -284,7 +284,7 @@ index f114265..ff59370 100644
284284 """Iterate over all elements in the subtree in document order (depth
285285 first pre-order), starting with this element.
286286
287- @@ -509 ,7 +509 ,7 @@ class _Element:
287+ @@ -520 ,7 +520 ,7 @@ class _Element:
288288 @overload
289289 def iter(
290290 self, tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None
@@ -293,16 +293,16 @@ index f114265..ff59370 100644
293293 """Iterate over all elements in the subtree in document order (depth
294294 first pre-order), starting with this element.
295295
296- @@ -557 ,7 +557 ,7 @@ class _Element:
296+ @@ -568 ,7 +568 ,7 @@ class _Element:
297297 - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Element.itertext)
298298 - [Possible tag values in `iter()`](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Element.iter)
299299 """
300- - makeelement: _t._ElementFactory [Self]
301- + makeelement: _t._ElementFactory [_Element]
300+ - makeelement: type [Self]
301+ + makeelement: type [_Element]
302302 """Creates a new element associated with the same document.
303303
304304 See Also
305- @@ -566 ,7 +566 ,7 @@ class _Element:
305+ @@ -577 ,7 +577 ,7 @@ class _Element:
306306 """
307307 def find(
308308 self, path: _t._ElemPathArg, namespaces: _t._StrOnlyNSMap | None = None
@@ -311,7 +311,7 @@ index f114265..ff59370 100644
311311 """Creates a new element associated with the same document.
312312
313313 See Also
314- @@ -609 ,7 +609 ,7 @@ class _Element:
314+ @@ -620 ,7 +620 ,7 @@ class _Element:
315315 """
316316 def findall(
317317 self, path: _t._ElemPathArg, namespaces: _t._StrOnlyNSMap | None = None
@@ -320,7 +320,7 @@ index f114265..ff59370 100644
320320 """Finds all matching subelements, by tag name or path.
321321
322322 See Also
323- @@ -618 ,7 +618 ,7 @@ class _Element:
323+ @@ -629 ,7 +629 ,7 @@ class _Element:
324324 """
325325 def iterfind(
326326 self, path: _t._ElemPathArg, namespaces: _t._StrOnlyNSMap | None = None
@@ -329,7 +329,7 @@ index f114265..ff59370 100644
329329 """Iterates over all matching subelements, by tag name or path.
330330
331331 See Also
332- @@ -646 ,7 +646 ,7 @@ class _Element:
332+ @@ -657 ,7 +657 ,7 @@ class _Element:
333333 expr: str,
334334 *,
335335 translator: _CSSTransArg = "xml",
@@ -338,7 +338,7 @@ index f114265..ff59370 100644
338338 """Run the CSS expression on this element and its children,
339339 returning a list of the results.
340340
341- @@ -655 ,13 +655 ,13 @@ class _Element:
341+ @@ -666 ,13 +666 ,13 @@ class _Element:
342342 - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Entity.cssselect)
343343 """
344344 @deprecated("Since v2.0 (2008); use list(element) or iterate over element")
@@ -352,22 +352,24 @@ index f114265..ff59370 100644
352352- ) -> Iterator[Self]: ...
353353+ ) -> Iterator[_Element]: ...
354354
355- _ET2_co = TypeVar("_ET2_co", bound=_Element, default= _Element, covariant=True)
355+ Element: TypeAlias = _Element
356356
357357diff --git a/src/lxml-stubs/etree/_factory_func.pyi b/src/lxml-stubs/etree/_factory_func.pyi
358- index b417517..29d0261 100644
358+ index 3dd52b8..1dfdf67 100644
359359--- a/src/lxml-stubs/etree/_factory_func.pyi
360360+++ b/src/lxml-stubs/etree/_factory_func.pyi
361- @@ -14,7 +14,7 @@ from .._types import (
362- )
363- from ..html import HtmlElement
364- from ..objectify import ObjectifiedElement, StringElement
365- - from ._element import _Comment, _ElementTree, _Entity, _ProcessingInstruction
366- + from ._element import _Comment, _Element, _ElementTree, _Entity, _ProcessingInstruction
367- from ._parser import CustomTargetParser
368-
369- _T = TypeVar("_T")
370- @@ -64,13 +64,13 @@ def SubElement(
361+ @@ -1,9 +1,9 @@
362+ from typing import TypeVar, overload
363+
364+ from .._types import (
365+ - _ET,
366+ _AttrMapping,
367+ _AttrVal,
368+ + _Element,
369+ _NSMapArg,
370+ _TagName,
371+ _TextArg,
372+ @@ -57,10 +57,10 @@ def SubElement(
371373 ) -> HtmlElement: ...
372374 @overload
373375 def SubElement(
@@ -380,14 +382,11 @@ index b417517..29d0261 100644
380382 **_extra: _AttrVal,
381383- ) -> _ET: ...
382384+ ) -> _Element: ...
383- @overload # from element, parser ignored
384- def ElementTree(
385- element: _ET,
386385diff --git a/src/lxml-stubs/html/_element.pyi b/src/lxml-stubs/html/_element.pyi
387- index b00bfb3..8cda2b3 100644
386+ index d46fbc3..d327fb5 100644
388387--- a/src/lxml-stubs/html/_element.pyi
389388+++ b/src/lxml-stubs/html/_element.pyi
390- @@ -124 ,7 +124 ,7 @@ class HtmlElement(etree.ElementBase):
389+ @@ -126 ,7 +126 ,7 @@ class HtmlElement(etree.ElementBase):
391390 # Subclassing of _Element should not go beyond HtmlElement. For example,
392391 # while children of HtmlElement are mostly HtmlElement, FormElement never
393392 # contains FormElement as child.
@@ -396,7 +395,7 @@ index b00bfb3..8cda2b3 100644
396395 def __getitem__(
397396 self,
398397 __x: int,
399- @@ -134 ,7 +134 ,7 @@ class HtmlElement(etree.ElementBase):
398+ @@ -136 ,7 +136 ,7 @@ class HtmlElement(etree.ElementBase):
400399 self,
401400 __x: slice,
402401 ) -> list[HtmlElement]: ...
@@ -405,7 +404,7 @@ index b00bfb3..8cda2b3 100644
405404 def __setitem__(
406405 self,
407406 __x: int,
408- @@ -150 ,9 +150 ,9 @@ class HtmlElement(etree.ElementBase):
407+ @@ -152 ,9 +152 ,9 @@ class HtmlElement(etree.ElementBase):
409408 def __reversed__(self) -> Iterator[HtmlElement]: ...
410409 def append( # pyright: ignore[reportIncompatibleMethodOverride]
411410 self,
@@ -417,7 +416,7 @@ index b00bfb3..8cda2b3 100644
417416 @deprecated("Expects iterable of elements as value, not single element")
418417 def extend(
419418 self,
420- @@ -166 ,30 +166 ,30 @@ class HtmlElement(etree.ElementBase):
419+ @@ -168 ,30 +168 ,30 @@ class HtmlElement(etree.ElementBase):
421420 def insert( # pyright: ignore[reportIncompatibleMethodOverride]
422421 self,
423422 index: int,
@@ -455,7 +454,7 @@ index b00bfb3..8cda2b3 100644
455454 ) -> None: ...
456455 def getparent(self) -> HtmlElement | None: ...
457456 def getnext(self) -> HtmlElement | None: ...
458- @@ -270 ,7 +270 ,7 @@ class HtmlElement(etree.ElementBase):
457+ @@ -272 ,7 +272 ,7 @@ class HtmlElement(etree.ElementBase):
459458 path: _ElemPathArg,
460459 namespaces: _StrOnlyNSMap | None = None,
461460 ) -> HtmlElement | None: ...
@@ -464,7 +463,7 @@ index b00bfb3..8cda2b3 100644
464463 self,
465464 path: _ElemPathArg,
466465 namespaces: _StrOnlyNSMap | None = None,
467- @@ -280 ,7 +280 ,7 @@ class HtmlElement(etree.ElementBase):
466+ @@ -282 ,7 +282 ,7 @@ class HtmlElement(etree.ElementBase):
468467 path: _ElemPathArg,
469468 namespaces: _StrOnlyNSMap | None = None,
470469 ) -> Iterator[HtmlElement]: ...
0 commit comments