@@ -38,25 +38,109 @@ else:
3838
3939class SerialisationError (LxmlError ): ...
4040
41- # Interface quite similar to a ParserTarget , but canonicalized output
41+ # Usage identical to custom target parser , but canonicalized output
4242# is written during various stages before calling .close()
4343class C14NWriterTarget :
44+ """Canonicalization writer target for the XMLParser. Serialises parse events
45+ to XML C14N 2.0.
46+
47+ Annotation
48+ ----------
49+ Totally 5 overload signatures. The first 4 deal with erroneous usage of
50+ tag or attribute parameters, and final one covers normal usage.
51+
52+ See Also
53+ --------
54+ - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree.C14NWriterTarget)
55+ """
4456 @overload
45- @deprecated ("Should specify a collection or iterator of tags" )
46- def __init__ (self , * args : Any , qname_aware_tags : str , ** kw : Any ) -> Never : ...
57+ @deprecated (
58+ "'qname_aware_tags' should be iterable of tags, "
59+ "otherwise it will silently fail to replace any tag"
60+ )
61+ def __init__ (
62+ self , write : Callable [[str ], object ], * , qname_aware_tags : str , ** kw : Any
63+ ) -> Never :
64+ """Canonicalization writer target for the XMLParser. Serialises parse
65+ events to XML C14N 2.0.
66+
67+ Annotation
68+ ----------
69+ This overload signature handles the case where `exclude_tags` parameter
70+ is wrongly specified as a plain `str`. It will be broken down into
71+ characters and each character will be treated as a single tag.
72+
73+ See Also
74+ --------
75+ - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree.C14NWriterTarget)
76+ """
4777 @overload
48- @deprecated ("Should specify a collection or iterator of attributes" )
49- def __init__ (self , * args : Any , qname_aware_attrs : str , ** kw : Any ) -> Never : ...
78+ @deprecated (
79+ "'qname_aware_attrs' should be iterable of attributes, "
80+ "otherwise it will silently fail to replace any attribute"
81+ )
82+ def __init__ (
83+ self , write : Callable [[str ], object ], * , qname_aware_attrs : str , ** kw : Any
84+ ) -> Never :
85+ """Canonicalization writer target for the XMLParser. Serialises parse
86+ events to XML C14N 2.0.
87+
88+ Annotation
89+ ----------
90+ This overload signature handles the case where `exclude_attrs` parameter
91+ is wrongly specified as a plain `str`. It will be broken down into
92+ characters and each character will be treated as a single attribute.
93+
94+ See Also
95+ --------
96+ - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree.C14NWriterTarget)
97+ """
5098 @overload
51- @deprecated ("Should specify a collection or iterator of attributes" )
52- def __init__ (self , * args : Any , exclude_attrs : str , ** kw : Any ) -> Never : ...
99+ @deprecated (
100+ "'exclude_attrs' should be iterable of attributes, "
101+ "otherwise it will silently fail to exclude anything"
102+ )
103+ def __init__ (
104+ self , write : Callable [[str ], object ], * , exclude_attrs : str , ** kw : Any
105+ ) -> Never :
106+ """Canonicalization writer target for the XMLParser. Serialises parse
107+ events to XML C14N 2.0.
108+
109+ Annotation
110+ ----------
111+ This overload signature handles the case where `exclude_attrs` parameter
112+ is wrongly specified as a plain `str`. It will be broken down into
113+ characters and each character will be treated as a single attribute.
114+
115+ See Also
116+ --------
117+ - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree.C14NWriterTarget)
118+ """
53119 @overload
54- @deprecated ("Should specify a collection or iterator of tags" )
55- def __init__ (self , * args : Any , exclude_tags : str , ** kw : Any ) -> Never : ...
120+ @deprecated (
121+ "'exclude_tags' should be iterable of tags, "
122+ "otherwise it will silently fail to exclude anything"
123+ )
124+ def __init__ (
125+ self , write : Callable [[str ], object ], * , exclude_tags : str , ** kw : Any
126+ ) -> Never :
127+ """Canonicalization writer target for the XMLParser. Serialises parse
128+ events to XML C14N 2.0.
129+
130+ Annotation
131+ ----------
132+ This overload signature handles the case where `exclude_tags` parameter
133+ is wrongly specified as a plain `str`. It will be broken down into
134+ characters and each character will be treated as a single tag.
135+
136+ See Also
137+ --------
138+ - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree.C14NWriterTarget)
139+ """
56140 @overload
57141 def __init__ (
58142 self ,
59- write : Callable [[str ], Any ],
143+ write : Callable [[str ], object ],
60144 * ,
61145 with_comments : bool = False ,
62146 strip_text : bool = False ,
@@ -65,7 +149,19 @@ class C14NWriterTarget:
65149 qname_aware_attrs : Iterable [str ] | None = None ,
66150 exclude_attrs : Iterable [str ] | None = None ,
67151 exclude_tags : Iterable [str ] | None = None ,
68- ) -> None : ...
152+ ) -> None :
153+ """Canonicalization writer target for the XMLParser. Serialises parse
154+ events to XML C14N 2.0.
155+
156+ Annotation
157+ ----------
158+ Totally 5 overload signatures. The first 4 deal with erroneous usage of
159+ tag or attribute parameters, and final one covers normal usage.
160+
161+ See Also
162+ --------
163+ - [API Documentation](https://lxml.de/apidoc/lxml.etree.html#lxml.etree.C14NWriterTarget)
164+ """
69165 def data (self , data : str ) -> None : ...
70166 def start_ns (self , prefix : str , uri : str ) -> None : ...
71167 def start (self , tag : str , attrs : SupportsLaxItems [str , str ] | None ) -> None : ...
0 commit comments