Skip to content

Commit 8bca22c

Browse files
committed
chore: Refresh multiclass patch
1 parent 7c08258 commit 8bca22c

1 file changed

Lines changed: 34 additions & 34 deletions

File tree

multi-subclass.patch

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ index 1ccf715..24f914b 100644
5555
- ) -> list[_ET]: ...
5656
+ ) -> list[_Element]: ...
5757
diff --git a/src/lxml-stubs/etree/_element.pyi b/src/lxml-stubs/etree/_element.pyi
58-
index cc1f37a..9e4a85d 100644
58+
index 771b76c..90b0f8f 100644
5959
--- a/src/lxml-stubs/etree/_element.pyi
6060
+++ b/src/lxml-stubs/etree/_element.pyi
61-
@@ -12,9 +12,9 @@ from typing import (
62-
)
61+
@@ -18,9 +18,9 @@ from ._parser import CustomTargetParser
62+
from ._xslt import XSLTAccessControl, XSLTExtension, _Stylesheet_Param, _XSLTResultTree
6363

6464
if sys.version_info >= (3, 11):
6565
- from typing import Never, Self
@@ -70,7 +70,7 @@ index cc1f37a..9e4a85d 100644
7070

7171
if sys.version_info >= (3, 13):
7272
from warnings import deprecated
73-
@@ -168,11 +168,11 @@ class _Element:
73+
@@ -169,11 +169,11 @@ class _Element:
7474
#
7575
def __delitem__(self, __k: int | slice) -> None: ...
7676
@overload
@@ -85,7 +85,7 @@ index cc1f37a..9e4a85d 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-
@@ -182,13 +182,13 @@ class _Element:
88+
@@ -183,13 +183,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 cc1f37a..9e4a85d 100644
102102
def set(self, key: _t._AttrName, value: _t._AttrVal) -> None:
103103
"""Sets an element attribute.
104104

105-
@@ -196,7 +196,7 @@ class _Element:
105+
@@ -197,7 +197,7 @@ class _Element:
106106
--------
107107
- [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Element.set)
108108
"""
@@ -111,7 +111,7 @@ index cc1f37a..9e4a85d 100644
111111
"""Adds a subelement to the end of this element.
112112

113113
See Also
114-
@@ -218,7 +218,7 @@ class _Element:
114+
@@ -219,7 +219,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 cc1f37a..9e4a85d 100644
120120
"""Extends the current children by the elements in the iterable.
121121

122122
See Also
123-
@@ -232,14 +232,14 @@ class _Element:
123+
@@ -233,14 +233,14 @@ class _Element:
124124
--------
125125
- [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree._Element.clear)
126126
"""
@@ -137,7 +137,7 @@ index cc1f37a..9e4a85d 100644
137137
"""Removes a matching subelement.
138138

139139
See Also
140-
@@ -248,7 +248,7 @@ class _Element:
140+
@@ -249,7 +249,7 @@ class _Element:
141141
"""
142142
def index(
143143
self,
@@ -146,7 +146,7 @@ index cc1f37a..9e4a85d 100644
146146
start: int | None = None,
147147
stop: int | None = None,
148148
) -> int:
149-
@@ -306,49 +306,49 @@ class _Element:
149+
@@ -307,49 +307,49 @@ class _Element:
150150
#
151151
# extra Element / ET methods
152152
#
@@ -203,7 +203,7 @@ index cc1f37a..9e4a85d 100644
203203
"""Return an ElementTree for the root node of the document that
204204
contains this element.
205205

206-
@@ -359,7 +359,7 @@ class _Element:
206+
@@ -360,7 +360,7 @@ class _Element:
207207
@overload
208208
def itersiblings(
209209
self, *tags: _t._TagSelector, preceding: bool = False
@@ -212,7 +212,7 @@ index cc1f37a..9e4a85d 100644
212212
"""Iterate over the following or preceding siblings of this element.
213213

214214
Annotation
215-
@@ -378,7 +378,7 @@ class _Element:
215+
@@ -379,7 +379,7 @@ class _Element:
216216
tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None,
217217
*,
218218
preceding: bool = False,
@@ -221,7 +221,7 @@ index cc1f37a..9e4a85d 100644
221221
"""Iterate over the following or preceding siblings of this element.
222222

223223
Annotation
224-
@@ -393,7 +393,7 @@ class _Element:
224+
@@ -394,7 +394,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 cc1f37a..9e4a85d 100644
230230
"""Iterate over the ancestors of this element (from parent to parent).
231231

232232
Annotation
233-
@@ -409,7 +409,7 @@ class _Element:
233+
@@ -410,7 +410,7 @@ class _Element:
234234
@overload
235235
def iterancestors(
236236
self, tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None
@@ -239,7 +239,7 @@ index cc1f37a..9e4a85d 100644
239239
"""Iterate over the ancestors of this element (from parent to parent).
240240

241241
Annotation
242-
@@ -424,7 +424,7 @@ class _Element:
242+
@@ -425,7 +425,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 cc1f37a..9e4a85d 100644
248248
"""Iterate over the descendants of this element in document order.
249249

250250
Annotation
251-
@@ -440,7 +440,7 @@ class _Element:
251+
@@ -441,7 +441,7 @@ class _Element:
252252
@overload
253253
def iterdescendants(
254254
self, tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None
@@ -257,7 +257,7 @@ index cc1f37a..9e4a85d 100644
257257
"""Iterate over the descendants of this element in document order.
258258

259259
Annotation
260-
@@ -457,7 +457,7 @@ class _Element:
260+
@@ -458,7 +458,7 @@ class _Element:
261261
@overload
262262
def iterchildren(
263263
self, *tags: _t._TagSelector, reversed: bool = False
@@ -266,7 +266,7 @@ index cc1f37a..9e4a85d 100644
266266
"""Iterate over the children of this element.
267267

268268
Annotation
269-
@@ -476,7 +476,7 @@ class _Element:
269+
@@ -477,7 +477,7 @@ class _Element:
270270
tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None,
271271
*,
272272
reversed: bool = False,
@@ -275,7 +275,7 @@ index cc1f37a..9e4a85d 100644
275275
"""Iterate over the children of this element.
276276

277277
Annotation
278-
@@ -491,7 +491,7 @@ class _Element:
278+
@@ -492,7 +492,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 cc1f37a..9e4a85d 100644
284284
"""Iterate over all elements in the subtree in document order (depth
285285
first pre-order), starting with this element.
286286

287-
@@ -507,7 +507,7 @@ class _Element:
287+
@@ -508,7 +508,7 @@ class _Element:
288288
@overload
289289
def iter(
290290
self, tag: _t._TagSelector | Iterable[_t._TagSelector] | None = None
@@ -293,7 +293,7 @@ index cc1f37a..9e4a85d 100644
293293
"""Iterate over all elements in the subtree in document order (depth
294294
first pre-order), starting with this element.
295295

296-
@@ -555,7 +555,7 @@ class _Element:
296+
@@ -556,7 +556,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
"""
@@ -302,7 +302,7 @@ index cc1f37a..9e4a85d 100644
302302
"""Creates a new element associated with the same document.
303303

304304
See Also
305-
@@ -564,7 +564,7 @@ class _Element:
305+
@@ -565,7 +565,7 @@ class _Element:
306306
"""
307307
def find(
308308
self, path: _t._ElemPathArg, namespaces: _t._StrOnlyNSMap | None = None
@@ -311,7 +311,7 @@ index cc1f37a..9e4a85d 100644
311311
"""Creates a new element associated with the same document.
312312

313313
See Also
314-
@@ -607,7 +607,7 @@ class _Element:
314+
@@ -608,7 +608,7 @@ class _Element:
315315
"""
316316
def findall(
317317
self, path: _t._ElemPathArg, namespaces: _t._StrOnlyNSMap | None = None
@@ -320,7 +320,7 @@ index cc1f37a..9e4a85d 100644
320320
"""Finds all matching subelements, by tag name or path.
321321

322322
See Also
323-
@@ -616,7 +616,7 @@ class _Element:
323+
@@ -617,7 +617,7 @@ class _Element:
324324
"""
325325
def iterfind(
326326
self, path: _t._ElemPathArg, namespaces: _t._StrOnlyNSMap | None = None
@@ -329,7 +329,7 @@ index cc1f37a..9e4a85d 100644
329329
"""Iterates over all matching subelements, by tag name or path.
330330

331331
See Also
332-
@@ -644,7 +644,7 @@ class _Element:
332+
@@ -645,7 +645,7 @@ class _Element:
333333
expr: str,
334334
*,
335335
translator: _CSSTransArg = "xml",
@@ -338,7 +338,7 @@ index cc1f37a..9e4a85d 100644
338338
"""Run the CSS expression on this element and its children,
339339
returning a list of the results.
340340

341-
@@ -653,13 +653,13 @@ class _Element:
341+
@@ -654,13 +654,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,10 +352,10 @@ index cc1f37a..9e4a85d 100644
352352
- ) -> Iterator[Self]: ...
353353
+ ) -> Iterator[_Element]: ...
354354

355-
# ET class notation is specialized, indicating the type of element
356-
# it is holding (e.g. XML element, HTML element or Objectified
355+
_ET2_co = TypeVar("_ET2_co", bound=_Element, default=_Element, covariant=True)
356+
357357
diff --git a/src/lxml-stubs/etree/_factory_func.pyi b/src/lxml-stubs/etree/_factory_func.pyi
358-
index c76d234..a30daff 100644
358+
index 3525354..243383f 100644
359359
--- a/src/lxml-stubs/etree/_factory_func.pyi
360360
+++ b/src/lxml-stubs/etree/_factory_func.pyi
361361
@@ -14,7 +14,7 @@ from .._types import (
@@ -364,10 +364,10 @@ index c76d234..a30daff 100644
364364
from ..objectify import ObjectifiedElement, StringElement
365365
-from ._element import _Comment, _ElementTree, _Entity, _ProcessingInstruction
366366
+from ._element import _Comment, _Element, _ElementTree, _Entity, _ProcessingInstruction
367+
from ._parser import CustomTargetParser
367368

368-
def Comment(text: _TextArg | None = None) -> _Comment: ...
369-
def ProcessingInstruction(
370-
@@ -61,13 +61,13 @@ def SubElement(
369+
_T = TypeVar("_T")
370+
@@ -64,13 +64,13 @@ def SubElement(
371371
) -> HtmlElement: ...
372372
@overload
373373
def SubElement(
@@ -381,8 +381,8 @@ index c76d234..a30daff 100644
381381
-) -> _ET: ...
382382
+) -> _Element: ...
383383
@overload # from element, parser ignored
384-
def ElementTree(element: _ET) -> _ElementTree[_ET]: ...
385-
@overload # from file source, custom parser
384+
def ElementTree(element: _ET) -> _ElementTree[_ET]:
385+
"""ElementTree wrapper class for Element objects.
386386
diff --git a/src/lxml-stubs/html/_element.pyi b/src/lxml-stubs/html/_element.pyi
387387
index 52f07a6..8cda2b3 100644
388388
--- a/src/lxml-stubs/html/_element.pyi

0 commit comments

Comments
 (0)