Imported Upstream version 4.1.0
authorHyunjee Kim <hj0426.kim@samsung.com>
Thu, 31 Jan 2019 02:20:24 +0000 (11:20 +0900)
committerHyunjee Kim <hj0426.kim@samsung.com>
Thu, 31 Jan 2019 02:21:24 +0000 (11:21 +0900)
Change-Id: Ib333f4d3fc94168e957f0dc2177daac60d2edc8b
Signed-off-by: Hyunjee Kim <hj0426.kim@samsung.com>
463 files changed:
CHANGES.txt
Makefile
PKG-INFO
buildlibxml.py
doc/api.txt
doc/element_classes.txt
doc/extensions.txt
doc/html/FAQ.html
doc/html/api.html
doc/html/api/abc.ABCMeta-class.html
doc/html/api/api-objects.txt
doc/html/api/class-tree.html
doc/html/api/cssselect.parser.SelectorError-class.html
doc/html/api/cssselect.parser.SelectorSyntaxError-class.html
doc/html/api/cssselect.xpath.ExpressionError-class.html
doc/html/api/cssselect.xpath.XPathExpr-class.html
doc/html/api/deprecated-index.html
doc/html/api/exceptions.AssertionError-class.html
doc/html/api/help.html
doc/html/api/identifier-index-A.html
doc/html/api/identifier-index-B.html
doc/html/api/identifier-index-C.html
doc/html/api/identifier-index-D.html
doc/html/api/identifier-index-E.html
doc/html/api/identifier-index-F.html
doc/html/api/identifier-index-G.html
doc/html/api/identifier-index-H.html
doc/html/api/identifier-index-I.html
doc/html/api/identifier-index-J.html
doc/html/api/identifier-index-K.html
doc/html/api/identifier-index-L.html
doc/html/api/identifier-index-M.html
doc/html/api/identifier-index-N.html
doc/html/api/identifier-index-O.html
doc/html/api/identifier-index-P.html
doc/html/api/identifier-index-Q.html
doc/html/api/identifier-index-R.html
doc/html/api/identifier-index-S.html
doc/html/api/identifier-index-T.html
doc/html/api/identifier-index-U.html
doc/html/api/identifier-index-V.html
doc/html/api/identifier-index-W.html
doc/html/api/identifier-index-X.html
doc/html/api/identifier-index-Y.html
doc/html/api/identifier-index-Z.html
doc/html/api/identifier-index-_.html
doc/html/api/identifier-index.html
doc/html/api/lxml-module.html
doc/html/api/lxml-pysrc.html
doc/html/api/lxml.ElementInclude-module.html
doc/html/api/lxml.ElementInclude-pysrc.html
doc/html/api/lxml.ElementInclude.FatalIncludeError-class.html
doc/html/api/lxml.builder-module.html
doc/html/api/lxml.builder-pysrc.html
doc/html/api/lxml.builder.ElementMaker-class.html
doc/html/api/lxml.cssselect-module.html
doc/html/api/lxml.cssselect-pysrc.html
doc/html/api/lxml.cssselect.CSSSelector-class.html
doc/html/api/lxml.cssselect.LxmlHTMLTranslator-class.html
doc/html/api/lxml.cssselect.LxmlTranslator-class.html
doc/html/api/lxml.doctestcompare-module.html
doc/html/api/lxml.doctestcompare-pysrc.html
doc/html/api/lxml.doctestcompare.LHTMLOutputChecker-class.html
doc/html/api/lxml.doctestcompare.LXMLOutputChecker-class.html
doc/html/api/lxml.doctestcompare._RestoreChecker-class.html
doc/html/api/lxml.etree-module.html
doc/html/api/lxml.etree.AncestorsIterator-class.html
doc/html/api/lxml.etree.AttributeBasedElementClassLookup-class.html
doc/html/api/lxml.etree.C14NError-class.html
doc/html/api/lxml.etree.CDATA-class.html
doc/html/api/lxml.etree.CommentBase-class.html
doc/html/api/lxml.etree.CustomElementClassLookup-class.html
doc/html/api/lxml.etree.DTD-class.html
doc/html/api/lxml.etree.DTDError-class.html
doc/html/api/lxml.etree.DTDParseError-class.html
doc/html/api/lxml.etree.DTDValidateError-class.html
doc/html/api/lxml.etree.DocInfo-class.html
doc/html/api/lxml.etree.DocumentInvalid-class.html
doc/html/api/lxml.etree.ETCompatXMLParser-class.html
doc/html/api/lxml.etree.ETXPath-class.html
doc/html/api/lxml.etree.ElementBase-class.html
doc/html/api/lxml.etree.ElementChildIterator-class.html
doc/html/api/lxml.etree.ElementClassLookup-class.html
doc/html/api/lxml.etree.ElementDefaultClassLookup-class.html
doc/html/api/lxml.etree.ElementDepthFirstIterator-class.html
doc/html/api/lxml.etree.ElementNamespaceClassLookup-class.html
doc/html/api/lxml.etree.ElementTextIterator-class.html
doc/html/api/lxml.etree.EntityBase-class.html
doc/html/api/lxml.etree.Error-class.html
doc/html/api/lxml.etree.ErrorDomains-class.html
doc/html/api/lxml.etree.ErrorLevels-class.html
doc/html/api/lxml.etree.ErrorTypes-class.html
doc/html/api/lxml.etree.FallbackElementClassLookup-class.html
doc/html/api/lxml.etree.HTMLParser-class.html
doc/html/api/lxml.etree.HTMLPullParser-class.html
doc/html/api/lxml.etree.LxmlError-class.html
doc/html/api/lxml.etree.LxmlRegistryError-class.html
doc/html/api/lxml.etree.LxmlSyntaxError-class.html
doc/html/api/lxml.etree.NamespaceRegistryError-class.html
doc/html/api/lxml.etree.PIBase-class.html
doc/html/api/lxml.etree.ParseError-class.html
doc/html/api/lxml.etree.ParserBasedElementClassLookup-class.html
doc/html/api/lxml.etree.ParserError-class.html
doc/html/api/lxml.etree.PyErrorLog-class.html
doc/html/api/lxml.etree.PythonElementClassLookup-class.html
doc/html/api/lxml.etree.QName-class.html
doc/html/api/lxml.etree.RelaxNG-class.html
doc/html/api/lxml.etree.RelaxNGError-class.html
doc/html/api/lxml.etree.RelaxNGErrorTypes-class.html
doc/html/api/lxml.etree.RelaxNGParseError-class.html
doc/html/api/lxml.etree.RelaxNGValidateError-class.html
doc/html/api/lxml.etree.Resolver-class.html
doc/html/api/lxml.etree.Schematron-class.html
doc/html/api/lxml.etree.SchematronError-class.html
doc/html/api/lxml.etree.SchematronParseError-class.html
doc/html/api/lxml.etree.SchematronValidateError-class.html
doc/html/api/lxml.etree.SerialisationError-class.html
doc/html/api/lxml.etree.SiblingsIterator-class.html
doc/html/api/lxml.etree.TreeBuilder-class.html
doc/html/api/lxml.etree.XInclude-class.html
doc/html/api/lxml.etree.XIncludeError-class.html
doc/html/api/lxml.etree.XMLParser-class.html
doc/html/api/lxml.etree.XMLPullParser-class.html
doc/html/api/lxml.etree.XMLSchema-class.html
doc/html/api/lxml.etree.XMLSchemaError-class.html
doc/html/api/lxml.etree.XMLSchemaParseError-class.html
doc/html/api/lxml.etree.XMLSchemaValidateError-class.html
doc/html/api/lxml.etree.XMLSyntaxError-class.html
doc/html/api/lxml.etree.XPath-class.html
doc/html/api/lxml.etree.XPathDocumentEvaluator-class.html
doc/html/api/lxml.etree.XPathElementEvaluator-class.html
doc/html/api/lxml.etree.XPathError-class.html
doc/html/api/lxml.etree.XPathEvalError-class.html
doc/html/api/lxml.etree.XPathFunctionError-class.html
doc/html/api/lxml.etree.XPathResultError-class.html
doc/html/api/lxml.etree.XPathSyntaxError-class.html
doc/html/api/lxml.etree.XSLT-class.html
doc/html/api/lxml.etree.XSLTAccessControl-class.html
doc/html/api/lxml.etree.XSLTApplyError-class.html
doc/html/api/lxml.etree.XSLTError-class.html
doc/html/api/lxml.etree.XSLTExtension-class.html
doc/html/api/lxml.etree.XSLTExtensionError-class.html
doc/html/api/lxml.etree.XSLTParseError-class.html
doc/html/api/lxml.etree.XSLTSaveError-class.html
doc/html/api/lxml.etree._Attrib-class.html
doc/html/api/lxml.etree._BaseErrorLog-class.html
doc/html/api/lxml.etree._Comment-class.html
doc/html/api/lxml.etree._Document-class.html
doc/html/api/lxml.etree._DomainErrorLog-class.html
doc/html/api/lxml.etree._Element-class.html
doc/html/api/lxml.etree._ElementIterator-class.html
doc/html/api/lxml.etree._ElementMatchIterator-class.html
doc/html/api/lxml.etree._ElementStringResult-class.html
doc/html/api/lxml.etree._ElementTagMatcher-class.html
doc/html/api/lxml.etree._ElementTree-class.html
doc/html/api/lxml.etree._ElementUnicodeResult-class.html
doc/html/api/lxml.etree._Entity-class.html
doc/html/api/lxml.etree._ErrorLog-class.html
doc/html/api/lxml.etree._FeedParser-class.html
doc/html/api/lxml.etree._IDDict-class.html
doc/html/api/lxml.etree._ListErrorLog-class.html
doc/html/api/lxml.etree._LogEntry-class.html
doc/html/api/lxml.etree._ProcessingInstruction-class.html
doc/html/api/lxml.etree._RotatingErrorLog-class.html
doc/html/api/lxml.etree._SaxParserTarget-class.html
doc/html/api/lxml.etree._TargetParserResult-class.html
doc/html/api/lxml.etree._Validator-class.html
doc/html/api/lxml.etree._XPathEvaluatorBase-class.html
doc/html/api/lxml.etree._XSLTProcessingInstruction-class.html
doc/html/api/lxml.etree._XSLTResultTree-class.html
doc/html/api/lxml.etree.htmlfile-class.html
doc/html/api/lxml.etree.iterparse-class.html
doc/html/api/lxml.etree.iterwalk-class.html
doc/html/api/lxml.etree.xmlfile-class.html
doc/html/api/lxml.html-module.html
doc/html/api/lxml.html-pysrc.html
doc/html/api/lxml.html.CheckboxGroup-class.html
doc/html/api/lxml.html.CheckboxValues-class.html
doc/html/api/lxml.html.Classes-class.html
doc/html/api/lxml.html.ElementSoup-module.html
doc/html/api/lxml.html.ElementSoup-pysrc.html
doc/html/api/lxml.html.FieldsDict-class.html
doc/html/api/lxml.html.FormElement-class.html
doc/html/api/lxml.html.HTMLParser-class.html
doc/html/api/lxml.html.HtmlComment-class.html
doc/html/api/lxml.html.HtmlElement-class.html
doc/html/api/lxml.html.HtmlElementClassLookup-class.html
doc/html/api/lxml.html.HtmlEntity-class.html
doc/html/api/lxml.html.HtmlMixin-class.html
doc/html/api/lxml.html.HtmlProcessingInstruction-class.html
doc/html/api/lxml.html.InputElement-class.html
doc/html/api/lxml.html.InputGetter-class.html
doc/html/api/lxml.html.InputMixin-class.html
doc/html/api/lxml.html.LabelElement-class.html
doc/html/api/lxml.html.MultipleSelectOptions-class.html
doc/html/api/lxml.html.RadioGroup-class.html
doc/html/api/lxml.html.SelectElement-class.html
doc/html/api/lxml.html.TextareaElement-class.html
doc/html/api/lxml.html.XHTMLParser-class.html
doc/html/api/lxml.html._MethodFunc-class.html
doc/html/api/lxml.html.builder-module.html
doc/html/api/lxml.html.builder-pysrc.html
doc/html/api/lxml.html.clean-module.html
doc/html/api/lxml.html.clean-pysrc.html
doc/html/api/lxml.html.clean.Cleaner-class.html
doc/html/api/lxml.html.defs-module.html
doc/html/api/lxml.html.defs-pysrc.html
doc/html/api/lxml.html.diff-module.html
doc/html/api/lxml.html.diff-pysrc.html
doc/html/api/lxml.html.diff.DEL_END-class.html
doc/html/api/lxml.html.diff.DEL_START-class.html
doc/html/api/lxml.html.diff.InsensitiveSequenceMatcher-class.html
doc/html/api/lxml.html.diff.NoDeletes-class.html
doc/html/api/lxml.html.diff.href_token-class.html
doc/html/api/lxml.html.diff.tag_token-class.html
doc/html/api/lxml.html.diff.token-class.html
doc/html/api/lxml.html.formfill-module.html
doc/html/api/lxml.html.formfill-pysrc.html
doc/html/api/lxml.html.formfill.DefaultErrorCreator-class.html
doc/html/api/lxml.html.formfill.FormNotFound-class.html
doc/html/api/lxml.html.html5parser-module.html
doc/html/api/lxml.html.html5parser-pysrc.html
doc/html/api/lxml.html.html5parser.HTMLParser-class.html
doc/html/api/lxml.html.html5parser.XHTMLParser-class.html
doc/html/api/lxml.html.soupparser-module.html
doc/html/api/lxml.html.soupparser-pysrc.html
doc/html/api/lxml.html.soupparser._PseudoTag-class.html
doc/html/api/lxml.html.usedoctest-module.html
doc/html/api/lxml.html.usedoctest-pysrc.html
doc/html/api/lxml.includes-module.html
doc/html/api/lxml.includes-pysrc.html
doc/html/api/lxml.isoschematron-module.html
doc/html/api/lxml.isoschematron-pysrc.html
doc/html/api/lxml.isoschematron.Schematron-class.html
doc/html/api/lxml.objectify-module.html
doc/html/api/lxml.objectify.BoolElement-class.html
doc/html/api/lxml.objectify.ElementMaker-class.html
doc/html/api/lxml.objectify.FloatElement-class.html
doc/html/api/lxml.objectify.IntElement-class.html
doc/html/api/lxml.objectify.LongElement-class.html
doc/html/api/lxml.objectify.NoneElement-class.html
doc/html/api/lxml.objectify.NumberElement-class.html
doc/html/api/lxml.objectify.ObjectPath-class.html
doc/html/api/lxml.objectify.ObjectifiedDataElement-class.html
doc/html/api/lxml.objectify.ObjectifiedElement-class.html
doc/html/api/lxml.objectify.ObjectifyElementClassLookup-class.html
doc/html/api/lxml.objectify.PyType-class.html
doc/html/api/lxml.objectify.StringElement-class.html
doc/html/api/lxml.pyclasslookup-module.html
doc/html/api/lxml.pyclasslookup-pysrc.html
doc/html/api/lxml.sax-module.html
doc/html/api/lxml.sax-pysrc.html
doc/html/api/lxml.sax.ElementTreeContentHandler-class.html
doc/html/api/lxml.sax.ElementTreeProducer-class.html
doc/html/api/lxml.sax.SaxError-class.html
doc/html/api/lxml.tests-module.html
doc/html/api/lxml.tests-pysrc.html
doc/html/api/lxml.tests.common_imports-module.html
doc/html/api/lxml.tests.common_imports-pysrc.html
doc/html/api/lxml.tests.common_imports.HelperTestCase-class.html
doc/html/api/lxml.tests.common_imports.LargeFileLike-class.html
doc/html/api/lxml.tests.common_imports.LargeFileLikeUnicode-class.html
doc/html/api/lxml.tests.common_imports.SillyFileLike-class.html
doc/html/api/lxml.tests.common_imports.skipif-class.html
doc/html/api/lxml.tests.dummy_http_server-module.html
doc/html/api/lxml.tests.dummy_http_server-pysrc.html
doc/html/api/lxml.tests.dummy_http_server.HTTPRequestCollector-class.html
doc/html/api/lxml.tests.dummy_http_server.WebServer-class.html
doc/html/api/lxml.tests.dummy_http_server._RequestHandler-class.html
doc/html/api/lxml.tests.selftest-module.html
doc/html/api/lxml.tests.selftest-pysrc.html
doc/html/api/lxml.tests.selftest2-module.html
doc/html/api/lxml.tests.selftest2-pysrc.html
doc/html/api/lxml.tests.test_builder-module.html
doc/html/api/lxml.tests.test_builder-pysrc.html
doc/html/api/lxml.tests.test_builder.BuilderTestCase-class.html
doc/html/api/lxml.tests.test_classlookup-module.html
doc/html/api/lxml.tests.test_classlookup-pysrc.html
doc/html/api/lxml.tests.test_classlookup.ClassLookupTestCase-class.html
doc/html/api/lxml.tests.test_classlookup.ProxyTestCase-class.html
doc/html/api/lxml.tests.test_css-module.html
doc/html/api/lxml.tests.test_css-pysrc.html
doc/html/api/lxml.tests.test_css.CSSTestCase-class.html
doc/html/api/lxml.tests.test_doctestcompare-module.html
doc/html/api/lxml.tests.test_doctestcompare-pysrc.html
doc/html/api/lxml.tests.test_doctestcompare.DoctestCompareTest-class.html
doc/html/api/lxml.tests.test_doctestcompare.DummyInput-class.html
doc/html/api/lxml.tests.test_dtd-module.html
doc/html/api/lxml.tests.test_dtd-pysrc.html
doc/html/api/lxml.tests.test_dtd.ETreeDtdTestCase-class.html
doc/html/api/lxml.tests.test_elementpath-module.html
doc/html/api/lxml.tests.test_elementpath-pysrc.html
doc/html/api/lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html
doc/html/api/lxml.tests.test_elementtree-module.html
doc/html/api/lxml.tests.test_elementtree-pysrc.html
doc/html/api/lxml.tests.test_elementtree.CElementTreeTestCase-class.html
doc/html/api/lxml.tests.test_elementtree.ETreePullTestCase-class.html
doc/html/api/lxml.tests.test_elementtree.ETreeTestCase-class.html
doc/html/api/lxml.tests.test_elementtree.ElementTreeTestCase-class.html
doc/html/api/lxml.tests.test_elementtree._ETreeTestCaseBase-class.html
doc/html/api/lxml.tests.test_elementtree._XMLPullParserTest-class.html
doc/html/api/lxml.tests.test_errors-module.html
doc/html/api/lxml.tests.test_errors-pysrc.html
doc/html/api/lxml.tests.test_errors.ErrorTestCase-class.html
doc/html/api/lxml.tests.test_etree-module.html
doc/html/api/lxml.tests.test_etree-pysrc.html
doc/html/api/lxml.tests.test_etree.ETreeC14NTestCase-class.html
doc/html/api/lxml.tests.test_etree.ETreeErrorLogTest-class.html
doc/html/api/lxml.tests.test_etree.ETreeOnlyTestCase-class.html
doc/html/api/lxml.tests.test_etree.ETreeWriteTestCase-class.html
doc/html/api/lxml.tests.test_etree.ETreeXIncludeTestCase-class.html
doc/html/api/lxml.tests.test_etree.ElementIncludeTestCase-class.html
doc/html/api/lxml.tests.test_etree.XMLPullParserTest-class.html
doc/html/api/lxml.tests.test_etree._XIncludeTestCase-class.html
doc/html/api/lxml.tests.test_external_document-module.html
doc/html/api/lxml.tests.test_external_document-pysrc.html
doc/html/api/lxml.tests.test_external_document.ExternalDocumentTestCase-class.html
doc/html/api/lxml.tests.test_htmlparser-module.html
doc/html/api/lxml.tests.test_htmlparser-pysrc.html
doc/html/api/lxml.tests.test_htmlparser.HtmlParserTestCase-class.html
doc/html/api/lxml.tests.test_http_io-module.html
doc/html/api/lxml.tests.test_http_io-pysrc.html
doc/html/api/lxml.tests.test_http_io.HttpIOTestCase-class.html
doc/html/api/lxml.tests.test_incremental_xmlfile-module.html
doc/html/api/lxml.tests.test_incremental_xmlfile-pysrc.html
doc/html/api/lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html
doc/html/api/lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase-class.html
doc/html/api/lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html
doc/html/api/lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html
doc/html/api/lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html
doc/html/api/lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html
doc/html/api/lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase-class.html
doc/html/api/lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html
doc/html/api/lxml.tests.test_io-module.html
doc/html/api/lxml.tests.test_io-pysrc.html
doc/html/api/lxml.tests.test_io.ETreeIOTestCase-class.html
doc/html/api/lxml.tests.test_io.ElementTreeIOTestCase-class.html
doc/html/api/lxml.tests.test_io._IOTestCaseBase-class.html
doc/html/api/lxml.tests.test_isoschematron-module.html
doc/html/api/lxml.tests.test_isoschematron-pysrc.html
doc/html/api/lxml.tests.test_isoschematron.ETreeISOSchematronTestCase-class.html
doc/html/api/lxml.tests.test_nsclasses-module.html
doc/html/api/lxml.tests.test_nsclasses-pysrc.html
doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html
doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.bluff_class-class.html
doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.default_class-class.html
doc/html/api/lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase.maeh_class-class.html
doc/html/api/lxml.tests.test_objectify-module.html
doc/html/api/lxml.tests.test_objectify-pysrc.html
doc/html/api/lxml.tests.test_objectify.ObjectifyTestCase-class.html
doc/html/api/lxml.tests.test_pyclasslookup-module.html
doc/html/api/lxml.tests.test_pyclasslookup-pysrc.html
doc/html/api/lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html
doc/html/api/lxml.tests.test_relaxng-module.html
doc/html/api/lxml.tests.test_relaxng-pysrc.html
doc/html/api/lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html
doc/html/api/lxml.tests.test_relaxng.RelaxNGCompactTestCase-class.html
doc/html/api/lxml.tests.test_sax-module.html
doc/html/api/lxml.tests.test_sax-pysrc.html
doc/html/api/lxml.tests.test_sax.ETreeSaxTestCase-class.html
doc/html/api/lxml.tests.test_schematron-module.html
doc/html/api/lxml.tests.test_schematron-pysrc.html
doc/html/api/lxml.tests.test_schematron.ETreeSchematronTestCase-class.html
doc/html/api/lxml.tests.test_threading-module.html
doc/html/api/lxml.tests.test_threading-pysrc.html
doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase-class.html
doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker-class.html
doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker-class.html
doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker-class.html
doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.ReverseWorker-class.html
doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.RotateWorker-class.html
doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker-class.html
doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.Validate-class.html
doc/html/api/lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html
doc/html/api/lxml.tests.test_threading.ThreadingTestCase-class.html
doc/html/api/lxml.tests.test_unicode-module.html
doc/html/api/lxml.tests.test_unicode-pysrc.html
doc/html/api/lxml.tests.test_unicode.EncodingsTestCase-class.html
doc/html/api/lxml.tests.test_unicode.UnicodeTestCase-class.html
doc/html/api/lxml.tests.test_xmlschema-module.html
doc/html/api/lxml.tests.test_xmlschema-pysrc.html
doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html
doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html
doc/html/api/lxml.tests.test_xmlschema.ETreeXMLSchemaTestCase-class.html
doc/html/api/lxml.tests.test_xpathevaluator-module.html
doc/html/api/lxml.tests.test_xpathevaluator-pysrc.html
doc/html/api/lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html
doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathClassTestCase-class.html
doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html
doc/html/api/lxml.tests.test_xpathevaluator.ETreeXPathTestCase-class.html
doc/html/api/lxml.tests.test_xslt-module.html
doc/html/api/lxml.tests.test_xslt-pysrc.html
doc/html/api/lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html
doc/html/api/lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html
doc/html/api/lxml.tests.test_xslt.ETreeXSLTExtFuncTestCase-class.html
doc/html/api/lxml.tests.test_xslt.ETreeXSLTTestCase-class.html
doc/html/api/lxml.tests.test_xslt.Py3XSLTTestCase-class.html
doc/html/api/lxml.usedoctest-module.html
doc/html/api/lxml.usedoctest-pysrc.html
doc/html/api/mimetools.Message-class.html
doc/html/api/module-tree.html
doc/html/api/str-class.html
doc/html/api/toc-everything.html
doc/html/api/toc-lxml.tests.test_elementpath-module.html
doc/html/api/xml.etree.ElementTree-module.html
doc/html/api/xml.etree.ElementTree-pysrc.html
doc/html/api/xml.etree.ElementTree.Element-class.html
doc/html/api/xml.etree.ElementTree.ElementTree-class.html
doc/html/api/xml.etree.ElementTree.ParseError-class.html
doc/html/api/xml.etree.ElementTree.QName-class.html
doc/html/api/xml.etree.ElementTree.TreeBuilder-class.html
doc/html/api/xml.etree.ElementTree.XMLParser-class.html
doc/html/api/xml.etree.ElementTree._IterParseIterator-class.html
doc/html/api/xml.etree.ElementTree._SimpleElementPath-class.html
doc/html/build.html
doc/html/capi.html
doc/html/changes-4.0.0.html [deleted file]
doc/html/changes-4.1.0.html [new file with mode: 0644]
doc/html/compatibility.html
doc/html/credits.html
doc/html/cssselect.html
doc/html/element_classes.html
doc/html/elementsoup.html
doc/html/extensions.html
doc/html/html5parser.html
doc/html/index.html
doc/html/installation.html
doc/html/intro.html
doc/html/lxml-source-howto.html
doc/html/lxmlhtml.html
doc/html/objectify.html
doc/html/parsing.html
doc/html/performance.html
doc/html/resolvers.html
doc/html/sax.html
doc/html/sitemap.html
doc/html/tutorial.html
doc/html/validation.html
doc/html/xpathxslt.html
doc/main.txt
setup.cfg
setupinfo.py
src/lxml.egg-info/PKG-INFO
src/lxml.egg-info/SOURCES.txt
src/lxml/_elementpath.c
src/lxml/_elementpath.py
src/lxml/builder.c
src/lxml/classlookup.pxi
src/lxml/etree.c
src/lxml/etree.h
src/lxml/etree.pyx
src/lxml/etree_api.h
src/lxml/html/clean.c
src/lxml/html/diff.c
src/lxml/includes/lxml-version.h
src/lxml/lxml.etree.h
src/lxml/lxml.etree_api.h
src/lxml/nsclasses.pxi
src/lxml/objectify.c
src/lxml/tests/test_elementpath.py
src/lxml/tests/test_pyclasslookup.py
tools/manylinux/build-wheels.sh
version.txt

index efff6d3a56599c4fe561998a5069d50cb28690b0..5d28d35a973a67165ea94aa161682f32d54ff709 100644 (file)
@@ -2,6 +2,30 @@
 lxml changelog
 ==============
 
+4.1.0 (2017-10-13)
+==================
+
+Features added
+--------------
+
+* ElementPath supports text predicates for current node, like "[.='text']".
+
+* ElementPath allows spaces in predicates.
+
+* Custom Element classes and XPath functions can now be registered with a
+  decorator rather than explicit dict assignments.
+
+* Static Linux wheels are now built with link time optimisation (LTO) enabled.
+  This should have a beneficial impact on the overall performance by providing
+  a tighter compiler integration between lxml and libxml2/libxslt.
+
+Bugs fixed
+----------
+
+* LP#1722776: Requesting non-Element objects like comments from a document with
+  ``PythonElementClassLookup`` could fail with a TypeError.
+
+
 4.0.0 (2017-09-17)
 ==================
 
index 0b4c82efb6428fa868cc46304bf5f61e36796dfd..9a2e2234b69a8145f7fde5e208331c91e603e6a1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -43,15 +43,16 @@ require-cython:
        @[ -n "$(PYTHON_WITH_CYTHON)" ] || { \
            echo "NOTE: missing Cython - please use this command to install it: $(PYTHON) -m pip install Cython"; false; }
 
-wheel_manylinux: wheel_manylinux64   # wheel_manylinux32
+wheel_manylinux: wheel_manylinux64 wheel_manylinux32
 
 wheel_manylinux32 wheel_manylinux64: dist/lxml-$(LXMLVERSION).tar.gz
        time docker run --rm -t \
                -v $(shell pwd):/io \
-               -e CFLAGS="-O3 -mtune=generic -pipe -fPIC" \
-               -e LDFLAGS="$(LDFLAGS)" \
+               -e CFLAGS="-O3 -g1 -mtune=generic -pipe -fPIC -flto" \
+               -e LDFLAGS="$(LDFLAGS) -flto" \
                -e LIBXML2_VERSION="$(MANYLINUX_LIBXML2_VERSION)" \
                -e LIBXSLT_VERSION="$(MANYLINUX_LIBXSLT_VERSION)" \
+               -e WHEELHOUSE=wheelhouse_$(subst wheel_,,$@) \
                $(if $(patsubst %32,,$@),$(MANYLINUX_IMAGE_X86_64),$(MANYLINUX_IMAGE_686)) \
                bash /io/tools/manylinux/build-wheels.sh /io/$<
 
index 535f725af8197b259deef84659af32dcc5113687..06477a3c24f18d1f799675d0d7fb1a43bca031b2 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: lxml
-Version: 4.0.0
+Version: 4.1.0
 Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
 Home-page: http://lxml.de/
 Author: lxml dev team
@@ -29,76 +29,35 @@ Description: lxml is a Pythonic, mature binding for the libxml2 and libxslt libr
         
         After an official release of a new stable series, bug fixes may become
         available at
-        https://github.com/lxml/lxml/tree/lxml-4.0 .
-        Running ``easy_install lxml==4.0bugfix`` will install
+        https://github.com/lxml/lxml/tree/lxml-4.1 .
+        Running ``easy_install lxml==4.1bugfix`` will install
         the unreleased branch state from
-        https://github.com/lxml/lxml/tarball/lxml-4.0#egg=lxml-4.0bugfix
+        https://github.com/lxml/lxml/tarball/lxml-4.1#egg=lxml-4.1bugfix
         as soon as a maintenance branch has been established.  Note that this
         requires Cython to be installed at an appropriate version for the build.
         
-        4.0.0 (2017-09-17)
+        4.1.0 (2017-10-13)
         ==================
         
         Features added
         --------------
         
-        * The ElementPath implementation is now compiled using Cython,
-          which speeds up the ``.find*()`` methods quite significantly.
+        * ElementPath supports text predicates for current node, like "[.='text']".
         
-        * The modules ``lxml.builder``, ``lxml.html.diff`` and ``lxml.html.clean``
-          are also compiled using Cython in order to speed them up.
+        * ElementPath allows spaces in predicates.
         
-        * ``xmlfile()`` supports async coroutines using ``async with`` and ``await``.
+        * Custom Element classes and XPath functions can now be registered with a
+          decorator rather than explicit dict assignments.
         
-        * ``iterwalk()`` has a new method ``skip_subtree()`` that prevents walking into
-          the descendants of the current element.
-        
-        * ``RelaxNG.from_rnc_string()`` accepts a ``base_url`` argument to
-          allow relative resource lookups.
-        
-        * The XSLT result object has a new method ``.write_output(file)`` that serialises
-          output data into a file according to the ``<xsl:output>`` configuration.
+        * Static Linux wheels are now built with link time optimisation (LTO) enabled.
+          This should have a beneficial impact on the overall performance by providing
+          a tighter compiler integration between lxml and libxml2/libxslt.
         
         Bugs fixed
         ----------
         
-        * GH#251: HTML comments were handled incorrectly by the soupparser.
-          Patch by mozbugbox.
-        
-        * LP#1654544: The html5parser no longer passes the ``useChardet`` option
-          if the input is a Unicode string, unless explicitly requested.  When parsing
-          files, the default is to enable it when a URL or file path is passed (because
-          the file is then opened in binary mode), and to disable it when reading from
-          a file(-like) object.
-        
-          Note: This is a backwards incompatible change of the default configuration.
-          If your code parses byte strings/streams and depends on character detection,
-          please pass the option ``guess_charset=True`` explicitly, which already worked
-          in older lxml versions.
-        
-        * LP#1703810: ``etree.fromstring()`` failed to parse UTF-32 data with BOM.
-        
-        * LP#1526522: Some RelaxNG errors were not reported in the error log.
-        
-        * LP#1567526: Empty and plain text input raised a TypeError in soupparser.
-        
-        * LP#1710429: Uninitialised variable usage in HTML diff.
-        
-        * LP#1415643: The closing tags context manager in ``xmlfile()`` could continue
-          to output end tags even after writing failed with an exception.
-        
-        * LP#1465357: ``xmlfile.write()`` now accepts and ignores None as input argument.
-        
-        * Compilation under Py3.7-pre failed due to a modified function signature.
-        
-        Other changes
-        -------------
-        
-        * The main module source files were renamed from ``lxml.*.pyx`` to plain
-          ``*.pyx`` (e.g. ``etree.pyx``) to simplify their handling in the build
-          process.  Care was taken to keep the old header files as fallbacks for
-          code that compiles against the public C-API of lxml, but it might still
-          be worth validating that third-party code does not notice this change.
+        * LP#1722776: Requesting non-Element objects like comments from a document with
+          ``PythonElementClassLookup`` could fail with a TypeError.
         
         
         
index 1695978eedc89fad8d3d30794d757449c757afe8..6c9b33ae784e4a303bdc600431139f58f9a533b9 100644 (file)
@@ -25,35 +25,34 @@ except:
 
 # use pre-built libraries on Windows
 
-def download_and_extract_zlatkovic_binaries(destdir):
+def download_and_extract_windows_binaries(destdir):
+    url = "https://github.com/mhils/libxml2-win-binaries/releases"
+    filenames = list(_list_dir_urllib(url))
+
+    release_path = "/download/%s/" % find_max_version(
+        "library release", filenames, re.compile(r"/releases/tag/([0-9.]+[0-9])$"))
+    url += release_path
+    filenames = [
+        filename.rsplit('/', 1)[1]
+        for filename in filenames
+        if release_path in filename
+    ]
+
+    arch = "win64" if sys.maxsize > 2**32 else "win32"
     if sys.version_info < (3, 5):
-        url = 'ftp://ftp.zlatkovic.com/pub/libxml/'
-        libs = dict(
-            libxml2  = None,
-            libxslt  = None,
-            zlib     = None,
-            iconv    = None,
-        )
-        for fn in ftp_listdir(url):
-            for libname in libs:
-                if fn.startswith(libname):
-                    assert libs[libname] is None, 'duplicate listings?'
-                    assert fn.endswith('.win32.zip')
-                    libs[libname] = fn
-    else:
-        if sys.maxsize > 2147483647:
-            arch = "win64"
-        else:
-            arch = "win32"
-        url = "https://github.com/mhils/libxml2-win-binaries/releases/download/lxml/"
-        libs = dict(
-            libxml2  = "libxml2-latest.{}.zip".format(arch),
-            libxslt  = "libxslt-latest.{}.zip".format(arch),
-            zlib     = "zlib-latest.{}.zip".format(arch),
-            iconv    = "iconv-latest.{}.zip".format(arch),
+        arch = 'vs2008.' + arch
+
+    libs = {}
+    for libname in ['libxml2', 'libxslt', 'zlib', 'iconv']:
+        libs[libname] = "%s-%s.%s.zip" % (
+            libname,
+            find_max_version(libname, filenames),
+            arch,
         )
 
-    if not os.path.exists(destdir): os.makedirs(destdir)
+    if not os.path.exists(destdir):
+        os.makedirs(destdir)
+
     for libname, libfn in libs.items():
         srcfile = urljoin(url, libfn)
         destfile = os.path.join(destdir, libfn)
@@ -103,7 +102,7 @@ def unpack_zipfile(zipfn, destdir):
 
 def get_prebuilt_libxml2xslt(download_dir, static_include_dirs, static_library_dirs):
     assert sys.platform.startswith('win')
-    libs = download_and_extract_zlatkovic_binaries(download_dir)
+    libs = download_and_extract_windows_binaries(download_dir)
     for libname, path in libs.items():
         i = os.path.join(path, 'include')
         l = os.path.join(path, 'lib')
@@ -133,11 +132,11 @@ def _find_content_encoding(response, default='iso8859-1'):
     return charset
 
 
-def ftp_listdir(url):
-    assert url.lower().startswith('ftp://')
+def remote_listdir(url):
     try:
         return _list_dir_urllib(url)
     except IOError:
+        assert url.lower().startswith('ftp://')
         print("Requesting with urllib failed. Falling back to ftplib. Proxy argument will be ignored")
         return _list_dir_ftplib(url)
 
@@ -163,7 +162,7 @@ def _list_dir_urllib(url):
 
     data = data.decode(charset)
     if content_type and content_type.startswith('text/html'):
-        files = parse_html_ftplist(data)
+        files = parse_html_filelist(data)
     else:
         files = parse_text_ftplist(data)
     return files
@@ -186,8 +185,10 @@ def parse_text_ftplist(s):
             yield line.split(None, 8)[-1]
 
 
-def parse_html_ftplist(s):
-    re_href = re.compile(r'<a\s+(?:[^>]*?\s+)?href=["\'](.*?)[;\?"\']', re.I|re.M)
+def parse_html_filelist(s):
+    re_href = re.compile(
+        r'<a\s+(?:[^>]*\s+)?href=["\']([^;?"\']+?)[;?"\']',
+        re.I|re.M)
     links = set(re_href.findall(s))
     for link in links:
         if not link.endswith('/'):
@@ -233,28 +234,34 @@ def download_zlib(dest_dir, version):
                             version_re, filename, version=version)
 
 
+def find_max_version(libname, filenames, version_re=None):
+    if version_re is None:
+        version_re = re.compile(r'%s-([0-9.]+[0-9])' % libname)
+    versions = []
+    for fn in filenames:
+        match = version_re.search(fn)
+        if match:
+            version_string = match.group(1)
+            versions.append((tuple(map(tryint, version_string.split('.'))),
+                             version_string))
+    if not versions:
+        raise Exception(
+            "Could not find the most current version of %s from the files: %s" % (
+                libname, filenames))
+    versions.sort()
+    version_string = versions[-1][-1]
+    print('Latest version of %s is %s' % (libname, version_string))
+    return version_string
+
+
 def download_library(dest_dir, location, name, version_re, filename, version=None):
     if version is None:
         try:
             if location.startswith('ftp://'):
-                fns = ftp_listdir(location)
+                fns = remote_listdir(location)
             else:
                 fns = http_listfiles(location, filename.replace('%s', '(?:[0-9.]+[0-9])'))
-            versions = []
-            for fn in fns:
-                match = version_re.search(fn)
-                if match:
-                    version_string = match.group(1)
-                    versions.append((tuple(map(tryint, version_string.split('.'))),
-                                     version_string))
-            if versions:
-                versions.sort()
-                version = versions[-1][-1]
-                print('Latest version of %s is %s' % (name, version))
-            else:
-                raise Exception(
-                    "Could not find the most current version of the %s from the files: %s"
-                    % (name, fns))
+            version = find_max_version(name, fns, version_re)
         except IOError:
             # network failure - maybe we have the files already?
             latest = (0,0,0)
@@ -275,11 +282,12 @@ def download_library(dest_dir, location, name, version_re, filename, version=Non
     full_url = urljoin(location, filename)
     dest_filename = os.path.join(dest_dir, filename)
     if os.path.exists(dest_filename):
-        print('Using existing %s downloaded into %s (delete this file if you want to re-download the package)'
-              % (name, dest_filename))
+        print(('Using existing %s downloaded into %s '
+               '(delete this file if you want to re-download the package)') % (
+            name, dest_filename))
     else:
         print('Downloading %s into %s from %s' % (name, dest_filename, full_url))
-        urlcleanup()  # work around FTP bug 27973 in Py2.7.12+
+        urlcleanup()  # work around FTP bug 27973 in Py2.7.12
         urlretrieve(full_url, dest_filename)
     return dest_filename
 
@@ -292,9 +300,8 @@ def unpack_tarball(tar_filename, dest):
         base_name = member.name.split('/')[0]
         if base_dir is None:
             base_dir = base_name
-        else:
-            if base_dir != base_name:
-                print('Unexpected path in %s: %s' % (tar_filename, base_name))
+        elif base_dir != base_name:
+            print('Unexpected path in %s: %s' % (tar_filename, base_name))
     tar.extractall(dest)
     tar.close()
     return os.path.join(dest, base_dir)
index 6d464988c106c23fe00adfb4b64184a257b40cdb..d4f2c48ffe92f7da74a46c4b85514cfbbfc4bc8a 100644 (file)
@@ -571,6 +571,15 @@ supported since lxml 4.0.  The output stream is expected to have methods
                       await xf.write(el)
                       await xf.flush()
 
+
+    class DummyAsyncOut(object):
+        async def write(self, data):
+            print(data.decode('utf8'))
+
+        async def close(self):
+             pass
+
+    stream = DummyAsyncOut()
     async_writer = writer(stream, async_message_stream)
 
 
index e3476633b7eeb8b65b780e7be05a7c810cabb346..4b1e72e8e264f1f90467c7f11c2d408d69c04523 100644 (file)
@@ -211,7 +211,9 @@ Default class lookup
 
 This is the most simple lookup mechanism.  It always returns the default
 element class.  Consequently, no further fallbacks are supported, but this
-scheme is a nice fallback for other custom lookup mechanisms.
+scheme is a nice fallback for other custom lookup mechanisms.  Specifically,
+it also handles comments and processing instructions, which are easy to
+forget about when mapping proxies to classes.
 
 Usage:
 
@@ -248,6 +250,13 @@ the constructor.  While it accepts classes for ``element``, ``comment`` and
   >>> el.honking
   True
 
+  >>> root = etree.fromstring(
+  ...     '<root honking="true"><!--comment--></root>', parser)
+  >>> root.honking
+  True
+  >>> print(root[0].text)
+  comment
+
 
 Namespace class lookup
 ----------------------
@@ -277,6 +286,13 @@ desired fallback lookup scheme to the constructor:
   >>> lookup = etree.ElementNamespaceClassLookup(fallback)
   >>> parser.set_element_class_lookup(lookup)
 
+  >>> root = etree.fromstring(
+  ...     '<root honking="true"><!--comment--></root>', parser)
+  >>> root.honking
+  True
+  >>> print(root[0].text)
+  comment
+
 
 Attribute based lookup
 ----------------------
@@ -334,11 +350,21 @@ basis.  It allows you to implement a custom lookup scheme in a subclass:
 
   >>> class MyLookup(etree.CustomElementClassLookup):
   ...     def lookup(self, node_type, document, namespace, name):
-  ...         return honk # be a bit more selective here ...
+  ...         if node_type == 'element':
+  ...             return honk  # be a bit more selective here ...
+  ...         else:
+  ...             return None  # pass on to (default) fallback
 
   >>> parser = etree.XMLParser()
   >>> parser.set_element_class_lookup(MyLookup())
 
+  >>> root = etree.fromstring(
+  ...     '<root honking="true"><!--comment--></root>', parser)
+  >>> root.honking
+  True
+  >>> print(root[0].text)
+  comment
+
 The ``.lookup()`` method must return either None (which triggers the
 fallback mechanism) or a subclass of ``lxml.etree.ElementBase``.  It
 can take any decision it wants based on the node type (one of
@@ -400,7 +426,7 @@ this class will simply create a new Element:
 
 .. sourcecode:: pycon
 
-  >>> el = honk(honking = 'true')
+  >>> el = honk(honking='true')
   >>> el.tag
   'honk'
   >>> el.honking
@@ -452,7 +478,7 @@ name ``honk``:
 
 If you have many Element classes declared in one module, and they are
 all named like the elements they create, you can simply use
-``namespace.update(vars())`` at the end of your module to declare them
+``namespace.update(globals())`` at the end of your module to declare them
 automatically.  The implementation is smart enough to ignore
 everything that is not an Element class.
 
@@ -479,7 +505,7 @@ Essentially, what this allows you to do, is to give Elements a custom API
 based on their namespace and tag name.
 
 A somewhat related topic are `extension functions`_ which use a similar
-mechanism for registering extension functions in XPath and XSLT.
+mechanism for registering Python functions for use in XPath and XSLT.
 
 .. _`extension functions`: extensions.html
 
@@ -490,21 +516,25 @@ implementation:
 
 .. sourcecode:: pycon
 
-  >>> xml = '<honk xmlns="http://hui.de/honk" honking="true"><bla/></honk>'
+  >>> xml = ('<honk xmlns="http://hui.de/honk" honking="true">'
+  ...        '<bla/><!--comment-->'
+  ...        '</honk>')
   >>> honk_element = etree.XML(xml, parser)
   >>> print(honk_element.honking)
   True
   >>> print(honk_element[0].honking)
   Traceback (most recent call last):
-  ...
+    ...
   AttributeError: 'lxml.etree._Element' object has no attribute 'honking'
+  >>> print(honk_element[1].text)
+  comment
 
 You can therefore provide one implementation per element name in each
 namespace and have lxml select the right one on the fly.  If you want one
 element implementation per namespace (ignoring the element name) or prefer
 having a common class for most elements except a few, you can specify a
 default implementation for an entire namespace by registering that class with
-the empty element name (None).
+the empty element name (``None``).
 
 You may consider following an object oriented approach here.  If you build a
 class hierarchy of element classes, you can also implement a base class for a
@@ -516,21 +546,23 @@ can just pass None as an element name:
   >>> class HonkNSElement(etree.ElementBase):
   ...    def honk(self):
   ...       return "HONK"
-  >>> namespace[None] = HonkNSElement # default Element for namespace
+  >>> namespace[None] = HonkNSElement  # default Element for namespace
 
   >>> class HonkElement(HonkNSElement):
   ...    @property
   ...    def honking(self):
   ...       return self.get('honking') == 'true'
-  >>> namespace['honk'] = HonkElement # Element for specific tag
+  >>> namespace['honk'] = HonkElement  # Element for specific tag
 
 Now you can rely on lxml to always return objects of type HonkNSElement or its
 subclasses for elements of this namespace:
 
 .. sourcecode:: pycon
 
-  >>> xml = '<honk xmlns="http://hui.de/honk" honking="true"><bla/></honk>'
-  >>> honk_element = etree.XML(xml, parser)
+  >>> xml = ('<honk xmlns="http://hui.de/honk" honking="true">'
+  ...        '<bla/><!--comment-->'
+  ...        '</honk>')
+  >>> honk_element = etree.fromstring(xml, parser)
 
   >>> print(type(honk_element))
   <class 'HonkElement'>
@@ -548,3 +580,36 @@ subclasses for elements of this namespace:
   Traceback (most recent call last):
   ...
   AttributeError: 'HonkNSElement' object has no attribute 'honking'
+
+  >>> print(honk_element[1].text)  # uses fallback for non-elements
+  comment
+
+Since lxml 4.1, the registration is more conveniently done with
+class decorators.  The namespace registry object is callable with
+a name (or ``None``) as argument and can then be used as decorator.
+
+.. sourcecode:: pycon
+
+  >>> honk_elements = lookup.get_namespace('http://hui.de/honk')
+
+  >>> @honk_elements(None)
+  ... class HonkNSElement(etree.ElementBase):
+  ...    def honk(self):
+  ...       return "HONK"
+
+If the class has the same name as the tag, you can also leave out the call
+and use the blank decorator instead:
+
+  >>> @honk_elements
+  ... class honkel(HonkNSElement):
+  ...    @property
+  ...    def honking(self):
+  ...       return self.get('honking') == 'true'
+
+  >>> xml = '<honkel xmlns="http://hui.de/honk" honking="true"><bla/><!--comment--></honkel>'
+  >>> honk_element = etree.fromstring(xml, parser)
+
+  >>> print(type(honk_element))
+  <class 'honkel'>
+  >>> print(type(honk_element[0]))
+  <class 'HonkNSElement'>
index 287fb649c449b7d61e1aa6f726bb5a44c9e0e979..45bcf9795486ed722bb1c294f53cf1cb2f9bbb47 100644 (file)
@@ -78,6 +78,17 @@ the empty namespace (None):
 
 This registers the function `hello` with the name `hello` in the default
 namespace (None), and the function `loadsofargs` with the name `countargs`.
+
+Since lxml 4.1, it is preferred to use the ``FunctionNamespace`` as a decorator.
+Either pass an explicit function name (``@ns("countargs")``), or just use the
+bare decorator to register the function under its own name:
+
+.. sourcecode:: pycon
+
+  >>> @ns
+  ... def hello(context, a):
+  ...    return "Hello %s" % a
+
 Now we're going to create a document that we can run XPath expressions
 against:
 
@@ -99,8 +110,8 @@ Done. Now we can have XPath expressions call our new function:
   >>> print(root.xpath('countargs(., b, ./*)'))
   Got 3 arguments.
 
-Note how we call both a Python function (`hello`) and an XPath built-in
-function (`string`) in exactly the same way.  Normally, however, you would
+Note how we call both a Python function (``hello()``) and an XPath built-in
+function (``string()``) in exactly the same way.  Normally, however, you would
 want to separate the two in different namespaces.  The FunctionNamespace class
 allows you to do this:
 
@@ -108,6 +119,7 @@ allows you to do this:
 
   >>> ns = etree.FunctionNamespace('http://mydomain.org/myfunctions')
   >>> ns['hello'] = hello
+
   >>> prefixmap = {'f' : 'http://mydomain.org/myfunctions'}
   >>> print(root.xpath('f:hello(local-name(*))', namespaces=prefixmap))
   Hello b
@@ -125,6 +137,7 @@ register it with the namespace:
   >>> ns = etree.FunctionNamespace('http://mydomain.org/myother/functions')
   >>> ns.prefix = 'es'
   >>> ns['hello'] = ola
+
   >>> print(root.xpath('es:hello(local-name(*))'))
   Ola b
 
index 0b2cb6421f7e262fe1a4ba705176ebcd5ce6fad0..e5003d3f54b2edb86eebb2a2718e469fdb41c3c4 100644 (file)
@@ -26,7 +26,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="lxml-faq-frequently-asked-questions">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu current" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">lxml FAQ - Frequently Asked Questions</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu current" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">lxml FAQ - Frequently Asked Questions</h1>
 
 <p>Frequently asked questions on lxml.  See also the notes on <a class="reference external" href="compatibility.html">compatibility</a> to
 <a class="reference external" href="http://effbot.org/zone/element-index.htm">ElementTree</a>.</p>
@@ -976,7 +976,7 @@ map it to your namespace.  See also the question above.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 793cca319c5a7e7ac2987c3c4edf465ff31eaf4b..c779ccc0d2ccb7f978a9c5fadc4b25957e7f4952 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="apis-specific-to-lxml-etree">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu current" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">APIs specific to lxml.etree</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu current" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">APIs specific to lxml.etree</h1>
 
 <p>lxml.etree tries to follow established APIs wherever possible.  Sometimes,
 however, the need to expose a feature in an easy way led to the invention of a
@@ -442,6 +442,15 @@ async def writer(out_stream, xml_messages):
                   await xf.write(el)
                   await xf.flush()
 
+
+class DummyAsyncOut(object):
+    async def write(self, data):
+        print(data.decode('utf8'))
+
+    async def close(self):
+         pass
+
+stream = DummyAsyncOut()
 async_writer = writer(stream, async_message_stream)
 </pre>
 </div>
@@ -522,7 +531,7 @@ example:</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 7b6718e60baae628afdc099c628e869eab5d9fb9..038c925ce0f78ad65fb5e0458500eee0d0ca494f 100644 (file)
@@ -427,7 +427,7 @@ even via super()).</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b17eecda9419a3f423241aad892be4914a5fcd2f..f0f1de087854517dae0d72dfaac006383f358a38 100644 (file)
@@ -560,6 +560,9 @@ lxml.tests.test_dtd.this_dir        lxml.tests.test_dtd-module.html#this_dir
 lxml.tests.test_elementpath    lxml.tests.test_elementpath-module.html
 lxml.tests.test_elementpath.__package__        lxml.tests.test_elementpath-module.html#__package__
 lxml.tests.test_elementpath.test_suite lxml.tests.test_elementpath-module.html#test_suite
+lxml.tests.test_elementpath.summarize  lxml.tests.test_elementpath-module.html#summarize
+lxml.tests.test_elementpath.normalize_crlf     lxml.tests.test_elementpath-module.html#normalize_crlf
+lxml.tests.test_elementpath.summarize_list     lxml.tests.test_elementpath-module.html#summarize_list
 lxml.tests.test_elementtree    lxml.tests.test_elementtree-module.html
 lxml.tests.test_elementtree.ElementTreePullTestCase    lxml.tests.test_elementtree-module.html#ElementTreePullTestCase
 lxml.tests.test_elementtree._str       lxml.tests.common_imports-module.html#_str
@@ -4698,11 +4701,14 @@ lxml.tests.test_dtd.ETreeDtdTestCase.test_dtd_parse_valid_relative_file_url     lxml
 lxml.tests.test_elementpath.EtreeElementPathTestCase   lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html
 lxml.tests.test_elementpath.EtreeElementPathTestCase.etree     lxml.etree-module.html
 lxml.tests.common_imports.HelperTestCase.tearDown      lxml.tests.common_imports.HelperTestCase-class.html#tearDown
+lxml.tests.test_elementpath.EtreeElementPathTestCase.test_find lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_find
+lxml.tests.test_elementpath.EtreeElementPathTestCase.test_tokenizer_predicates lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_tokenizer_predicates
 lxml.tests.common_imports.HelperTestCase._rootstring   lxml.tests.common_imports.HelperTestCase-class.html#_rootstring
 lxml.tests.test_elementpath.EtreeElementPathTestCase.test_tokenizer    lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_tokenizer
 lxml.tests.test_elementpath.EtreeElementPathTestCase.test_cache        lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_cache
 lxml.tests.common_imports.HelperTestCase.parse lxml.tests.common_imports.HelperTestCase-class.html#parse
 unittest.case.TestCase.failureException        exceptions.AssertionError-class.html
+lxml.tests.test_elementpath.EtreeElementPathTestCase._assert_tokens    lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#_assert_tokens
 lxml.tests.test_elementtree.CElementTreeTestCase       lxml.tests.test_elementtree.CElementTreeTestCase-class.html
 lxml.tests.test_elementtree._ETreeTestCaseBase.test_attribute_update_iter      lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_iter
 lxml.tests.test_elementtree._ETreeTestCaseBase.test_getiterator_filter_pi      lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_pi
@@ -7059,6 +7065,7 @@ lxml.tests.test_objectify.ObjectifyTestCase.test_countchildren    lxml.tests.test_o
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase    lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_get_default    lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_get_default
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getitem_neg    lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getitem_neg
+lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_comments_fallback     lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_comments_fallback
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_iterchildren   lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_iterchildren
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_len    lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_len
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_prefix lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_prefix
@@ -7071,7 +7078,7 @@ lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_tag       lxml.tests.t
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getitem        lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getitem
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_get    lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_get
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_sourceline     lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_sourceline
-lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getchildren    lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getchildren
+lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_attrib lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_attrib
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_bool   lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_bool
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getnext        lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getnext
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getprevious    lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getprevious
@@ -7086,7 +7093,7 @@ lxml.tests.common_imports.HelperTestCase.parse    lxml.tests.common_imports.HelperT
 unittest.case.TestCase.failureException        exceptions.AssertionError-class.html
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_text   lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_text
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.Element    lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#Element
-lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_attrib lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_attrib
+lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_getchildren    lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getchildren
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_tail   lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_tail
 lxml.tests.test_pyclasslookup.PyClassLookupTestCase.test_lookup_iter_children  lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_iter_children
 lxml.tests.test_relaxng.ETreeRelaxNGTestCase   lxml.tests.test_relaxng.ETreeRelaxNGTestCase-class.html
index f1af9207d8d0eade00f8eb94617f9419627200c2..0c71aa647fe7abeaf1a2ebd442d069cc9cb5f48f 100644 (file)
@@ -1333,7 +1333,7 @@ type(name, bases, dict) -&gt; a new type</em>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a48e6560aaac8f98f264981cadf2c4258b5b10b0..45a3be1dafe9685087974979ca4b32522a98721f 100644 (file)
@@ -195,7 +195,7 @@ You can just use ``except SelectorError:`` when calling
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9374fead9fd07665b3cccabd4210287e27a4ff39..b9a1767469981e0b18c16b038c111877ed30c78e 100644 (file)
@@ -202,7 +202,7 @@ Parsing a selector that does not match the grammar.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 26ff567d233dd06aba41a8634becd154f9ec3e0f..f1ee6cdf3175604ffff7a1b2a9432d4290ec84a0 100644 (file)
@@ -194,7 +194,7 @@ Unknown or unsupported selector (eg. pseudo-class).
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2f52f1db5d9607274ff3e9535999590fca8635de..82871b5861a959592918852550881583cdacdd7e 100644 (file)
@@ -380,7 +380,7 @@ to a single parent.</td>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 71e55134b9cc64764fe03b897fed53fbf34d90e4..64ff658db63196832235040f154ecccebcef5eb4 100644 (file)
@@ -146,7 +146,7 @@ with older versions of lxml or ElementTree.</li>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a2ca374dfdbb309ac61fb69ec85699455ac0cd33..63bbf051b19894f0b802381355e8a6bd8c56b246 100644 (file)
@@ -281,7 +281,7 @@ Assertion failed.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1bf3a7572d23e844ca872d3021f4f2c3811c1a46..3355b836fe4669c2817ef27ab78488bf3f00a488 100644 (file)
@@ -257,7 +257,7 @@ page was last updated. </p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b6402b55229fcb544ec4e69508368e23392137e3..7ca4adca612729f9e18361a9e340b41573b82372 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 0749a4cd983395f2d1afca2e0ee53f4b876eff58..ead37288d7f50ee81f3e9f48923990e444eb9a0d 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a29eef07c652f1eb47304ea623474d214d73ab8e..8873f8134f5f8d09fe5dcc445be647c5c17553b2 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 54a2ffe6f42db77414be09ce962f5a43a3c88fc8..9d729e8afdc3b1b1f910372b1514814e3d0a7e2d 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index df9a80e131b057b850d5461ab7ea025053afc577..87e74cb9ba498820f0b075040e540a6089cb10d7 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4c8b69a30197a4d6f8351ca7b476b4e72b5c9d7f..226cf38c516a4700865b65af61959ceba00d10b0 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7abba782ee9d15697a4ca4fe011f3079a114fd52..3f1ea92d2e411291886c4147eecfedb83629a1ef 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 82322ec9fa9f6150661e839b2b987f08048c864c..cc73d01c2b82ba7674285ee0a5591fc2ba14f823 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 28c46ac07b76e41f6141186c8dd8d9dcb947dfc5..95d570b32b5cf474e7495d68b72cdb0c73a74743 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3cb201e36eae44dcff34ce566de8a1f16e224be4..3ffc39cf893f3acde3724c1e2220b94b396145ba 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 491d0a847562a3f677afe2fd11ced4a8b20eae42..c93904a321efa5bb939259cf7f4e35978549b7f1 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 8d270c8933f7caeb251a9499c3f06febba6eb64a..fe22a441f8a2954f9d59e97c16c86db272616e22 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 988515f561d0f97161b08682a6572f071f81be39..a6126ef4c012b7fc92d1cd22d10c0ded3d74fd21 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e99c6a1541d27e2d77ecfe7e8d80301a8175678c..b4879af73a674046df0336f417f0e2f00b168a3a 100644 (file)
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DTD-class.html">DTD</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.iterparse-class.html#next">next()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterparse-class.html">iterparse</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.cssselect-module.html#ns">ns</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.cssselect-module.html">lxml.cssselect</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.builder-module.html#NOSCRIPT">NOSCRIPT</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Entity-class.html#name">name</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Entity-class.html" onclick="show_private();">_Entity</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.iterwalk-class.html#next">next()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterwalk-class.html">iterwalk</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_ATTRIBUTE_REDEFINED">NS_ERR_ATTRIBUTE_REDEFINED</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.cssselect-module.html#ns">ns</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.cssselect-module.html">lxml.cssselect</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.InputMixin-class.html#name">name</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.InputMixin-class.html">InputMixin</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.NoDeletes-class.html">NoDeletes</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_COLON">NS_ERR_COLON</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_ATTRIBUTE_REDEFINED">NS_ERR_ATTRIBUTE_REDEFINED</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.PyType-class.html">PyType</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#NOFRAMES">NOFRAMES</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_EMPTY">NS_ERR_EMPTY</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_COLON">NS_ERR_COLON</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#NONE">NONE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_QNAME">NS_ERR_QNAME</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_EMPTY">NS_ERR_EMPTY</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.QName-class.html">QName</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorLevels-class.html#NONE">NONE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorLevels-class.html">ErrorLevels</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_UNDEFINED_NAMESPACE">NS_ERR_UNDEFINED_NAMESPACE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_QNAME">NS_ERR_QNAME</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest-module.html">lxml.tests.selftest</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NoneElement-class.html">NoneElement</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify-module.html">lxml.objectify</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_XML_NAMESPACE">NS_ERR_XML_NAMESPACE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_UNDEFINED_NAMESPACE">NS_ERR_UNDEFINED_NAMESPACE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.defs-module.html#nonstandard_tags">nonstandard_tags</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.defs-module.html">lxml.html.defs</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#nsmap">nsmap</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#NS_ERR_XML_NAMESPACE">NS_ERR_XML_NAMESPACE</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ElementDepthFirstIterator-class.html#next">next()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ElementDepthFirstIterator-class.html" onclick="show_private();">ElementDepthFirstIterator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#NOPARSE_MARKUP">NOPARSE_MARKUP</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html#NSMAP">NSMAP</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html">ETreeXPathExsltTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#nsmap">nsmap</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ElementTextIterator-class.html#next">next()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ElementTextIterator-class.html" onclick="show_private();">ElementTextIterator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#norm_whitespace">norm_whitespace()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html">NumberElement</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.objectify-module.html">lxml.objectify</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html#NSMAP">NSMAP</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator.ETreeXPathExsltTestCase-class.html">ETreeXPathExsltTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementIterator-class.html#next">next()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementIterator-class.html" onclick="show_private();">_ElementIterator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest-module.html#normalize_crlf">normalize_crlf()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest-module.html">lxml.tests.selftest</a>)</span></td>
-<td width="33%" class="link-index">&nbsp;</td>
+<td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html">NumberElement</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.objectify-module.html">lxml.objectify</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementMatchIterator-class.html#next">next()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementMatchIterator-class.html" onclick="show_private();">_ElementMatchIterator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.builder-module.html#NOSCRIPT">NOSCRIPT</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementpath-module.html#normalize_crlf">normalize_crlf()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath-module.html">lxml.tests.test_elementpath</a>)</span></td>
 <td width="33%" class="link-index">&nbsp;</td>
 </tr>
 </table>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6bc34893d86ca79782a592fe583b32754b5dc5c5..a83177b4de07b18007f78b12c145593d4885468a 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1c406b35c724394a8668f75d2555c765e5f1d677..2e6c452f41a238697523dcecadee73d4b5b031d6 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6342c2d9ce5b749a7843cd7ba4839f2bfa5cb5ae..75cb35964d47b817b48ee953fa180aeb68d8028b 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a0786fec3315a1d2fdbd25f10ced30755e59b0a5..76e20bf917711ebbdaf47fed3d94720728faea8c 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 05b88b5852d2f54b65d63e05cb8bbc5780b89402..a67ce71ca7367489b2b0cb07193154a49dff81a7 100644 (file)
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#S">S</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_RESTRICTION_NONAME_NOREF">SCHEMAP_RESTRICTION_NONAME_NOREF</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ATTR_INVALID_VALUE">SCHEMAP_S4S_ATTR_INVALID_VALUE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_IDC">SCHEMAV_CVC_IDC</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MAXEXCLUSIVE_VALID">SCHEMAV_CVC_MAXEXCLUSIVE_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#safe_attrs">safe_attrs</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ATTR_INVALID_VALUE">SCHEMAP_S4S_ATTR_INVALID_VALUE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ATTR_MISSING">SCHEMAP_S4S_ATTR_MISSING</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_LENGTH_VALID">SCHEMAV_CVC_LENGTH_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MAXINCLUSIVE_VALID">SCHEMAV_CVC_MAXINCLUSIVE_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.defs-module.html#safe_attrs">safe_attrs</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.defs-module.html">lxml.html.defs</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ATTR_MISSING">SCHEMAP_S4S_ATTR_MISSING</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ATTR_NOT_ALLOWED">SCHEMAP_S4S_ATTR_NOT_ALLOWED</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MAXEXCLUSIVE_VALID">SCHEMAV_CVC_MAXEXCLUSIVE_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MAXLENGTH_VALID">SCHEMAV_CVC_MAXLENGTH_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#safe_attrs_only">safe_attrs_only</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ATTR_NOT_ALLOWED">SCHEMAP_S4S_ATTR_NOT_ALLOWED</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ELEM_MISSING">SCHEMAP_S4S_ELEM_MISSING</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MAXINCLUSIVE_VALID">SCHEMAV_CVC_MAXINCLUSIVE_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MINEXCLUSIVE_VALID">SCHEMAV_CVC_MINEXCLUSIVE_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#SAMP">SAMP</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ELEM_MISSING">SCHEMAP_S4S_ELEM_MISSING</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ELEM_NOT_ALLOWED">SCHEMAP_S4S_ELEM_NOT_ALLOWED</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MAXLENGTH_VALID">SCHEMAV_CVC_MAXLENGTH_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MININCLUSIVE_VALID">SCHEMAV_CVC_MININCLUSIVE_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest-module.html#SAMPLE_XML">SAMPLE_XML</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest-module.html">lxml.tests.selftest</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_S4S_ELEM_NOT_ALLOWED">SCHEMAP_S4S_ELEM_NOT_ALLOWED</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SIMPLETYPE_NONAME">SCHEMAP_SIMPLETYPE_NONAME</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MINEXCLUSIVE_VALID">SCHEMAV_CVC_MINEXCLUSIVE_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MINLENGTH_VALID">SCHEMAV_CVC_MINLENGTH_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest2-module.html#SAMPLE_XML">SAMPLE_XML</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest2-module.html">lxml.tests.selftest2</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SIMPLETYPE_NONAME">SCHEMAP_SIMPLETYPE_NONAME</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_1">SCHEMAP_SRC_ATTRIBUTE_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MININCLUSIVE_VALID">SCHEMAV_CVC_MININCLUSIVE_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_PATTERN_VALID">SCHEMAV_CVC_PATTERN_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator-module.html#SAMPLE_XML">SAMPLE_XML</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator-module.html">lxml.tests.test_xpathevaluator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_1">SCHEMAP_SRC_ATTRIBUTE_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_2">SCHEMAP_SRC_ATTRIBUTE_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_MINLENGTH_VALID">SCHEMAV_CVC_MINLENGTH_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TOTALDIGITS_VALID">SCHEMAV_CVC_TOTALDIGITS_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest2-module.html#SAMPLE_XML_NS">SAMPLE_XML_NS</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest2-module.html">lxml.tests.selftest2</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_2">SCHEMAP_SRC_ATTRIBUTE_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_3_1">SCHEMAP_SRC_ATTRIBUTE_3_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_PATTERN_VALID">SCHEMAV_CVC_PATTERN_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_1">SCHEMAV_CVC_TYPE_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SAVE_CHAR_INVALID">SAVE_CHAR_INVALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_3_1">SCHEMAP_SRC_ATTRIBUTE_3_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_3_2">SCHEMAP_SRC_ATTRIBUTE_3_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TOTALDIGITS_VALID">SCHEMAV_CVC_TOTALDIGITS_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_2">SCHEMAV_CVC_TYPE_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SAVE_NO_DOCTYPE">SAVE_NO_DOCTYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_3_2">SCHEMAP_SRC_ATTRIBUTE_3_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_4">SCHEMAP_SRC_ATTRIBUTE_4</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_1">SCHEMAV_CVC_TYPE_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_3_1_1">SCHEMAV_CVC_TYPE_3_1_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SAVE_NOT_UTF8">SAVE_NOT_UTF8</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_4">SCHEMAP_SRC_ATTRIBUTE_4</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_GROUP_1">SCHEMAP_SRC_ATTRIBUTE_GROUP_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_2">SCHEMAV_CVC_TYPE_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_3_1_2">SCHEMAV_CVC_TYPE_3_1_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SAVE_UNKNOWN_ENCODING">SAVE_UNKNOWN_ENCODING</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_GROUP_1">SCHEMAP_SRC_ATTRIBUTE_GROUP_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_GROUP_2">SCHEMAP_SRC_ATTRIBUTE_GROUP_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_3_1_1">SCHEMAV_CVC_TYPE_3_1_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_WILDCARD">SCHEMAV_CVC_WILDCARD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.sax-module.html">sax</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml-module.html">lxml</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_GROUP_2">SCHEMAP_SRC_ATTRIBUTE_GROUP_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_GROUP_3">SCHEMAP_SRC_ATTRIBUTE_GROUP_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_TYPE_3_1_2">SCHEMAV_CVC_TYPE_3_1_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_DOCUMENT_ELEMENT_MISSING">SCHEMAV_DOCUMENT_ELEMENT_MISSING</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.sax.SaxError-class.html">SaxError</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax-module.html">lxml.sax</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ATTRIBUTE_GROUP_3">SCHEMAP_SRC_ATTRIBUTE_GROUP_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_CT_1">SCHEMAP_SRC_CT_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_WILDCARD">SCHEMAV_CVC_WILDCARD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_ELEMCONT">SCHEMAV_ELEMCONT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.sax.ElementTreeProducer-class.html#saxify">saxify()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeProducer-class.html">ElementTreeProducer</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_CT_1">SCHEMAP_SRC_CT_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_1">SCHEMAP_SRC_ELEMENT_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_DOCUMENT_ELEMENT_MISSING">SCHEMAV_DOCUMENT_ELEMENT_MISSING</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_ELEMENT_CONTENT">SCHEMAV_ELEMENT_CONTENT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.sax-module.html#saxify">saxify()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax-module.html">lxml.sax</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_1">SCHEMAP_SRC_ELEMENT_1</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_ELEMCONT">SCHEMAV_ELEMCONT</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-</tr>
-<tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_A_PROPS_CORRECT_2">SCHEMAP_A_PROPS_CORRECT_2</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_2_1">SCHEMAP_SRC_ELEMENT_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_ELEMENT_CONTENT">SCHEMAV_ELEMENT_CONTENT</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-</tr>
-<tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_A_PROPS_CORRECT_3">SCHEMAP_A_PROPS_CORRECT_3</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_2_2">SCHEMAP_SRC_ELEMENT_2_2</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_EXTRACONTENT">SCHEMAV_EXTRACONTENT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_AG_PROPS_CORRECT">SCHEMAP_AG_PROPS_CORRECT</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_A_PROPS_CORRECT_2">SCHEMAP_A_PROPS_CORRECT_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_3">SCHEMAP_SRC_ELEMENT_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_2_2">SCHEMAP_SRC_ELEMENT_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_FACET">SCHEMAV_FACET</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ATTR_NONAME_NOREF">SCHEMAP_ATTR_NONAME_NOREF</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_A_PROPS_CORRECT_3">SCHEMAP_A_PROPS_CORRECT_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT">SCHEMAP_SRC_IMPORT</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_ELEMENT_3">SCHEMAP_SRC_ELEMENT_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_HAVEDEFAULT">SCHEMAV_HAVEDEFAULT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ATTRFORMDEFAULT_VALUE">SCHEMAP_ATTRFORMDEFAULT_VALUE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_AG_PROPS_CORRECT">SCHEMAP_AG_PROPS_CORRECT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_1_1">SCHEMAP_SRC_IMPORT_1_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT">SCHEMAP_SRC_IMPORT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_INTERNAL">SCHEMAV_INTERNAL</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ATTRGRP_NONAME_NOREF">SCHEMAP_ATTRGRP_NONAME_NOREF</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ATTR_NONAME_NOREF">SCHEMAP_ATTR_NONAME_NOREF</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_1_2">SCHEMAP_SRC_IMPORT_1_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_1_1">SCHEMAP_SRC_IMPORT_1_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_INVALIDATTR">SCHEMAV_INVALIDATTR</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_AU_PROPS_CORRECT">SCHEMAP_AU_PROPS_CORRECT</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ATTRFORMDEFAULT_VALUE">SCHEMAP_ATTRFORMDEFAULT_VALUE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_2">SCHEMAP_SRC_IMPORT_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_1_2">SCHEMAP_SRC_IMPORT_1_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_INVALIDELEM">SCHEMAV_INVALIDELEM</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_AU_PROPS_CORRECT_2">SCHEMAP_AU_PROPS_CORRECT_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ATTRGRP_NONAME_NOREF">SCHEMAP_ATTRGRP_NONAME_NOREF</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_2_1">SCHEMAP_SRC_IMPORT_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_2">SCHEMAP_SRC_IMPORT_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_ISABSTRACT">SCHEMAV_ISABSTRACT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_C_PROPS_CORRECT">SCHEMAP_C_PROPS_CORRECT</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_AU_PROPS_CORRECT">SCHEMAP_AU_PROPS_CORRECT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_2_2">SCHEMAP_SRC_IMPORT_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_2_1">SCHEMAP_SRC_IMPORT_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_MISC">SCHEMAV_MISC</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COMPLEXTYPE_NONAME_NOREF">SCHEMAP_COMPLEXTYPE_NONAME_NOREF</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_AU_PROPS_CORRECT_2">SCHEMAP_AU_PROPS_CORRECT_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_3_1">SCHEMAP_SRC_IMPORT_3_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_2_2">SCHEMAP_SRC_IMPORT_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_MISSING">SCHEMAV_MISSING</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ALL_LIMITED">SCHEMAP_COS_ALL_LIMITED</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_C_PROPS_CORRECT">SCHEMAP_C_PROPS_CORRECT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_3_2">SCHEMAP_SRC_IMPORT_3_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_3_1">SCHEMAP_SRC_IMPORT_3_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_NOROLLBACK">SCHEMAV_NOROLLBACK</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_CT_EXTENDS_1_1">SCHEMAP_COS_CT_EXTENDS_1_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COMPLEXTYPE_NONAME_NOREF">SCHEMAP_COMPLEXTYPE_NONAME_NOREF</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_INCLUDE">SCHEMAP_SRC_INCLUDE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_IMPORT_3_2">SCHEMAP_SRC_IMPORT_3_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_NOROOT">SCHEMAV_NOROOT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_CT_EXTENDS_1_2">SCHEMAP_COS_CT_EXTENDS_1_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ALL_LIMITED">SCHEMAP_COS_ALL_LIMITED</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE">SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_INCLUDE">SCHEMAP_SRC_INCLUDE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTDETERMINIST">SCHEMAV_NOTDETERMINIST</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_CT_EXTENDS_1_3">SCHEMAP_COS_CT_EXTENDS_1_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_CT_EXTENDS_1_1">SCHEMAP_COS_CT_EXTENDS_1_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_REDEFINE">SCHEMAP_SRC_REDEFINE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE">SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTEMPTY">SCHEMAV_NOTEMPTY</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_DERIVED_OK_2_1">SCHEMAP_COS_ST_DERIVED_OK_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_CT_EXTENDS_1_2">SCHEMAP_COS_CT_EXTENDS_1_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_RESOLVE">SCHEMAP_SRC_RESOLVE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_REDEFINE">SCHEMAP_SRC_REDEFINE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTNILLABLE">SCHEMAV_NOTNILLABLE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_DERIVED_OK_2_2">SCHEMAP_COS_ST_DERIVED_OK_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_CT_EXTENDS_1_3">SCHEMAP_COS_CT_EXTENDS_1_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE">SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_RESOLVE">SCHEMAP_SRC_RESOLVE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTSIMPLE">SCHEMAV_NOTSIMPLE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_1">SCHEMAP_COS_ST_RESTRICTS_1_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_DERIVED_OK_2_1">SCHEMAP_COS_ST_DERIVED_OK_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_1">SCHEMAP_SRC_SIMPLE_TYPE_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE">SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTTOPLEVEL">SCHEMAV_NOTTOPLEVEL</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_2">SCHEMAP_COS_ST_RESTRICTS_1_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_DERIVED_OK_2_2">SCHEMAP_COS_ST_DERIVED_OK_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_2">SCHEMAP_SRC_SIMPLE_TYPE_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_1">SCHEMAP_SRC_SIMPLE_TYPE_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_NOTYPE">SCHEMAV_NOTYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_3_1">SCHEMAP_COS_ST_RESTRICTS_1_3_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_1">SCHEMAP_COS_ST_RESTRICTS_1_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_3">SCHEMAP_SRC_SIMPLE_TYPE_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_2">SCHEMAP_SRC_SIMPLE_TYPE_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_UNDECLAREDELEM">SCHEMAV_UNDECLAREDELEM</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_3_2">SCHEMAP_COS_ST_RESTRICTS_1_3_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_2">SCHEMAP_COS_ST_RESTRICTS_1_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_4">SCHEMAP_SRC_SIMPLE_TYPE_4</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_3">SCHEMAP_SRC_SIMPLE_TYPE_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_VALUE">SCHEMAV_VALUE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_1">SCHEMAP_COS_ST_RESTRICTS_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_3_1">SCHEMAP_COS_ST_RESTRICTS_1_3_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES">SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_SIMPLE_TYPE_4">SCHEMAP_SRC_SIMPLE_TYPE_4</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_WRONGELEM">SCHEMAV_WRONGELEM</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_1_1">SCHEMAP_COS_ST_RESTRICTS_2_3_1_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_1_3_2">SCHEMAP_COS_ST_RESTRICTS_1_3_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ST_PROPS_CORRECT_1">SCHEMAP_ST_PROPS_CORRECT_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES">SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#SCRIPT">SCRIPT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_1_2">SCHEMAP_COS_ST_RESTRICTS_2_3_1_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_1">SCHEMAP_COS_ST_RESTRICTS_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ST_PROPS_CORRECT_2">SCHEMAP_ST_PROPS_CORRECT_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ST_PROPS_CORRECT_1">SCHEMAP_ST_PROPS_CORRECT_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#scripts">scripts</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_1">SCHEMAP_COS_ST_RESTRICTS_2_3_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_1_1">SCHEMAP_COS_ST_RESTRICTS_2_3_1_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ST_PROPS_CORRECT_3">SCHEMAP_ST_PROPS_CORRECT_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ST_PROPS_CORRECT_2">SCHEMAP_ST_PROPS_CORRECT_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#SELECT">SELECT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_2">SCHEMAP_COS_ST_RESTRICTS_2_3_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_1_2">SCHEMAP_COS_ST_RESTRICTS_2_3_1_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE">SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ST_PROPS_CORRECT_3">SCHEMAP_ST_PROPS_CORRECT_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.SelectElement-class.html">SelectElement</a></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_3">SCHEMAP_COS_ST_RESTRICTS_2_3_2_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_1">SCHEMAP_COS_ST_RESTRICTS_2_3_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_TYPE_AND_SUBTYPE">SCHEMAP_TYPE_AND_SUBTYPE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE">SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="cssselect.parser.SelectorError-class.html">SelectorError</a></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_4">SCHEMAP_COS_ST_RESTRICTS_2_3_2_4</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_2">SCHEMAP_COS_ST_RESTRICTS_2_3_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNION_NOT_EXPRESSIBLE">SCHEMAP_UNION_NOT_EXPRESSIBLE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_TYPE_AND_SUBTYPE">SCHEMAP_TYPE_AND_SUBTYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="cssselect.parser.SelectorSyntaxError-class.html">SelectorSyntaxError</a></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_5">SCHEMAP_COS_ST_RESTRICTS_2_3_2_5</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_3">SCHEMAP_COS_ST_RESTRICTS_2_3_2_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ALL_CHILD">SCHEMAP_UNKNOWN_ALL_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNION_NOT_EXPRESSIBLE">SCHEMAP_UNION_NOT_EXPRESSIBLE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest-module.html">selftest</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_1">SCHEMAP_COS_ST_RESTRICTS_3_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_4">SCHEMAP_COS_ST_RESTRICTS_2_3_2_4</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD">SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ALL_CHILD">SCHEMAP_UNKNOWN_ALL_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest2-module.html">selftest2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_1">SCHEMAP_COS_ST_RESTRICTS_3_3_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_2_3_2_5">SCHEMAP_COS_ST_RESTRICTS_2_3_2_5</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ATTR_CHILD">SCHEMAP_UNKNOWN_ATTR_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD">SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.SerialisationError-class.html">SerialisationError</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_1_2">SCHEMAP_COS_ST_RESTRICTS_3_3_1_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_1">SCHEMAP_COS_ST_RESTRICTS_3_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ATTRGRP_CHILD">SCHEMAP_UNKNOWN_ATTRGRP_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ATTR_CHILD">SCHEMAP_UNKNOWN_ATTR_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadPipelineTestCase.SerialiseWorker-class.html">SerialiseWorker</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadPipelineTestCase-class.html">ThreadPipelineTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_1">SCHEMAP_COS_ST_RESTRICTS_3_3_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_1">SCHEMAP_COS_ST_RESTRICTS_3_3_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP">SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ATTRGRP_CHILD">SCHEMAP_UNKNOWN_ATTRGRP_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest-module.html#serialize">serialize()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest-module.html">lxml.tests.selftest</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_2">SCHEMAP_COS_ST_RESTRICTS_3_3_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_1_2">SCHEMAP_COS_ST_RESTRICTS_3_3_1_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_BASE_TYPE">SCHEMAP_UNKNOWN_BASE_TYPE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP">SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest2-module.html#serialize">serialize()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest2-module.html">lxml.tests.selftest2</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_3">SCHEMAP_COS_ST_RESTRICTS_3_3_2_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_1">SCHEMAP_COS_ST_RESTRICTS_3_3_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_CHOICE_CHILD">SCHEMAP_UNKNOWN_CHOICE_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_BASE_TYPE">SCHEMAP_UNKNOWN_BASE_TYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff-module.html#serialize_html_fragment">serialize_html_fragment()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_4">SCHEMAP_COS_ST_RESTRICTS_3_3_2_4</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_2">SCHEMAP_COS_ST_RESTRICTS_3_3_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD">SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_CHOICE_CHILD">SCHEMAP_UNKNOWN_CHOICE_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#set">set()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_5">SCHEMAP_COS_ST_RESTRICTS_3_3_2_5</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_3">SCHEMAP_COS_ST_RESTRICTS_3_3_2_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD">SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD">SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._XSLTProcessingInstruction-class.html#set">set()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._XSLTProcessingInstruction-class.html" onclick="show_private();">_XSLTProcessingInstruction</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_1">SCHEMAP_COS_VALID_DEFAULT_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_4">SCHEMAP_COS_ST_RESTRICTS_3_3_2_4</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ELEM_CHILD">SCHEMAP_UNKNOWN_ELEM_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD">SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.HtmlElement-class.html#set">set()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.HtmlElement-class.html">HtmlElement</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_2_1">SCHEMAP_COS_VALID_DEFAULT_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_ST_RESTRICTS_3_3_2_5">SCHEMAP_COS_ST_RESTRICTS_3_3_2_5</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_EXTENSION_CHILD">SCHEMAP_UNKNOWN_EXTENSION_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_ELEM_CHILD">SCHEMAP_UNKNOWN_ELEM_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.HtmlMixin-class.html#set">set()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.HtmlMixin-class.html">HtmlMixin</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_2_2_1">SCHEMAP_COS_VALID_DEFAULT_2_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_1">SCHEMAP_COS_VALID_DEFAULT_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_FACET_CHILD">SCHEMAP_UNKNOWN_FACET_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_EXTENSION_CHILD">SCHEMAP_UNKNOWN_EXTENSION_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree-module.html#set_default_parser">set_default_parser()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_2_2_2">SCHEMAP_COS_VALID_DEFAULT_2_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_2_1">SCHEMAP_COS_VALID_DEFAULT_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_FACET_TYPE">SCHEMAP_UNKNOWN_FACET_TYPE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_FACET_CHILD">SCHEMAP_UNKNOWN_FACET_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify-module.html#set_default_parser">set_default_parser()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify-module.html">lxml.objectify</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_1">SCHEMAP_CT_PROPS_CORRECT_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_2_2_1">SCHEMAP_COS_VALID_DEFAULT_2_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_GROUP_CHILD">SCHEMAP_UNKNOWN_GROUP_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_FACET_TYPE">SCHEMAP_UNKNOWN_FACET_TYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.iterparse-class.html#set_element_class_lookup">set_element_class_lookup()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterparse-class.html">iterparse</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_2">SCHEMAP_CT_PROPS_CORRECT_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_COS_VALID_DEFAULT_2_2_2">SCHEMAP_COS_VALID_DEFAULT_2_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_IMPORT_CHILD">SCHEMAP_UNKNOWN_IMPORT_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_GROUP_CHILD">SCHEMAP_UNKNOWN_GROUP_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree-module.html#set_element_class_lookup">set_element_class_lookup()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_3">SCHEMAP_CT_PROPS_CORRECT_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_1">SCHEMAP_CT_PROPS_CORRECT_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_INCLUDE_CHILD">SCHEMAP_UNKNOWN_INCLUDE_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_IMPORT_CHILD">SCHEMAP_UNKNOWN_IMPORT_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.FallbackElementClassLookup-class.html#set_fallback">set_fallback()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.FallbackElementClassLookup-class.html">FallbackElementClassLookup</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_4">SCHEMAP_CT_PROPS_CORRECT_4</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_2">SCHEMAP_CT_PROPS_CORRECT_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_LIST_CHILD">SCHEMAP_UNKNOWN_LIST_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_INCLUDE_CHILD">SCHEMAP_UNKNOWN_INCLUDE_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLT-class.html#set_global_max_depth">set_global_max_depth()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLT-class.html">XSLT</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_5">SCHEMAP_CT_PROPS_CORRECT_5</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_3">SCHEMAP_CT_PROPS_CORRECT_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_MEMBER_TYPE">SCHEMAP_UNKNOWN_MEMBER_TYPE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_LIST_CHILD">SCHEMAP_UNKNOWN_LIST_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify-module.html#set_pytype_attribute_tag">set_pytype_attribute_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify-module.html">lxml.objectify</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CVC_SIMPLE_TYPE">SCHEMAP_CVC_SIMPLE_TYPE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_4">SCHEMAP_CT_PROPS_CORRECT_4</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_NOTATION_CHILD">SCHEMAP_UNKNOWN_NOTATION_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_MEMBER_TYPE">SCHEMAP_UNKNOWN_MEMBER_TYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectPath-class.html#setattr">setattr()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectPath-class.html">ObjectPath</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DEF_AND_PREFIX">SCHEMAP_DEF_AND_PREFIX</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CT_PROPS_CORRECT_5">SCHEMAP_CT_PROPS_CORRECT_5</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_PREFIX">SCHEMAP_UNKNOWN_PREFIX</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_NOTATION_CHILD">SCHEMAP_UNKNOWN_NOTATION_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.sax.ElementTreeContentHandler-class.html#setDocumentLocator">setDocumentLocator()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeContentHandler-class.html">ElementTreeContentHandler</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_1">SCHEMAP_DERIVATION_OK_RESTRICTION_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_CVC_SIMPLE_TYPE">SCHEMAP_CVC_SIMPLE_TYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD">SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_PREFIX">SCHEMAP_UNKNOWN_PREFIX</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator-module.html#setTest">setTest()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator-module.html">lxml.tests.test_xpathevaluator</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1">SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DEF_AND_PREFIX">SCHEMAP_DEF_AND_PREFIX</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_REF">SCHEMAP_UNKNOWN_REF</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD">SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator-module.html#setTest2">setTest2()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator-module.html">lxml.tests.test_xpathevaluator</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2">SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_1">SCHEMAP_DERIVATION_OK_RESTRICTION_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_RESTRICTION_CHILD">SCHEMAP_UNKNOWN_RESTRICTION_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_REF">SCHEMAP_UNKNOWN_REF</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_external_document.ExternalDocumentTestCase-class.html#setUp">setUp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_external_document.ExternalDocumentTestCase-class.html">ExternalDocumentTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3">SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1">SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SCHEMAS_CHILD">SCHEMAP_UNKNOWN_SCHEMAS_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_RESTRICTION_CHILD">SCHEMAP_UNKNOWN_RESTRICTION_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase-class.html#setUp">setUp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.BytesIOXmlFileTestCase-class.html">BytesIOXmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_2">SCHEMAP_DERIVATION_OK_RESTRICTION_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2">SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SEQUENCE_CHILD">SCHEMAP_UNKNOWN_SEQUENCE_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SCHEMAS_CHILD">SCHEMAP_UNKNOWN_SCHEMAS_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#setUp">setUp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html">HtmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_3">SCHEMAP_DERIVATION_OK_RESTRICTION_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3">SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD">SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SEQUENCE_CHILD">SCHEMAP_UNKNOWN_SEQUENCE_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#setUp">setUp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html">SimpleFileLikeXmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_4_1">SCHEMAP_DERIVATION_OK_RESTRICTION_4_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_2_2">SCHEMAP_DERIVATION_OK_RESTRICTION_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD">SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD">SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#setUp">setUp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html">TempPathXmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_4_2">SCHEMAP_DERIVATION_OK_RESTRICTION_4_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_3">SCHEMAP_DERIVATION_OK_RESTRICTION_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_TYPE">SCHEMAP_UNKNOWN_TYPE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD">SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase-class.html#setUp">setUp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase-class.html">TempXmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_4_3">SCHEMAP_DERIVATION_OK_RESTRICTION_4_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_4_1">SCHEMAP_DERIVATION_OK_RESTRICTION_4_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_UNION_CHILD">SCHEMAP_UNKNOWN_UNION_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_TYPE">SCHEMAP_UNKNOWN_TYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#setUp">setUp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_2">SCHEMAP_E_PROPS_CORRECT_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_4_2">SCHEMAP_DERIVATION_OK_RESTRICTION_4_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_ATTR_POINTLESS_PROH">SCHEMAP_WARN_ATTR_POINTLESS_PROH</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_UNKNOWN_UNION_CHILD">SCHEMAP_UNKNOWN_UNION_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html#setUp">setUp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html">ETreeNamespaceClassesTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_3">SCHEMAP_E_PROPS_CORRECT_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_DERIVATION_OK_RESTRICTION_4_3">SCHEMAP_DERIVATION_OK_RESTRICTION_4_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_ATTR_REDECL_PROH">SCHEMAP_WARN_ATTR_REDECL_PROH</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_ATTR_POINTLESS_PROH">SCHEMAP_WARN_ATTR_POINTLESS_PROH</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#setUp">setUp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_4">SCHEMAP_E_PROPS_CORRECT_4</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_2">SCHEMAP_E_PROPS_CORRECT_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_SKIP_SCHEMA">SCHEMAP_WARN_SKIP_SCHEMA</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_ATTR_REDECL_PROH">SCHEMAP_WARN_ATTR_REDECL_PROH</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree.ElementTreeTestCase-class.html#setUpClass">setUpClass()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree.ElementTreeTestCase-class.html">ElementTreeTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_5">SCHEMAP_E_PROPS_CORRECT_5</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_3">SCHEMAP_E_PROPS_CORRECT_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_UNLOCATED_SCHEMA">SCHEMAP_WARN_UNLOCATED_SCHEMA</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_SKIP_SCHEMA">SCHEMAP_WARN_SKIP_SCHEMA</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.SiblingsIterator-class.html">SiblingsIterator</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_6">SCHEMAP_E_PROPS_CORRECT_6</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_4">SCHEMAP_E_PROPS_CORRECT_4</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_WILDCARD_INVALID_NS_MEMBER">SCHEMAP_WILDCARD_INVALID_NS_MEMBER</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_WARN_UNLOCATED_SCHEMA">SCHEMAP_WARN_UNLOCATED_SCHEMA</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.common_imports.SillyFileLike-class.html">SillyFileLike</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ELEM_DEFAULT_FIXED">SCHEMAP_ELEM_DEFAULT_FIXED</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_5">SCHEMAP_E_PROPS_CORRECT_5</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_WILDCARD_INVALID_NS_MEMBER">SCHEMAP_WILDCARD_INVALID_NS_MEMBER</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#SCHEMASP">SCHEMASP</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html">simple_resolver</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase-class.html">ETreeXMLSchemaResolversTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ELEM_NONAME_NOREF">SCHEMAP_ELEM_NONAME_NOREF</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_E_PROPS_CORRECT_6">SCHEMAP_E_PROPS_CORRECT_6</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#SCHEMASV">SCHEMASV</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#SCHEMASP">SCHEMASP</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html">SimpleFileLike</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html">SimpleFileLikeXmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ELEMFORMDEFAULT_VALUE">SCHEMAP_ELEMFORMDEFAULT_VALUE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ELEM_DEFAULT_FIXED">SCHEMAP_ELEM_DEFAULT_FIXED</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.Schematron-class.html">Schematron</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#SCHEMASV">SCHEMASV</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html">SimpleFileLikeXmlFileTestCase</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile-module.html">lxml.tests.test_incremental_xmlfile</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_EXTENSION_NO_BASE">SCHEMAP_EXTENSION_NO_BASE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ELEM_NONAME_NOREF">SCHEMAP_ELEM_NONAME_NOREF</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html">Schematron</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.Schematron-class.html">Schematron</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest-module.html#simpleops">simpleops()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest-module.html">lxml.tests.selftest</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_FACET_NO_VALUE">SCHEMAP_FACET_NO_VALUE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_ELEMFORMDEFAULT_VALUE">SCHEMAP_ELEMFORMDEFAULT_VALUE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#schematron">schematron</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html">Schematron</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.iterwalk-class.html#skip_subtree">skip_subtree()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterwalk-class.html">iterwalk</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_FAILED_BUILD_IMPORT">SCHEMAP_FAILED_BUILD_IMPORT</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_EXTENSION_NO_BASE">SCHEMAP_EXTENSION_NO_BASE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#SCHEMATRON_NS">SCHEMATRON_NS</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#schematron">schematron</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.common_imports.skipif-class.html">skipif</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_FAILED_LOAD">SCHEMAP_FAILED_LOAD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_FACET_NO_VALUE">SCHEMAP_FACET_NO_VALUE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#schematron_schema_valid">schematron_schema_valid</a><br />
+<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#SCHEMATRON_NS">SCHEMATRON_NS</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#SMALL">SMALL</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_FAILED_PARSE">SCHEMAP_FAILED_PARSE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_FAILED_BUILD_IMPORT">SCHEMAP_FAILED_BUILD_IMPORT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.SchematronError-class.html">SchematronError</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#schematron_schema_valid">schematron_schema_valid</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html">soupparser</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_GROUP_NONAME_NOREF">SCHEMAP_GROUP_NONAME_NOREF</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_FAILED_LOAD">SCHEMAP_FAILED_LOAD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.SchematronParseError-class.html">SchematronParseError</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.SchematronError-class.html">SchematronError</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#sourceline">sourceline</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_IMPORT_NAMESPACE_NOT_URI">SCHEMAP_IMPORT_NAMESPACE_NOT_URI</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_FAILED_PARSE">SCHEMAP_FAILED_PARSE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#SCHEMATRONV">SCHEMATRONV</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.SchematronParseError-class.html">SchematronParseError</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#SPAN">SPAN</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_IMPORT_REDEFINE_NSNAME">SCHEMAP_IMPORT_REDEFINE_NSNAME</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMATRONV_ASSERT">SCHEMATRONV_ASSERT</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_GROUP_NONAME_NOREF">SCHEMAP_GROUP_NONAME_NOREF</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#SCHEMATRONV">SCHEMATRONV</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.defs-module.html#special_inline_tags">special_inline_tags</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.defs-module.html">lxml.html.defs</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_IMPORT_SCHEMA_NOT_URI">SCHEMAP_IMPORT_SCHEMA_NOT_URI</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_IMPORT_NAMESPACE_NOT_URI">SCHEMAP_IMPORT_NAMESPACE_NOT_URI</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMATRONV_REPORT">SCHEMATRONV_REPORT</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMATRONV_ASSERT">SCHEMATRONV_ASSERT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff-module.html#split_delete">split_delete()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INCLUDE_SCHEMA_NO_URI">SCHEMAP_INCLUDE_SCHEMA_NO_URI</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_IMPORT_REDEFINE_NSNAME">SCHEMAP_IMPORT_REDEFINE_NSNAME</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMATRONV_REPORT">SCHEMATRONV_REPORT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.SchematronValidateError-class.html">SchematronValidateError</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff-module.html#split_trailing_whitespace">split_trailing_whitespace()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INCLUDE_SCHEMA_NOT_URI">SCHEMAP_INCLUDE_SCHEMA_NOT_URI</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_ATTRINVALID">SCHEMAV_ATTRINVALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_IMPORT_SCHEMA_NOT_URI">SCHEMAP_IMPORT_SCHEMA_NOT_URI</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.SchematronValidateError-class.html">SchematronValidateError</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff-module.html#split_unbalanced">split_unbalanced()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INTERNAL">SCHEMAP_INTERNAL</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INCLUDE_SCHEMA_NO_URI">SCHEMAP_INCLUDE_SCHEMA_NO_URI</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_ATTRUNKNOWN">SCHEMAV_ATTRUNKNOWN</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_ATTRINVALID">SCHEMAV_ATTRINVALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff-module.html#split_words">split_words()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE">SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INCLUDE_SCHEMA_NOT_URI">SCHEMAP_INCLUDE_SCHEMA_NOT_URI</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CONSTRUCT">SCHEMAV_CONSTRUCT</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_ATTRUNKNOWN">SCHEMAV_ATTRUNKNOWN</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff-module.html#split_words_re">split_words_re</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_COMBINATION">SCHEMAP_INVALID_ATTR_COMBINATION</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INTERNAL">SCHEMAP_INTERNAL</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_1">SCHEMAV_CVC_ATTRIBUTE_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CONSTRUCT">SCHEMAV_CONSTRUCT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.DocInfo-class.html#standalone">standalone</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DocInfo-class.html" onclick="show_private();">DocInfo</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_INLINE_COMBINATION">SCHEMAP_INVALID_ATTR_INLINE_COMBINATION</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE">SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_2">SCHEMAV_CVC_ATTRIBUTE_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_1">SCHEMAV_CVC_ATTRIBUTE_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.TreeBuilder-class.html#start">start()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.TreeBuilder-class.html">TreeBuilder</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_NAME">SCHEMAP_INVALID_ATTR_NAME</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_COMBINATION">SCHEMAP_INVALID_ATTR_COMBINATION</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_3">SCHEMAV_CVC_ATTRIBUTE_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_2">SCHEMAV_CVC_ATTRIBUTE_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff-module.html#start_tag">start_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_USE">SCHEMAP_INVALID_ATTR_USE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_INLINE_COMBINATION">SCHEMAP_INVALID_ATTR_INLINE_COMBINATION</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_4">SCHEMAV_CVC_ATTRIBUTE_4</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_3">SCHEMAV_CVC_ATTRIBUTE_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff-module.html#start_whitespace_re">start_whitespace_re</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_BOOLEAN">SCHEMAP_INVALID_BOOLEAN</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_NAME">SCHEMAP_INVALID_ATTR_NAME</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_AU">SCHEMAV_CVC_AU</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ATTRIBUTE_4">SCHEMAV_CVC_ATTRIBUTE_4</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.sax.ElementTreeContentHandler-class.html#startDocument">startDocument()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeContentHandler-class.html">ElementTreeContentHandler</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ENUM">SCHEMAP_INVALID_ENUM</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ATTR_USE">SCHEMAP_INVALID_ATTR_USE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_1">SCHEMAV_CVC_COMPLEX_TYPE_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_AU">SCHEMAV_CVC_AU</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.sax.ElementTreeContentHandler-class.html#startElement">startElement()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeContentHandler-class.html">ElementTreeContentHandler</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_FACET">SCHEMAP_INVALID_FACET</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_BOOLEAN">SCHEMAP_INVALID_BOOLEAN</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_1">SCHEMAV_CVC_COMPLEX_TYPE_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_1">SCHEMAV_CVC_COMPLEX_TYPE_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.sax.ElementTreeContentHandler-class.html#startElementNS">startElementNS()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeContentHandler-class.html">ElementTreeContentHandler</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_FACET_VALUE">SCHEMAP_INVALID_FACET_VALUE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_ENUM">SCHEMAP_INVALID_ENUM</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_2">SCHEMAV_CVC_COMPLEX_TYPE_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_1">SCHEMAV_CVC_COMPLEX_TYPE_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.sax.ElementTreeContentHandler-class.html#startPrefixMapping">startPrefixMapping()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeContentHandler-class.html">ElementTreeContentHandler</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_MAXOCCURS">SCHEMAP_INVALID_MAXOCCURS</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_FACET">SCHEMAP_INVALID_FACET</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_3">SCHEMAV_CVC_COMPLEX_TYPE_2_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_2">SCHEMAV_CVC_COMPLEX_TYPE_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest-module.html#stdout">stdout()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest-module.html">lxml.tests.selftest</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_MINOCCURS">SCHEMAP_INVALID_MINOCCURS</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_FACET_VALUE">SCHEMAP_INVALID_FACET_VALUE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_4">SCHEMAV_CVC_COMPLEX_TYPE_2_4</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_3">SCHEMAV_CVC_COMPLEX_TYPE_2_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest2-module.html#stdout">stdout()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest2-module.html">lxml.tests.selftest2</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_REF_AND_SUBTYPE">SCHEMAP_INVALID_REF_AND_SUBTYPE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_MAXOCCURS">SCHEMAP_INVALID_MAXOCCURS</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_3_1">SCHEMAV_CVC_COMPLEX_TYPE_3_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_2_4">SCHEMAV_CVC_COMPLEX_TYPE_2_4</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="str-class.html">str</a></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_WHITE_SPACE">SCHEMAP_INVALID_WHITE_SPACE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_MINOCCURS">SCHEMAP_INVALID_MINOCCURS</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_3_2_1">SCHEMAV_CVC_COMPLEX_TYPE_3_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_3_1">SCHEMAV_CVC_COMPLEX_TYPE_3_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#STRIKE">STRIKE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_MG_PROPS_CORRECT_1">SCHEMAP_MG_PROPS_CORRECT_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_REF_AND_SUBTYPE">SCHEMAP_INVALID_REF_AND_SUBTYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_3_2_2">SCHEMAV_CVC_COMPLEX_TYPE_3_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_3_2_1">SCHEMAV_CVC_COMPLEX_TYPE_3_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html">StringElement</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify-module.html">lxml.objectify</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_MG_PROPS_CORRECT_2">SCHEMAP_MG_PROPS_CORRECT_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_INVALID_WHITE_SPACE">SCHEMAP_INVALID_WHITE_SPACE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_4">SCHEMAV_CVC_COMPLEX_TYPE_4</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_3_2_2">SCHEMAV_CVC_COMPLEX_TYPE_3_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.PyType-class.html#stringify">stringify</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.PyType-class.html">PyType</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_MISSING_SIMPLETYPE_CHILD">SCHEMAP_MISSING_SIMPLETYPE_CHILD</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_MG_PROPS_CORRECT_1">SCHEMAP_MG_PROPS_CORRECT_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_5_1">SCHEMAV_CVC_COMPLEX_TYPE_5_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_4">SCHEMAV_CVC_COMPLEX_TYPE_4</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator-module.html#stringListTest">stringListTest()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator-module.html">lxml.tests.test_xpathevaluator</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NO_XMLNS">SCHEMAP_NO_XMLNS</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_MG_PROPS_CORRECT_2">SCHEMAP_MG_PROPS_CORRECT_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_5_2">SCHEMAV_CVC_COMPLEX_TYPE_5_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_5_1">SCHEMAV_CVC_COMPLEX_TYPE_5_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator-module.html#stringTest">stringTest()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator-module.html">lxml.tests.test_xpathevaluator</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NO_XSI">SCHEMAP_NO_XSI</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_MISSING_SIMPLETYPE_CHILD">SCHEMAP_MISSING_SIMPLETYPE_CHILD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_DATATYPE_VALID_1_2_1">SCHEMAV_CVC_DATATYPE_VALID_1_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_COMPLEX_TYPE_5_2">SCHEMAV_CVC_COMPLEX_TYPE_5_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#strip">strip()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOATTR_NOREF">SCHEMAP_NOATTR_NOREF</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NO_XMLNS">SCHEMAP_NO_XMLNS</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_DATATYPE_VALID_1_2_2">SCHEMAV_CVC_DATATYPE_VALID_1_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_DATATYPE_VALID_1_2_1">SCHEMAV_CVC_DATATYPE_VALID_1_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree-module.html#strip_attributes">strip_attributes()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOROOT">SCHEMAP_NOROOT</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NO_XSI">SCHEMAP_NO_XSI</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_DATATYPE_VALID_1_2_3">SCHEMAV_CVC_DATATYPE_VALID_1_2_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_DATATYPE_VALID_1_2_2">SCHEMAV_CVC_DATATYPE_VALID_1_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree-module.html#strip_elements">strip_elements()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOT_DETERMINISTIC">SCHEMAP_NOT_DETERMINISTIC</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOATTR_NOREF">SCHEMAP_NOATTR_NOREF</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_1">SCHEMAV_CVC_ELT_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_DATATYPE_VALID_1_2_3">SCHEMAV_CVC_DATATYPE_VALID_1_2_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree-module.html#strip_tags">strip_tags()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOT_SCHEMA">SCHEMAP_NOT_SCHEMA</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOROOT">SCHEMAP_NOROOT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_2">SCHEMAV_CVC_ELT_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_1">SCHEMAV_CVC_ELT_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#strlen">strlen()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOTATION_NO_NAME">SCHEMAP_NOTATION_NO_NAME</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOT_DETERMINISTIC">SCHEMAP_NOT_DETERMINISTIC</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_3_1">SCHEMAV_CVC_ELT_3_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_2">SCHEMAV_CVC_ELT_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#STRONG">STRONG</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOTHING_TO_PARSE">SCHEMAP_NOTHING_TO_PARSE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOT_SCHEMA">SCHEMAP_NOT_SCHEMA</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_3_2_1">SCHEMAV_CVC_ELT_3_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_3_1">SCHEMAV_CVC_ELT_3_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLT-class.html#strparam">strparam()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLT-class.html">XSLT</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOTYPE_NOREF">SCHEMAP_NOTYPE_NOREF</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOTATION_NO_NAME">SCHEMAP_NOTATION_NO_NAME</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_3_2_2">SCHEMAV_CVC_ELT_3_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_3_2_1">SCHEMAV_CVC_ELT_3_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#STYLE">STYLE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_P_PROPS_CORRECT_1">SCHEMAP_P_PROPS_CORRECT_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOTHING_TO_PARSE">SCHEMAP_NOTHING_TO_PARSE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_4_1">SCHEMAV_CVC_ELT_4_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_3_2_2">SCHEMAV_CVC_ELT_3_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#style">style</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_P_PROPS_CORRECT_2_1">SCHEMAP_P_PROPS_CORRECT_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_NOTYPE_NOREF">SCHEMAP_NOTYPE_NOREF</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_4_2">SCHEMAV_CVC_ELT_4_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_4_1">SCHEMAV_CVC_ELT_4_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#stylesheet_params">stylesheet_params()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_P_PROPS_CORRECT_2_2">SCHEMAP_P_PROPS_CORRECT_2_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_P_PROPS_CORRECT_1">SCHEMAP_P_PROPS_CORRECT_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_4_3">SCHEMAV_CVC_ELT_4_3</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_4_2">SCHEMAV_CVC_ELT_4_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#SUB">SUB</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_PREFIX_UNDEFINED">SCHEMAP_PREFIX_UNDEFINED</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_P_PROPS_CORRECT_2_1">SCHEMAP_P_PROPS_CORRECT_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_1_1">SCHEMAV_CVC_ELT_5_1_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_4_3">SCHEMAV_CVC_ELT_4_3</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree-module.html#SubElement">SubElement()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_RECURSIVE">SCHEMAP_RECURSIVE</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_P_PROPS_CORRECT_2_2">SCHEMAP_P_PROPS_CORRECT_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_1_2">SCHEMAV_CVC_ELT_5_1_2</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_1_1">SCHEMAV_CVC_ELT_5_1_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest-module.html#summarize">summarize()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest-module.html">lxml.tests.selftest</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_ATTR">SCHEMAP_REDEFINED_ATTR</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_PREFIX_UNDEFINED">SCHEMAP_PREFIX_UNDEFINED</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_2_1">SCHEMAV_CVC_ELT_5_2_1</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_1_2">SCHEMAV_CVC_ELT_5_1_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest2-module.html#summarize">summarize()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest2-module.html">lxml.tests.selftest2</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_ATTRGROUP">SCHEMAP_REDEFINED_ATTRGROUP</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_RECURSIVE">SCHEMAP_RECURSIVE</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_2_1">SCHEMAV_CVC_ELT_5_2_1</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementpath-module.html#summarize">summarize()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath-module.html">lxml.tests.test_elementpath</a>)</span></td>
+</tr>
+<tr>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_ATTR">SCHEMAP_REDEFINED_ATTR</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_2_2_1">SCHEMAV_CVC_ELT_5_2_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest-module.html">lxml.tests.selftest</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_ELEMENT">SCHEMAP_REDEFINED_ELEMENT</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_ATTRGROUP">SCHEMAP_REDEFINED_ATTRGROUP</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_2_2_2_1">SCHEMAV_CVC_ELT_5_2_2_2_1</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest2-module.html">lxml.tests.selftest2</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_GROUP">SCHEMAP_REDEFINED_GROUP</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_ELEMENT">SCHEMAP_REDEFINED_ELEMENT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_5_2_2_2_2">SCHEMAV_CVC_ELT_5_2_2_2_2</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementpath-module.html#summarize_list">summarize_list()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath-module.html">lxml.tests.test_elementpath</a>)</span></td>
+</tr>
+<tr>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_GROUP">SCHEMAP_REDEFINED_GROUP</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_6">SCHEMAV_CVC_ELT_6</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#SUP">SUP</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_NOTATION">SCHEMAP_REDEFINED_NOTATION</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_6">SCHEMAV_CVC_ELT_6</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_7">SCHEMAV_CVC_ELT_7</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#SVRL_NS">SVRL_NS</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REDEFINED_TYPE">SCHEMAP_REDEFINED_TYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ELT_7">SCHEMAV_CVC_ELT_7</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ENUMERATION_VALID">SCHEMAV_CVC_ENUMERATION_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#svrl_validation_errors">svrl_validation_errors</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REF_AND_CONTENT">SCHEMAP_REF_AND_CONTENT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_ENUMERATION_VALID">SCHEMAV_CVC_ENUMERATION_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_FACET_VALID">SCHEMAV_CVC_FACET_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.DTD-class.html#system_url">system_url</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DTD-class.html">DTD</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REF_AND_SUBTYPE">SCHEMAP_REF_AND_SUBTYPE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_FACET_VALID">SCHEMAV_CVC_FACET_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_FRACTIONDIGITS_VALID">SCHEMAV_CVC_FRACTIONDIGITS_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.DocInfo-class.html#system_url">system_url</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DocInfo-class.html" onclick="show_private();">DocInfo</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_REGEXP_INVALID">SCHEMAP_REGEXP_INVALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_FRACTIONDIGITS_VALID">SCHEMAV_CVC_FRACTIONDIGITS_VALID</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_IDC">SCHEMAV_CVC_IDC</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index">&nbsp;</td>
+</tr>
+<tr>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAP_RESTRICTION_NONAME_NOREF">SCHEMAP_RESTRICTION_NONAME_NOREF</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#SCHEMAV_CVC_LENGTH_VALID">SCHEMAV_CVC_LENGTH_VALID</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 <td width="33%" class="link-index">&nbsp;</td>
 </tr>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 09e563b7bd9c99336d74d031ffcdd400b91e939c..6c732345fd0fc98bfecddda96d6b27bb7ca0eafe 100644 (file)
@@ -99,7 +99,7 @@
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#TABLE">TABLE</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_characters">test_fromstringlist_characters()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist">test_fromstringlist()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_empty">test_setslice_all_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.defs-module.html#table_tags">table_tags</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.defs-module.html">lxml.html.defs</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_single">test_fromstringlist_single()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_characters">test_fromstringlist_characters()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setslice_all_empty_reversed">test_setslice_all_empty_reversed()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Comment-class.html#tag">tag</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Comment-class.html" onclick="show_private();">_Comment</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_generator_close_continues_closing">test_generator_close_continues_closing()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist_single">test_fromstringlist_single()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace">test_setslice_all_replace()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#tag">tag</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator">test_getiterator()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_generator_close_continues_closing">test_generator_close_continues_closing()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed">test_setslice_all_replace_reversed()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Entity-class.html#tag">tag</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Entity-class.html" onclick="show_private();">_Entity</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_empty">test_getiterator_empty()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator">test_getiterator()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed_ns1">test_setslice_all_replace_reversed_ns1()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ProcessingInstruction-class.html#tag">tag</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ProcessingInstruction-class.html" onclick="show_private();">_ProcessingInstruction</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter">test_getiterator_filter()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_empty">test_getiterator_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all_replace_reversed_ns2">test_setslice_all_replace_reversed_ns2()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="xml.etree.ElementTree.Element-class.html#tag">tag</a><br />
 <span class="index-where">(in&nbsp;<a href="xml.etree.ElementTree.Element-class.html">Element</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_all">test_getiterator_filter_all()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter">test_getiterator_filter()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_complete">test_setslice_complete()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator-module.html#tag">tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator-module.html">lxml.tests.test_xpathevaluator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_all_comment_pi">test_getiterator_filter_all_comment_pi()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_all">test_getiterator_filter_all()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_elements">test_setslice_elements()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.doctestcompare.LXMLOutputChecker-class.html#tag_compare">tag_compare()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.doctestcompare.LXMLOutputChecker-class.html">LXMLOutputChecker</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_comment">test_getiterator_filter_comment()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_all_comment_pi">test_getiterator_filter_all_comment_pi()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_empty">test_setslice_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator-module.html#tag_or_value">tag_or_value()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator-module.html">lxml.tests.test_xpathevaluator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_element">test_getiterator_filter_element()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_comment">test_getiterator_filter_comment()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_empty">test_setslice_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.diff.tag_token-class.html">tag_token</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_entities">test_getiterator_filter_entities()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_element">test_getiterator_filter_element()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_end">test_setslice_end()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.defs-module.html#tags">tags</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.defs-module.html">lxml.html.defs</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_local_name">test_getiterator_filter_local_name()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_entities">test_getiterator_filter_entities()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_end_exact">test_setslice_end_exact()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#tail">tail</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_multiple">test_getiterator_filter_multiple()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_local_name">test_getiterator_filter_local_name()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_insert">test_setslice_insert()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="xml.etree.ElementTree.Element-class.html#tail">tail</a><br />
 <span class="index-where">(in&nbsp;<a href="xml.etree.ElementTree.Element-class.html">Element</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_multiple_tuple">test_getiterator_filter_multiple_tuple()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_multiple">test_getiterator_filter_multiple()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_insert_neg">test_setslice_insert_neg()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ProcessingInstruction-class.html#target">target</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ProcessingInstruction-class.html" onclick="show_private();">_ProcessingInstruction</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_namespace">test_getiterator_filter_namespace()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_multiple_tuple">test_getiterator_filter_multiple_tuple()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_negative">test_setslice_negative()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#TBODY">TBODY</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_pi">test_getiterator_filter_pi()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getiterator_filter_namespace">test_getiterator_filter_namespace()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_negative2">test_setslice_negative2()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#TD">TD</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_with_text">test_getiterator_filter_with_text()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_pi">test_getiterator_filter_pi()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_partial">test_setslice_partial()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.common_imports.HelperTestCase-class.html#tearDown">tearDown()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports.HelperTestCase-class.html">HelperTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_with_text">test_getiterator_with_text()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_filter_with_text">test_getiterator_filter_with_text()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_partial_allneg">test_setslice_partial_allneg()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html#tearDown">tearDown()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html">ClassLookupTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getnext">test_getnext()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getiterator_with_text">test_getiterator_with_text()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_partial_neg">test_setslice_partial_neg()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#tearDown">tearDown()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getparent">test_getparent()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getnext">test_getnext()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setslice_partial_wrong_length">test_setslice_partial_wrong_length()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#tearDown">tearDown()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html">TempPathXmlFileTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getprevious">test_getprevious()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getparent">test_getparent()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_single">test_setslice_single()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#tearDown">tearDown()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getroottree">test_getroottree()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getprevious">test_getprevious()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setslice_step">test_setslice_step()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#tearDown">tearDown()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice">test_getslice()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_getroottree">test_getroottree()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setslice_step_negative">test_setslice_step_negative()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html#tearDown">tearDown()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_nsclasses.ETreeNamespaceClassesTestCase-class.html">ETreeNamespaceClassesTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_getslice_complete">test_getslice_complete()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice">test_getslice()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setslice_step_negative2">test_setslice_step_negative2()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#tearDown">tearDown()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_negative">test_getslice_negative()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_getslice_complete">test_getslice_complete()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setslice_step_overrun">test_setslice_step_overrun()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#tearDown">tearDown()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_getslice_partial">test_getslice_partial()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_negative">test_getslice_negative()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_tail">test_setslice_tail()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#temp_install">temp_install()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_getslice_partial_neg">test_getslice_partial_neg()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_getslice_partial">test_getslice_partial()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_shallowcopy">test_shallowcopy()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html">TempPathXmlFileTestCase</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile-module.html">lxml.tests.test_incremental_xmlfile</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_step">test_getslice_step()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_getslice_partial_neg">test_getslice_partial_neg()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_shallowcopy_elementtree">test_shallowcopy_elementtree()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempXmlFileTestCase-class.html">TempXmlFileTestCase</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile-module.html">lxml.tests.test_incremental_xmlfile</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_text">test_getslice_text()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_step">test_getslice_step()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_simple">test_simple()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_unicode.UnicodeTestCase-class.html#test__str">test__str()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_unicode.UnicodeTestCase-class.html">UnicodeTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html5_doctype">test_html5_doctype()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_getslice_text">test_getslice_text()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_simple_xml">test_simple_xml()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html" onclick="show_private();">_XMLPullParserTest</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_addattr">test_addattr()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_html_base">test_html_base()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html5_doctype">test_html5_doctype()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html#test_simple_xml_with_ns">test_simple_xml_with_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html" onclick="show_private();">_XMLPullParserTest</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_addattr_element">test_addattr_element()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_html_base_tag">test_html_base_tag()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_html_base">test_html_base()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_sourceline_element">test_sourceline_element()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_addattr_list">test_addattr_list()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_HTML_base_url_docinfo">test_HTML_base_url_docinfo()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_html_base_tag">test_html_base_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_sourceline_iterparse_end">test_sourceline_iterparse_end()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext">test_addnext()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_html_decl">test_html_decl()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_HTML_base_url_docinfo">test_HTML_base_url_docinfo()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_sourceline_iterparse_start">test_sourceline_iterparse_start()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_comment">test_addnext_comment()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_colon">test_html_element_name_colon()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_html_decl">test_html_decl()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_sourceline_parse">test_sourceline_parse()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_cycle">test_addnext_cycle()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_empty">test_html_element_name_empty()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_colon">test_html_element_name_colon()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_sourceline_XML">test_sourceline_XML()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_cycle_long">test_addnext_cycle_long()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_quote">test_html_element_name_quote()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_empty">test_html_element_name_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_standalone">test_standalone()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_noops">test_addnext_noops()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_space">test_html_element_name_space()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_quote">test_html_element_name_quote()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_standard_lookup">test_standard_lookup()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_pi">test_addnext_pi()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_feed_parser">test_html_feed_parser()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_element_name_space">test_html_element_name_space()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_str">test_str()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_root">test_addnext_root()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_feed_parser_chunky">test_html_feed_parser_chunky()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_feed_parser">test_html_feed_parser()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_attributes">test_strip_attributes()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_root_comment">test_addnext_root_comment()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_feed_parser_more_tags">test_html_feed_parser_more_tags()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_feed_parser_chunky">test_html_feed_parser_chunky()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_attributes_ns">test_strip_attributes_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addnext_root_pi">test_addnext_root_pi()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_file_error">test_html_file_error()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_feed_parser_more_tags">test_html_feed_parser_more_tags()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_elements">test_strip_elements()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious">test_addprevious()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_fromstring_target_exceptions">test_html_fromstring_target_exceptions()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_file_error">test_html_file_error()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_elements_ns">test_strip_elements_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_comment">test_addprevious_comment()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_ids">test_html_ids()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_fromstring_target_exceptions">test_html_fromstring_target_exceptions()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags">test_strip_tags()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_cycle">test_addprevious_cycle()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_ids_no_collect_ids">test_html_ids_no_collect_ids()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_ids">test_html_ids()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags_and_remove">test_strip_tags_and_remove()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_cycle_long">test_addprevious_cycle_long()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse">test_html_iterparse()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_ids_no_collect_ids">test_html_ids_no_collect_ids()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags_doc_style">test_strip_tags_doc_style()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_noops">test_addprevious_noops()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_broken">test_html_iterparse_broken()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse">test_html_iterparse()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags_ns">test_strip_tags_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_pi">test_addprevious_pi()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_broken_no_recover">test_html_iterparse_broken_no_recover()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_broken">test_html_iterparse_broken()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags_pi_comment">test_strip_tags_pi_comment()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_root_comment">test_addprevious_root_comment()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_file">test_html_iterparse_file()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_broken_no_recover">test_html_iterparse_broken_no_recover()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_strip_tags_pi_comment_all">test_strip_tags_pi_comment_all()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_addprevious_root_pi">test_addprevious_root_pi()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_start">test_html_iterparse_start()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_file">test_html_iterparse_file()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_data_element_nsmap_custom">test_sub_data_element_nsmap_custom()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_anonymous_namespace">test_anonymous_namespace()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_stop_short">test_html_iterparse_stop_short()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_start">test_html_iterparse_start()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_data_element_nsmap_custom_prefixes">test_sub_data_element_nsmap_custom_prefixes()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_append_error">test_append_error()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_doctype_empty">test_html_parser_target_doctype_empty()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_iterparse_stop_short">test_html_iterparse_stop_short()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_data_element_nsmap_default">test_sub_data_element_nsmap_default()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_append_recursive_error">test_append_recursive_error()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_doctype_html">test_html_parser_target_doctype_html()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_doctype_empty">test_html_parser_target_doctype_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_data_element_nsmap_empty">test_sub_data_element_nsmap_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html#test_async">test_async()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html">AsyncXmlFileTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_doctype_html_full">test_html_parser_target_doctype_html_full()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_doctype_html">test_html_parser_target_doctype_html()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_element_nsmap_custom">test_sub_element_nsmap_custom()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html#test_async_api">test_async_api()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html">AsyncXmlFileTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_exceptions">test_html_parser_target_exceptions()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_doctype_html_full">test_html_parser_target_doctype_html_full()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_element_nsmap_custom_prefixes">test_sub_element_nsmap_custom_prefixes()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib">test_attrib()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_tag">test_html_parser_target_tag()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_exceptions">test_html_parser_target_exceptions()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_element_nsmap_default">test_sub_element_nsmap_default()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attrib_and_keywords">test_attrib_and_keywords()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_html_prefix_nsmap">test_html_prefix_nsmap()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_parser_target_tag">test_html_parser_target_tag()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_sub_element_nsmap_empty">test_sub_element_nsmap_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_as_attrib">test_attrib_as_attrib()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_colon">test_html_subelement_name_colon()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_html_prefix_nsmap">test_html_prefix_nsmap()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement">test_subelement()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_clear">test_attrib_clear()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_empty">test_html_subelement_name_empty()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_colon">test_html_subelement_name_colon()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_attribute_invalid">test_subelement_attribute_invalid()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_copy">test_attrib_copy()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_quote">test_html_subelement_name_quote()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_empty">test_html_subelement_name_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_name_colon">test_subelement_name_colon()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_deepcopy">test_attrib_deepcopy()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_space">test_html_subelement_name_space()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_quote">test_html_subelement_name_quote()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_name_empty">test_subelement_name_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_dict">test_attrib_dict()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser-module.html">test_htmlparser</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_html_subelement_name_space">test_html_subelement_name_space()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_name_quote">test_subelement_name_quote()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_get">test_attrib_get()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_http_io.HttpIOTestCase-class.html#test_http_client">test_http_client()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_http_io.HttpIOTestCase-class.html">HttpIOTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser-module.html">test_htmlparser</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_name_space">test_subelement_name_space()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_ns_clear">test_attrib_ns_clear()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_http_io.HttpIOTestCase-class.html#test_http_client_404">test_http_client_404()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_http_io.HttpIOTestCase-class.html#test_http_client">test_http_client()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_http_io.HttpIOTestCase-class.html">HttpIOTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_subelement_nsmap">test_subelement_nsmap()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attrib_order">test_attrib_order()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_http_io.HttpIOTestCase-class.html#test_http_client_gzip">test_http_client_gzip()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_http_io.HttpIOTestCase-class.html#test_http_client_404">test_http_client_404()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_http_io.HttpIOTestCase-class.html">HttpIOTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_reference">test_subelement_reference()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop">test_attrib_pop()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_http_io-module.html">test_http_io</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_http_io.HttpIOTestCase-class.html#test_http_client_gzip">test_http_client_gzip()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_http_io.HttpIOTestCase-class.html">HttpIOTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_with_attributes">test_subelement_with_attributes()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_default">test_attrib_pop_default()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_ietf_decl">test_ietf_decl()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_http_io-module.html">test_http_io</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_subelement_with_attributes_ns">test_subelement_with_attributes_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_empty_default">test_attrib_pop_empty_default()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_ietf_decl">test_ietf_decl()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_ietf_decl">test_ietf_decl()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadingTestCase-class.html#test_subtree_copy_thread">test_subtree_copy_thread()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadingTestCase-class.html">ThreadingTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_invalid_args">test_attrib_pop_invalid_args()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_unicode.EncodingsTestCase-class.html#test_illegal_utf8">test_illegal_utf8()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_unicode.EncodingsTestCase-class.html">EncodingsTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_ietf_decl">test_ietf_decl()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_builder-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_builder-module.html">lxml.tests.test_builder</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_pop_unknown">test_attrib_pop_unknown()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_unicode.EncodingsTestCase-class.html#test_illegal_utf8_recover">test_illegal_utf8_recover()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_unicode.EncodingsTestCase-class.html#test_illegal_utf8">test_illegal_utf8()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_unicode.EncodingsTestCase-class.html">EncodingsTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_classlookup-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_classlookup-module.html">lxml.tests.test_classlookup</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attrib_set_clear">test_attrib_set_clear()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_include_paths">test_include_paths()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_unicode.EncodingsTestCase-class.html#test_illegal_utf8_recover">test_illegal_utf8_recover()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_unicode.EncodingsTestCase-class.html">EncodingsTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_css-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_css-module.html">lxml.tests.test_css</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute">test_attribute()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile-module.html">test_incremental_xmlfile</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_include_paths">test_include_paths()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_doctestcompare-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_doctestcompare-module.html">lxml.tests.test_doctestcompare</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_attribute_based_lookup">test_attribute_based_lookup()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html">ClassLookupTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_index">test_index()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile-module.html">test_incremental_xmlfile</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_dtd-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd-module.html">lxml.tests.test_dtd</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_contains">test_attribute_contains()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert">test_insert()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_index">test_index()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementpath-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath-module.html">lxml.tests.test_elementpath</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra">test_attribute_extra()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_beyond_index">test_insert_beyond_index()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert">test_insert()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree-module.html">lxml.tests.test_elementtree</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_attribute_extra_duplicate">test_attribute_extra_duplicate()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_negative">test_insert_negative()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_beyond_index">test_insert_beyond_index()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_errors-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_errors-module.html">lxml.tests.test_errors</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_gets_namespace_prefix_on_merge">test_attribute_gets_namespace_prefix_on_merge()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_tail">test_insert_tail()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_negative">test_insert_negative()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree-module.html">lxml.tests.test_etree</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_gets_namespace_prefix_on_merge_with_nons">test_attribute_gets_namespace_prefix_on_merge_with_nons()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_internal_dtds">test_internal_dtds()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_insert_tail">test_insert_tail()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_external_document-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_external_document-module.html">lxml.tests.test_external_document</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_has_key">test_attribute_has_key()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_invalid_decl_1">test_invalid_decl_1()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_internal_dtds">test_internal_dtds()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser-module.html">lxml.tests.test_htmlparser</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items">test_attribute_items()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_invalid_decl_2">test_invalid_decl_2()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_invalid_decl_1">test_invalid_decl_1()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_http_io-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_http_io-module.html">lxml.tests.test_http_io</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items2">test_attribute_items2()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_io-module.html">test_io</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_invalid_decl_2">test_invalid_decl_2()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile-module.html">lxml.tests.test_incremental_xmlfile</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_items_ns">test_attribute_items_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iselement">test_iselement()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_io-module.html">test_io</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_io-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io-module.html">lxml.tests.test_io</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_iterator">test_attribute_iterator()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_isoschematron-module.html">test_isoschematron</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iselement">test_iselement()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_isoschematron-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_isoschematron-module.html">lxml.tests.test_isoschematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_keeps_namespace_prefix_on_merge">test_attribute_keeps_namespace_prefix_on_merge()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iter">test_iter()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_isoschematron-module.html">test_isoschematron</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_nsclasses-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_nsclasses-module.html">lxml.tests.test_nsclasses</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_keeps_namespace_prefix_on_merge_with_nons">test_attribute_keeps_namespace_prefix_on_merge_with_nons()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterancestors">test_iterancestors()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iter">test_iter()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify-module.html">lxml.tests.test_objectify</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys">test_attribute_keys()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterancestors_tag">test_iterancestors_tag()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterancestors">test_iterancestors()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup-module.html">lxml.tests.test_pyclasslookup</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys2">test_attribute_keys2()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterancestors_tag_multiple">test_iterancestors_tag_multiple()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterancestors_tag">test_iterancestors_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_relaxng-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_relaxng-module.html">lxml.tests.test_relaxng</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_keys_ns">test_attribute_keys_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration">test_iteration()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterancestors_tag_multiple">test_iterancestors_tag_multiple()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_sax-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_sax-module.html">lxml.tests.test_sax</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_manipulation">test_attribute_manipulation()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_crash">test_iteration_crash()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration">test_iteration()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_schematron-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_schematron-module.html">lxml.tests.test_schematron</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_namespace_roundtrip">test_attribute_namespace_roundtrip()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_del_child">test_iteration_del_child()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_crash">test_iteration_crash()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading-module.html">lxml.tests.test_threading</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_namespace_roundtrip_replaced">test_attribute_namespace_roundtrip_replaced()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_double">test_iteration_double()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_del_child">test_iteration_del_child()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_unicode-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_unicode-module.html">lxml.tests.test_unicode</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_attribute_quoting">test_attribute_quoting()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html">HtmlFileTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_empty">test_iteration_empty()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_double">test_iteration_double()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xmlschema-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xmlschema-module.html">lxml.tests.test_xmlschema</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html#test_attribute_quoting_unicode">test_attribute_quoting_unicode()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.HtmlFileTestCase-class.html">HtmlFileTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_reversed">test_iteration_reversed()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_empty">test_iteration_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator-module.html">lxml.tests.test_xpathevaluator</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_set">test_attribute_set()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_subelement">test_iteration_subelement()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_reversed">test_iteration_reversed()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xslt-module.html#test_suite">test_suite()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt-module.html">lxml.tests.test_xslt</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_set">test_attribute_set()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_text_only">test_iteration_text_only()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_subelement">test_iteration_subelement()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_reset_ns">test_tag_reset_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_set_invalid">test_attribute_set_invalid()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren">test_iterchildren()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iteration_text_only">test_iteration_text_only()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_reset_root_ns">test_tag_reset_root_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_set_nonstring">test_attribute_set_nonstring()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_reversed">test_iterchildren_reversed()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren">test_iterchildren()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_str_subclass">test_tag_str_subclass()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_str">test_attribute_str()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag">test_iterchildren_tag()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_reversed">test_iterchildren_reversed()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tag_write">test_tag_write()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_attrib">test_attribute_update_attrib()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_multiple">test_iterchildren_tag_multiple()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag">test_iterchildren_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_tags_upper_lower_case">test_tags_upper_lower_case()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_doctestcompare.DoctestCompareTest-class.html">DoctestCompareTest</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_dict">test_attribute_update_dict()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_multiple_posarg">test_iterchildren_tag_multiple_posarg()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_multiple">test_iterchildren_tag_multiple()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#test_tags_upper_lower_case_html">test_tags_upper_lower_case_html()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_doctestcompare.DoctestCompareTest-class.html">DoctestCompareTest</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_iter">test_attribute_update_iter()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_multiple_reversed">test_iterchildren_tag_multiple_reversed()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_multiple_posarg">test_iterchildren_tag_multiple_posarg()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail">test_tail()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_update_sequence">test_attribute_update_sequence()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_posarg">test_iterchildren_tag_posarg()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_multiple_reversed">test_iterchildren_tag_multiple_reversed()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail1">test_tail1()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_values">test_attribute_values()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_reversed">test_iterchildren_tag_reversed()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_posarg">test_iterchildren_tag_posarg()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_append">test_tail_append()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_attribute_values">test_attribute_values()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterdescendants">test_iterdescendants()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterchildren_tag_reversed">test_iterchildren_tag_reversed()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_elementtree_root">test_tail_elementtree_root()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_values_ns">test_attribute_values_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterdescendants_tag">test_iterdescendants_tag()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterdescendants">test_iterdescendants()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_set_none">test_tail_set_none()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attribute_xmlns_move">test_attribute_xmlns_move()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterdescendants_tag_multiple">test_iterdescendants_tag_multiple()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterdescendants_tag">test_iterdescendants_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_set_twice">test_tail_set_twice()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_attributes_get">test_attributes_get()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse">test_iterparse()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterdescendants_tag_multiple">test_iterdescendants_tag_multiple()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tail_str_subclass">test_tail_str_subclass()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_errors.ErrorTestCase-class.html#test_bad_element">test_bad_element()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_errors.ErrorTestCase-class.html">ErrorTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_attrib_ns">test_iterparse_attrib_ns()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse">test_iterparse()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text">test_text()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_boolean_attribute">test_boolean_attribute()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_broken">test_iterparse_broken()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_attrib_ns">test_iterparse_attrib_ns()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_empty">test_text_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_boolean_attribute_round_trip">test_boolean_attribute_round_trip()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_broken_multi_recover">test_iterparse_broken_multi_recover()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_broken">test_iterparse_broken()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_in">test_text_escape_in()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html#test_boolean_attribute_xml_adds_empty_string">test_boolean_attribute_xml_adds_empty_string()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser.HtmlParserTestCase-class.html">HtmlParserTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_broken_recover">test_iterparse_broken_recover()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_broken_multi_recover">test_iterparse_broken_multi_recover()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_out">test_text_escape_out()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#test_buffering">test_buffering()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html">TempPathXmlFileTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_cdata">test_iterparse_cdata()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_broken_recover">test_iterparse_broken_recover()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_escape_tostring">test_text_escape_tostring()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_buffering">test_buffering()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_clear">test_iterparse_clear()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_cdata">test_iterparse_cdata()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_other">test_text_other()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_builder.BuilderTestCase-class.html#test_build_from_xpath_result">test_build_from_xpath_result()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_builder.BuilderTestCase-class.html">BuilderTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_comments">test_iterparse_comments()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_clear">test_iterparse_clear()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_text_str_subclass">test_text_str_subclass()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_build_tree">test_build_tree()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_encoding_8bit_override">test_iterparse_encoding_8bit_override()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_comments">test_iterparse_comments()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_create_xslt">test_thread_create_xslt()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadingTestCase-class.html">ThreadingTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_builder-module.html">test_builder</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_encoding_error">test_iterparse_encoding_error()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_encoding_8bit_override">test_iterparse_encoding_8bit_override()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_error_log">test_thread_error_log()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadingTestCase-class.html">ThreadingTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_byte_invalid">test_byte_invalid()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_file">test_iterparse_file()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_encoding_error">test_iterparse_encoding_error()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_mix">test_thread_mix()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadingTestCase-class.html">ThreadingTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_byte_zero">test_byte_zero()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_iterparse_file_dtd_end">test_iterparse_file_dtd_end()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_file">test_iterparse_file()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadPipelineTestCase-class.html#test_thread_pipeline_global_parse">test_thread_pipeline_global_parse()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadPipelineTestCase-class.html">ThreadPipelineTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n">test_c14n()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_iterparse_file_dtd_start">test_iterparse_file_dtd_start()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_iterparse_file_dtd_end">test_iterparse_file_dtd_end()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadPipelineTestCase-class.html#test_thread_pipeline_thread_parse">test_thread_pipeline_thread_parse()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadPipelineTestCase-class.html">ThreadPipelineTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_element_tostring_exclusive">test_c14n_element_tostring_exclusive()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_getiterator">test_iterparse_getiterator()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_iterparse_file_dtd_start">test_iterparse_file_dtd_start()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_xslt">test_thread_xslt()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadingTestCase-class.html">ThreadingTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_element_tostring_with_comments">test_c14n_element_tostring_with_comments()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_keep_cdata">test_iterparse_keep_cdata()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_getiterator">test_iterparse_getiterator()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadingTestCase-class.html#test_thread_xslt_attr_replace">test_thread_xslt_attr_replace()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadingTestCase-class.html">ThreadingTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_exclusive">test_c14n_exclusive()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_large">test_iterparse_large()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_keep_cdata">test_iterparse_keep_cdata()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading-module.html">test_threading</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_file">test_c14n_file()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_move_elements">test_iterparse_move_elements()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_large">test_iterparse_large()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_tokenizer">test_tokenizer()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html">EtreeElementPathTestCase</a>)</span></td>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_file_gzip">test_c14n_file_gzip()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_move_elements">test_iterparse_move_elements()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_tokenizer_predicates">test_tokenizer_predicates()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html">EtreeElementPathTestCase</a>)</span></td>
+</tr>
+<tr>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_gzip">test_c14n_gzip()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_pis">test_iterparse_pis()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring">test_tostring()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_gzip">test_c14n_gzip()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_tostring_exclusive">test_c14n_tostring_exclusive()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_remove_comments">test_iterparse_remove_comments()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_tostring_exclusive">test_c14n_tostring_exclusive()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_tostring_inclusive_ns_prefixes">test_c14n_tostring_inclusive_ns_prefixes()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_start">test_iterparse_start()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_tostring_inclusive_ns_prefixes">test_c14n_tostring_inclusive_ns_prefixes()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_tostring_with_comments">test_c14n_tostring_with_comments()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_iterparse_start_end">test_iterparse_start_end()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_tostring_with_comments">test_c14n_tostring_with_comments()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_with_comments">test_c14n_with_comments()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_strip">test_iterparse_strip()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html#test_c14n_with_comments">test_c14n_with_comments()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeC14NTestCase-class.html">ETreeC14NTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_c_api">test_c_api()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag">test_iterparse_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_tostring_method_text">test_tostring_method_text()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_c_api">test_c_api()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_cache">test_cache()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html">EtreeElementPathTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag_all">test_iterparse_tag_all()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_method_text_encoding">test_tostring_method_text_encoding()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_cache">test_cache()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html">EtreeElementPathTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_builder.BuilderTestCase-class.html#test_cdata">test_cdata()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_builder.BuilderTestCase-class.html">BuilderTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag_ns">test_iterparse_tag_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_method_text_unicode">test_tostring_method_text_unicode()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_builder.BuilderTestCase-class.html#test_cdata">test_cdata()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_builder.BuilderTestCase-class.html">BuilderTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata">test_cdata()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag_ns_all">test_iterparse_tag_ns_all()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_none">test_tostring_none()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata">test_cdata()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_errors">test_cdata_errors()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag_ns_empty">test_iterparse_tag_ns_empty()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_errors">test_cdata_errors()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_parser">test_cdata_parser()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tag_ns_empty_all">test_iterparse_tag_ns_empty_all()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_parser">test_cdata_parser()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_builder.BuilderTestCase-class.html#test_cdata_solo">test_cdata_solo()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_builder.BuilderTestCase-class.html">BuilderTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterparse_tree_comments">test_iterparse_tree_comments()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_standalone_in_out">test_tostring_standalone_in_out()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_builder.BuilderTestCase-class.html#test_cdata_solo">test_cdata_solo()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_builder.BuilderTestCase-class.html">BuilderTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_tail">test_cdata_tail()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#test_iterparse_utf16_bom">test_iterparse_utf16_bom()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_unicode">test_tostring_unicode()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_tail">test_cdata_tail()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_type">test_cdata_type()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#test_iterparse_utf8_bom">test_iterparse_utf8_bom()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_type">test_cdata_type()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_xpath">test_cdata_xpath()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_itersiblings">test_itersiblings()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_cdata_xpath">test_cdata_xpath()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_change_pytype_attribute">test_change_pytype_attribute()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_itersiblings_tag">test_itersiblings_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_tostring_unicode_none">test_tostring_unicode_none()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_change_pytype_attribute">test_change_pytype_attribute()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child">test_child()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_itersiblings_tag_multiple">test_itersiblings_tag_multiple()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child">test_child()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_addattr">test_child_addattr()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_itertext">test_itertext()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_addattr">test_child_addattr()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_getattr">test_child_getattr()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_itertext_child">test_itertext_child()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_getattr">test_child_getattr()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_getattr_empty_ns">test_child_getattr_empty_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk">test_iterwalk()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_getattr_empty_ns">test_child_getattr_empty_ns()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_index">test_child_index()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_attrib_ns">test_iterwalk_attrib_ns()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_index">test_child_index()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_index_neg">test_child_index_neg()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_clear">test_iterwalk_clear()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_index_neg">test_child_index_neg()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_iter">test_child_iter()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_end_skip">test_iterwalk_end_skip()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_iter">test_child_iter()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_len">test_child_len()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_getiterator">test_iterwalk_getiterator()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_len">test_child_len()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_nonexistant">test_child_nonexistant()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_ns_skip">test_iterwalk_ns_skip()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_nonexistant">test_child_nonexistant()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_ns_nons">test_child_ns_nons()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_start">test_iterwalk_start()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_ns_nons">test_child_ns_nons()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_set_ro">test_child_set_ro()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_start_end">test_iterwalk_start_end()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_child_set_ro">test_child_set_ro()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_class_lookup">test_class_lookup()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_start_end_skip">test_iterwalk_start_end_skip()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_class_lookup">test_class_lookup()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_class_lookup_reentry">test_class_lookup_reentry()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html">ClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_tag">test_iterwalk_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_bool_cmp">test_type_bool_cmp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_class_lookup_reentry">test_class_lookup_reentry()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_class_lookup_type_mismatch">test_class_lookup_type_mismatch()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html">ClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_iterwalk_tag_all">test_iterwalk_tag_all()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_class_lookup_type_mismatch">test_class_lookup_type_mismatch()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html">ClassLookupTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_filename">test_class_parse_filename()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_large_sourceline_XML">test_large_sourceline_XML()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_float_instantiation_precision">test_type_float_instantiation_precision()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_filename">test_class_parse_filename()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_filename_remove_previous">test_class_parse_filename_remove_previous()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup">test_lookup()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_filename_remove_previous">test_class_parse_filename_remove_previous()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_fileobject">test_class_parse_fileobject()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_attrib">test_lookup_attrib()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_fileobject">test_class_parse_fileobject()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_unamed_fileobject">test_class_parse_unamed_fileobject()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_bool">test_lookup_bool()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html#test_class_parse_unamed_fileobject">test_class_parse_unamed_fileobject()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_io._IOTestCaseBase-class.html" onclick="show_private();">_IOTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_classlookup-module.html">test_classlookup</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_get">test_lookup_get()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_int_cmp">test_type_int_cmp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_classlookup-module.html">test_classlookup</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_clean_doctype">test_clean_doctype()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_get_default">test_lookup_get_default()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_none_cmp">test_type_none_cmp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_clean_doctype">test_clean_doctype()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear">test_clear()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getchildren">test_lookup_getchildren()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_NoneType">test_type_NoneType()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear">test_clear()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_sub">test_clear_sub()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getitem">test_lookup_getitem()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_sub">test_clear_sub()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_tail">test_clear_tail()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getitem_neg">test_lookup_getitem_neg()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_clear_tail">test_clear_tail()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_closing_out_of_order_in_error_case">test_closing_out_of_order_in_error_case()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getnext">test_lookup_getnext()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_as_complex">test_type_str_as_complex()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_closing_out_of_order_in_error_case">test_closing_out_of_order_in_error_case()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment">test_comment()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getparent">test_lookup_getparent()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_as_float">test_type_str_as_float()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment">test_comment()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_comment">test_comment()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getprevious">test_lookup_getprevious()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_as_int">test_type_str_as_int()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_comment">test_comment()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_classlookup.ProxyTestCase-class.html#test_comment_base">test_comment_base()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_classlookup.ProxyTestCase-class.html">ProxyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_getslice">test_lookup_getslice()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_cmp">test_type_str_cmp()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_classlookup.ProxyTestCase-class.html#test_comment_base">test_comment_base()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_classlookup.ProxyTestCase-class.html">ProxyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_comment_before_dtd">test_comment_before_dtd()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_iter_children">test_lookup_iter_children()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_floatliteral">test_type_str_floatliteral()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html#test_comment_before_dtd">test_comment_before_dtd()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd.ETreeDtdTestCase-class.html">ETreeDtdTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_empty">test_comment_empty()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_iterchildren">test_lookup_iterchildren()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_hash">test_type_str_hash()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_empty">test_comment_empty()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_getitem_getslice">test_comment_getitem_getslice()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_iterchildren_tag">test_lookup_iterchildren_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_intliteral">test_type_str_intliteral()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_getitem_getslice">test_comment_getitem_getslice()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_immutable">test_comment_immutable()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_keep_ref_assertion">test_lookup_keep_ref_assertion()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_mod">test_type_str_mod()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_immutable">test_comment_immutable()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_immutable_attrib">test_comment_immutable_attrib()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_len">test_lookup_len()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_immutable_attrib">test_comment_immutable_attrib()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_no_proxy_yet">test_comment_no_proxy_yet()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_prefix">test_lookup_prefix()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_no_proxy_yet">test_comment_no_proxy_yet()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_nonsense">test_comment_nonsense()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_sourceline">test_lookup_sourceline()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_str_sequence">test_type_str_sequence()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_nonsense">test_comment_nonsense()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_parse_empty">test_comment_parse_empty()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_tag">test_lookup_tag()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_unregistered">test_type_unregistered()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_comment_parse_empty">test_comment_parse_empty()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_text">test_comment_text()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_tail">test_lookup_tail()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_ustr">test_type_ustr()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_text">test_comment_text()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_whitespace">test_comment_whitespace()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_lookup_text">test_lookup_text()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_comment_whitespace">test_comment_whitespace()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_comments_fallback">test_comments_fallback()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html#test_lookup_without_fallback">test_lookup_without_fallback()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_classlookup.ClassLookupTestCase-class.html">ClassLookupTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_type_ustr_floatliteral">test_type_ustr_floatliteral()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall">test_findall()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_find">test_find()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html">EtreeElementPathTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setattr">test_setattr()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#TREE_INVALID_DEC">TREE_INVALID_DEC</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_findall">test_findall()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall">test_findall()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setattr_nonunicode">test_setattr_nonunicode()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#TREE_INVALID_HEX">TREE_INVALID_HEX</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_different_nsmaps">test_findall_different_nsmaps()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_findall">test_findall()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem">test_setitem()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#TREE_NOT_UTF8">TREE_NOT_UTF8</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_empty_prefix">test_findall_empty_prefix()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_different_nsmaps">test_findall_different_nsmaps()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem2">test_setitem2()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify-module.html">lxml.tests.test_objectify</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall_ns">test_findall_ns()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_empty_prefix">test_findall_empty_prefix()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_setitem_assert">test_setitem_assert()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#TREE_UNTERMINATED_ENTITY">TREE_UNTERMINATED_ENTITY</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_ns">test_findall_ns()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_findall_ns">test_findall_ns()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_indexerror">test_setitem_indexerror()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.TreeBuilder-class.html">TreeBuilder</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_findall_ns">test_findall_ns()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_ns">test_findall_ns()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_replace">test_setitem_replace()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="xml.etree.ElementTree.TreeBuilder-class.html">TreeBuilder</a></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_syntax_error">test_findall_syntax_error()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_findall_ns">test_findall_ns()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setitem_string">test_setitem_string()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#TT">TT</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#test_flush">test_flush()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html">TempPathXmlFileTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#test_findall_syntax_error">test_findall_syntax_error()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#test_setitem_string_special">test_setitem_string_special()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._LogEntry-class.html#type">type</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._LogEntry-class.html" onclick="show_private();">_LogEntry</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_flush">test_flush()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#test_flush">test_flush()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html">TempPathXmlFileTestCase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setitem_tail">test_setitem_tail()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.InputElement-class.html#type">type</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.InputElement-class.html">InputElement</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstring">test_fromstring()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#test_flush">test_flush()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice">test_setslice()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.PyType-class.html#type_check">type_check</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.PyType-class.html">PyType</a>)</span></td>
 </tr>
 <tr>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstringlist">test_fromstringlist()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_fromstring">test_fromstring()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#test_setslice_all">test_setslice_all()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a8c6efef89694eebb3a4d27dd0928d3bc91560e8..e14e696dc652bf7cc949423f43b8dd601a73d857 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2b4ea984ea895782d713363bf4c271cf7e21d74c..2752592e7413b29c95341cb1ae8e216823aa02b1 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 59b39ddc5b3921c72e486e5eb3c3efe467f6bd85..5176cdefd646ca797df05e139be83373205f94df 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 22dfe9799d31a886268baa2ffd33ae3721144762..1aa4102d25418e68effa2c9bf54b98f2b4ebe6ea 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 63602aa2fcee639bf0cf857de31535b32a157e6b..203e93301bd25f117762c17f8c66bffd989bcec0 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 01d2add7dd0574dcb04da3b145fc4798efdcc07e..40c36aa01aa9e0bcc335cb3ae4a11ba0e7bd4d47 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 80f460e2228f06eb76a1bd1252632ef820a43c98..69cbcd47d722febb45d6419fd86c9191b7e8e605 100644 (file)
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ListErrorLog-class.html" onclick="show_private();">_ListErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XMLParser-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XMLParser-class.html">XMLParser</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html">_Attrib</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#_assert_tokens">_assert_tokens()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html">EtreeElementPathTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.Classes-class.html#__contains__">__contains__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.Classes-class.html">Classes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XMLPullParser-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XMLPullParser-class.html" onclick="show_private();">XMLPullParser</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_avoid_classes">_avoid_classes</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html">_Attrib</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.FieldsDict-class.html#__contains__">__contains__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.FieldsDict-class.html">FieldsDict</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XMLSchema-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XMLSchema-class.html">XMLSchema</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_avoid_elements">_avoid_elements</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_avoid_classes">_avoid_classes</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.html.InputGetter-class.html">InputGetter</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XMLSchemaError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XMLSchemaError-class.html">XMLSchemaError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_avoid_hosts">_avoid_hosts</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_avoid_elements">_avoid_elements</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLT-class.html">XSLT</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XMLSchemaParseError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XMLSchemaParseError-class.html">XMLSchemaParseError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_avoid_word_break_classes">_avoid_word_break_classes</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_avoid_hosts">_avoid_hosts</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XMLSchemaValidateError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XMLSchemaValidateError-class.html">XMLSchemaValidateError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_avoid_word_break_elements">_avoid_word_break_elements</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_avoid_word_break_classes">_avoid_word_break_classes</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XPath-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPath-class.html">XPath</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._BaseErrorLog-class.html">_BaseErrorLog</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_avoid_word_break_elements">_avoid_word_break_elements</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementTree-class.html#__copy__">__copy__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementTree-class.html" onclick="show_private();">_ElementTree</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XPathDocumentEvaluator-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPathDocumentEvaluator-class.html">XPathDocumentEvaluator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_body_re">_body_re</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._BaseErrorLog-class.html">_BaseErrorLog</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLT-class.html#__deepcopy__">__deepcopy__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLT-class.html">XSLT</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XPathElementEvaluator-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPathElementEvaluator-class.html" onclick="show_private();">XPathElementEvaluator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_break_prefer_re">_break_prefer_re</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_body_re">_body_re</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__deepcopy__">__deepcopy__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XPathError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPathError-class.html">XPathError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_break_text">_break_text()</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_break_prefer_re">_break_prefer_re</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XPathEvalError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPathEvalError-class.html">XPathEvalError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadPipelineTestCase-class.html#_build_pipeline">_build_pipeline()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadPipelineTestCase-class.html">ThreadPipelineTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_break_text">_break_text()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementTree-class.html#__deepcopy__">__deepcopy__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementTree-class.html" onclick="show_private();">_ElementTree</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XPathFunctionError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPathFunctionError-class.html">XPathFunctionError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.sax.ElementTreeProducer-class.html#_build_qname">_build_qname()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeProducer-class.html">ElementTreeProducer</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadPipelineTestCase-class.html#_build_pipeline">_build_pipeline()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadPipelineTestCase-class.html">ThreadPipelineTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedElement-class.html#__delattr__">__delattr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedElement-class.html">ObjectifiedElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XPathResultError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPathResultError-class.html">XPathResultError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#_buildElementClass">_buildElementClass()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.sax.ElementTreeProducer-class.html#_build_qname">_build_qname()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeProducer-class.html">ElementTreeProducer</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__delitem__">__delitem__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLT-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLT-class.html">XSLT</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.sax.ElementTreeContentHandler-class.html#_buildTag">_buildTag()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeContentHandler-class.html">ElementTreeContentHandler</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#_buildElementClass">_buildElementClass()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#__delitem__">__delitem__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLTAccessControl-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLTAccessControl-class.html">XSLTAccessControl</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_bytes">_bytes()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.sax.ElementTreeContentHandler-class.html#_buildTag">_buildTag()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeContentHandler-class.html">ElementTreeContentHandler</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.FieldsDict-class.html#__delitem__">__delitem__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.FieldsDict-class.html">FieldsDict</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLTApplyError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLTApplyError-class.html">XSLTApplyError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_check">_check()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_bytes">_bytes()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedElement-class.html#__delitem__">__delitem__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedElement-class.html">ObjectifiedElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLTError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLTError-class.html">XSLTError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element">_check_element()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_check">_check()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__div__">__div__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLTExtension-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLTExtension-class.html">XSLTExtension</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element_tree">_check_element_tree()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element">_check_element()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.html.ElementSoup-module.html">lxml.html.ElementSoup</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLTExtensionError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLTExtensionError-class.html">XSLTExtensionError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_mapping">_check_mapping()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_element_tree">_check_element_tree()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.xmlfile-class.html" onclick="show_private();">xmlfile</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLTParseError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLTParseError-class.html">XSLTParseError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_string">_check_string()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_mapping">_check_mapping()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.QName-class.html">QName</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#_checker">_checker</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_doctestcompare.DoctestCompareTest-class.html">DoctestCompareTest</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_check_string">_check_string()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__eq__">__eq__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._BaseErrorLog-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._BaseErrorLog-class.html" onclick="show_private();">_BaseErrorLog</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#_checkIDDict">_checkIDDict()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_doctestcompare.DoctestCompareTest-class.html#_checker">_checker</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_doctestcompare.DoctestCompareTest-class.html">DoctestCompareTest</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#__eq__">__eq__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Comment-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Comment-class.html" onclick="show_private();">_Comment</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html-module.html#_class_xpath">_class_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#_checkIDDict">_checkIDDict()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NoneElement-class.html#__eq__">__eq__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NoneElement-class.html">NoneElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Document-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Document-class.html" onclick="show_private();">_Document</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._Validator-class.html#_clear_error_log">_clear_error_log()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree._Validator-class.html" onclick="show_private();">_Validator</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html-module.html#_class_xpath">_class_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__eq__">__eq__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._DomainErrorLog-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._DomainErrorLog-class.html" onclick="show_private();">_DomainErrorLog</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html#_close_and_return_root">_close_and_return_root()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html" onclick="show_private();">_XMLPullParserTest</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._Validator-class.html#_clear_error_log">_clear_error_log()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree._Validator-class.html" onclick="show_private();">_Validator</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__eq__">__eq__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html-module.html#_collect_string_content">_collect_string_content</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html#_close_and_return_root">_close_and_return_root()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html" onclick="show_private();">_XMLPullParserTest</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ErrorLog-class.html#__exit__">__exit__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ErrorLog-class.html" onclick="show_private();">_ErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementIterator-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementIterator-class.html" onclick="show_private();">_ElementIterator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._Comment-class.html">_Comment</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html-module.html#_collect_string_content">_collect_string_content</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.xmlfile-class.html#__exit__">__exit__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.xmlfile-class.html" onclick="show_private();">xmlfile</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementMatchIterator-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementMatchIterator-class.html" onclick="show_private();">_ElementMatchIterator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_compile">_compile</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._Comment-class.html">_Comment</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__float__">__float__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementTagMatcher-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementTagMatcher-class.html" onclick="show_private();">_ElementTagMatcher</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_conditional_comment_re">_conditional_comment_re</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_compile">_compile</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__float__">__float__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementTree-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementTree-class.html" onclick="show_private();">_ElementTree</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_contains_block_level_tag">_contains_block_level_tag()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_conditional_comment_re">_conditional_comment_re</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.QName-class.html#__ge__">__ge__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.QName-class.html">QName</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementUnicodeResult-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementUnicodeResult-class.html" onclick="show_private();">_ElementUnicodeResult</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#_convert_tree">_convert_tree()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_contains_block_level_tag">_contains_block_level_tag()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__ge__">__ge__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Entity-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Entity-class.html" onclick="show_private();">_Entity</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_css_import_re">_css_import_re</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#_convert_tree">_convert_tree()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#__ge__">__ge__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ErrorLog-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ErrorLog-class.html" onclick="show_private();">_ErrorLog</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_css_javascript_re">_css_javascript_re</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_css_import_re">_css_import_re</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NoneElement-class.html">NoneElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._FeedParser-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._FeedParser-class.html" onclick="show_private();">_FeedParser</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#_DECLARATION_OR_DOCTYPE">_DECLARATION_OR_DOCTYPE</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_css_javascript_re">_css_javascript_re</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__ge__">__ge__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._IDDict-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._IDDict-class.html" onclick="show_private();">_IDDict</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.HtmlElementClassLookup-class.html#_default_element_classes">_default_element_classes</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.HtmlElementClassLookup-class.html">HtmlElementClassLookup</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#_DECLARATION_OR_DOCTYPE">_DECLARATION_OR_DOCTYPE</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__ge__">__ge__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ListErrorLog-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ListErrorLog-class.html" onclick="show_private();">_ListErrorLog</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._Document-class.html">_Document</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.HtmlElementClassLookup-class.html#_default_element_classes">_default_element_classes</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.HtmlElementClassLookup-class.html">HtmlElementClassLookup</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#__getattr__">__getattr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._LogEntry-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._LogEntry-class.html" onclick="show_private();">_LogEntry</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_domain">_domain</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._Document-class.html">_Document</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.ElementMaker-class.html#__getattr__">__getattr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ElementMaker-class.html">ElementMaker</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ProcessingInstruction-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ProcessingInstruction-class.html" onclick="show_private();">_ProcessingInstruction</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._DomainErrorLog-class.html">_DomainErrorLog</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_domain">_domain</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedElement-class.html#__getattr__">__getattr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedElement-class.html">ObjectifiedElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._RotatingErrorLog-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._RotatingErrorLog-class.html" onclick="show_private();">_RotatingErrorLog</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._Element-class.html">_Element</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree._DomainErrorLog-class.html">_DomainErrorLog</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._SaxParserTarget-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._SaxParserTarget-class.html" onclick="show_private();">_SaxParserTarget</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._ElementIterator-class.html">_ElementIterator</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree._Element-class.html">_Element</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ElementMaker-class.html">ElementMaker</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Validator-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Validator-class.html" onclick="show_private();">_Validator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._ElementMatchIterator-class.html">_ElementMatchIterator</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree._ElementIterator-class.html">_ElementIterator</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedElement-class.html">ObjectifiedElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._XPathEvaluatorBase-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._XPathEvaluatorBase-class.html" onclick="show_private();">_XPathEvaluatorBase</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._ElementStringResult-class.html">_ElementStringResult</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree._ElementMatchIterator-class.html">_ElementMatchIterator</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._XSLTProcessingInstruction-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._XSLTProcessingInstruction-class.html" onclick="show_private();">_XSLTProcessingInstruction</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._ElementTagMatcher-class.html">_ElementTagMatcher</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree._ElementStringResult-class.html">_ElementStringResult</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._XSLTResultTree-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._XSLTResultTree-class.html" onclick="show_private();">_XSLTResultTree</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._ElementTree-class.html">_ElementTree</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree._ElementTagMatcher-class.html">_ElementTagMatcher</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree._IDDict-class.html" onclick="show_private();">_IDDict</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.htmlfile-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.htmlfile-class.html" onclick="show_private();">htmlfile</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._ElementUnicodeResult-class.html">_ElementUnicodeResult</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree._ElementTree-class.html">_ElementTree</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ListErrorLog-class.html" onclick="show_private();">_ListErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.iterparse-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterparse-class.html">iterparse</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_end_body_re">_end_body_re</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._ElementUnicodeResult-class.html">_ElementUnicodeResult</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.FieldsDict-class.html#__getitem__">__getitem__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.FieldsDict-class.html">FieldsDict</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.iterwalk-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterwalk-class.html">iterwalk</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._Entity-class.html">_Entity</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_end_body_re">_end_body_re</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.InputGetter-class.html#__getitem__">__getitem__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.InputGetter-class.html">InputGetter</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.xmlfile-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.xmlfile-class.html" onclick="show_private();">xmlfile</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_error_type">_error_type</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._Entity-class.html">_Entity</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedElement-class.html#__getitem__">__getitem__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedElement-class.html">ObjectifiedElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.tag_token-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.tag_token-class.html" onclick="show_private();">tag_token</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._ErrorLog-class.html">_ErrorLog</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_error_type">_error_type</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.QName-class.html#__gt__">__gt__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.QName-class.html">QName</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.token-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.token-class.html" onclick="show_private();">token</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html">_ETreeTestCaseBase</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree-module.html">lxml.tests.test_elementtree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._ErrorLog-class.html">_ErrorLog</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__gt__">__gt__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_expand">_expand</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html">_ETreeTestCaseBase</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree-module.html">lxml.tests.test_elementtree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#__gt__">__gt__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.ElementMaker-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ElementMaker-class.html">ElementMaker</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_extract">_extract()</a><br />
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_expand">_expand</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NoneElement-class.html">NoneElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.FloatElement-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.FloatElement-class.html">FloatElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_extract_rng">_extract_rng</a><br />
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_extract">_extract()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.IntElement-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.IntElement-class.html">IntElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_extract_xsd">_extract_xsd</a><br />
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_extract_rng">_extract_rng</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.LongElement-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.LongElement-class.html">LongElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html#_feed">_feed()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html" onclick="show_private();">_XMLPullParserTest</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_extract_xsd">_extract_xsd</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.QName-class.html#__hash__">__hash__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.QName-class.html">QName</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NoneElement-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NoneElement-class.html">NoneElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._FeedParser-class.html">_FeedParser</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html#_feed">_feed()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html" onclick="show_private();">_XMLPullParserTest</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#__hash__">__hash__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_file">_file</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._FeedParser-class.html">_FeedParser</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NoneElement-class.html#__hash__">__hash__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NoneElement-class.html">NoneElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectPath-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectPath-class.html">ObjectPath</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_fill_form">_fill_form()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_file">_file</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__hash__">__hash__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedDataElement-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedDataElement-class.html">ObjectifiedDataElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_fill_multiple">_fill_multiple()</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_fill_form">_fill_form()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedElement-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedElement-class.html">ObjectifiedElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_fill_single">_fill_single()</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_fill_multiple">_fill_multiple()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifyElementClassLookup-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifyElementClassLookup-class.html">ObjectifyElementClassLookup</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#_find_doctest_frame">_find_doctest_frame()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_fill_single">_fill_single()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.PyType-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.PyType-class.html">PyType</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_find_elements_for_name">_find_elements_for_name()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#_find_doctest_frame">_find_doctest_frame()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.cssselect.CSSSelector-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.cssselect.CSSSelector-class.html">CSSSelector</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_find_external_links">_find_external_links</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_find_elements_for_name">_find_elements_for_name()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.doctestcompare._RestoreChecker-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.doctestcompare._RestoreChecker-class.html" onclick="show_private();">_RestoreChecker</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ElementDepthFirstIterator-class.html#__next__">__next__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ElementDepthFirstIterator-class.html" onclick="show_private();">ElementDepthFirstIterator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_find_form">_find_form()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_find_external_links">_find_external_links</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.AttributeBasedElementClassLookup-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.AttributeBasedElementClassLookup-class.html">AttributeBasedElementClassLookup</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ElementTextIterator-class.html#__next__">__next__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ElementTextIterator-class.html" onclick="show_private();">ElementTextIterator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_find_form_ids">_find_form_ids()</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_find_form">_find_form()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.CommentBase-class.html">CommentBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementIterator-class.html#__next__">__next__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementIterator-class.html" onclick="show_private();">_ElementIterator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_find_styled_elements">_find_styled_elements</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_find_form_ids">_find_form_ids()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.DTD-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DTD-class.html">DTD</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementMatchIterator-class.html#__next__">__next__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementMatchIterator-class.html" onclick="show_private();">_ElementMatchIterator</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.html5parser-module.html#_find_tag">_find_tag()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.html5parser-module.html">lxml.html.html5parser</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_find_styled_elements">_find_styled_elements</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ETCompatXMLParser-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ETCompatXMLParser-class.html">ETCompatXMLParser</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.iterparse-class.html#__next__">__next__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterparse-class.html">iterparse</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_fix_bytes">_fix_bytes()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.html5parser-module.html#_find_tag">_find_tag()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.html5parser-module.html">lxml.html.html5parser</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ETXPath-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ETXPath-class.html">ETXPath</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.iterwalk-class.html#__next__">__next__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterwalk-class.html">iterwalk</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_fix_exceptions">_fix_exceptions()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_fix_bytes">_fix_bytes()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ElementBase-class.html">ElementBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__nonzero__">__nonzero__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_fix_traceback">_fix_traceback()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_fix_exceptions">_fix_exceptions()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ElementDefaultClassLookup-class.html">ElementDefaultClassLookup</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#__nonzero__">__nonzero__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_fix_unicode">_fix_unicode</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_fix_traceback">_fix_traceback()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ElementNamespaceClassLookup-class.html">ElementNamespaceClassLookup</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ListErrorLog-class.html#__nonzero__">__nonzero__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ListErrorLog-class.html" onclick="show_private();">_ListErrorLog</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_fixup_ins_del_tags">_fixup_ins_del_tags()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_fix_unicode">_fix_unicode</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.EntityBase-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.EntityBase-class.html">EntityBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#__nonzero__">__nonzero__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_form_name_xpath">_form_name_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_fixup_ins_del_tags">_fixup_ins_del_tags()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.FallbackElementClassLookup-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.FallbackElementClassLookup-class.html">FallbackElementClassLookup</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NoneElement-class.html#__nonzero__">__nonzero__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NoneElement-class.html">NoneElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html-module.html#_forms_xpath">_forms_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_form_name_xpath">_form_name_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.HTMLParser-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.HTMLParser-class.html">HTMLParser</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__nonzero__">__nonzero__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_get_caller_relative_path">_get_caller_relative_path()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html-module.html#_forms_xpath">_forms_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.HTMLPullParser-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.HTMLPullParser-class.html" onclick="show_private();">HTMLPullParser</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__nonzero__">__nonzero__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.sax.ElementTreeContentHandler-class.html#_get_etree">_get_etree()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeContentHandler-class.html">ElementTreeContentHandler</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_get_caller_relative_path">_get_caller_relative_path()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.LxmlError-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.LxmlError-class.html">LxmlError</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__oct__">__oct__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#_getName">_getName()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.sax.ElementTreeContentHandler-class.html#_get_etree">_get_etree()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeContentHandler-class.html">ElementTreeContentHandler</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.PIBase-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.PIBase-class.html">PIBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__or__">__or__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorLevels-class.html#_getName">_getName()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorLevels-class.html">ErrorLevels</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#_getName">_getName()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ParseError-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ParseError-class.html">ParseError</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.ElementInclude-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.ElementInclude-module.html">lxml.ElementInclude</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#_getName">_getName()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorLevels-class.html#_getName">_getName()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorLevels-class.html">ErrorLevels</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.PyErrorLog-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.PyErrorLog-class.html">PyErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml-module.html">lxml</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.RelaxNGErrorTypes-class.html#_getName">_getName()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.RelaxNGErrorTypes-class.html">RelaxNGErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#_getName">_getName()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.QName-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.QName-class.html">QName</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.builder-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.builder-module.html">lxml.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.sax-module.html#_getNsTag">_getNsTag()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.sax-module.html">lxml.sax</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.RelaxNGErrorTypes-class.html#_getName">_getName()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.RelaxNGErrorTypes-class.html">RelaxNGErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.RelaxNG-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.RelaxNG-class.html">RelaxNG</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.cssselect-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.cssselect-module.html">lxml.cssselect</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#_has_sneaky_javascript">_has_sneaky_javascript()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.sax-module.html#_getNsTag">_getNsTag()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.sax-module.html">lxml.sax</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.Schematron-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.Schematron-class.html">Schematron</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#_html_parser">_html_parser</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#_has_sneaky_javascript">_has_sneaky_javascript()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.TreeBuilder-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.TreeBuilder-class.html">TreeBuilder</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html-module.html#_id_xpath">_id_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#_html_parser">_html_parser</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.XInclude-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XInclude-class.html">XInclude</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.ElementSoup-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.ElementSoup-module.html">lxml.html.ElementSoup</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._IDDict-class.html">_IDDict</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html-module.html#_id_xpath">_id_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.XMLParser-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XMLParser-class.html">XMLParser</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_include">_include</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._IDDict-class.html">_IDDict</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.XMLPullParser-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XMLPullParser-class.html" onclick="show_private();">XMLPullParser</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.builder-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.builder-module.html">lxml.html.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.ElementInclude-module.html#_include">_include()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.ElementInclude-module.html">lxml.ElementInclude</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_include">_include</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.XMLSchema-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XMLSchema-class.html">XMLSchema</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.clean-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#_init">_init()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.ElementInclude-module.html#_include">_include()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.ElementInclude-module.html">lxml.ElementInclude</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.XPath-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPath-class.html">XPath</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.defs-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.defs-module.html">lxml.html.defs</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#_init">_init()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#_init">_init()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.XPathDocumentEvaluator-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPathDocumentEvaluator-class.html">XPathDocumentEvaluator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.objectify.FloatElement-class.html#_init">_init()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.objectify.FloatElement-class.html">FloatElement</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#_init">_init()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.XPathElementEvaluator-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPathElementEvaluator-class.html" onclick="show_private();">XPathElementEvaluator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.objectify.IntElement-class.html#_init">_init()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.objectify.IntElement-class.html">IntElement</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.objectify.FloatElement-class.html#_init">_init()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.objectify.FloatElement-class.html">FloatElement</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLT-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLT-class.html">XSLT</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.html5parser-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.html5parser-module.html">lxml.html.html5parser</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.objectify.LongElement-class.html#_init">_init()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.objectify.LongElement-class.html">LongElement</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.objectify.IntElement-class.html#_init">_init()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.objectify.IntElement-class.html">IntElement</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLTAccessControl-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLTAccessControl-class.html">XSLTAccessControl</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#_init_node_converters">_init_node_converters()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.objectify.LongElement-class.html#_init">_init()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.objectify.LongElement-class.html">LongElement</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._BaseErrorLog-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._BaseErrorLog-class.html" onclick="show_private();">_BaseErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.includes-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.includes-module.html">lxml.includes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_input_xpath">_input_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#_init_node_converters">_init_node_converters()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._DomainErrorLog-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._DomainErrorLog-class.html" onclick="show_private();">_DomainErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_ins_del_re">_ins_del_re</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_input_xpath">_input_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ErrorLog-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ErrorLog-class.html" onclick="show_private();">_ErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify-module.html">lxml.objectify</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_insert_break">_insert_break()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_ins_del_re">_ins_del_re</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ListErrorLog-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ListErrorLog-class.html" onclick="show_private();">_ListErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.pyclasslookup-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.pyclasslookup-module.html">lxml.pyclasslookup</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_insert_error">_insert_error()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_insert_break">_insert_break()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._RotatingErrorLog-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._RotatingErrorLog-class.html" onclick="show_private();">_RotatingErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.sax-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax-module.html">lxml.sax</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html">_IOTestCaseBase</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_io-module.html">lxml.tests.test_io</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_insert_error">_insert_error()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._TargetParserResult-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._TargetParserResult-class.html" onclick="show_private();">_TargetParserResult</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests-module.html">lxml.tests</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_is_image_dataurl">_is_image_dataurl()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_io._IOTestCaseBase-class.html">_IOTestCaseBase</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_io-module.html">lxml.tests.test_io</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._XPathEvaluatorBase-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._XPathEvaluatorBase-class.html" onclick="show_private();">_XPathEvaluatorBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_is_javascript_scheme">_is_javascript_scheme()</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_is_image_dataurl">_is_image_dataurl()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.htmlfile-class.html" onclick="show_private();">htmlfile</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.dummy_http_server-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.dummy_http_server-module.html">lxml.tests.dummy_http_server</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_is_possibly_malicious_scheme">_is_possibly_malicious_scheme()</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_is_javascript_scheme">_is_javascript_scheme()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterparse-class.html">iterparse</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest-module.html">lxml.tests.selftest</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#_IS_PYTHON_3">_IS_PYTHON_3</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_is_possibly_malicious_scheme">_is_possibly_malicious_scheme()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.iterwalk-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterwalk-class.html">iterwalk</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.selftest2-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.selftest2-module.html">lxml.tests.selftest2</a>)</span></td>
-<td width="33%" class="link-index"><a href="xml.etree.ElementTree._IterParseIterator-class.html">_IterParseIterator</a></td>
+<td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#_IS_PYTHON_3">_IS_PYTHON_3</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.xmlfile-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.xmlfile-class.html" onclick="show_private();">xmlfile</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_builder-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_builder-module.html">lxml.tests.test_builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#_kill_elements">_kill_elements()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
+<td width="33%" class="link-index"><a href="xml.etree.ElementTree._IterParseIterator-class.html">_IterParseIterator</a></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.CheckboxValues-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.CheckboxValues-class.html">CheckboxValues</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_classlookup-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_classlookup-module.html">lxml.tests.test_classlookup</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_label_for_xpath">_label_for_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#_kill_elements">_kill_elements()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.Classes-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.Classes-class.html">Classes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_css-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_css-module.html">lxml.tests.test_css</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html-module.html#_label_xpath">_label_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_label_for_xpath">_label_for_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.FieldsDict-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.FieldsDict-class.html">FieldsDict</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_doctestcompare-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_doctestcompare-module.html">lxml.tests.test_doctestcompare</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_level">_level</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html-module.html#_label_xpath">_label_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.HTMLParser-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.HTMLParser-class.html">HTMLParser</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_dtd-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_dtd-module.html">lxml.tests.test_dtd</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_link_regexes">_link_regexes</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_level">_level</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.HtmlElementClassLookup-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.HtmlElementClassLookup-class.html">HtmlElementClassLookup</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementpath-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementpath-module.html">lxml.tests.test_elementpath</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_link_text">_link_text()</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_link_regexes">_link_regexes</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.html.InputGetter-class.html">InputGetter</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_elementtree-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree-module.html">lxml.tests.test_elementtree</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._ListErrorLog-class.html">_ListErrorLog</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_link_text">_link_text()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.MultipleSelectOptions-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.MultipleSelectOptions-class.html">MultipleSelectOptions</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_errors-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_errors-module.html">lxml.tests.test_errors</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._LogEntry-class.html">_LogEntry</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree._ListErrorLog-class.html">_ListErrorLog</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.html.XHTMLParser-class.html">XHTMLParser</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_etree-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree-module.html">lxml.tests.test_etree</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.doctestcompare.LXMLOutputChecker-class.html#_looks_like_markup">_looks_like_markup()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare.LXMLOutputChecker-class.html">LXMLOutputChecker</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._LogEntry-class.html">_LogEntry</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html._MethodFunc-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html._MethodFunc-class.html">_MethodFunc</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_external_document-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_external_document-module.html">lxml.tests.test_external_document</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.html5parser-module.html#_looks_like_url">_looks_like_url()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.html5parser-module.html">lxml.html.html5parser</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.doctestcompare.LXMLOutputChecker-class.html#_looks_like_markup">_looks_like_markup()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare.LXMLOutputChecker-class.html">LXMLOutputChecker</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_htmlparser-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_htmlparser-module.html">lxml.tests.test_htmlparser</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.ElementInclude-module.html#_lxml_default_loader">_lxml_default_loader()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.ElementInclude-module.html">lxml.ElementInclude</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.html5parser-module.html#_looks_like_url">_looks_like_url()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.html5parser-module.html">lxml.html.html5parser</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.formfill.DefaultErrorCreator-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.formfill.DefaultErrorCreator-class.html">DefaultErrorCreator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_http_io-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_http_io-module.html">lxml.tests.test_http_io</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.cssselect-module.html#_make_lower_case">_make_lower_case()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.cssselect-module.html">lxml.cssselect</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.ElementInclude-module.html#_lxml_default_loader">_lxml_default_loader()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.ElementInclude-module.html">lxml.ElementInclude</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.html5parser.HTMLParser-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.html5parser.HTMLParser-class.html">HTMLParser</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile-module.html">lxml.tests.test_incremental_xmlfile</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#_makeelement">_makeelement</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.cssselect-module.html#_make_lower_case">_make_lower_case()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.cssselect-module.html">lxml.cssselect</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.html5parser.XHTMLParser-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.html5parser.XHTMLParser-class.html">XHTMLParser</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_io-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_io-module.html">lxml.tests.test_io</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_merge_element_contents">_merge_element_contents()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#_makeelement">_makeelement</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.soupparser._PseudoTag-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.soupparser._PseudoTag-class.html" onclick="show_private();">_PseudoTag</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_isoschematron-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_isoschematron-module.html">lxml.tests.test_isoschematron</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html._MethodFunc-class.html">_MethodFunc</a></td>
+<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_merge_element_contents">_merge_element_contents()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_nsclasses-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_nsclasses-module.html">lxml.tests.test_nsclasses</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_move_el_inside_block">_move_el_inside_block()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html._MethodFunc-class.html">_MethodFunc</a></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.ElementMaker-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ElementMaker-class.html">ElementMaker</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_objectify-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify-module.html">lxml.tests.test_objectify</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.FormElement-class.html#_name">_name()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.FormElement-class.html">FormElement</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.diff-module.html#_move_el_inside_block">_move_el_inside_block()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.diff-module.html">lxml.html.diff</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectPath-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectPath-class.html">ObjectPath</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup-module.html">lxml.tests.test_pyclasslookup</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.InputGetter-class.html#_name_xpath">_name_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.InputGetter-class.html">InputGetter</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.FormElement-class.html#_name">_name()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.FormElement-class.html">FormElement</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifyElementClassLookup-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifyElementClassLookup-class.html">ObjectifyElementClassLookup</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_relaxng-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_relaxng-module.html">lxml.tests.test_relaxng</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_name_xpath">_name_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.InputGetter-class.html#_name_xpath">_name_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.InputGetter-class.html">InputGetter</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.PyType-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.PyType-class.html">PyType</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_sax-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_sax-module.html">lxml.tests.test_sax</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#_names">_names</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_name_xpath">_name_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.sax.ElementTreeContentHandler-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeContentHandler-class.html">ElementTreeContentHandler</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_schematron-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_schematron-module.html">lxml.tests.test_schematron</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorLevels-class.html#_names">_names</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorLevels-class.html">ErrorLevels</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#_names">_names</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.sax.ElementTreeProducer-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeProducer-class.html">ElementTreeProducer</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading-module.html">lxml.tests.test_threading</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#_names">_names</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorLevels-class.html#_names">_names</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorLevels-class.html">ErrorLevels</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.common_imports.LargeFileLike-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports.LargeFileLike-class.html">LargeFileLike</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_unicode-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_unicode-module.html">lxml.tests.test_unicode</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree.RelaxNGErrorTypes-class.html#_names">_names</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree.RelaxNGErrorTypes-class.html">RelaxNGErrorTypes</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#_names">_names</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.common_imports.LargeFileLikeUnicode-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports.LargeFileLikeUnicode-class.html">LargeFileLikeUnicode</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xmlschema-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xmlschema-module.html">lxml.tests.test_xmlschema</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#_namespace">_namespace</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree.RelaxNGErrorTypes-class.html#_names">_names</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree.RelaxNGErrorTypes-class.html">RelaxNGErrorTypes</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.common_imports.SillyFileLike-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports.SillyFileLike-class.html">SillyFileLike</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator-module.html">lxml.tests.test_xpathevaluator</a>)</span></td>
-<td width="33%" class="link-index"><a href="xml.etree.ElementTree-module.html#_namespace_map">_namespace_map</a><br />
-<span class="index-where">(in&nbsp;<a href="xml.etree.ElementTree-module.html">xml.etree.ElementTree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#_namespace">_namespace</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.common_imports.skipif-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports.skipif-class.html">skipif</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.tests.test_xslt-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt-module.html">lxml.tests.test_xslt</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#_norm_whitespace_re">_norm_whitespace_re</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
+<td width="33%" class="link-index"><a href="xml.etree.ElementTree-module.html#_namespace_map">_namespace_map</a><br />
+<span class="index-where">(in&nbsp;<a href="xml.etree.ElementTree-module.html">xml.etree.ElementTree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.dummy_http_server.HTTPRequestCollector-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.dummy_http_server.HTTPRequestCollector-class.html">HTTPRequestCollector</a>)</span></td>
 <td width="33%" class="link-index"><a href="xml.etree.ElementTree-module.html#__package__">__package__</a><br />
 <span class="index-where">(in&nbsp;<a href="xml.etree.ElementTree-module.html">xml.etree.ElementTree</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#_nsmap">_nsmap</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#_norm_whitespace_re">_norm_whitespace_re</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_doctestcompare.DummyInput-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_doctestcompare.DummyInput-class.html">DummyInput</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify-module.html#__parseBool">__parseBool()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify-module.html">lxml.objectify</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html-module.html#_options_xpath">_options_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#_nsmap">_nsmap</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase.SimpleFileLike-class.html">SimpleFileLike</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__pos__">__pos__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#_parse">_parse()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html-module.html#_options_xpath">_options_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html#__init__">__init__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadPipelineTestCase.Worker-class.html">Worker</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__pow__">__pow__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#_parse_doctype_declaration">_parse_doctype_declaration()</a><br />
+<td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#_parse">_parse()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xmlschema.ETreeXMLSchemaResolversTestCase.simple_resolver-class.html">simple_resolver</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.builder-module.html#__pyx_capi__">__pyx_capi__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.builder-module.html">lxml.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#_parse_file">_parse_file()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html">SimpleFileLikeXmlFileTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.soupparser-module.html#_parse_doctype_declaration">_parse_doctype_declaration()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__int__">__int__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree-module.html#__pyx_capi__">__pyx_capi__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#_parse_file">_parse_file()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html">TempPathXmlFileTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#_parse_file">_parse_file()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html">SimpleFileLikeXmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__int__">__int__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.builder-module.html#__pyx_unpickle_ElementMaker">__pyx_unpickle_ElementMaker()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.builder-module.html">lxml.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_parse_file">_parse_file()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#_parse_file">_parse_file()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html">TempPathXmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__invert__">__invert__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorDomains-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorDomains-class.html">ErrorDomains</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_http_io.HttpIOTestCase-class.html#_parse_from_http">_parse_from_http()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_http_io.HttpIOTestCase-class.html">HttpIOTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_parse_file">_parse_file()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ElementDepthFirstIterator-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ElementDepthFirstIterator-class.html" onclick="show_private();">ElementDepthFirstIterator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorLevels-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorLevels-class.html">ErrorLevels</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._ProcessingInstruction-class.html">_ProcessingInstruction</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_http_io.HttpIOTestCase-class.html#_parse_from_http">_parse_from_http()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_http_io.HttpIOTestCase-class.html">HttpIOTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ElementTextIterator-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ElementTextIterator-class.html" onclick="show_private();">ElementTextIterator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ErrorTypes-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ErrorTypes-class.html">ErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.soupparser._PseudoTag-class.html">_PseudoTag</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._ProcessingInstruction-class.html">_ProcessingInstruction</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.LxmlSyntaxError-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.LxmlSyntaxError-class.html">LxmlSyntaxError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#_read_file">_read_file()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html">SimpleFileLikeXmlFileTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.soupparser._PseudoTag-class.html">_PseudoTag</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.soupparser-module.html">lxml.html.soupparser</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.ParseError-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ParseError-class.html">ParseError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#_read_file">_read_file()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html">TempPathXmlFileTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html#_read_file">_read_file()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.SimpleFileLikeXmlFileTestCase-class.html">SimpleFileLikeXmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementIterator-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementIterator-class.html" onclick="show_private();">_ElementIterator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.RelaxNGErrorTypes-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.RelaxNGErrorTypes-class.html">RelaxNGErrorTypes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_read_file">_read_file()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html#_read_file">_read_file()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.TempPathXmlFileTestCase-class.html">TempPathXmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementMatchIterator-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementMatchIterator-class.html" onclick="show_private();">_ElementMatchIterator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XMLSyntaxError-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XMLSyntaxError-class.html">XMLSyntaxError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.sax.ElementTreeProducer-class.html#_recursive_saxify">_recursive_saxify()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeProducer-class.html">ElementTreeProducer</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html#_read_file">_read_file()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html" onclick="show_private();">_XmlFileTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ErrorLog-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ErrorLog-class.html" onclick="show_private();">_ErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XPathSyntaxError-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPathSyntaxError-class.html">XPathSyntaxError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html-module.html#_rel_links_xpath">_rel_links_xpath</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.sax.ElementTreeProducer-class.html#_recursive_saxify">_recursive_saxify()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.sax.ElementTreeProducer-class.html">ElementTreeProducer</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._IDDict-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._IDDict-class.html" onclick="show_private();">_IDDict</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLTSaveError-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLTSaveError-class.html">XSLTSaveError</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#_remove_javascript_link">_remove_javascript_link()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html-module.html#_rel_links_xpath">_rel_links_xpath</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html-module.html">lxml.html</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ListErrorLog-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ListErrorLog-class.html" onclick="show_private();">_ListErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ElementStringResult-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ElementStringResult-class.html" onclick="show_private();">_ElementStringResult</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#_repr_re">_repr_re</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#_remove_javascript_link">_remove_javascript_link()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.iterparse-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterparse-class.html">iterparse</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._TargetParserResult-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._TargetParserResult-class.html" onclick="show_private();">_TargetParserResult</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.dummy_http_server._RequestHandler-class.html">_RequestHandler</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.dummy_http_server-module.html">lxml.tests.dummy_http_server</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.doctestcompare-module.html#_repr_re">_repr_re</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.iterwalk-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.iterwalk-class.html">iterwalk</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#_resources_dir">_resources_dir</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.dummy_http_server._RequestHandler-class.html">_RequestHandler</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.dummy_http_server-module.html">lxml.tests.dummy_http_server</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.CheckboxValues-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.CheckboxValues-class.html">CheckboxValues</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.DEL_END-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.DEL_END-class.html" onclick="show_private();">DEL_END</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.doctestcompare._RestoreChecker-class.html">_RestoreChecker</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#_resources_dir">_resources_dir</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.Classes-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.Classes-class.html">Classes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.DEL_START-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.DEL_START-class.html" onclick="show_private();">DEL_START</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.common_imports.HelperTestCase-class.html#_rootstring">_rootstring()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports.HelperTestCase-class.html">HelperTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.doctestcompare._RestoreChecker-class.html">_RestoreChecker</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.doctestcompare-module.html">lxml.doctestcompare</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.FieldsDict-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.FieldsDict-class.html">FieldsDict</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.InsensitiveSequenceMatcher-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.InsensitiveSequenceMatcher-class.html" onclick="show_private();">InsensitiveSequenceMatcher</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_rootstring">_rootstring()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.common_imports.HelperTestCase-class.html#_rootstring">_rootstring()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports.HelperTestCase-class.html">HelperTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.InputGetter-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.InputGetter-class.html">InputGetter</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.NoDeletes-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.NoDeletes-class.html" onclick="show_private();">NoDeletes</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._RotatingErrorLog-class.html">_RotatingErrorLog</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_rootstring">_rootstring()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.MultipleSelectOptions-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.MultipleSelectOptions-class.html">MultipleSelectOptions</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.href_token-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.href_token-class.html" onclick="show_private();">href_token</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html#_run_async">_run_async()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html">AsyncXmlFileTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._RotatingErrorLog-class.html">_RotatingErrorLog</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.soupparser._PseudoTag-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.soupparser._PseudoTag-class.html" onclick="show_private();">_PseudoTag</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.tag_token-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.tag_token-class.html" onclick="show_private();">tag_token</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadingTestCase-class.html#_run_thread">_run_thread()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadingTestCase-class.html">ThreadingTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html#_run_async">_run_async()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile.AsyncXmlFileTestCase-class.html">AsyncXmlFileTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedElement-class.html#__iter__">__iter__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedElement-class.html">ObjectifiedElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.token-class.html#__qualname__">__qualname__</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.token-class.html" onclick="show_private();">token</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadingTestCase-class.html#_run_threads">_run_threads()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadingTestCase-class.html#_run_thread">_run_thread()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadingTestCase-class.html">ThreadingTestCase</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.QName-class.html">QName</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__radd__">__radd__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_sax.ETreeSaxTestCase-class.html#_saxify_serialize">_saxify_serialize()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_sax.ETreeSaxTestCase-class.html">ETreeSaxTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_threading.ThreadingTestCase-class.html#_run_threads">_run_threads()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_threading.ThreadingTestCase-class.html">ThreadingTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__le__">__le__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__radd__">__radd__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_sax.ETreeSaxTestCase-class.html#_saxify_unsaxify">_saxify_unsaxify()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_sax.ETreeSaxTestCase-class.html#_saxify_serialize">_saxify_serialize()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_sax.ETreeSaxTestCase-class.html">ETreeSaxTestCase</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rand__">__rand__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._SaxParserTarget-class.html">_SaxParserTarget</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_sax.ETreeSaxTestCase-class.html#_saxify_unsaxify">_saxify_unsaxify()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_sax.ETreeSaxTestCase-class.html">ETreeSaxTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NoneElement-class.html#__le__">__le__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NoneElement-class.html">NoneElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rdiv__">__rdiv__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#_schematron_root">_schematron_root</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._SaxParserTarget-class.html">_SaxParserTarget</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__le__">__le__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#__reduce__">__reduce__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_select">_select()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#_schematron_root">_schematron_root</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__le__">__le__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedElement-class.html#__reduce__">__reduce__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedElement-class.html">ObjectifiedElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="xml.etree.ElementTree-module.html#_serialize">_serialize</a><br />
-<span class="index-where">(in&nbsp;<a href="xml.etree.ElementTree-module.html">xml.etree.ElementTree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_select">_select()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__len__">__len__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.builder-module.html#__reduce_cython__">__reduce_cython__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.builder-module.html">lxml.builder</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#_setClassLookup">_setClassLookup()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="xml.etree.ElementTree-module.html#_serialize">_serialize</a><br />
+<span class="index-where">(in&nbsp;<a href="xml.etree.ElementTree-module.html">xml.etree.ElementTree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#__len__">__len__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.cssselect.CSSSelector-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.cssselect.CSSSelector-class.html">CSSSelector</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._ElementTree-class.html#_setroot">_setroot()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree._ElementTree-class.html" onclick="show_private();">_ElementTree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#_setClassLookup">_setClassLookup()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html">PyClassLookupTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._IDDict-class.html#__len__">__len__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._IDDict-class.html" onclick="show_private();">_IDDict</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XPath-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XPath-class.html">XPath</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedDataElement-class.html#_setText">_setText()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedDataElement-class.html">ObjectifiedDataElement</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._ElementTree-class.html#_setroot">_setroot()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree._ElementTree-class.html" onclick="show_private();">_ElementTree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._ListErrorLog-class.html#__len__">__len__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ListErrorLog-class.html" onclick="show_private();">_ListErrorLog</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree.XSLTAccessControl-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.XSLTAccessControl-class.html">XSLTAccessControl</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#_setValueParser">_setValueParser()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedDataElement-class.html#_setText">_setText()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedDataElement-class.html">ObjectifiedDataElement</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.Classes-class.html#__len__">__len__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.Classes-class.html">Classes</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
-<td width="33%" class="link-index"><a href="xml.etree.ElementTree._SimpleElementPath-class.html">_SimpleElementPath</a></td>
+<td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#_setValueParser">_setValueParser()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.html.FieldsDict-class.html#__len__">__len__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.FieldsDict-class.html">FieldsDict</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._BaseErrorLog-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._BaseErrorLog-class.html" onclick="show_private();">_BaseErrorLog</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_str">_str()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
+<td width="33%" class="link-index"><a href="xml.etree.ElementTree._SimpleElementPath-class.html">_SimpleElementPath</a></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedElement-class.html#__len__">__len__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedElement-class.html">ObjectifiedElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Comment-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Comment-class.html" onclick="show_private();">_Comment</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#_stylesheet_param_dict">_stylesheet_param_dict()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.common_imports-module.html#_str">_str()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.common_imports-module.html">lxml.tests.common_imports</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__long__">__long__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#_substitute_comments">_substitute_comments()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#_stylesheet_param_dict">_stylesheet_param_dict()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__long__">__long__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Entity-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Entity-class.html" onclick="show_private();">_Entity</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_substitute_whitespace">_substitute_whitespace()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#_substitute_comments">_substitute_comments()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify-module.html#__lower_bool">__lower_bool()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify-module.html">lxml.objectify</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._IDDict-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._IDDict-class.html" onclick="show_private();">_IDDict</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_tag">_tag</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean-module.html#_substitute_whitespace">_substitute_whitespace()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean-module.html">lxml.html.clean</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__lshift__">__lshift__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ListErrorLog-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ListErrorLog-class.html" onclick="show_private();">_ListErrorLog</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#_tag_link_attrs">_tag_link_attrs</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_tag">_tag</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.QName-class.html#__lt__">__lt__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.QName-class.html">QName</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._LogEntry-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._LogEntry-class.html" onclick="show_private();">_LogEntry</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_takes_multiple">_takes_multiple()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.clean.Cleaner-class.html#_tag_link_attrs">_tag_link_attrs</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.clean.Cleaner-class.html">Cleaner</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__lt__">__lt__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._ProcessingInstruction-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._ProcessingInstruction-class.html" onclick="show_private();">_ProcessingInstruction</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._TargetParserResult-class.html">_TargetParserResult</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.html.formfill-module.html#_takes_multiple">_takes_multiple()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.html.formfill-module.html">lxml.html.formfill</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#__lt__">__lt__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.CheckboxGroup-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.CheckboxGroup-class.html">CheckboxGroup</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_del_tail">_test_del_tail()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._TargetParserResult-class.html">_TargetParserResult</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NoneElement-class.html#__lt__">__lt__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NoneElement-class.html">NoneElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.CheckboxValues-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.CheckboxValues-class.html">CheckboxValues</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_element_boolean">_test_element_boolean()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_del_tail">_test_del_tail()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.FieldsDict-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.FieldsDict-class.html">FieldsDict</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_unicode.EncodingsTestCase-class.html#_test_encoding">_test_encoding()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_unicode.EncodingsTestCase-class.html">EncodingsTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_element_boolean">_test_element_boolean()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__lt__">__lt__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.InputGetter-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.InputGetter-class.html">InputGetter</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#_test_exslt_regexp_match3">_test_exslt_regexp_match3()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html">ETreeEXSLTTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_unicode.EncodingsTestCase-class.html#_test_encoding">_test_encoding()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_unicode.EncodingsTestCase-class.html">EncodingsTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__mod__">__mod__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.InputMixin-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.InputMixin-class.html">InputMixin</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#_test_exslt_regexp_match4">_test_exslt_regexp_match4()</a><br />
+<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#_test_exslt_regexp_match3">_test_exslt_regexp_match3()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html">ETreeEXSLTTestCase</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.MultipleSelectOptions-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.MultipleSelectOptions-class.html">MultipleSelectOptions</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#_test_extension_element_attribute_context">_test_extension_element_attribute_context()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html">ETreeXSLTExtElementTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html#_test_exslt_regexp_match4">_test_exslt_regexp_match4()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeEXSLTTestCase-class.html">ETreeEXSLTTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__mul__">__mul__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.RadioGroup-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.RadioGroup-class.html">RadioGroup</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_getchildren">_test_getchildren()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#_test_extension_element_attribute_context">_test_extension_element_attribute_context()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html">ETreeXSLTExtElementTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__mul__">__mul__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.tag_token-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.tag_token-class.html" onclick="show_private();">tag_token</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#_test_multiple_extension_elements_with_output_parent">_test_multiple_extension_elements_with_output_parent()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html">ETreeXSLTExtElementTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_getchildren">_test_getchildren()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.QName-class.html#__ne__">__ne__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.QName-class.html">QName</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.html.diff.token-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.html.diff.token-class.html" onclick="show_private();">token</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#_test_pickle">_test_pickle()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html#_test_multiple_extension_elements_with_output_parent">_test_multiple_extension_elements_with_output_parent()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeXSLTExtElementTestCase-class.html">ETreeXSLTExtElementTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree._Attrib-class.html#__ne__">__ne__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Attrib-class.html" onclick="show_private();">_Attrib</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeErrorLogTest-class.html#_test_python_error_logging">_test_python_error_logging()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeErrorLogTest-class.html">ETreeErrorLogTest</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html#_test_pickle">_test_pickle()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_objectify.ObjectifyTestCase-class.html">ObjectifyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.BoolElement-class.html#__ne__">__ne__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.BoolElement-class.html">BoolElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NoneElement-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NoneElement-class.html">NoneElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_wrong_unicode_encoding">_test_wrong_unicode_encoding()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeErrorLogTest-class.html#_test_python_error_logging">_test_python_error_logging()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeErrorLogTest-class.html">ETreeErrorLogTest</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NoneElement-class.html#__ne__">__ne__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NoneElement-class.html">NoneElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html#_test_xpath_compile_unicode">_test_xpath_compile_unicode()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html">ETreeETXPathClassTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_test_wrong_unicode_encoding">_test_wrong_unicode_encoding()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__ne__">__ne__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedDataElement-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedDataElement-class.html">ObjectifiedDataElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#_test_xslt_error_log">_test_xslt_error_log()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeXSLTTestCase-class.html">ETreeXSLTTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html#_test_xpath_compile_unicode">_test_xpath_compile_unicode()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xpathevaluator.ETreeETXPathClassTestCase-class.html">ETreeETXPathClassTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__ne__">__ne__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.PyType-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.PyType-class.html">PyType</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#_typemap">_typemap</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#_test_xslt_error_log">_test_xslt_error_log()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeXSLTTestCase-class.html">ETreeXSLTTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__neg__">__neg__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__repr__">__repr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_validation_errors">_validation_errors</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#_typemap">_typemap</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.builder.ElementMaker-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.builder.ElementMaker-class.html">ElementMaker</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.etree._Element-class.html#__reversed__">__reversed__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree._Element-class.html" onclick="show_private();">_Element</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._Validator-class.html">_Validator</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron.Schematron-class.html#_validation_errors">_validation_errors</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron.Schematron-class.html">Schematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.AncestorsIterator-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.AncestorsIterator-class.html" onclick="show_private();">AncestorsIterator</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rlshift__">__rlshift__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.ElementInclude-module.html#_wrap_et_loader">_wrap_et_loader()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.ElementInclude-module.html">lxml.ElementInclude</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._Validator-class.html">_Validator</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.AttributeBasedElementClassLookup-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.AttributeBasedElementClassLookup-class.html">AttributeBasedElementClassLookup</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rmod__">__rmod__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElement">_writeElement()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.ElementInclude-module.html#_wrap_et_loader">_wrap_et_loader()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.ElementInclude-module.html">lxml.ElementInclude</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.C14NError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.C14NError-class.html">C14NError</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__rmod__">__rmod__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#_writeElement">_writeElement()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElement">_writeElement()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.CDATA-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.CDATA-class.html">CDATA</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rmul__">__rmul__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElementFile">_writeElementFile()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html#_writeElement">_writeElement()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree.ETreeOnlyTestCase-class.html">ETreeOnlyTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.CommentBase-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.CommentBase-class.html">CommentBase</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.StringElement-class.html#__rmul__">__rmul__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.StringElement-class.html">StringElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_etree._XIncludeTestCase-class.html">_XIncludeTestCase</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree-module.html">lxml.tests.test_etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#_writeElementFile">_writeElementFile()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree._ETreeTestCaseBase-class.html" onclick="show_private();">_ETreeTestCaseBase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.CustomElementClassLookup-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.CustomElementClassLookup-class.html">CustomElementClassLookup</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__ror__">__ror__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#_xml_schema_root">_xml_schema_root</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_etree._XIncludeTestCase-class.html">_XIncludeTestCase</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_etree-module.html">lxml.tests.test_etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.DTD-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DTD-class.html">DTD</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rpow__">__rpow__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html">_XmlFileTestCaseBase</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile-module.html">lxml.tests.test_incremental_xmlfile</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.isoschematron-module.html#_xml_schema_root">_xml_schema_root</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.isoschematron-module.html">lxml.isoschematron</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.DTDError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DTDError-class.html">DTDError</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rrshift__">__rrshift__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html">_XMLPullParserTest</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree-module.html">lxml.tests.test_elementtree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_incremental_xmlfile._XmlFileTestCaseBase-class.html">_XmlFileTestCaseBase</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_incremental_xmlfile-module.html">lxml.tests.test_incremental_xmlfile</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.DTDParseError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DTDParseError-class.html">DTDParseError</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rshift__">__rshift__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._XPathEvaluatorBase-class.html">_XPathEvaluatorBase</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_elementtree._XMLPullParserTest-class.html">_XMLPullParserTest</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_elementtree-module.html">lxml.tests.test_elementtree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.DTDValidateError-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DTDValidateError-class.html">DTDValidateError</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rsub__">__rsub__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#_xslt_setup">_xslt_setup()</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeXSLTTestCase-class.html">ETreeXSLTTestCase</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.etree._XPathEvaluatorBase-class.html">_XPathEvaluatorBase</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.DocInfo-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DocInfo-class.html" onclick="show_private();">DocInfo</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rtruediv__">__rtruediv__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._XSLTProcessingInstruction-class.html">_XSLTProcessingInstruction</a><br />
-<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
+<td width="33%" class="link-index"><a href="lxml.tests.test_xslt.ETreeXSLTTestCase-class.html#_xslt_setup">_xslt_setup()</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.tests.test_xslt.ETreeXSLTTestCase-class.html">ETreeXSLTTestCase</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.DocumentInvalid-class.html#__new__">__new__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree.DocumentInvalid-class.html">DocumentInvalid</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.NumberElement-class.html#__rxor__">__rxor__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.NumberElement-class.html">NumberElement</a>)</span></td>
-<td width="33%" class="link-index"><a href="lxml.etree._XSLTResultTree-class.html">_XSLTResultTree</a><br />
+<td width="33%" class="link-index"><a href="lxml.etree._XSLTProcessingInstruction-class.html">_XSLTProcessingInstruction</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <span class="index-where">(in&nbsp;<a href="lxml.etree.ETCompatXMLParser-class.html">ETCompatXMLParser</a>)</span></td>
 <td width="33%" class="link-index"><a href="lxml.objectify.ObjectifiedElement-class.html#__setattr__">__setattr__()</a><br />
 <span class="index-where">(in&nbsp;<a href="lxml.objectify.ObjectifiedElement-class.html">ObjectifiedElement</a>)</span></td>
-<td width="33%" class="link-index">&nbsp;</td>
+<td width="33%" class="link-index"><a href="lxml.etree._XSLTResultTree-class.html">_XSLTResultTree</a><br />
+<span class="index-where">(in&nbsp;<a href="lxml.etree-module.html">lxml.etree</a>)</span></td>
 </tr>
 <tr>
 <td width="33%" class="link-index"><a href="lxml.etree.ETXPath-class.html#__new__">__new__()</a><br />
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 269cd3ca10e92e5f5090c9dc055d0a6c06bf1a13..a9c8371dd08b74f74cc1818497dc45bbaa867460 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6f8842b284963e2d40abc8d57dc25828d3d459fd..d22464688f5207bf3aeec0714c57b45e1860adde 100644 (file)
@@ -239,7 +239,7 @@ with statically linked libraries.</td>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 94b6a8cf62f92a66dc8be29c024dd6f97b1a5e85..2c5a43bd77cb8f1ae149890e63e31bbf73846d4b 100644 (file)
@@ -130,7 +130,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 79f75005053feeb165a348b909c4601d1b1593bb..817694a224a11a315c9cdc2becb7042f1df7378e 100644 (file)
@@ -285,7 +285,7 @@ form of custom URL resolvers.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bcf2282baabafee75dc24ea902a0e952f833ff7f..c8308032713847fc40cce078388bfad5d8503176 100644 (file)
@@ -535,7 +535,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 733303fc25fef64753a2e80392f3d071a51f3943..56d7f87686626d32b38885ed0486c58c9a287abb 100644 (file)
@@ -230,7 +230,7 @@ exceptions.BaseException --+           |
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b31deed7b3a05a92d507ed809bd7a071037c7f27..9e1962026484bddd93b220e36476989c2a6e5003 100644 (file)
@@ -206,8 +206,8 @@ The <tt class="rst-docutils literal">E</tt> Element factory for generating XML d
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type">&nbsp;</span>
     </td><td class="summary">
-        <a href="lxml.builder-module.html#__pyx_capi__" class="summary-name">__pyx_capi__</a> = <code title="{'ET': &lt;capsule object &quot;PyObject *&quot; at 0x7f5c6757f900&gt;,
- 'partial': &lt;capsule object &quot;PyObject *&quot; at 0x7f5c6757f990&gt;}"><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">ET</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;PyObject *&quot; at 0x7f5c67<code class="variable-ellipsis">...</code></code>
+        <a href="lxml.builder-module.html#__pyx_capi__" class="summary-name">__pyx_capi__</a> = <code title="{'ET': &lt;capsule object &quot;PyObject *&quot; at 0x7f1537b0c120&gt;,
+ 'partial': &lt;capsule object &quot;PyObject *&quot; at 0x7f1537b0c1b0&gt;}"><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">ET</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;PyObject *&quot; at 0x7f1537<code class="variable-ellipsis">...</code></code>
     </td>
   </tr>
 <tr>
@@ -248,8 +248,8 @@ The <tt class="rst-docutils literal">E</tt> Element factory for generating XML d
   <dl class="fields">
     <dt>Value:</dt>
       <dd><table><tr><td><pre class="variable">
-<code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">ET</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;PyObject *&quot; at 0x7f5c6757f900&gt;<code class="variable-op">,</code>
- <code class="variable-quote">'</code><code class="variable-string">partial</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;PyObject *&quot; at 0x7f5c6757f990&gt;<code class="variable-group">}</code>
+<code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">ET</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;PyObject *&quot; at 0x7f1537b0c120&gt;<code class="variable-op">,</code>
+ <code class="variable-quote">'</code><code class="variable-string">partial</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;PyObject *&quot; at 0x7f1537b0c1b0&gt;<code class="variable-group">}</code>
 </pre></td></tr></table>
 </dd>
   </dl>
@@ -288,7 +288,7 @@ The <tt class="rst-docutils literal">E</tt> Element factory for generating XML d
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 055d9d2fc9170f2972fc12e0a9dbe562ec918998..7d7c39cecd371f38bd1711ed75b69980944d65d3 100644 (file)
@@ -435,7 +435,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3c374117defcd47f9209594b8d6610d788e77909..ee52bf947c4ff76f9ce53142800c2c59f3bc5b18 100644 (file)
@@ -514,7 +514,7 @@ and/or a specific target <tt class="rst-docutils literal">namespace</tt> to the
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 74c56ee4cca72c251129dab23e50e792dac5b105..39a74595b9e482c5c44c1c34f99edd5e6dafe57b 100644 (file)
@@ -232,7 +232,7 @@ See the <a href="lxml.cssselect.CSSSelector-class.html" class="link">CSSSelector
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5c577bdfaeb095f4b31bf7f886d4001ba51cc5a4..9417a8e8bc766c4ebc01af5228445488ad28d7db 100644 (file)
@@ -308,7 +308,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 96ac20f565574c254bf5e4504e13efd6f0d3a64e..1fdb08e42957cafa5a0b0b09ebf0c207662bc9d5 100644 (file)
@@ -309,7 +309,7 @@ mapping as <tt class="rst-docutils literal">namespaces</tt> keyword argument:</p
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2af2af7fb5d1da3e870752a5747de5dd18e97b07..8ccce048da75edcf291368d3d39bf780c054e338 100644 (file)
@@ -312,7 +312,7 @@ lxml extensions + HTML support.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2062f39df9165916285cbde73588cf6abf0d0f52..b067450fc38c11352e86d186ae72390d789ffd45 100644 (file)
@@ -364,7 +364,7 @@ A custom CSS selector to XPath translator with lxml-specific extensions.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c08d10aa6ee74db189b20e10260a60a2e1ca6b89..36f23ffacfe9f571f4d27c8bd5a099a5f7e3506e 100644 (file)
@@ -476,7 +476,7 @@ otherwise the XML parser is used.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index f4529fbb345ae0c729edffed43849a198f608e46..989ec2570559bc16bf3844a33b6aef103f878157 100644 (file)
@@ -1127,7 +1127,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9222b7bd74db462fe5ebd595308939aedc0a1cb7..15681dd8503f5dfd8bbe2c58ba9efe7a90fda288 100644 (file)
@@ -230,7 +230,7 @@ doctest.OutputChecker --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 8654af5267019483fc21a424801688a62f7a8759..8e5fd3c03b4a897f4cc3e9354f311650fa6eea6f 100644 (file)
@@ -611,7 +611,7 @@ to compare <code class="link">want</code> and <code class="link">got</code>.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5ae743ddc60e8623113e53cc262e53dc92ed5156..c8ad01911c326a3db70380d78118841530aea76c 100644 (file)
@@ -350,7 +350,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d59aa87edb4401995f5e7d9ca83caad6b13e0272..b59903ce48cfa29a9cc545c0851eda5f45032241 100644 (file)
@@ -65,7 +65,7 @@ The <tt class="rst-docutils literal">lxml.etree</tt> module implements the exten
 
 <hr />
 <div class="fields">      <p><strong>Version:</strong>
-        4.0.0
+        4.1.0
       </p>
 </div><!-- ==================== CLASSES ==================== -->
 <a name="section-Classes"></a>
@@ -1725,7 +1725,7 @@ standard Python logging package.</td>
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type">&nbsp;</span>
     </td><td class="summary">
-        <a name="LXML_VERSION"></a><span class="summary-name">LXML_VERSION</span> = <code title="(4, 0, 0, 0)"><code class="variable-group">(</code>4<code class="variable-op">, </code>0<code class="variable-op">, </code>0<code class="variable-op">, </code>0<code class="variable-group">)</code></code>
+        <a name="LXML_VERSION"></a><span class="summary-name">LXML_VERSION</span> = <code title="(4, 1, 0, 0)"><code class="variable-group">(</code>4<code class="variable-op">, </code>1<code class="variable-op">, </code>0<code class="variable-op">, </code>0<code class="variable-group">)</code></code>
     </td>
   </tr>
 <tr class="private">
@@ -1741,13 +1741,13 @@ standard Python logging package.</td>
       <span class="summary-type">&nbsp;</span>
     </td><td class="summary">
         <a href="lxml.etree-module.html#__pyx_capi__" class="summary-name" onclick="show_private();">__pyx_capi__</a> = <code title="{'adoptExternalDocument': &lt;capsule object &quot;struct LxmlElementTree *(xm\
-lDoc *, PyObject *, int)&quot; at 0x7f5c6b1a0d80&gt;,
+lDoc *, PyObject *, int)&quot; at 0x7f153b7a9c60&gt;,
  'appendChild': &lt;capsule object &quot;void (struct LxmlElement *, struct Lx\
-mlElement *)&quot; at 0x7f5c6b1b35a0&gt;,
+mlElement *)&quot; at 0x7f153b7bb480&gt;,
  'appendChildToElement': &lt;capsule object &quot;int (struct LxmlElement *, s\
-truct LxmlElement *)&quot; at 0x7f5c6b1b35d0&gt;,
+truct LxmlElement *)&quot; at 0x7f153b7bb4b0&gt;,
  'attributeValue': &lt;capsule object &quot;PyObject *(xmlNode *, xmlAttr *)&quot; \
-at 0x7f5c6b1b3270&gt;,
+at 0x7f153b7bb150&gt;,
 ..."><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">adoptExternalDocument</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;stru<code class="variable-ellipsis">...</code></code>
     </td>
   </tr>
@@ -1755,15 +1755,15 @@ at 0x7f5c6b1b3270&gt;,
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type">&nbsp;</span>
     </td><td class="summary">
-        <a href="lxml.etree-module.html#__test__" class="summary-name" onclick="show_private();">__test__</a> = <code title="{u'XML (line 3181)': u'''XML(text, parser=None, base_url=None)
+        <a href="lxml.etree-module.html#__test__" class="summary-name" onclick="show_private();">__test__</a> = <code title="{u'FunctionNamespace (line 207)': u'''FunctionNamespace(ns_uri)
 
-    Parses an XML document or fragment from a string constant.
-    Returns the root node (or the result returned by a parser target).
-    This function can be used to embed &quot;XML literals&quot; in Python code,
-    like in
+    Retrieve the function namespace object associated with the given
+    URI.
 
-       &gt;&gt;&gt; root = XML(&quot;&lt;root&gt;&lt;test/&gt;&lt;/root&gt;&quot;)
-..."><code class="variable-group">{</code><code class="variable-quote">u'</code><code class="variable-string">XML (line 3181)</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">u'</code><code class="variable-string">XML(text, parser=None, base_</code><code class="variable-ellipsis">...</code></code>
+    Creates a new one if it does not yet exist. A function namespace
+    can only be used to register extension functions.
+
+..."><code class="variable-group">{</code><code class="variable-quote">u'</code><code class="variable-string">FunctionNamespace (line 207)</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">u'</code><code class="variable-string">FunctionNamespa</code><code class="variable-ellipsis">...</code></code>
     </td>
   </tr>
 <tr class="private">
@@ -1863,6 +1863,17 @@ functions.</p>
 URI.</p>
 <p>Creates a new one if it does not yet exist. A function namespace
 can only be used to register extension functions.</p>
+<p>Usage:</p>
+<pre class="py-doctest">
+<span class="py-prompt">&gt;&gt;&gt; </span>ns_functions = FunctionNamespace(<span class="py-string">&quot;http://schema.org/Movie&quot;</span>)</pre>
+<pre class="py-doctest">
+<span class="py-prompt">&gt;&gt;&gt; </span>@ns_functions  <span class="py-comment"># uses function name</span>
+<span class="py-more">... </span><span class="py-keyword">def</span> <span class="py-defname">add2</span>(x):
+<span class="py-more">... </span>    return x + 2</pre>
+<pre class="py-doctest">
+<span class="py-prompt">&gt;&gt;&gt; </span>@ns_functions(<span class="py-string">&quot;add3&quot;</span>)  <span class="py-comment"># uses explicit name</span>
+<span class="py-more">... </span><span class="py-keyword">def</span> <span class="py-defname">add_three</span>(x):
+<span class="py-more">... </span>    return x + 3</pre>
   <dl class="fields">
   </dl>
 </td></tr></table>
@@ -2494,13 +2505,13 @@ function will only set the global error log of the current thread.</p>
     <dt>Value:</dt>
       <dd><table><tr><td><pre class="variable">
 <code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">adoptExternalDocument</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;struct LxmlElementTree *(xm<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
-lDoc *, PyObject *, int)&quot; at 0x7f5c6b1a0d80&gt;<code class="variable-op">,</code>
+lDoc *, PyObject *, int)&quot; at 0x7f153b7a9c60&gt;<code class="variable-op">,</code>
  <code class="variable-quote">'</code><code class="variable-string">appendChild</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;void (struct LxmlElement *, struct Lx<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
-mlElement *)&quot; at 0x7f5c6b1b35a0&gt;<code class="variable-op">,</code>
+mlElement *)&quot; at 0x7f153b7bb480&gt;<code class="variable-op">,</code>
  <code class="variable-quote">'</code><code class="variable-string">appendChildToElement</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;int (struct LxmlElement *, s<span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
-truct LxmlElement *)&quot; at 0x7f5c6b1b35d0&gt;<code class="variable-op">,</code>
+truct LxmlElement *)&quot; at 0x7f153b7bb4b0&gt;<code class="variable-op">,</code>
  <code class="variable-quote">'</code><code class="variable-string">attributeValue</code><code class="variable-quote">'</code><code class="variable-op">: </code>&lt;capsule object &quot;PyObject *(xmlNode *, xmlAttr *)&quot; <span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
-at 0x7f5c6b1b3270&gt;<code class="variable-op">,</code>
+at 0x7f153b7bb150&gt;<code class="variable-op">,</code>
 <code class="variable-ellipsis">...</code>
 </pre></td></tr></table>
 </dd>
@@ -2519,14 +2530,14 @@ at 0x7f5c6b1b3270&gt;<code class="variable-op">,</code>
   <dl class="fields">
     <dt>Value:</dt>
       <dd><table><tr><td><pre class="variable">
-<code class="variable-group">{</code><code class="variable-quote">u'</code><code class="variable-string">XML (line 3181)</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">u'''</code><code class="variable-string">XML(text, parser=None, base_url=None)</code>
+<code class="variable-group">{</code><code class="variable-quote">u'</code><code class="variable-string">FunctionNamespace (line 207)</code><code class="variable-quote">'</code><code class="variable-op">: </code><code class="variable-quote">u'''</code><code class="variable-string">FunctionNamespace(ns_uri)</code>
+<code class="variable-string"></code>
+<code class="variable-string">    Retrieve the function namespace object associated with the given</code>
+<code class="variable-string">    URI.</code>
 <code class="variable-string"></code>
-<code class="variable-string">    Parses an XML document or fragment from a string constant.</code>
-<code class="variable-string">    Returns the root node (or the result returned by a parser target).</code>
-<code class="variable-string">    This function can be used to embed &quot;XML literals&quot; in Python code,</code>
-<code class="variable-string">    like in</code>
+<code class="variable-string">    Creates a new one if it does not yet exist. A function namespace</code>
+<code class="variable-string">    can only be used to register extension functions.</code>
 <code class="variable-string"></code>
-<code class="variable-string">       &gt;&gt;&gt; root = XML(&quot;&lt;root&gt;&lt;test/&gt;&lt;/root&gt;&quot;)</code>
 <code class="variable-ellipsis">...</code>
 </pre></td></tr></table>
 </dd>
@@ -2566,7 +2577,7 @@ at 0x7f5c6b1b3270&gt;<code class="variable-op">,</code>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c539e1fc24e026aefd8b4a744608080775d3810d..655a0b9316cd10e1aec625935f8b68c7a45d5549 100644 (file)
@@ -234,7 +234,7 @@ Iterates over the ancestors of an element (from parent to parent).
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 52295f599b63558126cdab0363ef1cf272831b9d..da261ceb8263854be76a37cbcbb780fb01a27bd4 100644 (file)
@@ -294,7 +294,7 @@ missing.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 8da263db7f532ccb059be206e0e7bc361909452c..eddb7094b65bd26b520d1e4d03564976fe8bb8ee 100644 (file)
@@ -246,7 +246,7 @@ Error during C14N serialisation.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6e8f749b4d8ea409f4bea2995fedcd53bf4609b8..0a8baf7fccc5e1e3d0c3d0f62cc629c8c3d5dbcf 100644 (file)
@@ -237,7 +237,7 @@ a string
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4a66b4c811aafcca6c5b454ee9e0210a976e0650..60768a9abdaea3bb5b9fcb65436cb149f622d133 100644 (file)
@@ -350,7 +350,7 @@ called after object creation.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 40d277c7d87ef6a8baa72c3a5e062cc2fdf83591..632ddef5085fe6f8a02c168ec868cf1c573bfef2 100644 (file)
@@ -273,7 +273,7 @@ lookup(self, type, doc, namespace, name)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9e21a3733db139c98ebbcb0af2122ec11c03364a..73b3c9dff1bee57a3d651184a9575dbc608ff924 100644 (file)
@@ -412,7 +412,7 @@ catalog.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 99723b0143d8aa8e3875d240761193465c2df7b4..14a3f239e01d2054c8a46de9e1ed15c7cfb7bfa6 100644 (file)
@@ -252,7 +252,7 @@ Base class for DTD errors.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a564727562413da3beb0024e35128a2c7500bf97..6646e48c89b476c0b66d6fe33378c89c9cf3e472 100644 (file)
@@ -248,7 +248,7 @@ Error while parsing a DTD.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3e1056ba95280a05766689e91a07fd6edf817573..52f7959fbfedeca179836b06cb8e610ce663ed26 100644 (file)
@@ -248,7 +248,7 @@ Error while validating an XML document with a DTD.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e8670e3db894bb22b71847fa3794b1a33e63d567..79fc46ee8f7462fcc203acad18da3a3655ac8ac1 100644 (file)
@@ -373,7 +373,7 @@ exist, setting this variable (even to None) will create one.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3563b0251b3bee3526380c94e77425d70b8b8b8a..b2f3a75498cb75dcaeb8f409e2032913ff75b66d 100644 (file)
@@ -248,7 +248,7 @@ method fails.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b5117d19cb0079f4033b07b4b9cc24c71f7f201f..1019a0065762202afba7ac8d36b745ed4019272e 100644 (file)
@@ -326,7 +326,7 @@ and thus ignores comments and processing instructions.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6120440641bbc612f41d7cf156051fd11e6e59d0..c68ff6c43940d5a726faeb6feb6f2580664998da 100644 (file)
@@ -294,7 +294,7 @@ you pass <tt class="rst-docutils literal">smart_strings=False</tt>.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5d9637df8bb84bc2f7b0421212a71c88b66c2f1f..e1c7ef2a9253c086a0f9765a191cfc77d0cbe34e 100644 (file)
@@ -363,7 +363,7 @@ hierarchies that implement a common namespace.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6ec1503431f8cc2135f04140841bb95ad3c554f0..e6d1c76f261559f2a3018034f356c8705b85be4f 100644 (file)
@@ -234,7 +234,7 @@ Iterates over the children of an element.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 02fa0c729e68518a60f34f94056d49249334d31b..bfe90581101f41f2d44135d6e484c1336ab16d5a 100644 (file)
@@ -71,7 +71,7 @@ object --+
 <dl><dt>Known Subclasses:</dt>
 <dd>
       <ul class="subclass-list">
-<li><a href="lxml.objectify.ObjectifyElementClassLookup-class.html">objectify.ObjectifyElementClassLookup</a></li><li>, <a href="lxml.etree.FallbackElementClassLookup-class.html">FallbackElementClassLookup</a></li><li>, <a href="lxml.etree.ElementDefaultClassLookup-class.html">ElementDefaultClassLookup</a></li>  </ul>
+<li><a href="lxml.etree.FallbackElementClassLookup-class.html">FallbackElementClassLookup</a></li><li>, <a href="lxml.etree.ElementDefaultClassLookup-class.html">ElementDefaultClassLookup</a></li><li>, <a href="lxml.objectify.ObjectifyElementClassLookup-class.html">objectify.ObjectifyElementClassLookup</a></li>  </ul>
 </dd></dl>
 
 <hr />
@@ -233,7 +233,7 @@ Superclass of Element class lookups.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 0ec7dc1b6a31902f462f982a0b8abddccb155010..ab8d8b1eaf486a1d43399babff71a3286789a106 100644 (file)
@@ -307,7 +307,7 @@ accept the respective Element classes.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ddf0981a2491f409709e77611ce0f74f8d58b029..ac8b93dd8000b8c4e3c62c172d92a8e3e1912f6c 100644 (file)
@@ -288,7 +288,7 @@ tree it traverses is modified during iteration.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6c430fe8363c5315bead33f8822db19125a3968b..1615dd2b67fc5863a85815127ce52a293249ed7c 100644 (file)
 <p>ElementNamespaceClassLookup(self, fallback=None)</p>
 <p>Element class lookup scheme that searches the Element class in the
 Namespace registry.</p>
+<p>Usage:</p>
+<pre class="py-doctest">
+<span class="py-prompt">&gt;&gt;&gt; </span>lookup = ElementNamespaceClassLookup()
+<span class="py-prompt">&gt;&gt;&gt; </span>ns_elements = lookup.get_namespace(<span class="py-string">&quot;http://schema.org/Movie&quot;</span>)</pre>
+<pre class="py-doctest">
+<span class="py-prompt">&gt;&gt;&gt; </span>@ns_elements
+<span class="py-more">... </span><span class="py-keyword">class</span> <span class="py-defname">movie</span>(ElementBase):
+<span class="py-more">... </span>    <span class="py-string">&quot;Element implementation for 'movie' tag (using class name) in schema namespace.&quot;</span></pre>
+<pre class="py-doctest">
+<span class="py-prompt">&gt;&gt;&gt; </span>@ns_elements(<span class="py-string">&quot;movie&quot;</span>)
+<span class="py-more">... </span><span class="py-keyword">class</span> <span class="py-defname">MovieElement</span>(ElementBase):
+<span class="py-more">... </span>    <span class="py-string">&quot;Element implementation for 'movie' tag (explicit tag name) in schema namespace.&quot;</span></pre>
 
 <!-- ==================== INSTANCE METHODS ==================== -->
 <a name="section-InstanceMethods"></a>
@@ -320,7 +332,7 @@ Pass None for the empty namespace.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b73dbf5dd82ee2c7e9c3c803eca349e41412a281..25953b04676156b5c56576a7c4dfe6c8e46de389 100644 (file)
@@ -280,7 +280,7 @@ tail text (e.g. if you know that it's only whitespace from pretty-printing).</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e7b3209506572f7ac9aee63abc96f3577ae55380..09b5d94b4440d24e202bb3d84acc187efc2c1466 100644 (file)
@@ -351,7 +351,7 @@ called after object creation.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a11c4db89d806d9f627c7bbab2b510b672f095ba..f813d145f5695218c425509aedc6b09f8c672215 100644 (file)
@@ -246,7 +246,7 @@ exceptions.BaseException --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7288d2695a71c413264d61d8f506138ae330b5b9..ecf63858421cc8bb313aa920969a67c52acfec6b 100644 (file)
@@ -486,7 +486,7 @@ Libxml2 error domains
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 93f4c0d60588c36b14b713838e407debe9a84cdd..e5606efbd2f2fae41a00f3bde2d792b5a0ec7214 100644 (file)
@@ -244,7 +244,7 @@ Libxml2 error levels
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 0763bf0e3d9374616b7d225f65baa4165aad1935..3fe103ad295d4a1281f3d4cea9532166c251ae3a 100644 (file)
@@ -5407,7 +5407,7 @@ Libxml2 error types
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7ddbb2016670c78cc70d509e5b1ab896a7e774ae..ad22b6c482e3e289f8ad58815ab3de5e0656d53b 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6ab76d8f26108a97b6323bbdf5fd31b0cae0dd64..6f9a75e4b94c423304dee945dc4feff72affd68b 100644 (file)
@@ -341,7 +341,7 @@ reasons.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 31bcbd0e0500a3a453af4b959e8cf2abc1655a98..656362ff5a27fd24cb1c71a17bdaf664965393cc 100644 (file)
@@ -327,7 +327,7 @@ source, you can pass the <tt class="rst-docutils literal">base_url</tt>.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d5fa427e00f5dcfc2d2c66c0b34b4e068418cd98..29530e9136ff373b66065980186eb82eb92c43c7 100644 (file)
@@ -77,7 +77,7 @@ exceptions.BaseException --+
 <dl><dt>Known Subclasses:</dt>
 <dd>
       <ul class="subclass-list">
-<li><a href="lxml.etree.C14NError-class.html">C14NError</a></li><li>, <a href="lxml.etree.DTDError-class.html">DTDError</a></li><li>, <a href="lxml.etree.DocumentInvalid-class.html">DocumentInvalid</a></li><li>, <a href="lxml.etree.LxmlRegistryError-class.html">LxmlRegistryError</a></li><li>, <a href="lxml.etree.LxmlSyntaxError-class.html">LxmlSyntaxError</a></li><li>, <a href="lxml.etree.ParserError-class.html">ParserError</a></li><li>, <a href="lxml.etree.RelaxNGError-class.html">RelaxNGError</a></li><li>, <a href="lxml.etree.SchematronError-class.html">SchematronError</a></li><li>, <a href="lxml.etree.SerialisationError-class.html">SerialisationError</a></li><li>, <a href="lxml.etree.XIncludeError-class.html">XIncludeError</a></li><li>, <a href="lxml.etree.XMLSchemaError-class.html">XMLSchemaError</a></li><li>, <a href="lxml.etree.XPathError-class.html">XPathError</a></li><li>, <a href="lxml.etree.XSLTError-class.html">XSLTError</a></li><li>, <a href="lxml.sax.SaxError-class.html">sax.SaxError</a></li>  </ul>
+<li><a href="lxml.etree.LxmlSyntaxError-class.html">LxmlSyntaxError</a></li><li>, <a href="lxml.etree.C14NError-class.html">C14NError</a></li><li>, <a href="lxml.etree.DTDError-class.html">DTDError</a></li><li>, <a href="lxml.etree.DocumentInvalid-class.html">DocumentInvalid</a></li><li>, <a href="lxml.etree.LxmlRegistryError-class.html">LxmlRegistryError</a></li><li>, <a href="lxml.etree.ParserError-class.html">ParserError</a></li><li>, <a href="lxml.etree.RelaxNGError-class.html">RelaxNGError</a></li><li>, <a href="lxml.etree.SchematronError-class.html">SchematronError</a></li><li>, <a href="lxml.etree.SerialisationError-class.html">SerialisationError</a></li><li>, <a href="lxml.etree.XIncludeError-class.html">XIncludeError</a></li><li>, <a href="lxml.etree.XMLSchemaError-class.html">XMLSchemaError</a></li><li>, <a href="lxml.etree.XPathError-class.html">XPathError</a></li><li>, <a href="lxml.etree.XSLTError-class.html">XSLTError</a></li><li>, <a href="lxml.sax.SaxError-class.html">sax.SaxError</a></li>  </ul>
 </dd></dl>
 
 <hr />
@@ -288,7 +288,7 @@ this one.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ca29452258d27213dbe8bf30f38dd70ff288966e..aba9190881d78c6c7f9611bbd370d0cc78731ad1 100644 (file)
@@ -252,7 +252,7 @@ Base class of lxml registry errors.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 8d6fdc7cd06fc83cfad70fda048f3cb21724b09b..2ccc6d8f26eba623e412045136fac8a2b44bed65 100644 (file)
@@ -89,7 +89,7 @@ exceptions.BaseException --+           |
 <dl><dt>Known Subclasses:</dt>
 <dd>
       <ul class="subclass-list">
-<li><a href="lxml.etree.ParseError-class.html">ParseError</a></li><li>, <a href="lxml.etree.XPathSyntaxError-class.html">XPathSyntaxError</a></li><li>, <a href="lxml.ElementInclude.FatalIncludeError-class.html">ElementInclude.FatalIncludeError</a></li>  </ul>
+<li><a href="lxml.ElementInclude.FatalIncludeError-class.html">ElementInclude.FatalIncludeError</a></li><li>, <a href="lxml.etree.ParseError-class.html">ParseError</a></li><li>, <a href="lxml.etree.XPathSyntaxError-class.html">XPathSyntaxError</a></li>  </ul>
 </dd></dl>
 
 <hr />
@@ -236,7 +236,7 @@ Base class for all syntax errors.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 25a43011917a9f645f65ae07c3ed5661e4018317..b5ae7b9a850831ccdb496da148b872f7b5962594 100644 (file)
@@ -248,7 +248,7 @@ Error registering a namespace extension.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a87eebdc10550f7304972a28695592fcc053c136..cf92b468ffa6325f0e654128f3325acb4eee7cdf 100644 (file)
@@ -352,7 +352,7 @@ called after object creation.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 18c045bf6742adfad7451c9525243703d0347124..41d5bc3d59c6df0323e8ce0d8d85ca771db489ee 100644 (file)
@@ -341,7 +341,7 @@ exceptions.BaseException --+           |
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3f568356b7e827344a1b9f7e75cbb03608792363..e404c73ff33a7f3b82ff2e999942e02838820536 100644 (file)
@@ -237,7 +237,7 @@ Element class lookup based on the XML parser.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index f491eaa810171bfab6fb5e02d1a1874c8622bd9b..687eaa3b182c0b15d5ead420b1280f2e6e9f68bb 100644 (file)
@@ -246,7 +246,7 @@ Internal lxml parser error.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 94fa252ca397c4536ada02db5eb8ef8a443c164a..9017a5030302d5710197de37183e0aaded1f83f9 100644 (file)
@@ -434,7 +434,7 @@ format.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d18f974175d6604f37bcc42cc8bce903fda23baf..00d5850a1ad1a47fa87ca5bd8450d6781383d455 100644 (file)
@@ -290,7 +290,7 @@ iteration methods).</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ed4f10cdfe1ac8d8114b009150c45657c63abce4..d87745e7421bb127c4753020d5139382cf0a647a 100644 (file)
@@ -487,7 +487,7 @@ their text content.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index cf1ccefa19a69be5307ffb818b10d3a47edf8c4b..9fed140fe9ed415ff92095ef777e544d16c86331 100644 (file)
@@ -384,7 +384,7 @@ will enable resolving resource references relative to the source.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index aaf54a62a554f22c2ac01becc2a887e4d5a74037..7ee41c73748f6c278edcc52095bbba0948f621b6 100644 (file)
@@ -252,7 +252,7 @@ Base class for RelaxNG errors.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 0ea3c5f8166768f079fc3c77dd17fa80fcc6fe5d..b603caa85d5320c5767f7ad9ed65cd413ee049ef 100644 (file)
@@ -549,7 +549,7 @@ Libxml2 RelaxNG error types
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a1c697ad92e4dcbc6ec9b51aed93c023446c4020..7e7549945c03ec5f9a8bb9ae0f4455104b91f71d 100644 (file)
@@ -248,7 +248,7 @@ Error while parsing an XML document as RelaxNG.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 57023ae5da9b7319a37c5a982b012103b3d20afd..ee9b884c081cd14f87e8d093dae889b4e42ee91e 100644 (file)
@@ -248,7 +248,7 @@ Error while validating an XML document with a RelaxNG schema.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index cff84a0210745058be49a8ac77c385ab92e06e82..0a864671394bb4161b79e730075d2a4e5756b460 100644 (file)
@@ -455,7 +455,7 @@ argument.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index cc8515beea5286c487678828022c4052f6452ce1..107b147899215e0bf1ac108ae05639d0366e4214 100644 (file)
@@ -367,7 +367,7 @@ errors in lxml.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index cf4a9a8ae33adeccc431d7fa33f84e4eb6bfbdfc..73317f0b0474cae5b4eaeba2481d4ec64c123b0e 100644 (file)
@@ -252,7 +252,7 @@ Base class of all Schematron errors.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fceaeefc49bde92706888416879414048cc75192..4e0712a6b0b0ee8655ba9db59c79fc90a2b0ab2e 100644 (file)
@@ -248,7 +248,7 @@ Error while parsing an XML document as Schematron schema.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index f2b406941531d6557376de9307c11a7209d9fac7..e0853c1402675feb4fc7a55a279b61201edb77ce 100644 (file)
@@ -248,7 +248,7 @@ Error while validating an XML document with a Schematron schema.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2d3fe19a5e01214331182ef655feea1a4892c870..4961ad79bb77f3462576be4db9bb985aa6e0d0d3 100644 (file)
@@ -252,7 +252,7 @@ A libxml2 error that occurred during serialisation.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1cc21e5b19e98a3bff268797f7e6ec09ca75a3bc..301b7beeeff6ad382b49eb28da75066eb2d17cdc 100644 (file)
@@ -235,7 +235,7 @@ Iterates over the siblings of an element.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2defd389dd314dd04a7b3d31e6fcb1d91706d109..d8a3f5cd581243c9dc4c3ea17b0b934abb796fb3 100644 (file)
@@ -383,7 +383,7 @@ element.</td>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bde163bca4653d581a5bff72b4d92c5aa87d875a..7582c28c3179ac4d7c8b73b1ab11474c3b458dfb 100644 (file)
@@ -292,7 +292,7 @@ processing.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bfa9a2fee564bbc8d4616244da927d0a11f5d5bf..4f6abf5697f6633c600e47af9153ef038a01b6f7 100644 (file)
@@ -246,7 +246,7 @@ Error during XInclude processing.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 0432a214bf491a7ce6d38bb30229b515d4adc16e..dfd883aac2f23b5c9aeef8ddb34959fcf3876b21 100644 (file)
@@ -381,7 +381,7 @@ apply to the default parser.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 839844e256eea1baddd55895bd75054231062dba..7de8c1df43906b68d4dbba66f6a3c922e6038a35 100644 (file)
@@ -325,7 +325,7 @@ source, you can pass the <tt class="rst-docutils literal">base_url</tt>.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 581765f1e32d1a7fbd2bf2cde0e4fd388597867f..2247f1c3fc5d910973cc75fd939d47ce5910cea5 100644 (file)
@@ -328,7 +328,7 @@ schema insert default/fixed attributes into validated documents.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 754558879fabfb35061150796c387f16ff0309ae..be142cbb57b8527c02d18d40fa1c3d43c57a9e74 100644 (file)
@@ -252,7 +252,7 @@ Base class of all XML Schema errors
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 08fa5ef31d031f0e9e737c45b266cd78ec9e73be..69d8b1299871f9db51f84b598e971fdc205c3f7b 100644 (file)
@@ -248,7 +248,7 @@ Error while parsing an XML document as XML Schema.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index af0cdf7ac7031bf21d515fd655a2b27abc9eb605..cb0d665ae1aa11695172e43a7a4b08eb3588dc88 100644 (file)
@@ -248,7 +248,7 @@ Error while validating an XML document with an XML Schema.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3a98260250f3ea96ed0d2f5e709c79bf1c310ee5..389ed447ee6bab8f10caca5de73243c1919f5a18 100644 (file)
@@ -239,7 +239,7 @@ Syntax error while parsing an XML document.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2813830a4b6730da532bcd471f17e9fb4bc21587..9172fa9bdb6a162c65b45240bdf5d7f3e38ac6e6 100644 (file)
@@ -362,7 +362,7 @@ returned for string results unless you pass
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 68499cd37f0023550f160ab2247a9b5ba1aad9a6..4b7a5f20ede778395de352dc7461fd6770a960b8 100644 (file)
@@ -341,7 +341,7 @@ are currently not supported for variables.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fe36b28870f6cde3d15202d08469357f58e2d368..44361f976919bf5a89f8a8cc8639383fc29a50c8 100644 (file)
@@ -376,7 +376,7 @@ against the ElementTree as returned by getroottree().</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fd1e8c40557262fbca4c4a3e59eea8b445fcefcf..e43e6100e5d8d5c5a154b479a50f0bfa81bc3185 100644 (file)
@@ -252,7 +252,7 @@ Base class of all XPath errors.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e685663d8fab8a0b8e2e3f7f83632639ad01e0ab..4d510138225ae6fce06141edf676c8e11860510a 100644 (file)
@@ -254,7 +254,7 @@ Error during XPath evaluation.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c02e2edfa81a1e2a10616ee61351e8853fce42c6..b07db289457c739d85adbe4a1b596036a7662501 100644 (file)
@@ -250,7 +250,7 @@ Internal error looking up an XPath extension function.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 28ad6e7e87cf34af7bd7038f878693056499e7fb..1a4029fe0ac757f189e96c45625f15270a8a048c 100644 (file)
@@ -250,7 +250,7 @@ Error handling an XPath result.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4ac0947479ef498eeb73fd58664664db935ebc9d..4f129c4cfacb5aeb70832f613a260b1bac9cf9f8 100644 (file)
@@ -244,7 +244,7 @@ exceptions.BaseException --+               |
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fa89795249116d25e36be783d26a471991bec075..98ad6a9428dddbe83e0005080baae2487ad64dea 100644 (file)
@@ -576,7 +576,7 @@ result = transform(doc, some_strval = XSLT.strparam(
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e8645d42928028abf9b659b4ff585c6f689dc9d0..292906fbfa322502deb024672599e524c2fd29c8 100644 (file)
@@ -429,7 +429,7 @@ XSLTAccessControl(create_dir=False, read_file=True, read_network=True,<span clas
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index cc8ee958cce2fad214ca649483b0a522e7394a55..6e16dbd764768ffc007a8d7a11ee1c37ea4ffddb 100644 (file)
@@ -248,7 +248,7 @@ Error running an XSL transformation.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c07b155bb616c24a4d41da347c6bb634b5d3fed0..b7dae92f873f60d83fb1879ed56ff072bde4e595 100644 (file)
@@ -252,7 +252,7 @@ Base class of all XSLT errors.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4c8c0c7ed2fe3ac6c5ae9d1b84a7ab0131328432..803d2ad99c974580d5b6ee0ef2b933634d898f60 100644 (file)
@@ -398,7 +398,7 @@ case.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7f85f3ecb38030c84719b232f758e9783641f6d0..e79fe75933d66bd678146ace02b7bb8301f9bcfa 100644 (file)
@@ -248,7 +248,7 @@ Error registering an XSLT extension.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4268a1bdcebd7f6e175f9c7b89f501f6fca5be72..b99fa03eda5d8a978412388d6f0d6388ffb4c7e9 100644 (file)
@@ -248,7 +248,7 @@ Error parsing a stylesheet document.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 76f97ca304077155745e8de37d564d7552638726..145a7c140271dffa79d01d2b4fe8bab5898995b7 100644 (file)
@@ -226,7 +226,7 @@ Error serialising an XSLT result.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e7fd84c4c55b58ee6be785efe7074f1d3b240e6b..5a2047adb19158e405734580efd4c430a7dc1edb 100644 (file)
@@ -705,7 +705,7 @@ A dict-like proxy for the <tt class="rst-docutils literal">Element.attrib</tt> p
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fda225140e7c5f4a80ec731f87b2425229d155d4..1c09d20ddeae1e73151d7f1c06554f49c4e1ef13 100644 (file)
@@ -347,7 +347,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4a0a1914dfdcd606c3215500d0dcaada9f729f9b..c233bba1c91a0727f70acf961cab3865338004ee 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5d7c041cc31e46dfa80ecaebe5085b5c2be96999..10c8d7cbcc7458c1ef09524f2b2359415ed563f2 100644 (file)
@@ -228,7 +228,7 @@ document is cleaned up.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 44001393b20552e71e26abafd7bccabe62628854..a6704a30beb7ff2652ec57a0cb7977452125b2f8 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3e9f16cc64024735d8334d525b403907783792bb..b70a60bf1114a6b9f96e1b326962d9ed1c874e40 100644 (file)
@@ -71,7 +71,7 @@ object --+
 <dl><dt>Known Subclasses:</dt>
 <dd>
       <ul class="subclass-list">
-<li><a href="lxml.etree.ElementBase-class.html">ElementBase</a></li><li>, <i>unreachable</i>.__ContentOnlyElement</li>  </ul>
+<li><i>unreachable</i>.__ContentOnlyElement</li><li>, <a href="lxml.etree.ElementBase-class.html">ElementBase</a></li>  </ul>
 </dd></dl>
 
 <hr />
@@ -1642,7 +1642,7 @@ parents.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 23bfc9a79a51a5c5daa362a4c5217adb7d12b8b0..5d19ae4d2f343e45806b0e28d4e0d64d0c320cf9 100644 (file)
@@ -277,7 +277,7 @@ Dead but public. :)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b6da70186d21ecd356919c1ef6d9e919fb9cb7e7..c6b83ca830868a8673407298e6cf6da4ac007e98 100644 (file)
@@ -279,7 +279,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fa74817621b9adeacfe57ba237683bb59c8dee1b..9c061066f49aa8c7d13cf4ec5571e65bfb4d2336 100644 (file)
@@ -268,7 +268,7 @@ basestring --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 53b9c9fba8d0afaea3521da79118b8a8aa5739f4..1f48b4b66a0fd995a3d708ea93ef3c5523a0b099 100644 (file)
@@ -232,7 +232,7 @@ Dead but public. :)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d27b2316d417dd21e51bac028ec37fde692f9e21..4c3fac50833446da5308ea605af722e8c3a5610c 100644 (file)
@@ -1079,7 +1079,7 @@ class directly.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bc69e9c9e70665ecbd520a0728cd6ead17f444df..51810f3676c82d9530b66db2147584475861e9d7 100644 (file)
@@ -334,7 +334,7 @@ basestring --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 02d5e81abfbfccd57f581db1f0cf4b32225fb1d0..2dc852f6a8be243a805aec5aab8cc425c1f8c2d6 100644 (file)
@@ -357,7 +357,7 @@ the value None, if there was no text.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9a9c7b4580d3b190d5deed3508f88d0729f48ebf..64bea06f4b061bba2652f599e7057bcffdb8db5c 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bd31503597639b4ecc344d2aae1c9f0a5be360b8..8651933a7512fd03519a593d9cccc19028faf5e4 100644 (file)
@@ -378,7 +378,7 @@ different from what the <tt class="rst-docutils literal">error_log</tt> property
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 245cdbee2f568c4936f6fab85fe15267d6aaa3b0..ebf21f5658df1784223ad1d17b7cba116988e273 100644 (file)
@@ -483,7 +483,7 @@ that were created or modified 'by hand' are not supported.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 562934874ef6716084835320b4b4c901311d12d9..039a1254a393250a0e1731c51ef75c385940b2d6 100644 (file)
@@ -571,7 +571,7 @@ entries.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index cbbd7d0a2dd7012a2374d1016ebfac83eb3f5042..a013a61fed6190ad790cab4a4c9e28bced5c31fb 100644 (file)
@@ -357,7 +357,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 043c62357b50086fa65f42ac0d565f21b5a13363..0f48f7a020e3df3b2946a9c13211d7f29c1502ee 100644 (file)
@@ -409,7 +409,7 @@ It is not guaranteed to work for all possible text content.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 536c2400b7c5a8b147c80611b291d55c1956a3e4..288f1208cfe0c194eeb2b3cdbf606094c12448e7 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b9a67da308859cf8a96f4fc151ab0511f8a78d98..e4b9e33afa95094bd3ffdbaf031018a4970a6b05 100644 (file)
@@ -230,7 +230,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b4303f2f9969def6c6a24afed7162ffc36874f5d..91f7b8bc854efd2eabd7fc37d5cf30eface3b2d6 100644 (file)
@@ -263,7 +263,7 @@ exceptions.BaseException --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5e7f20ee1e39924b255d36d93f3fbf30d16179b9..e90b8bb22beb731834aedb54e091012016ac43c5 100644 (file)
@@ -347,7 +347,7 @@ Base class for XML validators.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7431f481ec06a323224cf4693f82e2444a082168..60d152157b94fc6a08a849eabdc6cb68e94235e5 100644 (file)
@@ -323,7 +323,7 @@ are currently not supported for variables.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 0ef072d24433458d8c0d2c6f14e90476160f0a9c..7658006aeb3b1295e5c1958ad78bfd83a5442589 100644 (file)
@@ -391,7 +391,7 @@ the processing instruction.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c746d45852d4046ecaa74745b3043069a445a6ec..c6208cb1fb7a1ed56ce50dcaa5157d5db3360dc8 100644 (file)
@@ -360,7 +360,7 @@ the result as defined by the <tt class="rst-docutils literal">&lt;xsl:output&gt;
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index da16090647a0daff719c9fd8eae66e0da97edcd9..7004c1b0fa4e0e1d5f40f0c2b60a3a410fa92f81 100644 (file)
@@ -285,7 +285,7 @@ xmlfile.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7ad94390bc6dd4091725d7c8db35c9e073bb3b77..5058b9dd2e92b4956d8e197a2a5b90d8e639825e 100644 (file)
@@ -501,7 +501,7 @@ attribute default values are requested.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 733307af88ae466f300858568502a729d5f96314..f546860807040e7f529f5e70f75de375b741d434 100644 (file)
@@ -368,7 +368,7 @@ Instead, the next returned event will be the 'end' event of the current element
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9a0328824806fa1ef547b85215828a82cb197f90..8be31cf84b911287b3222ddeb7c8f1c244d8ab75 100644 (file)
@@ -375,7 +375,7 @@ explicitly flush any pending output when buffering is enabled.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ac622798515cdaa17fb77806735abb783a743732..72682f7d270a8129e9a776ca0fda67eea45768b8 100644 (file)
@@ -1322,7 +1322,7 @@ descendant-or-self::a[@rel]|descendant-or-self::x:a[@rel]
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 12faff2d2e7657788cd432590fc2f27ef5427185..f19dae82be8b204eecbadf94541e6cac7fd54334 100644 (file)
@@ -4033,7 +4033,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index daa28803b500475e173683cb472d0045c3ec58ec..b8320f62a51211057a5cb62db36a08f9ea0afb9c 100644 (file)
@@ -363,7 +363,7 @@ uncheck individual checkboxes according to their value.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 063454d665baeec292a362f09419f1258fc527ea..c0532e0ca9393291451a0d34d2f253fae00d6272 100644 (file)
@@ -541,7 +541,7 @@ checkboxes with the same name.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ce81057f90c7fbdceca621eb8616a5703c60b500..f1dad25e750e9c1065dcac06d6f6a655f9fdf2f3 100644 (file)
@@ -693,7 +693,7 @@ false if it was removed (and is now disabled).</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c12e01b0e3c113fbb8d67a0b7710da78b31de4c5..9d5b0f244c49ae823a0b04c2622c894b8191131b 100644 (file)
@@ -264,7 +264,7 @@ keyword.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 12b98aa1b3845d608e5eda41db9c25e06bc4c168..3e47595d7ac4159f785c936457f4f9bee4b432b9 100644 (file)
@@ -121,7 +121,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d9df5f83297894746194cd5223c80c92fa7a1008..94d825aed77dd932e2d9ddb171596851e0085981 100644 (file)
@@ -683,7 +683,7 @@ _abcoll.Container --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 12aa19f0781a58337dc5f41d84f3858541a105ef..2ef036c3cb2a69cea3dfa000687063c4a0080f1f 100644 (file)
@@ -428,7 +428,7 @@ string, and defaults to <tt class="rst-docutils literal">'GET'</tt>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 627a2bc7136197d30d1622b029385a2a4585b708..02afa1b741c80b0635656b1d11278c99fddc26cd 100644 (file)
@@ -255,7 +255,7 @@ objects.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c4d0f53ba934991a09aacc307fdbbb7df1a67d0d..b6f0151bad5faeb9f0ef7c969d4d7838322a3639 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 0a809347768023eb6a3fea6b13b2ed2dd5cd869f..5ab72faaabd1cbe449db5171f5eca6787458b12e 100644 (file)
@@ -370,7 +370,7 @@ for <tt class="rst-docutils literal"><span class="pre">form.set('novalidate')</s
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 8dd2b96c0efccaf80f3d3a92d87786e068a9e9b2..2f2878a7a614bf2afc431eb0123707acd49f9a68 100644 (file)
@@ -365,7 +365,7 @@ Element classes.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1889701c8a24df66aad4f8276e0f8e10c3704ea5..0963c2b9de6c4a89010b5642e03723708c37819f 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3a4c85680c88b1e1a1bc362a0b8190840e860b61..7eaebcdd562d59a4b700b3f214dc49373a0bd919 100644 (file)
@@ -799,7 +799,7 @@ element to get the document's head.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 88b473c67dbb1b2fc972c43ffe0a9a7b8be885ff..33b4ecc4f311b862d39cb9572d05de35d787e369 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 52d7511fe316215e2dcda84bc4a39da7b13f7bd8..b63c3002e21f134143aa843da9c604ea9d335afd 100644 (file)
@@ -406,7 +406,7 @@ checked, this returns None.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 81e59a8247039bcb6c213d4383ae65eaaae157be..3e3a34cb7b0b8c6dd5c493a746941519709bb942 100644 (file)
@@ -432,7 +432,7 @@ nput' or local-name(.) = 'textarea')]
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c3ddec5fc65e8f950710e8ee45ff11e656270787..313ea3b5a2e83ff256f3c70a382e55e7a2c18180 100644 (file)
@@ -280,7 +280,7 @@ Mix-in for all input elements (input, select, and textarea)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b1f764042e26706008eaca3c127d8e9386176694..b265800890c105cfff0aa05930db5dacd305b8a7 100644 (file)
@@ -312,7 +312,7 @@ can't be found.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 803054ffc978a0503d960227d08e6abbb1d93125..3a4b125d0197a04a47e88e93bfcd51382801b7d4 100644 (file)
@@ -584,7 +584,7 @@ to unselect the option.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ec5e187c241513ffca3ab2aad3c5896946f3f691..89264fb75d9948235fa37947e0a4e960a807a123 100644 (file)
@@ -362,7 +362,7 @@ unchecks any other value).
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1dedd67f5587c63a1f52ea61d1f998632a3134d0..40862f4d9256e7117301cde545463753a57726b5 100644 (file)
@@ -377,7 +377,7 @@ attribute of all the <tt class="rst-docutils literal">&lt;option&gt;</tt> elemen
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7709dd509afdf0848577926c07ffe74f6d30d648..c7334e9b0fdcc03449edef03acc459da68fafb3d 100644 (file)
@@ -317,7 +317,7 @@ get/set the value with <tt class="rst-docutils literal">.value</tt>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a4932e081dd34c28eede1ecc129a39fa475ec0d9..ad83c0a65210823edda025f24a6b82e0516dfbc5 100644 (file)
@@ -267,7 +267,7 @@ parser like this:</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d4d8ac1eaae3ed61ed1e7c3b84b8376cd4884320..8cf5eef2dc750ad7088ea567a16baa6166376057 100644 (file)
@@ -254,7 +254,7 @@ of the resulting document.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e594b69eb53da94bac44f6af144df0a6d8829e2a..23766dbb8bf33ee069cc66dd97dc5343a7c3f03e 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e6954842147132a965fb2056174ea8a9711752f9..67d0a1b2bc08f2851c5a5a2168981d0bc0ea28cc 100644 (file)
@@ -436,7 +436,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 455cabf447daae0392ec1d3a0d9263a0fbdcdfd0..3a0ba353e2c186b464c2302de3fad547e8f96e1a 100644 (file)
@@ -756,7 +756,7 @@ a<code class="re-op">-</code>z0<code class="re-op">-</code>9%&amp;\?;=~<code cla
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2b33c6e38255d804bfddfc31f25846009b0575e4..ca300ef2ff1193ecf1fd6ca6d29ffa2058ea3dce 100644 (file)
@@ -1327,7 +1327,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 106668ada790a1041e878364ac9ea12b7087b5ef..9737b98a9adcbf4003e9c4e04fdba6d2eedfdc66 100644 (file)
@@ -775,7 +775,7 @@ more sneaky attempts.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 8f5b7634496a14b5817fce110d8fbe472b152c9d..890ba76ba00193cf0f3baffab7238a52a46c6462 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1073726883e7c1cf1221defcde451d5f2376e873..92d005a0dd8d6c2c4634891ed1e4a5b88af8a91e 100644 (file)
@@ -235,7 +235,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 47d0a6752d30bf3f6f7d13f531c89cc92eb9390d..1b091f73c03a41f71dfbdaed953631c9781d37b3 100644 (file)
@@ -1412,7 +1412,7 @@ includes the elements tail.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e210ddcf4302736d67e1d4d6ed8e676c99940386..dfb75c9dd04bbe08a654b8005c5a840eadb484bd 100644 (file)
@@ -1802,7 +1802,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index affa4c6e1cc469d6d4764739d383ac5561e5302f..297d37a9eb4e15dc7b067bb45841c1a65db756a7 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 8eea980b0ffadd4f61260c452b79d1735db9da32..66f332a3836d2b02fc2bf385355bfba193ae076e 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1e9dd8ece2c6c41bdaa960d945e028aeb696a01c..8f3830a4aaf11523c4138c94f174691834909f39 100644 (file)
@@ -243,7 +243,7 @@ triple with n==0.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5097ed48eca0bbeeae01ec2b882bb186277d10a2..64f4fb51e7efac950b3515bb1b19f8c85a927b0d 100644 (file)
@@ -208,7 +208,7 @@ Raised when the document no longer contains any pending deletes
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 87079bb618521106bb0b9feb764ad340e8aa25e8..bbaf543d41f489a45c05dcd0616de37d31b633c7 100644 (file)
@@ -326,7 +326,7 @@ show the href when it changes.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5953208506a22a0df1dad57025069a46388ed91a..a5c3bdd6102b0646aa588725ba9f1cbaa077cbb1 100644 (file)
@@ -416,7 +416,7 @@ is only represented in a document by a tag.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 0770e9abea0b441cd6c56cf4d2db8db1a71cc573..88c589184db2544bb25ce2a9b72cb4b14c07239e 100644 (file)
@@ -401,7 +401,7 @@ space.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b69a4427a983538879391436cf77dbfa8515a57c..9acac64c6ea0ff1ae4b778ba4b7a838868c0825b 100644 (file)
@@ -565,7 +565,7 @@ escendant-or-self::x:textarea
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2df5ff6345c23822b169375d5714a67125c71178..1eb62589214a2744e44bddf4d7f36cc9ef2a6994 100644 (file)
@@ -794,7 +794,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 397b0f159bfa95d0e4704fdc08fb562b6c5c3d5f..8da9c6ae84f778c94f9ab8127f0de2779d5ca6e8 100644 (file)
@@ -304,7 +304,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 161d7e63beb091cb512e45bfc9a2ad5f78d24be2..7614d71f99c789f0a14860d1db37e954084d4737 100644 (file)
@@ -186,7 +186,7 @@ Raised when no form can be found
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ef3aa3ac59626946e39716693ee85e79656d5182..bb66f7e96d83d85b39a590e78895ad939c30812d 100644 (file)
@@ -476,7 +476,7 @@ default when parsing from a file path (which is read in binary mode).</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e4acbd81c0511996f2a16cb17174b0d9ddd0ce76..ea885408522e9d98b7d9579ad241a9d5c31240e0 100644 (file)
@@ -672,7 +672,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 885a51184bd8ba3077f00895a230e180f5fb62dd..900ca740c7c86a29c732571336fc3bc78c28f870 100644 (file)
@@ -257,7 +257,7 @@ text</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4d3a9493e8c4f4bbb46de84dd2738fa45de823b3..ccfbab57da71e9e623c3b86140f3e97bc13a380b 100644 (file)
@@ -140,7 +140,7 @@ An html5lib XHTML Parser with lxml as tree.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index f4add6362c050335e160c3f87a477f8f32511344..0a63cc282bc21a0be3c7408f4e7166679ee66179 100644 (file)
@@ -488,7 +488,7 @@ keyword.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b9eabfe46aa14e29ca0e5fa7d1ef7f37a5f0f675..a1a9f6b6940fb61b3550624841ce146e1fe0f4be 100644 (file)
@@ -546,7 +546,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bce909adcca603cf93d219b77d9d92149403001c..73fc105bc2f64543eb1b7574a0fc703f578d8237 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d815d2547e8816d9751582b54efcc7cb85b0ecbd..778882014bb887bdcc9240ae0db5e9f4f8588169 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5cd5924659123cbde9e2c85f4d5fca3aed7ff9f8..2061601bb989a28d1a74cf7b7b3a00a082273ac2 100644 (file)
@@ -117,7 +117,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1c1ba81ee85b74fbc1848174b68b30afe5bf494f..3fba46c36d59c97410db9a3045afc163d6104c2a 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 34f54046b915fecf87acd0fc3939f2f479d17855..36ec60c0e0db9cbfd03dd7b4d11fcaddc34d19ea 100644 (file)
@@ -101,7 +101,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 430e27c611ea4e518fd2ceb0b1f104d813a65b80..1c853b91db755ddc6c21316c73a48269a5533e7c 100644 (file)
@@ -406,7 +406,7 @@ Else convert arg to string.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fdc64e8287619d438ebcd676e6ba03949d8dc960..8d714b3faeef93fd68ec4e62298abc73f89603f3 100644 (file)
@@ -638,7 +638,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bfd452689dd8bfe07eac2966fa995cfe284f68e6..a03ebe73d448998477936e4fdd936d4c7d13ac86 100644 (file)
@@ -628,7 +628,7 @@ been turned off).
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2a5839c147c75e09c69bbff03f3653c7c0f10213..37dbc6eee5a6c214e90f6790a805983c62331cd5 100644 (file)
@@ -66,7 +66,7 @@ It is based on <a href="lxml.etree-module.html" class="link">lxml.etree</a>.
 
 <hr />
 <div class="fields">      <p><strong>Version:</strong>
-        4.0.0
+        4.1.0
       </p>
 </div><!-- ==================== CLASSES ==================== -->
 <a name="section-Classes"></a>
@@ -1137,7 +1137,7 @@ elements.  Pass 'string', for example, to make string values the default.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5295f3d3fcdc9bcf9204abc60ca6f9f46839cb83..90eeb1c72f2fcfd03780ad59d40b772cc6fb0a76 100644 (file)
@@ -803,7 +803,7 @@ this if they recursively call _init() in the superclasses.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5721d740596d9eb8e4f28097af195c99bbfbc12b..9879df7bc6182911a61fd3c62a1814cabcfac656 100644 (file)
@@ -366,7 +366,7 @@ some text
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7e60fe8ee829b253dc29d962be8d55fa13ffe6ba..7acbb78524bc1429e7100e241c7c5e91017f06a1 100644 (file)
@@ -392,7 +392,7 @@ this if they recursively call _init() in the superclasses.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index be78a1ea7ca822ec32ba3b497f036ebb40df9a82..53e6caf309f99ad8e886f10181a94199fe61a320 100644 (file)
@@ -398,7 +398,7 @@ this if they recursively call _init() in the superclasses.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 466bda8886b1dc7461f482bd8249b4ca27bc4c12..18deba5e2362bb2a103caa921d29f25a8964bbec 100644 (file)
@@ -392,7 +392,7 @@ this if they recursively call _init() in the superclasses.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5036d3bcf0bd06d1557e801280bb63798c9ccddd..5d991ba932c045514dd9f8de87ac1596458515c4 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fd676f0a09718db87f5699a628d1d509370d5ed9..53788af719e574c1909d4c79bc640d7bfcdc10ee 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 26d2a00039d5fd8e860952ff53518f6884c734a8..91fa4934c5ee7270368478088bef1ba355501bdf 100644 (file)
@@ -453,7 +453,7 @@ as second argument) or raises AttributeError.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 91909ab88b0a866044d82aa2d212c8c33e7714df..a20d4a7ca755f256ae5895801088a5575935139d 100644 (file)
@@ -410,7 +410,7 @@ doing.</td>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 01162c5415bd55997a7095332592b66ac44cff39..8a3bf0693ecdb40618de9943f82a749855a9ac1b 100644 (file)
@@ -861,7 +861,7 @@ returned in document order.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b052873ef4390c695b64ebfcad2e994cafb6b866..4907eb48ae955731bef9f10a6012eae3c3af5da8 100644 (file)
@@ -277,7 +277,7 @@ empty data elements (defaults to StringElement).</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9abea9954f9aab129b1abdcd32f200a19427b7d1..e30d3c7dd7c8202193bc5dd4f1e94460a456544f 100644 (file)
@@ -447,7 +447,7 @@ ignored.  Raises ValueError if the dependencies cannot be fulfilled.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6e0efe8807c3efb73096283aacd2ba3925fe5bd2..8aef90065789dfdb0465701b0fd75bf63b12329b 100644 (file)
@@ -733,7 +733,7 @@ Instead, use the .text attribute to get a 'real' string.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 182a53f3e812821e105b27f6e2f8babe917b7988..32430a98e8bccb9ed7713b834ec4ec02c1ec6cac 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 18713481938b285921888f9a06af70fafcdcbd9a..ce621bbd8847d53b5bcb30283be23a4c4b668576 100644 (file)
@@ -108,7 +108,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index eb21976a0f7fec039101b7978d3d41c7b67760d4..b933dd88ce30b1bb507fad0a1910acf64b111831 100644 (file)
@@ -220,7 +220,7 @@ them against a SAX ContentHandler.</td>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 64c52d69ce78be2c604b8808f73bfaf26a952592..8792b9da808b85b598e46e38b7d4b626d0f86f4d 100644 (file)
@@ -577,7 +577,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2c806c706a0e374a2b345ebe510eefd7da83a642..3401f98060aa6c4e8c4a80c7ce5f268e890cb78f 100644 (file)
@@ -872,7 +872,7 @@ Locator provides useful information.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c0c3d076759c74658a996d9f6ada4545e0b89e7c..2981a11b1e592c0dca7c31379f6f6c98794d66e0 100644 (file)
@@ -282,7 +282,7 @@ Produces SAX events for an element and children.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5def9bbac7ef74385e9b7813ba8e87708ccddc9b..fcb284e147da5b7df60b3fc08f7b074233a16ca4 100644 (file)
@@ -185,7 +185,7 @@ General SAX error.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index de493f00d10dbf4aa8c2f27a9b4732d73e669e85..49d8cd6ad602b608743a72ede39c21b48628230b 100644 (file)
@@ -175,7 +175,7 @@ namespace registry mechanism</em>    </li>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a8412b68d7af2f18c4b2d490472a20f1275b4b1b..92b48ff38d8100213056a643d353c4d521822a74 100644 (file)
@@ -103,7 +103,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a6f41ba96c74c08c6ee690a27280d2836e534646..f3bdd1ccae15b6e658a329d4303abc99027a75eb 100644 (file)
@@ -538,7 +538,7 @@ occurrences of pattern in string by the replacement repl.</td>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 290a20ad48b40cadb721472d89c9cbd9acfe461f..c787976f2098e0e708cf4b828cc0550de04be694 100644 (file)
@@ -608,7 +608,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 71cf12b36e34dd0a4da2de6bcdd554f369a51cfd..fcc7a85cfa9fa94c20ef9c6db504390c5847c5a0 100644 (file)
@@ -414,7 +414,7 @@ unittest.case.TestCase --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fdde23eb22e5fe4f871a66d7c7fa7a25b56c327e..6e5df8898e0b83773d3f94f8851ad5a7e98b68e3 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 89f1d0066a6b8a5751c6fc61e1f8b2b342c0ed4f..56c8674a12cb32c4c84a0c048c1077284226bac9 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 46fb8c9cde873ccade9b43d5f7bba182f9648af7..bf48a89ba32046647d87af264c988926fa386980 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 81737df7e5cd2983dcf1ccf7f97564ce9f46c316..fad095d173d16a92b74f455c0651c5667294c420 100644 (file)
@@ -245,7 +245,7 @@ Using a class because a function would bind into a method when used in classes
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 0e5f5e8872631b7491bc83f8ca136f0bd1dce1f4..ef5cbedb339e88101c337f39943ad47c2c90895a 100644 (file)
@@ -264,7 +264,7 @@ Simple HTTP request dumper for tests in Python 2.5+.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e457a2659a18e3f72805d9d25ebab3f16022a052..e8838c39aca98d5b025866a7636e9c325a78228e 100644 (file)
@@ -198,7 +198,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b545c80b328b360fb0037b1d76261a3c475f4c0b..77f2ce48fda1751010074a73483641708428c5c5 100644 (file)
@@ -247,7 +247,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5e1623eb00efca7807eea7cb3eee928af3b01c55..28f5017804d4081667216501fa8eff152fb678d5 100644 (file)
@@ -204,7 +204,7 @@ A web server that starts a new thread for each request.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c5c50ddce6626cece5e0e4dd424cf4b72f5169a1..3742a94324a01dd5fecd83753f4a0a0839c405ea 100644 (file)
@@ -331,7 +331,7 @@ message.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 94b98d792a6de0a27e91c46a98804351a3aa7d1f..5989cefcdda3206124dd831ea13221ef793cc1e1 100644 (file)
@@ -1178,7 +1178,7 @@ ElementTree.XML(&quot;&quot;&quot;
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3560ebf00567323f6cac78543c74cc9e8d2d6e8e..b0e6e007b6e19192e1f83b3e95c956b80bb5816f 100644 (file)
@@ -160,8 +160,9 @@ lxml.tests.test_xpathevaluator.tag
 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-26', 'tag', 'link-26');">tag</a></tt> </tt>
 </div><a name="L65"></a><tt class="py-lineno">  65</tt>  <tt class="py-line"> </tt>
 <a name="summarize_list"></a><div id="summarize_list-def"><a name="L66"></a><tt class="py-lineno">  66</tt> <a class="py-toggle" href="#" id="summarize_list-toggle" onclick="return toggle('summarize_list');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.selftest-module.html#summarize_list">summarize_list</a><tt class="py-op">(</tt><tt class="py-param">seq</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="summarize_list-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="summarize_list-expanded"><a name="L67"></a><tt class="py-lineno">  67</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt id="link-27" class="py-name" targets="Function lxml.tests.selftest.summarize()=lxml.tests.selftest-module.html#summarize,Function lxml.tests.selftest2.summarize()=lxml.tests.selftest2-module.html#summarize"><a title="lxml.tests.selftest.summarize
-lxml.tests.selftest2.summarize" class="py-name" href="#" onclick="return doclink('link-27', 'summarize', 'link-27');">summarize</a></tt><tt class="py-op">,</tt> <tt class="py-name">seq</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+</div><div id="summarize_list-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="summarize_list-expanded"><a name="L67"></a><tt class="py-lineno">  67</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt id="link-27" class="py-name" targets="Function lxml.tests.selftest.summarize()=lxml.tests.selftest-module.html#summarize,Function lxml.tests.selftest2.summarize()=lxml.tests.selftest2-module.html#summarize,Function lxml.tests.test_elementpath.summarize()=lxml.tests.test_elementpath-module.html#summarize"><a title="lxml.tests.selftest.summarize
+lxml.tests.selftest2.summarize
+lxml.tests.test_elementpath.summarize" class="py-name" href="#" onclick="return doclink('link-27', 'summarize', 'link-27');">summarize</a></tt><tt class="py-op">,</tt> <tt class="py-name">seq</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
 </div><a name="L68"></a><tt class="py-lineno">  68</tt>  <tt class="py-line"> </tt>
 <a name="normalize_crlf"></a><div id="normalize_crlf-def"><a name="L69"></a><tt class="py-lineno">  69</tt> <a class="py-toggle" href="#" id="normalize_crlf-toggle" onclick="return toggle('normalize_crlf');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.selftest-module.html#normalize_crlf">normalize_crlf</a><tt class="py-op">(</tt><tt class="py-param">tree</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
 </div><div id="normalize_crlf-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="normalize_crlf-expanded"><a name="L70"></a><tt class="py-lineno">  70</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">elem</tt> <tt class="py-keyword">in</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-28" class="py-name" targets="Method lxml.etree._Element.getiterator()=lxml.etree._Element-class.html#getiterator,Method lxml.etree._ElementTree.getiterator()=lxml.etree._ElementTree-class.html#getiterator"><a title="lxml.etree._Element.getiterator
@@ -1513,7 +1514,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2a40a7524e7bfe698f170d76ca8891c093553e15..982ea3ccf2efd54220748a4b0c2bd43b8aaf709b 100644 (file)
@@ -677,7 +677,7 @@ unserialize(&quot;&quot;&quot;
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 86ba011dd3970ffd6ed58f9f415cea084e322d21..3db045f05ea300b298facd841abde74ebac11a6b 100644 (file)
@@ -148,8 +148,9 @@ lxml.tests.test_xpathevaluator.tag
 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-22', 'tag', 'link-22');">tag</a></tt> </tt>
 </div><a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"> </tt>
 <a name="summarize_list"></a><div id="summarize_list-def"><a name="L50"></a><tt class="py-lineno"> 50</tt> <a class="py-toggle" href="#" id="summarize_list-toggle" onclick="return toggle('summarize_list');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.selftest2-module.html#summarize_list">summarize_list</a><tt class="py-op">(</tt><tt class="py-param">seq</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="summarize_list-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="summarize_list-expanded"><a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt id="link-23" class="py-name" targets="Function lxml.tests.selftest.summarize()=lxml.tests.selftest-module.html#summarize,Function lxml.tests.selftest2.summarize()=lxml.tests.selftest2-module.html#summarize"><a title="lxml.tests.selftest.summarize
-lxml.tests.selftest2.summarize" class="py-name" href="#" onclick="return doclink('link-23', 'summarize', 'link-23');">summarize</a></tt><tt class="py-op">,</tt> <tt class="py-name">seq</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+</div><div id="summarize_list-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="summarize_list-expanded"><a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt id="link-23" class="py-name" targets="Function lxml.tests.selftest.summarize()=lxml.tests.selftest-module.html#summarize,Function lxml.tests.selftest2.summarize()=lxml.tests.selftest2-module.html#summarize,Function lxml.tests.test_elementpath.summarize()=lxml.tests.test_elementpath-module.html#summarize"><a title="lxml.tests.selftest.summarize
+lxml.tests.selftest2.summarize
+lxml.tests.test_elementpath.summarize" class="py-name" href="#" onclick="return doclink('link-23', 'summarize', 'link-23');">summarize</a></tt><tt class="py-op">,</tt> <tt class="py-name">seq</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
 </div><a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"> </tt>
 <a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt id="link-24" class="py-name" targets="Variable lxml.tests.selftest.SAMPLE_XML=lxml.tests.selftest-module.html#SAMPLE_XML,Variable lxml.tests.selftest2.SAMPLE_XML=lxml.tests.selftest2-module.html#SAMPLE_XML,Variable lxml.tests.test_xpathevaluator.SAMPLE_XML=lxml.tests.test_xpathevaluator-module.html#SAMPLE_XML"><a title="lxml.tests.selftest.SAMPLE_XML
 lxml.tests.selftest2.SAMPLE_XML
@@ -636,7 +637,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 973482ea352a39cfff64cce05d2262c4fe0089ee..71f0f873ceab64b3ef1fb97f5b677f4a879447d1 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7d561e06a875c581067b667096ff24a03689cb30..59dc9dfe47ada88799de2c0d32134d6fe5e7b582 100644 (file)
@@ -259,7 +259,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 0f15038afd4a6196a0671e3187446520d58d8382..059f210deb62f8bcb9c89d0d5d6d1d76595b718f 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 62412f0aea37997492b79bd6ecc05a443fd9a272..472cd13340ca8f9993c8aed0f0d657f8ad742f0c 100644 (file)
@@ -270,7 +270,7 @@ Tests for different Element class lookup mechanisms.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 8a8421d8c2283fb5654c3e970df245d05944bbc1..f2ea8a7764b89ffdc501d0df7dc34ebc5be0aaa0 100644 (file)
@@ -1270,7 +1270,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7d0f4ad78eab45e8859d309f8e41d8a8c5a205af..1cce4b60278a5cc6eed3235deb63fddd3be21987 100644 (file)
@@ -601,7 +601,7 @@ Test cases for different Element class lookup mechanisms.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5c645fe33f4daa4639fb1976a80b07fe8c3cf4e5..e884e38502b548a7a2973cbaae118d0be47dbbb0 100644 (file)
@@ -495,7 +495,7 @@ Basic tests for element proxy behaviour.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a1613816665019a77968079a3d607e56de97d394..2236ac62893f15265f0322066ab1fdec510e496d 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 48d066f35b78af4673a0647a4a70cd7b002188f8..7a1e041b6fddfebc51cf2ffacd1615e99fb0fe17 100644 (file)
@@ -212,7 +212,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 651a34040a0d5eccebd8d83ffaeec9254fb71f37..a8a4ce13834149ac3f26bf416219001509cd9ac5 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a4e1d1194583f607c69f34c004d7b136595572d6..10dce5d7c7f5989a7a5ae524959ec016c48af428 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5c9f82f34529de1a62f56cc6b21c52211a24312b..c9e6adcd1c2cd603215b786ce2d89ab382f0c062 100644 (file)
@@ -334,7 +334,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 981fa89bb521f3e3f079d829e14cb66e41204335..cfc40d583484897c99399412aff7ea2d8f7faf57 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3cfbe02f3bd26bbafbad30f98ffe9e7a54f9ead0..1fa25851bf652f576704dbb54ed524da3998fbca 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 52ea790fb0c1aaaf700004e25941e9d9509c6dde..e6a3839d8cff91f4a083a168b9da9d37d7d14d04 100644 (file)
@@ -224,7 +224,7 @@ Test cases related to DTD parsing and validation
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9859d252786b00ba9681e97710e06b1cb33710e2..8e2f89920473ce68053a94dcc6488fd4122caa6e 100644 (file)
@@ -1236,7 +1236,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 64cea07b0e9cde18a4e15dc90dc3cdced74e4ee0..c57f20bc7dcd055cba45de8a28fb5bd6992a7cf0 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ba8cabf8527d69cd120f4fc59f410abf6448bd9a..200e7edaff82b6eb8d798f0429d15ae3ea863787 100644 (file)
@@ -106,6 +106,54 @@ Tests for the ElementPath implementation.
     </table>
   </td>
 </tr>
+<tr>
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type">&nbsp;</span>
+    </td><td class="summary">
+      <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+          <td><span class="summary-sig"><a name="summarize"></a><span class="summary-sig-name">summarize</span>(<span class="summary-sig-arg">elem</span>)</span></td>
+          <td align="right" valign="top">
+            <span class="codelink"><a href="lxml.tests.test_elementpath-pysrc.html#summarize">source&nbsp;code</a></span>
+            
+          </td>
+        </tr>
+      </table>
+      
+    </td>
+  </tr>
+<tr>
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type">&nbsp;</span>
+    </td><td class="summary">
+      <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+          <td><span class="summary-sig"><a name="summarize_list"></a><span class="summary-sig-name">summarize_list</span>(<span class="summary-sig-arg">seq</span>)</span></td>
+          <td align="right" valign="top">
+            <span class="codelink"><a href="lxml.tests.test_elementpath-pysrc.html#summarize_list">source&nbsp;code</a></span>
+            
+          </td>
+        </tr>
+      </table>
+      
+    </td>
+  </tr>
+<tr>
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type">&nbsp;</span>
+    </td><td class="summary">
+      <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+          <td><span class="summary-sig"><a name="normalize_crlf"></a><span class="summary-sig-name">normalize_crlf</span>(<span class="summary-sig-arg">tree</span>)</span></td>
+          <td align="right" valign="top">
+            <span class="codelink"><a href="lxml.tests.test_elementpath-pysrc.html#normalize_crlf">source&nbsp;code</a></span>
+            
+          </td>
+        </tr>
+      </table>
+      
+    </td>
+  </tr>
 <tr>
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type">&nbsp;</span>
@@ -180,7 +228,7 @@ Tests for the ElementPath implementation.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6f461a9e53bf278171a501e085d9d4e6e4427a3d..1c5b21301570063003b0c30eaa233aa82144f0ec 100644 (file)
 </table>
 <h1 class="epydoc">Source Code for <a href="lxml.tests.test_elementpath-module.html">Module lxml.tests.test_elementpath</a></h1>
 <pre class="py-src">
-<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment"># -*- coding: utf-8 -*-</tt> </tt>
-<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"> </tt>
-<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
-<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-docstring">Tests for the ElementPath implementation.</tt> </tt>
-<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
-<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"> </tt>
-<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">__future__</tt> <tt class="py-keyword">import</tt> <tt class="py-name">absolute_import</tt> </tt>
-<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"> </tt>
-<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">unittest</tt> </tt>
-<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-op">.</tt><tt id="link-0" class="py-name" targets="Module lxml.tests.common_imports=lxml.tests.common_imports-module.html"><a title="lxml.tests.common_imports" class="py-name" href="#" onclick="return doclink('link-0', 'common_imports', 'link-0');">common_imports</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Module lxml.etree=lxml.etree-module.html,Variable lxml.sax.ElementTreeContentHandler.etree=lxml.sax.ElementTreeContentHandler-class.html#etree,Variable lxml.tests.test_elementtree.CElementTreeTestCase.etree=lxml.tests.test_elementtree.CElementTreeTestCase-class.html#etree,Variable lxml.tests.test_elementtree._ETreeTestCaseBase.etree=lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#etree,Variable lxml.tests.test_elementtree._XMLPullParserTest.etree=lxml.tests.test_elementtree._XMLPullParserTest-class.html#etree,Variable lxml.tests.test_io._IOTestCaseBase.etree=lxml.tests.test_io._IOTestCaseBase-class.html#etree"><a title="lxml.etree
+<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment"># -*- coding: utf-8 -*-</tt> </tt>
+<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"> </tt>
+<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
+<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring">Tests for the ElementPath implementation.</tt> </tt>
+<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
+<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"> </tt>
+<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">__future__</tt> <tt class="py-keyword">import</tt> <tt class="py-name">absolute_import</tt> </tt>
+<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"> </tt>
+<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">unittest</tt> </tt>
+<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Method lxml.etree.PyErrorLog.copy()=lxml.etree.PyErrorLog-class.html#copy,Method lxml.etree._BaseErrorLog.copy()=lxml.etree._BaseErrorLog-class.html#copy,Method lxml.etree._ErrorLog.copy()=lxml.etree._ErrorLog-class.html#copy,Method lxml.etree._IDDict.copy()=lxml.etree._IDDict-class.html#copy,Method lxml.etree._ListErrorLog.copy()=lxml.etree._ListErrorLog-class.html#copy,Function lxml.tests.selftest2.copy()=lxml.tests.selftest2-module.html#copy"><a title="lxml.etree.PyErrorLog.copy
+lxml.etree._BaseErrorLog.copy
+lxml.etree._ErrorLog.copy
+lxml.etree._IDDict.copy
+lxml.etree._ListErrorLog.copy
+lxml.tests.selftest2.copy" class="py-name" href="#" onclick="return doclink('link-0', 'copy', 'link-0');">copy</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">deepcopy</tt> </tt>
+<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Module lxml.tests.common_imports=lxml.tests.common_imports-module.html"><a title="lxml.tests.common_imports" class="py-name" href="#" onclick="return doclink('link-1', 'common_imports', 'link-1');">common_imports</a></tt> <tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Module lxml.etree=lxml.etree-module.html,Variable lxml.sax.ElementTreeContentHandler.etree=lxml.sax.ElementTreeContentHandler-class.html#etree,Variable lxml.tests.test_elementtree.CElementTreeTestCase.etree=lxml.tests.test_elementtree.CElementTreeTestCase-class.html#etree,Variable lxml.tests.test_elementtree._ETreeTestCaseBase.etree=lxml.tests.test_elementtree._ETreeTestCaseBase-class.html#etree,Variable lxml.tests.test_elementtree._XMLPullParserTest.etree=lxml.tests.test_elementtree._XMLPullParserTest-class.html#etree,Variable lxml.tests.test_io._IOTestCaseBase.etree=lxml.tests.test_io._IOTestCaseBase-class.html#etree"><a title="lxml.etree
 lxml.sax.ElementTreeContentHandler.etree
 lxml.tests.test_elementtree.CElementTreeTestCase.etree
 lxml.tests.test_elementtree._ETreeTestCaseBase.etree
 lxml.tests.test_elementtree._XMLPullParserTest.etree
-lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-1', 'etree', 'link-1');">etree</a></tt><tt class="py-op">,</tt> <tt id="link-2" class="py-name" targets="Class lxml.tests.common_imports.HelperTestCase=lxml.tests.common_imports.HelperTestCase-class.html"><a title="lxml.tests.common_imports.HelperTestCase" class="py-name" href="#" onclick="return doclink('link-2', 'HelperTestCase', 'link-2');">HelperTestCase</a></tt> </tt>
-<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"> </tt>
-<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"> </tt>
-<a name="EtreeElementPathTestCase"></a><div id="EtreeElementPathTestCase-def"><a name="L13"></a><tt class="py-lineno">13</tt> <a class="py-toggle" href="#" id="EtreeElementPathTestCase-toggle" onclick="return toggle('EtreeElementPathTestCase');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html">EtreeElementPathTestCase</a><tt class="py-op">(</tt><tt class="py-base-class">HelperTestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="EtreeElementPathTestCase-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="EtreeElementPathTestCase-expanded"><a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line">    <tt id="link-3" class="py-name"><a title="lxml.etree
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-2', 'etree', 'link-2');">etree</a></tt><tt class="py-op">,</tt> <tt id="link-3" class="py-name" targets="Class lxml.tests.common_imports.HelperTestCase=lxml.tests.common_imports.HelperTestCase-class.html"><a title="lxml.tests.common_imports.HelperTestCase" class="py-name" href="#" onclick="return doclink('link-3', 'HelperTestCase', 'link-3');">HelperTestCase</a></tt> </tt>
+<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"> </tt>
+<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"> </tt>
+<a name="summarize"></a><div id="summarize-def"><a name="L14"></a><tt class="py-lineno"> 14</tt> <a class="py-toggle" href="#" id="summarize-toggle" onclick="return toggle('summarize');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath-module.html#summarize">summarize</a><tt class="py-op">(</tt><tt class="py-param">elem</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="summarize-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="summarize-expanded"><a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Variable lxml.etree._Comment.tag=lxml.etree._Comment-class.html#tag,Variable lxml.etree._Element.tag=lxml.etree._Element-class.html#tag,Variable lxml.etree._Entity.tag=lxml.etree._Entity-class.html#tag,Variable lxml.etree._ProcessingInstruction.tag=lxml.etree._ProcessingInstruction-class.html#tag,Function lxml.tests.test_xpathevaluator.tag()=lxml.tests.test_xpathevaluator-module.html#tag,Variable xml.etree.ElementTree.Element.tag=xml.etree.ElementTree.Element-class.html#tag"><a title="lxml.etree._Comment.tag
+lxml.etree._Element.tag
+lxml.etree._Entity.tag
+lxml.etree._ProcessingInstruction.tag
+lxml.tests.test_xpathevaluator.tag
+xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-4', 'tag', 'link-4');">tag</a></tt> </tt>
+</div><a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"> </tt>
+<a name="summarize_list"></a><div id="summarize_list-def"><a name="L17"></a><tt class="py-lineno"> 17</tt> <a class="py-toggle" href="#" id="summarize_list-toggle" onclick="return toggle('summarize_list');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath-module.html#summarize_list">summarize_list</a><tt class="py-op">(</tt><tt class="py-param">seq</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="summarize_list-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="summarize_list-expanded"><a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt id="link-5" class="py-name" targets="Function lxml.tests.selftest.summarize()=lxml.tests.selftest-module.html#summarize,Function lxml.tests.selftest2.summarize()=lxml.tests.selftest2-module.html#summarize,Function lxml.tests.test_elementpath.summarize()=lxml.tests.test_elementpath-module.html#summarize"><a title="lxml.tests.selftest.summarize
+lxml.tests.selftest2.summarize
+lxml.tests.test_elementpath.summarize" class="py-name" href="#" onclick="return doclink('link-5', 'summarize', 'link-5');">summarize</a></tt><tt class="py-op">,</tt> <tt class="py-name">seq</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+</div><a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"> </tt>
+<a name="normalize_crlf"></a><div id="normalize_crlf-def"><a name="L20"></a><tt class="py-lineno"> 20</tt> <a class="py-toggle" href="#" id="normalize_crlf-toggle" onclick="return toggle('normalize_crlf');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath-module.html#normalize_crlf">normalize_crlf</a><tt class="py-op">(</tt><tt class="py-param">tree</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="normalize_crlf-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="normalize_crlf-expanded"><a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">elem</tt> <tt class="py-keyword">in</tt> <tt class="py-name">tree</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Method lxml.etree._Element.getiterator()=lxml.etree._Element-class.html#getiterator,Method lxml.etree._ElementTree.getiterator()=lxml.etree._ElementTree-class.html#getiterator"><a title="lxml.etree._Element.getiterator
+lxml.etree._ElementTree.getiterator" class="py-name" href="#" onclick="return doclink('link-6', 'getiterator', 'link-6');">getiterator</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Variable lxml.etree.QName.text=lxml.etree.QName-class.html#text,Variable lxml.etree._Element.text=lxml.etree._Element-class.html#text,Variable lxml.etree._Entity.text=lxml.etree._Entity-class.html#text,Variable lxml.objectify.ObjectifiedElement.text=lxml.objectify.ObjectifiedElement-class.html#text,Variable xml.etree.ElementTree.Element.text=xml.etree.ElementTree.Element-class.html#text"><a title="lxml.etree.QName.text
+lxml.etree._Element.text
+lxml.etree._Entity.text
+lxml.objectify.ObjectifiedElement.text
+xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-7', 'text', 'link-7');">text</a></tt><tt class="py-op">:</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="lxml.etree.QName.text
+lxml.etree._Element.text
+lxml.etree._Entity.text
+lxml.objectify.ObjectifiedElement.text
+xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-8', 'text', 'link-7');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="lxml.etree.QName.text
+lxml.etree._Element.text
+lxml.etree._Entity.text
+lxml.objectify.ObjectifiedElement.text
+xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-9', 'text', 'link-7');">text</a></tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Method lxml.etree._Element.replace()=lxml.etree._Element-class.html#replace"><a title="lxml.etree._Element.replace" class="py-name" href="#" onclick="return doclink('link-10', 'replace', 'link-10');">replace</a></tt><tt class="py-op">(</tt><tt class="py-string">"\r\n"</tt><tt class="py-op">,</tt> <tt class="py-string">"\n"</tt><tt class="py-op">)</tt> </tt>
+<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Variable lxml.etree._Element.tail=lxml.etree._Element-class.html#tail,Variable xml.etree.ElementTree.Element.tail=xml.etree.ElementTree.Element-class.html#tail"><a title="lxml.etree._Element.tail
+xml.etree.ElementTree.Element.tail" class="py-name" href="#" onclick="return doclink('link-11', 'tail', 'link-11');">tail</a></tt><tt class="py-op">:</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="lxml.etree._Element.tail
+xml.etree.ElementTree.Element.tail" class="py-name" href="#" onclick="return doclink('link-12', 'tail', 'link-11');">tail</a></tt> <tt class="py-op">=</tt> <tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="lxml.etree._Element.tail
+xml.etree.ElementTree.Element.tail" class="py-name" href="#" onclick="return doclink('link-13', 'tail', 'link-11');">tail</a></tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="lxml.etree._Element.replace" class="py-name" href="#" onclick="return doclink('link-14', 'replace', 'link-10');">replace</a></tt><tt class="py-op">(</tt><tt class="py-string">"\r\n"</tt><tt class="py-op">,</tt> <tt class="py-string">"\n"</tt><tt class="py-op">)</tt> </tt>
+</div><a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"> </tt>
+<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"> </tt>
+<a name="EtreeElementPathTestCase"></a><div id="EtreeElementPathTestCase-def"><a name="L26"></a><tt class="py-lineno"> 26</tt> <a class="py-toggle" href="#" id="EtreeElementPathTestCase-toggle" onclick="return toggle('EtreeElementPathTestCase');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html">EtreeElementPathTestCase</a><tt class="py-op">(</tt><tt class="py-base-class">HelperTestCase</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="EtreeElementPathTestCase-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="EtreeElementPathTestCase-expanded"><a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line">    <tt id="link-15" class="py-name"><a title="lxml.etree
 lxml.sax.ElementTreeContentHandler.etree
 lxml.tests.test_elementtree.CElementTreeTestCase.etree
 lxml.tests.test_elementtree._ETreeTestCaseBase.etree
 lxml.tests.test_elementtree._XMLPullParserTest.etree
-lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-3', 'etree', 'link-1');">etree</a></tt> <tt class="py-op">=</tt> <tt id="link-4" class="py-name"><a title="lxml.etree
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-15', 'etree', 'link-2');">etree</a></tt> <tt class="py-op">=</tt> <tt id="link-16" class="py-name"><a title="lxml.etree
 lxml.sax.ElementTreeContentHandler.etree
 lxml.tests.test_elementtree.CElementTreeTestCase.etree
 lxml.tests.test_elementtree._ETreeTestCaseBase.etree
 lxml.tests.test_elementtree._XMLPullParserTest.etree
-lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-4', 'etree', 'link-1');">etree</a></tt> </tt>
-<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line">    <tt class="py-keyword">from</tt> <tt id="link-5" class="py-name" targets="Package lxml=lxml-module.html"><a title="lxml" class="py-name" href="#" onclick="return doclink('link-5', 'lxml', 'link-5');">lxml</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">_elementpath</tt> </tt>
-<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line"> </tt>
-<a name="EtreeElementPathTestCase.test_cache"></a><div id="EtreeElementPathTestCase.test_cache-def"><a name="L17"></a><tt class="py-lineno">17</tt> <a class="py-toggle" href="#" id="EtreeElementPathTestCase.test_cache-toggle" onclick="return toggle('EtreeElementPathTestCase.test_cache');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_cache">test_cache</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="EtreeElementPathTestCase.test_cache-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="EtreeElementPathTestCase.test_cache-expanded"><a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Method lxml.etree.DocInfo.clear()=lxml.etree.DocInfo-class.html#clear,Method lxml.etree._Attrib.clear()=lxml.etree._Attrib-class.html#clear,Method lxml.etree._Element.clear()=lxml.etree._Element-class.html#clear,Method lxml.etree._ErrorLog.clear()=lxml.etree._ErrorLog-class.html#clear"><a title="lxml.etree.DocInfo.clear
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-16', 'etree', 'link-2');">etree</a></tt> </tt>
+<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line">    <tt class="py-keyword">from</tt> <tt id="link-17" class="py-name" targets="Package lxml=lxml-module.html"><a title="lxml" class="py-name" href="#" onclick="return doclink('link-17', 'lxml', 'link-17');">lxml</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">_elementpath</tt> </tt>
+<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"> </tt>
+<a name="EtreeElementPathTestCase.test_cache"></a><div id="EtreeElementPathTestCase.test_cache-def"><a name="L30"></a><tt class="py-lineno"> 30</tt> <a class="py-toggle" href="#" id="EtreeElementPathTestCase.test_cache-toggle" onclick="return toggle('EtreeElementPathTestCase.test_cache');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_cache">test_cache</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="EtreeElementPathTestCase.test_cache-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EtreeElementPathTestCase.test_cache-expanded"><a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name" targets="Method lxml.etree.DocInfo.clear()=lxml.etree.DocInfo-class.html#clear,Method lxml.etree._Attrib.clear()=lxml.etree._Attrib-class.html#clear,Method lxml.etree._Element.clear()=lxml.etree._Element-class.html#clear,Method lxml.etree._ErrorLog.clear()=lxml.etree._ErrorLog-class.html#clear"><a title="lxml.etree.DocInfo.clear
 lxml.etree._Attrib.clear
 lxml.etree._Element.clear
-lxml.etree._ErrorLog.clear" class="py-name" href="#" onclick="return doclink('link-6', 'clear', 'link-6');">clear</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line">        <tt class="py-name">el</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name"><a title="lxml.etree
+lxml.etree._ErrorLog.clear" class="py-name" href="#" onclick="return doclink('link-18', 'clear', 'link-18');">clear</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line">        <tt class="py-name">el</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="lxml.etree
 lxml.sax.ElementTreeContentHandler.etree
 lxml.tests.test_elementtree.CElementTreeTestCase.etree
 lxml.tests.test_elementtree._ETreeTestCaseBase.etree
 lxml.tests.test_elementtree._XMLPullParserTest.etree
-lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-7', 'etree', 'link-1');">etree</a></tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Function lxml.etree.XML()=lxml.etree-module.html#XML,Function lxml.objectify.XML()=lxml.objectify-module.html#XML,Method lxml.tests.test_objectify.ObjectifyTestCase.XML()=lxml.tests.test_objectify.ObjectifyTestCase-class.html#XML,Method lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML()=lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#XML"><a title="lxml.etree.XML
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-19', 'etree', 'link-2');">etree</a></tt><tt class="py-op">.</tt><tt id="link-20" class="py-name" targets="Function lxml.etree.XML()=lxml.etree-module.html#XML,Function lxml.objectify.XML()=lxml.objectify-module.html#XML,Method lxml.tests.test_objectify.ObjectifyTestCase.XML()=lxml.tests.test_objectify.ObjectifyTestCase-class.html#XML,Method lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML()=lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#XML"><a title="lxml.etree.XML
 lxml.objectify.XML
 lxml.tests.test_objectify.ObjectifyTestCase.XML
-lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML" class="py-name" href="#" onclick="return doclink('link-8', 'XML', 'link-8');">XML</a></tt><tt class="py-op">(</tt><tt class="py-string">b'&lt;a&gt;&lt;b&gt;&lt;c/&gt;&lt;c/&gt;&lt;/b&gt;&lt;/a&gt;'</tt><tt class="py-op">)</tt> </tt>
-<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertFalse</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt> </tt>
-<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line"> </tt>
-<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertTrue</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Method lxml.etree._Element.findall()=lxml.etree._Element-class.html#findall,Method lxml.etree._ElementTree.findall()=lxml.etree._ElementTree-class.html#findall"><a title="lxml.etree._Element.findall
-lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-9', 'findall', 'link-9');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'b/c'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertTrue</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="lxml.etree._Element.findall
-lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-10', 'findall', 'link-9');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'b/c'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertFalse</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name"><a title="lxml.etree._Element.findall
-lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-11', 'findall', 'link-9');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'xxx'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertFalse</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="lxml.etree._Element.findall
-lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-12', 'findall', 'link-9');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'xxx'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertTrue</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="lxml.etree._Element.findall
-lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-13', 'findall', 'link-9');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'b/c'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-</div><a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line"> </tt>
-<a name="EtreeElementPathTestCase.test_tokenizer"></a><div id="EtreeElementPathTestCase.test_tokenizer-def"><a name="L33"></a><tt class="py-lineno">33</tt> <a class="py-toggle" href="#" id="EtreeElementPathTestCase.test_tokenizer-toggle" onclick="return toggle('EtreeElementPathTestCase.test_tokenizer');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_tokenizer">test_tokenizer</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="EtreeElementPathTestCase.test_tokenizer-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="EtreeElementPathTestCase.test_tokenizer-expanded"><a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line">        <tt class="py-keyword">def</tt> <tt class="py-def-name">assert_tokens</tt><tt class="py-op">(</tt><tt class="py-param">tokens</tt><tt class="py-op">,</tt> <tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">namespaces</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">tokens</tt><tt class="py-op">,</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Function lxml.tests.selftest.xpath_tokenizer()=lxml.tests.selftest-module.html#xpath_tokenizer"><a title="lxml.tests.selftest.xpath_tokenizer" class="py-name" href="#" onclick="return doclink('link-14', 'xpath_tokenizer', 'link-14');">xpath_tokenizer</a></tt><tt class="py-op">(</tt><tt id="link-15" class="py-name" targets="Variable lxml.etree.XPath.path=lxml.etree.XPath-class.html#path,Variable lxml.etree._LogEntry.path=lxml.etree._LogEntry-class.html#path"><a title="lxml.etree.XPath.path
-lxml.etree._LogEntry.path" class="py-name" href="#" onclick="return doclink('link-15', 'path', 'link-15');">path</a></tt><tt class="py-op">,</tt> <tt class="py-name">namespaces</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-</div><a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line"> </tt>
-<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
-<a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
-<a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line">            <tt class="py-string">'/'</tt><tt class="py-op">,</tt> </tt>
-<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
-<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
-<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'.'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'b'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'c'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
-<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line">            <tt class="py-string">'./a/b/c'</tt><tt class="py-op">,</tt> </tt>
-<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
-<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
-<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'b'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'c'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
-<a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">            <tt class="py-string">'/a/b/c'</tt><tt class="py-op">,</tt> </tt>
-<a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
-<a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
-<a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'{nsx}a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'{nsy}b'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'c'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
-<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">            <tt class="py-string">'/x:a/y:b/c'</tt><tt class="py-op">,</tt> </tt>
-<a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line">            <tt class="py-op">{</tt><tt class="py-string">'x'</tt><tt class="py-op">:</tt> <tt class="py-string">'nsx'</tt><tt class="py-op">,</tt> <tt class="py-string">'y'</tt><tt class="py-op">:</tt> <tt class="py-string">'nsy'</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
-<a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
-<a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
-<a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'{nsx}a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'{nsy}b'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'{nsnone}c'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
-<a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line">            <tt class="py-string">'/x:a/y:b/c'</tt><tt class="py-op">,</tt> </tt>
-<a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line">            <tt class="py-op">{</tt><tt class="py-string">'x'</tt><tt class="py-op">:</tt> <tt class="py-string">'nsx'</tt><tt class="py-op">,</tt> <tt class="py-string">'y'</tt><tt class="py-op">:</tt> <tt class="py-string">'nsy'</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> <tt class="py-string">'nsnone'</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
-<a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
-</div></div><a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line"> </tt>
-<a name="L60"></a><tt class="py-lineno">60</tt>  <tt class="py-line"> </tt>
-<a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line"><tt class="py-comment">#class ElementTreeElementPathTestCase(EtreeElementPathTestCase):</tt> </tt>
-<a name="L62"></a><tt class="py-lineno">62</tt>  <tt class="py-line"><tt class="py-comment">#    import xml.etree.ElementTree as etree</tt> </tt>
-<a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line"><tt class="py-comment">#    import xml.etree.ElementPath as _elementpath</tt> </tt>
-<a name="L64"></a><tt class="py-lineno">64</tt>  <tt class="py-line"> </tt>
-<a name="L65"></a><tt class="py-lineno">65</tt>  <tt class="py-line"> </tt>
-<a name="test_suite"></a><div id="test_suite-def"><a name="L66"></a><tt class="py-lineno">66</tt> <a class="py-toggle" href="#" id="test_suite-toggle" onclick="return toggle('test_suite');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath-module.html#test_suite">test_suite</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="test_suite-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="test_suite-expanded"><a name="L67"></a><tt class="py-lineno">67</tt>  <tt class="py-line">    <tt class="py-name">suite</tt> <tt class="py-op">=</tt> <tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">TestSuite</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L68"></a><tt class="py-lineno">68</tt>  <tt class="py-line">    <tt class="py-name">suite</tt><tt class="py-op">.</tt><tt class="py-name">addTests</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">makeSuite</tt><tt class="py-op">(</tt><tt id="link-16" class="py-name" targets="Class lxml.tests.test_elementpath.EtreeElementPathTestCase=lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html"><a title="lxml.tests.test_elementpath.EtreeElementPathTestCase" class="py-name" href="#" onclick="return doclink('link-16', 'EtreeElementPathTestCase', 'link-16');">EtreeElementPathTestCase</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
-<a name="L69"></a><tt class="py-lineno">69</tt>  <tt class="py-line">    <tt class="py-comment">#suite.addTests([unittest.makeSuite(ElementTreeElementPathTestCase)])</tt> </tt>
-<a name="L70"></a><tt class="py-lineno">70</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">suite</tt> </tt>
-</div><a name="L71"></a><tt class="py-lineno">71</tt>  <tt class="py-line"> </tt>
-<a name="L72"></a><tt class="py-lineno">72</tt>  <tt class="py-line"> </tt>
-<a name="L73"></a><tt class="py-lineno">73</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
-<a name="L74"></a><tt class="py-lineno">74</tt>  <tt class="py-line">    <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">'to test use test.py %s'</tt> <tt class="py-op">%</tt> <tt class="py-name">__file__</tt><tt class="py-op">)</tt> </tt>
-<a name="L75"></a><tt class="py-lineno">75</tt>  <tt class="py-line"> </tt><script type="text/javascript">
+lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML" class="py-name" href="#" onclick="return doclink('link-20', 'XML', 'link-20');">XML</a></tt><tt class="py-op">(</tt><tt class="py-string">b'&lt;a&gt;&lt;b&gt;&lt;c/&gt;&lt;c/&gt;&lt;/b&gt;&lt;/a&gt;'</tt><tt class="py-op">)</tt> </tt>
+<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertFalse</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt> </tt>
+<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"> </tt>
+<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertTrue</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name" targets="Method lxml.etree._Element.findall()=lxml.etree._Element-class.html#findall,Method lxml.etree._ElementTree.findall()=lxml.etree._ElementTree-class.html#findall"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-21', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'b/c'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertTrue</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-22', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'b/c'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertFalse</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-23', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'xxx'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertFalse</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-24" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-24', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'xxx'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertTrue</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-25', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'b/c'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt class="py-name">_cache</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+</div><a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"> </tt>
+<a name="EtreeElementPathTestCase._assert_tokens"></a><div id="EtreeElementPathTestCase._assert_tokens-def"><a name="L46"></a><tt class="py-lineno"> 46</tt> <a class="py-toggle" href="#" id="EtreeElementPathTestCase._assert_tokens-toggle" onclick="return toggle('EtreeElementPathTestCase._assert_tokens');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#_assert_tokens">_assert_tokens</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">tokens</tt><tt class="py-op">,</tt> <tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">namespaces</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="EtreeElementPathTestCase._assert_tokens-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EtreeElementPathTestCase._assert_tokens-expanded"><a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">tokens</tt><tt class="py-op">,</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_elementpath</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name" targets="Function lxml.tests.selftest.xpath_tokenizer()=lxml.tests.selftest-module.html#xpath_tokenizer"><a title="lxml.tests.selftest.xpath_tokenizer" class="py-name" href="#" onclick="return doclink('link-26', 'xpath_tokenizer', 'link-26');">xpath_tokenizer</a></tt><tt class="py-op">(</tt><tt id="link-27" class="py-name" targets="Variable lxml.etree.XPath.path=lxml.etree.XPath-class.html#path,Variable lxml.etree._LogEntry.path=lxml.etree._LogEntry-class.html#path"><a title="lxml.etree.XPath.path
+lxml.etree._LogEntry.path" class="py-name" href="#" onclick="return doclink('link-27', 'path', 'link-27');">path</a></tt><tt class="py-op">,</tt> <tt class="py-name">namespaces</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+</div><a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"> </tt>
+<a name="EtreeElementPathTestCase.test_tokenizer"></a><div id="EtreeElementPathTestCase.test_tokenizer-def"><a name="L49"></a><tt class="py-lineno"> 49</tt> <a class="py-toggle" href="#" id="EtreeElementPathTestCase.test_tokenizer-toggle" onclick="return toggle('EtreeElementPathTestCase.test_tokenizer');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_tokenizer">test_tokenizer</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="EtreeElementPathTestCase.test_tokenizer-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EtreeElementPathTestCase.test_tokenizer-expanded"><a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-28" class="py-name" targets="Method lxml.tests.test_elementpath.EtreeElementPathTestCase._assert_tokens()=lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#_assert_tokens"><a title="lxml.tests.test_elementpath.EtreeElementPathTestCase._assert_tokens" class="py-name" href="#" onclick="return doclink('link-28', '_assert_tokens', 'link-28');">_assert_tokens</a></tt> </tt>
+<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
+<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
+<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">            <tt class="py-string">'/'</tt><tt class="py-op">,</tt> </tt>
+<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
+<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
+<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'.'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'b'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'c'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
+<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">            <tt class="py-string">'./a/b/c'</tt><tt class="py-op">,</tt> </tt>
+<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
+<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
+<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'b'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'c'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
+<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">            <tt class="py-string">'/a/b/c'</tt><tt class="py-op">,</tt> </tt>
+<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
+<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
+<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'{nsx}a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'{nsy}b'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'c'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
+<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">            <tt class="py-string">'/x:a/y:b/c'</tt><tt class="py-op">,</tt> </tt>
+<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">            <tt class="py-op">{</tt><tt class="py-string">'x'</tt><tt class="py-op">:</tt> <tt class="py-string">'nsx'</tt><tt class="py-op">,</tt> <tt class="py-string">'y'</tt><tt class="py-op">:</tt> <tt class="py-string">'nsy'</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
+<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
+<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
+<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'{nsx}a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'{nsy}b'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'{nsnone}c'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
+<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">            <tt class="py-string">'/x:a/y:b/c'</tt><tt class="py-op">,</tt> </tt>
+<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">            <tt class="py-op">{</tt><tt class="py-string">'x'</tt><tt class="py-op">:</tt> <tt class="py-string">'nsx'</tt><tt class="py-op">,</tt> <tt class="py-string">'y'</tt><tt class="py-op">:</tt> <tt class="py-string">'nsy'</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> <tt class="py-string">'nsnone'</tt><tt class="py-op">}</tt><tt class="py-op">,</tt> </tt>
+<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
+</div><a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line"> </tt>
+<a name="EtreeElementPathTestCase.test_tokenizer_predicates"></a><div id="EtreeElementPathTestCase.test_tokenizer_predicates-def"><a name="L74"></a><tt class="py-lineno"> 74</tt> <a class="py-toggle" href="#" id="EtreeElementPathTestCase.test_tokenizer_predicates-toggle" onclick="return toggle('EtreeElementPathTestCase.test_tokenizer_predicates');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_tokenizer_predicates">test_tokenizer_predicates</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="EtreeElementPathTestCase.test_tokenizer_predicates-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EtreeElementPathTestCase.test_tokenizer_predicates-expanded"><a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-29" class="py-name"><a title="lxml.tests.test_elementpath.EtreeElementPathTestCase._assert_tokens" class="py-name" href="#" onclick="return doclink('link-29', '_assert_tokens', 'link-28');">_assert_tokens</a></tt> </tt>
+<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
+<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'['</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'b'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">']'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
+<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">            <tt class="py-string">'a[b]'</tt><tt class="py-op">,</tt> </tt>
+<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
+<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
+<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'['</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'b'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'='</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'"abc"'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">']'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
+<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">            <tt class="py-string">'a[b="abc"]'</tt><tt class="py-op">,</tt> </tt>
+<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
+<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-name">assert_tokens</tt><tt class="py-op">(</tt> </tt>
+<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">'a'</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'['</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'.'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'='</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">'"abc"'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-string">']'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
+<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">            <tt class="py-string">'a[. = "abc"]'</tt><tt class="py-op">,</tt> </tt>
+<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">        <tt class="py-op">)</tt> </tt>
+</div><a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"> </tt>
+<a name="EtreeElementPathTestCase.test_find"></a><div id="EtreeElementPathTestCase.test_find-def"><a name="L89"></a><tt class="py-lineno"> 89</tt> <a class="py-toggle" href="#" id="EtreeElementPathTestCase.test_find-toggle" onclick="return toggle('EtreeElementPathTestCase.test_find');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html#test_find">test_find</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="EtreeElementPathTestCase.test_find-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="EtreeElementPathTestCase.test_find-expanded"><a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"><tt class="py-docstring">        Test find methods (including xpath syntax).</tt> </tt>
+<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line"><tt class="py-docstring">        Originally copied from 'selftest.py'.</tt> </tt>
+<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">        <tt class="py-name">elem</tt> <tt class="py-op">=</tt> <tt id="link-30" class="py-name"><a title="lxml.etree
+lxml.sax.ElementTreeContentHandler.etree
+lxml.tests.test_elementtree.CElementTreeTestCase.etree
+lxml.tests.test_elementtree._ETreeTestCaseBase.etree
+lxml.tests.test_elementtree._XMLPullParserTest.etree
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-30', 'etree', 'link-2');">etree</a></tt><tt class="py-op">.</tt><tt id="link-31" class="py-name"><a title="lxml.etree.XML
+lxml.objectify.XML
+lxml.tests.test_objectify.ObjectifyTestCase.XML
+lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML" class="py-name" href="#" onclick="return doclink('link-31', 'XML', 'link-20');">XML</a></tt><tt class="py-op">(</tt><tt class="py-string">"""</tt> </tt>
+<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line"><tt class="py-string">        &lt;body&gt;</tt> </tt>
+<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"><tt class="py-string">          &lt;tag class='a'&gt;text&lt;/tag&gt;</tt> </tt>
+<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line"><tt class="py-string">          &lt;tag class='b' /&gt;</tt> </tt>
+<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line"><tt class="py-string">          &lt;section&gt;</tt> </tt>
+<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"><tt class="py-string">            &lt;tag class='b' id='inner'&gt;subtext&lt;/tag&gt;</tt> </tt>
+<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"><tt class="py-string">          &lt;/section&gt;</tt> </tt>
+<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line"><tt class="py-string">        &lt;/body&gt;</tt> </tt>
+<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line"><tt class="py-string">        """</tt><tt class="py-op">)</tt> </tt>
+<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"> </tt>
+<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-32" class="py-name" targets="Method lxml.etree._Element.find()=lxml.etree._Element-class.html#find,Method lxml.etree._ElementTree.find()=lxml.etree._ElementTree-class.html#find,Variable lxml.objectify.ObjectPath.find=lxml.objectify.ObjectPath-class.html#find,Function lxml.tests.selftest.find()=lxml.tests.selftest-module.html#find,Function lxml.tests.selftest2.find()=lxml.tests.selftest2-module.html#find"><a title="lxml.etree._Element.find
+lxml.etree._ElementTree.find
+lxml.objectify.ObjectPath.find
+lxml.tests.selftest.find
+lxml.tests.selftest2.find" class="py-name" href="#" onclick="return doclink('link-32', 'find', 'link-32');">find</a></tt><tt class="py-op">(</tt><tt class="py-string">"tag"</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-33" class="py-name"><a title="lxml.etree._Comment.tag
+lxml.etree._Element.tag
+lxml.etree._Entity.tag
+lxml.etree._ProcessingInstruction.tag
+lxml.tests.test_xpathevaluator.tag
+xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-33', 'tag', 'link-4');">tag</a></tt><tt class="py-op">,</tt> </tt>
+<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">                         <tt class="py-string">'tag'</tt><tt class="py-op">)</tt> </tt>
+<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-34" class="py-name"><a title="lxml.etree
+lxml.sax.ElementTreeContentHandler.etree
+lxml.tests.test_elementtree.CElementTreeTestCase.etree
+lxml.tests.test_elementtree._ETreeTestCaseBase.etree
+lxml.tests.test_elementtree._XMLPullParserTest.etree
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-34', 'etree', 'link-2');">etree</a></tt><tt class="py-op">.</tt><tt id="link-35" class="py-name" targets="Function lxml.etree.ElementTree()=lxml.etree-module.html#ElementTree,Module xml.etree.ElementTree=xml.etree.ElementTree-module.html,Class xml.etree.ElementTree.ElementTree=xml.etree.ElementTree.ElementTree-class.html"><a title="lxml.etree.ElementTree
+xml.etree.ElementTree
+xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-35', 'ElementTree', 'link-35');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-36" class="py-name"><a title="lxml.etree._Element.find
+lxml.etree._ElementTree.find
+lxml.objectify.ObjectPath.find
+lxml.tests.selftest.find
+lxml.tests.selftest2.find" class="py-name" href="#" onclick="return doclink('link-36', 'find', 'link-32');">find</a></tt><tt class="py-op">(</tt><tt class="py-string">"tag"</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-37" class="py-name"><a title="lxml.etree._Comment.tag
+lxml.etree._Element.tag
+lxml.etree._Entity.tag
+lxml.etree._ProcessingInstruction.tag
+lxml.tests.test_xpathevaluator.tag
+xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-37', 'tag', 'link-4');">tag</a></tt><tt class="py-op">,</tt> </tt>
+<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">                         <tt class="py-string">'tag'</tt><tt class="py-op">)</tt> </tt>
+<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-38" class="py-name"><a title="lxml.etree._Element.find
+lxml.etree._ElementTree.find
+lxml.objectify.ObjectPath.find
+lxml.tests.selftest.find
+lxml.tests.selftest2.find" class="py-name" href="#" onclick="return doclink('link-38', 'find', 'link-32');">find</a></tt><tt class="py-op">(</tt><tt class="py-string">"section/tag"</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-39" class="py-name"><a title="lxml.etree._Comment.tag
+lxml.etree._Element.tag
+lxml.etree._Entity.tag
+lxml.etree._ProcessingInstruction.tag
+lxml.tests.test_xpathevaluator.tag
+xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-39', 'tag', 'link-4');">tag</a></tt><tt class="py-op">,</tt> </tt>
+<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">                         <tt class="py-string">'tag'</tt><tt class="py-op">)</tt> </tt>
+<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-40" class="py-name"><a title="lxml.etree
+lxml.sax.ElementTreeContentHandler.etree
+lxml.tests.test_elementtree.CElementTreeTestCase.etree
+lxml.tests.test_elementtree._ETreeTestCaseBase.etree
+lxml.tests.test_elementtree._XMLPullParserTest.etree
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-40', 'etree', 'link-2');">etree</a></tt><tt class="py-op">.</tt><tt id="link-41" class="py-name"><a title="lxml.etree.ElementTree
+xml.etree.ElementTree
+xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-41', 'ElementTree', 'link-35');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name"><a title="lxml.etree._Element.find
+lxml.etree._ElementTree.find
+lxml.objectify.ObjectPath.find
+lxml.tests.selftest.find
+lxml.tests.selftest2.find" class="py-name" href="#" onclick="return doclink('link-42', 'find', 'link-32');">find</a></tt><tt class="py-op">(</tt><tt class="py-string">"section/tag"</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name"><a title="lxml.etree._Comment.tag
+lxml.etree._Element.tag
+lxml.etree._Entity.tag
+lxml.etree._ProcessingInstruction.tag
+lxml.tests.test_xpathevaluator.tag
+xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-43', 'tag', 'link-4');">tag</a></tt><tt class="py-op">,</tt> </tt>
+<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">                         <tt class="py-string">'tag'</tt><tt class="py-op">)</tt> </tt>
+<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"> </tt>
+<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-44" class="py-name" targets="Method lxml.etree._Element.findtext()=lxml.etree._Element-class.html#findtext,Method lxml.etree._ElementTree.findtext()=lxml.etree._ElementTree-class.html#findtext"><a title="lxml.etree._Element.findtext
+lxml.etree._ElementTree.findtext" class="py-name" href="#" onclick="return doclink('link-44', 'findtext', 'link-44');">findtext</a></tt><tt class="py-op">(</tt><tt class="py-string">"tag"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">                         <tt class="py-string">'text'</tt><tt class="py-op">)</tt> </tt>
+<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-45" class="py-name"><a title="lxml.etree._Element.findtext
+lxml.etree._ElementTree.findtext" class="py-name" href="#" onclick="return doclink('link-45', 'findtext', 'link-44');">findtext</a></tt><tt class="py-op">(</tt><tt class="py-string">"tog"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">                         <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
+<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="lxml.etree._Element.findtext
+lxml.etree._ElementTree.findtext" class="py-name" href="#" onclick="return doclink('link-46', 'findtext', 'link-44');">findtext</a></tt><tt class="py-op">(</tt><tt class="py-string">"tog"</tt><tt class="py-op">,</tt> <tt class="py-string">"default"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">                         <tt class="py-string">'default'</tt><tt class="py-op">)</tt> </tt>
+<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-47" class="py-name"><a title="lxml.etree
+lxml.sax.ElementTreeContentHandler.etree
+lxml.tests.test_elementtree.CElementTreeTestCase.etree
+lxml.tests.test_elementtree._ETreeTestCaseBase.etree
+lxml.tests.test_elementtree._XMLPullParserTest.etree
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-47', 'etree', 'link-2');">etree</a></tt><tt class="py-op">.</tt><tt id="link-48" class="py-name"><a title="lxml.etree.ElementTree
+xml.etree.ElementTree
+xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-48', 'ElementTree', 'link-35');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-49" class="py-name"><a title="lxml.etree._Element.findtext
+lxml.etree._ElementTree.findtext" class="py-name" href="#" onclick="return doclink('link-49', 'findtext', 'link-44');">findtext</a></tt><tt class="py-op">(</tt><tt class="py-string">"tag"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">                         <tt class="py-string">'text'</tt><tt class="py-op">)</tt> </tt>
+<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-50" class="py-name"><a title="lxml.etree._Element.findtext
+lxml.etree._ElementTree.findtext" class="py-name" href="#" onclick="return doclink('link-50', 'findtext', 'link-44');">findtext</a></tt><tt class="py-op">(</tt><tt class="py-string">"section/tag"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">                         <tt class="py-string">'subtext'</tt><tt class="py-op">)</tt> </tt>
+<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-51" class="py-name"><a title="lxml.etree
+lxml.sax.ElementTreeContentHandler.etree
+lxml.tests.test_elementtree.CElementTreeTestCase.etree
+lxml.tests.test_elementtree._ETreeTestCaseBase.etree
+lxml.tests.test_elementtree._XMLPullParserTest.etree
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-51', 'etree', 'link-2');">etree</a></tt><tt class="py-op">.</tt><tt id="link-52" class="py-name"><a title="lxml.etree.ElementTree
+xml.etree.ElementTree
+xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-52', 'ElementTree', 'link-35');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-53" class="py-name"><a title="lxml.etree._Element.findtext
+lxml.etree._ElementTree.findtext" class="py-name" href="#" onclick="return doclink('link-53', 'findtext', 'link-44');">findtext</a></tt><tt class="py-op">(</tt><tt class="py-string">"section/tag"</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">                         <tt class="py-string">'subtext'</tt><tt class="py-op">)</tt> </tt>
+<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line"> </tt>
+<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-54" class="py-name" targets="Function lxml.tests.selftest.summarize_list()=lxml.tests.selftest-module.html#summarize_list,Function lxml.tests.selftest2.summarize_list()=lxml.tests.selftest2-module.html#summarize_list,Function lxml.tests.test_elementpath.summarize_list()=lxml.tests.test_elementpath-module.html#summarize_list"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-54', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-55" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-55', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-56" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-56', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-57" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-57', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"*"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'section'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-58" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-58', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-59" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-59', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-60" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-60', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-61" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-61', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"section/tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-62" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-62', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-63" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-63', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"section//tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line"> </tt>
+<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-64" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-64', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-65" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-65', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"section/*"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-66" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-66', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-67" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-67', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"section//*"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-68" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-68', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-69" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-69', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"section/.//*"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-70" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-70', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-71" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-71', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"*/*"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-72" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-72', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-73" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-73', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"*//*"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-74" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-74', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-75" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-75', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"*/tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-76" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-76', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-77" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-77', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"*/./tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-78" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-78', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-79" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-79', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"./tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-80" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-80', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-81" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-81', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-82" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-82', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-83" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-83', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"././tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line"> </tt>
+<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-84" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-84', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-85" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-85', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[@class]"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-86" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-86', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-87" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-87', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[ @class]"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-88" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-88', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-89" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-89', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[@class ]"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-90" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-90', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-91" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-91', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[  @class  ]"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-92" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-92', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-93" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-93', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[@class='a']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-94" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-94', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-95" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-95', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'.//tag[@class="a"]'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-96" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-96', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-97" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-97', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[@class='b']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-98" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-98', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-99" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-99', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'.//tag[@class="b"]'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-100" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-100', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-101" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-101', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'.//tag[@class = "b"]'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-102" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-102', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-103" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-103', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[@id]"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-104" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-104', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-105" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-105', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[@class][@id]"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-106" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-106', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-107" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-107', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//section[tag]"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'section'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-108" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-108', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-109" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-109', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//section[element]"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line"> </tt>
+<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-110" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-110', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-111" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-111', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//section[tag='subtext']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'section'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-112" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-112', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-113" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-113', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//section[tag ='subtext']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'section'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-114" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-114', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-115" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-115', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//section[tag= 'subtext']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'section'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-116" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-116', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-117" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-117', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//section[tag = 'subtext']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'section'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-118" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-118', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-119" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-119', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//section[  tag   =   'subtext'  ]"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'section'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-120" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-120', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-121" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-121', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[.='subtext']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-122" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-122', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-123" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-123', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[. ='subtext']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-124" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-124', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-125" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-125', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">'.//tag[.= "subtext"]'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-126" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-126', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-127" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-127', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[. = 'subtext']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-128" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-128', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-129" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-129', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[. = 'subtext ']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-130" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-130', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-131" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-131', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[.= ' subtext']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line"> </tt>
+<a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-132" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-132', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-133" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-133', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"../tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-134" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-134', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-135" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-135', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"section/../tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-136" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-136', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt id="link-137" class="py-name"><a title="lxml.etree
+lxml.sax.ElementTreeContentHandler.etree
+lxml.tests.test_elementtree.CElementTreeTestCase.etree
+lxml.tests.test_elementtree._ETreeTestCaseBase.etree
+lxml.tests.test_elementtree._XMLPullParserTest.etree
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-137', 'etree', 'link-2');">etree</a></tt><tt class="py-op">.</tt><tt id="link-138" class="py-name"><a title="lxml.etree.ElementTree
+xml.etree.ElementTree
+xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-138', 'ElementTree', 'link-35');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-139" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-139', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"./tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line"> </tt>
+<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line">        <tt class="py-comment"># FIXME: ET's Path module handles this case incorrectly; this gives</tt> </tt>
+<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line">        <tt class="py-comment"># a warning in 1.3, and the behaviour will be modified in 1.4.</tt> </tt>
+<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-140" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-140', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt id="link-141" class="py-name"><a title="lxml.etree
+lxml.sax.ElementTreeContentHandler.etree
+lxml.tests.test_elementtree.CElementTreeTestCase.etree
+lxml.tests.test_elementtree._ETreeTestCaseBase.etree
+lxml.tests.test_elementtree._XMLPullParserTest.etree
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-141', 'etree', 'link-2');">etree</a></tt><tt class="py-op">.</tt><tt id="link-142" class="py-name"><a title="lxml.etree.ElementTree
+xml.etree.ElementTree
+xml.etree.ElementTree.ElementTree" class="py-name" href="#" onclick="return doclink('link-142', 'ElementTree', 'link-35');">ElementTree</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-143" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-143', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">"/tag"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line"> </tt>
+<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line">        <tt class="py-comment"># duplicate section =&gt; 2x tag matches</tt> </tt>
+<a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line">        <tt class="py-name">elem</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">deepcopy</tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-144" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-144', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-145" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-145', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//section[tag = 'subtext']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'section'</tt><tt class="py-op">,</tt> <tt class="py-string">'section'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-146" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-146', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-147" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-147', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[. = 'subtext']"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt id="link-148" class="py-name"><a title="lxml.tests.selftest.summarize_list
+lxml.tests.selftest2.summarize_list
+lxml.tests.test_elementpath.summarize_list" class="py-name" href="#" onclick="return doclink('link-148', 'summarize_list', 'link-54');">summarize_list</a></tt><tt class="py-op">(</tt><tt class="py-name">elem</tt><tt class="py-op">.</tt><tt id="link-149" class="py-name"><a title="lxml.etree._Element.findall
+lxml.etree._ElementTree.findall" class="py-name" href="#" onclick="return doclink('link-149', 'findall', 'link-21');">findall</a></tt><tt class="py-op">(</tt><tt class="py-string">".//tag[@class][@id]"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
+<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line">                         <tt class="py-op">[</tt><tt class="py-string">'tag'</tt><tt class="py-op">,</tt> <tt class="py-string">'tag'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+</div></div><a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line"> </tt>
+<a name="L229"></a><tt class="py-lineno">229</tt>  <tt class="py-line"> </tt>
+<a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line"><tt class="py-comment">#class ElementTreeElementPathTestCase(EtreeElementPathTestCase):</tt> </tt>
+<a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line"><tt class="py-comment">#    import xml.etree.ElementTree as etree</tt> </tt>
+<a name="L232"></a><tt class="py-lineno">232</tt>  <tt class="py-line"><tt class="py-comment">#    import xml.etree.ElementPath as _elementpath</tt> </tt>
+<a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line"> </tt>
+<a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line"> </tt>
+<a name="test_suite"></a><div id="test_suite-def"><a name="L235"></a><tt class="py-lineno">235</tt> <a class="py-toggle" href="#" id="test_suite-toggle" onclick="return toggle('test_suite');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_elementpath-module.html#test_suite">test_suite</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="test_suite-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="test_suite-expanded"><a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line">    <tt class="py-name">suite</tt> <tt class="py-op">=</tt> <tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">TestSuite</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line">    <tt class="py-name">suite</tt><tt class="py-op">.</tt><tt class="py-name">addTests</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">makeSuite</tt><tt class="py-op">(</tt><tt id="link-150" class="py-name" targets="Class lxml.tests.test_elementpath.EtreeElementPathTestCase=lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html"><a title="lxml.tests.test_elementpath.EtreeElementPathTestCase" class="py-name" href="#" onclick="return doclink('link-150', 'EtreeElementPathTestCase', 'link-150');">EtreeElementPathTestCase</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line">    <tt class="py-comment">#suite.addTests([unittest.makeSuite(ElementTreeElementPathTestCase)])</tt> </tt>
+<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">suite</tt> </tt>
+</div><a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line"> </tt>
+<a name="L241"></a><tt class="py-lineno">241</tt>  <tt class="py-line"> </tt>
+<a name="L242"></a><tt class="py-lineno">242</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
+<a name="L243"></a><tt class="py-lineno">243</tt>  <tt class="py-line">    <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">'to test use test.py %s'</tt> <tt class="py-op">%</tt> <tt class="py-name">__file__</tt><tt class="py-op">)</tt> </tt>
+<a name="L244"></a><tt class="py-lineno">244</tt>  <tt class="py-line"> </tt><script type="text/javascript">
 <!--
 expandto(location.href);
 // -->
@@ -207,7 +634,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index f2d1ba0289102196b3c50d03d98883786c4b7b96..306651c2f1746c23118463592c1a0ccafedef368 100644 (file)
         </tr>
       </table>
       
+    </td>
+  </tr>
+<tr class="private">
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type">&nbsp;</span>
+    </td><td class="summary">
+      <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+          <td><span class="summary-sig"><a name="_assert_tokens"></a><span class="summary-sig-name">_assert_tokens</span>(<span class="summary-sig-arg">self</span>,
+        <span class="summary-sig-arg">tokens</span>,
+        <span class="summary-sig-arg">path</span>,
+        <span class="summary-sig-arg">namespaces</span>=<span class="summary-sig-default">None</span>)</span></td>
+          <td align="right" valign="top">
+            <span class="codelink"><a href="lxml.tests.test_elementpath-pysrc.html#EtreeElementPathTestCase._assert_tokens">source&nbsp;code</a></span>
+            
+          </td>
+        </tr>
+      </table>
+      
     </td>
   </tr>
 <tr>
       
     </td>
   </tr>
+<tr>
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type">&nbsp;</span>
+    </td><td class="summary">
+      <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+          <td><span class="summary-sig"><a name="test_tokenizer_predicates"></a><span class="summary-sig-name">test_tokenizer_predicates</span>(<span class="summary-sig-arg">self</span>)</span></td>
+          <td align="right" valign="top">
+            <span class="codelink"><a href="lxml.tests.test_elementpath-pysrc.html#EtreeElementPathTestCase.test_tokenizer_predicates">source&nbsp;code</a></span>
+            
+          </td>
+        </tr>
+      </table>
+      
+    </td>
+  </tr>
+<tr>
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type">&nbsp;</span>
+    </td><td class="summary">
+      <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+          <td><span class="summary-sig"><a name="test_find"></a><span class="summary-sig-name">test_find</span>(<span class="summary-sig-arg">self</span>)</span><br />
+      Test find methods (including xpath syntax).
+Originally copied from 'selftest.py'.</td>
+          <td align="right" valign="top">
+            <span class="codelink"><a href="lxml.tests.test_elementpath-pysrc.html#EtreeElementPathTestCase.test_find">source&nbsp;code</a></span>
+            
+          </td>
+        </tr>
+      </table>
+      
+    </td>
+  </tr>
   <tr>
     <td colspan="2" class="summary">
     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.tests.common_imports.HelperTestCase-class.html">common_imports.HelperTestCase</a></code></b>:
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 93375e21a378cf2d1ba8d0a9ebe6f9b51271cd5c..b6c59ef2b79a6b49211431deef6b09f3ebe95dd8 100644 (file)
@@ -278,7 +278,7 @@ for IO related test cases.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 098974a8df8cd35928e8a13b981d304ea339aca0..033e7afeaf34b86d04d42d55b1b77f6e355dc048 100644 (file)
@@ -11765,7 +11765,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 57a15699f05174144b76189d481e2dfc5887cd03..7638cd8e075183c91bd90967fc7127ebda098d81 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index f097e78e3b2288e31ea4a6468f1154c0a0dcc4e1..672137514da105cb8c9cddfecf8c96a2c4686c12 100644 (file)
@@ -373,7 +373,7 @@ unittest.case.TestCase --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ff559bc66d3cf83da8bc6642228398130eb19f45..67000b74a7aa829e6e77f044df19db9b06dc700c 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 81d7e22930a4886af69fe06ba0ab3ad0d2e7cde2..9c7ada7b2268f13174108bf216481b8ba3f75570 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3ad30f31b73de6c0d00d2862ad0c355ac4b2c2f3..2d2f76aa12b5e7f306092fec571b542b15ed2197 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 526c0a29c5faae2b637c7a97bc7a0179ab25b113..c0c7a3e91758737975417579dc7ed8ffc6018ca6 100644 (file)
@@ -495,7 +495,7 @@ unittest.case.TestCase --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 54aef206f5278a64618092424e708ca56ea7344a..d65a2e20c554664ea82cc681df57872b47ef0459 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e61605f0fe0ae452aa2318e5eda812529f214c80..e5c7520cfc426061cc9858da3f0f75fc40ff3475 100644 (file)
@@ -333,7 +333,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c7337e422e99695903f9c71920e66be1db850f74..0d59999288b8730da6c2c8791db08df14601ae03 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5332cf378cd74ff8faa05f185ad19dbcd22d49c2..fbe65f283b9f6c400bfee6cfc08951a5361bcc6b 100644 (file)
@@ -292,7 +292,7 @@ test_elementtree</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ca70a49c8817dfd552a8d2a63eef8cc851c44c7d..2fe828cf26cbf83f72cdd39a4625deddc583394f 100644 (file)
@@ -12436,7 +12436,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a265fff801f22aecbbb4e349ba8a905704c70343..4410597e26d74eb8df1773bc6a1487e5a26198a4 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d871e98bc929f95a8e4d00795eb8b3d5a68674d0..1099d1b31495d0708428ba2206add48a0cb053fe 100644 (file)
@@ -399,7 +399,7 @@ reset the logging setup ...</td>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 907606844886b6c2998df55f8541a487c90b0f17..f171567651c1cfc9caebb32bbb897fc199845d56 100644 (file)
@@ -4533,7 +4533,7 @@ Tests only for etree, not ElementTree
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2b519c75dd65b20d43dcee0de1a205b8157e0209..6479ac97cdb1ac478c325c052d11ded89d9e0866 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b3cc8fa592b9b6926ba0e88a5641ddf3011b5cc1..dc6e2329e3065ccf5c89c4bee92584535cf030d7 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 404fbb7886c82ba77341a28097e93ee94dc1af30..3e6eeb546b24162c0b6bc85aa897fbad54b00bca 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 941bd491fe54ae885ad079125df005f9724d7f34..a259d483ef26d0fd44493fc9caaccca07ee407fb 100644 (file)
@@ -439,7 +439,7 @@ unittest.case.TestCase --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e9694ba5f1901b30c785ae144cea0868c69ac83b..60282f39a88651c248cb3972333047e713499c2e 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1fd6fe8bdfebfae973186b5b33d183f961ac1b14..8a5fd65cccb74b8249de3b82de11ec86270a6f68 100644 (file)
@@ -194,7 +194,7 @@ Test cases related to direct loading of external libxml2 documents
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 161b0090d563b34ea2dc5e6006506bc5d8f47452..cd3f8e5132c8a3463855039b80499ce1ab0e4b6f 100644 (file)
@@ -277,7 +277,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c785168f9d44a2eeb5cbea39dd63576934af24f7..51f9aa605f046cd73b3040a824ac7a92c09c9ccd 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c4a42f54ed76afc53c095a733b3a2104d5c3fc0c..8466f578bd8ca2e874f57fc0304b9f76c3f9e375 100644 (file)
@@ -233,7 +233,7 @@ HTML parser test cases for etree
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9db4480d36d7011bc1c9a2994b681c73755c6d99..d6cece0bf10bcb26e693ce2be77d6d38083a465a 100644 (file)
@@ -2013,7 +2013,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6cf76150de104adf984b7cb5f56946c86e69e22b..9c3988efef31ad8f4d2bf79c95250a0d84e67403 100644 (file)
@@ -1289,7 +1289,7 @@ h1&gt;&lt;/body&gt;&lt;/html&gt;'"><code class="variable-quote">u'</code><code c
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 213543f0d59acf569087aa8344534475f5141c2c..3c3d806febca0d4b52e2d856fd6077baa5af5b09 100644 (file)
@@ -224,7 +224,7 @@ Web IO test cases that need Python 2.5+ (wsgiref)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 324a9d4d34f5fa431ec90b845b51831155db6e24..88d840d289cbba769d3cba6207ade6451eb7e4e7 100644 (file)
@@ -463,7 +463,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bb2d99b9a470a4a7fb9c0af1f576370b41881b59..e3d21d76d97b368242157f4080429feb3ebebddc 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index cce873427bb9e587ce6f46c1b0298d8efd7a6cde..986313ab0c5e5ec24f37d45c4e7c981ee9d5df65 100644 (file)
@@ -266,7 +266,7 @@ Tests for the incremental XML serialisation API.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d6c901c37d087874a35394dfa6f273405097e1ec..e85900caf2d7da6456e30867d67e5a3e38734b03 100644 (file)
@@ -1370,7 +1370,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bf7d880f612de8b469634f3bc49204111288b73c..2877bfac25e457f87ac4e234935492722579d8c0 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 75f27ef66b8080d00730b5c783f295101a8577dc..e9e111192f2ba8bb5ea149a20b73cbce520e0d12 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 000414b0da9ba453f3a90c47590d023ca29aa76e..8e5c3a27f5cc5df5ab205dae3183706bfe58e108 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c2041132c9acd531de7f3bfca9253230109269fd..49e0697fe617fea06772f90e44fb999b8f207cb3 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 97a15e0dab484615959ae2e4582cf452ea64db9d..db1bc12330b626b9b2eec06d4483576eeb4cc468 100644 (file)
@@ -242,7 +242,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7ef50e726797ad08bc4bdd78e0426ba3eb6c7b13..2d67a9db2b448a26f1cf779da6f3559f4083a7ad 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 07415443527862c10b0984fc4568e19d65d4be9f..698cc720edd5a480d256609079522f7ea3fe2d77 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 67f3607c7e451c8843746345c65e27849ed87cb2..269ef81739de3a557655d5f6d0ba6bbf1cc1f61a 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1c9fbcc107569e5879b8eec7cc54645b0a6f3627..f673f811c02137eced7b84d71529886477e4ffb7 100644 (file)
@@ -239,7 +239,7 @@ IO test cases that apply to both etree and ElementTree
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1e3869f4623f8e1db38d485bcc9515b6b2cf4319..154f69e16cc9175e279af20eb393c710d62e9688 100644 (file)
@@ -1167,7 +1167,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 8945f04e032d3b7682d442162da21db0ffa71587..b81c4f9e8dc8e01dc5c586fbebe5afb90e4b807b 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a18b2832f6e0bc1a970d73ca3c611739a5b460b4..51fbd29db3e28dc1ab2269fd2f7e1b776ea3f5b0 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 40ca5b45e6c4f22e91bf5057580fb11576cd90c7..c16f92f09bded68efc7d4a1369c9f233ace7300b 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fa4e05d211bca3348e3dc1f7138384dd7ed462ad..3c7bcbb8d7c14e079fb4766db7360c07571cc976 100644 (file)
@@ -224,7 +224,7 @@ Test cases related to ISO-Schematron parsing and validation
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ad5095351ffcbc7ea6764c10fc0e036ab4e5d939..6d2422678d713f44cf6925926b719df6c6d7c695 100644 (file)
@@ -1659,7 +1659,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 737aad8e7cded9c8b9a805bafddbe9076660d637..afe8be5da99863cf1b087f4b22b603998445ed1a 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 26285663e61e06384f89bd733687f5d177e31ca4..bdc0f2e62e1103f1eabd42f3074030a08049b8e0 100644 (file)
@@ -225,7 +225,7 @@ namespace registry mechanism
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9ec16a7f18682abf21ffca6d328854d15f32538b..333dc9f116c328e4c2184d8c566be452583c6fd9 100644 (file)
@@ -614,7 +614,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 850a77b0ffac9c13eb96a3ec8c8f564d47bff8b5..b27d27f448530fa621839949b8cd09fadfbe98b6 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5073ded872f2793ccb43604a98df314fe5c6ca34..334cf630c1fb8bbfe641e35f8db8add75099dcb9 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 2d0abe29582385b7f738ef7f82357912c0351fac..af7f647a3cba410d93d04d8597ea52ca67b11f31 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 71428565397c3e65954834c87b99e79cb0d3ba73..7d8c06a7d23e951ac9ee0160322c467548928f50 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 74b5a6a360963e7ad45b6c35d5ef7176282ae0ef..2a111b3e16d45f9315afc3e56793e128552091fa 100644 (file)
@@ -542,7 +542,7 @@ Tests specific to the lxml.objectify API
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b0e04ebe48cc48681d9d1dbb4af6fae3ac165a94..0983f93684a468d09b3d2116f8f137d256c217a9 100644 (file)
@@ -5958,7 +5958,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 172c3f4474d33f1592025c41dac73503a4c3eb9e..bf8502491881486931fa32b36b13ce178684ba05 100644 (file)
@@ -3634,7 +3634,7 @@ Test cases for lxml.objectify
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bec273775cec89fc7f6bf96ea426946905a47fd3..a2d8673004048decafdc27869465f8a524e91130 100644 (file)
@@ -266,7 +266,7 @@ Tests specific to the Python based class lookup.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a2841d82be8dfa74914b6f70bd3d31d4718e3878..34aa864d0d8ac105824dc533754f024e05371597 100644 (file)
@@ -829,16 +829,42 @@ lxml.etree._Entity.tag
 lxml.etree._ProcessingInstruction.tag
 lxml.tests.test_xpathevaluator.tag
 xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-258', 'tag', 'link-53');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-name">el_class</tt><tt class="py-op">.</tt><tt class="py-name">PREV</tt><tt class="py-op">)</tt> </tt>
-</div></div><a name="L337"></a><tt class="py-lineno">337</tt>  <tt class="py-line"> </tt>
-<a name="L338"></a><tt class="py-lineno">338</tt>  <tt class="py-line"> </tt>
-<a name="test_suite"></a><div id="test_suite-def"><a name="L339"></a><tt class="py-lineno">339</tt> <a class="py-toggle" href="#" id="test_suite-toggle" onclick="return toggle('test_suite');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_pyclasslookup-module.html#test_suite">test_suite</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="test_suite-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="test_suite-expanded"><a name="L340"></a><tt class="py-lineno">340</tt>  <tt class="py-line">    <tt class="py-name">suite</tt> <tt class="py-op">=</tt> <tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">TestSuite</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L341"></a><tt class="py-lineno">341</tt>  <tt class="py-line">    <tt class="py-name">suite</tt><tt class="py-op">.</tt><tt class="py-name">addTests</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">makeSuite</tt><tt class="py-op">(</tt><tt id="link-259" class="py-name"><a title="lxml.tests.test_pyclasslookup.PyClassLookupTestCase" class="py-name" href="#" onclick="return doclink('link-259', 'PyClassLookupTestCase', 'link-31');">PyClassLookupTestCase</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
-<a name="L342"></a><tt class="py-lineno">342</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">suite</tt> </tt>
-</div><a name="L343"></a><tt class="py-lineno">343</tt>  <tt class="py-line"> </tt>
-<a name="L344"></a><tt class="py-lineno">344</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
-<a name="L345"></a><tt class="py-lineno">345</tt>  <tt class="py-line">    <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">'to test use test.py %s'</tt> <tt class="py-op">%</tt> <tt class="py-name">__file__</tt><tt class="py-op">)</tt> </tt>
-<a name="L346"></a><tt class="py-lineno">346</tt>  <tt class="py-line"> </tt><script type="text/javascript">
+</div><a name="L337"></a><tt class="py-lineno">337</tt>  <tt class="py-line"> </tt>
+<a name="PyClassLookupTestCase.test_comments_fallback"></a><div id="PyClassLookupTestCase.test_comments_fallback-def"><a name="L338"></a><tt class="py-lineno">338</tt> <a class="py-toggle" href="#" id="PyClassLookupTestCase.test_comments_fallback-toggle" onclick="return toggle('PyClassLookupTestCase.test_comments_fallback');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_pyclasslookup.PyClassLookupTestCase-class.html#test_comments_fallback">test_comments_fallback</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="PyClassLookupTestCase.test_comments_fallback-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="PyClassLookupTestCase.test_comments_fallback-expanded"><a name="L339"></a><tt class="py-lineno">339</tt>  <tt class="py-line">        <tt class="py-keyword">def</tt> <tt class="py-def-name">return_none</tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+<a name="L340"></a><tt class="py-lineno">340</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
+</div><a name="L341"></a><tt class="py-lineno">341</tt>  <tt class="py-line"> </tt>
+<a name="L342"></a><tt class="py-lineno">342</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-259" class="py-name"><a title="lxml.tests.test_pyclasslookup.PyClassLookupTestCase._setClassLookup" class="py-name" href="#" onclick="return doclink('link-259', '_setClassLookup', 'link-40');">_setClassLookup</a></tt><tt class="py-op">(</tt><tt class="py-name">return_none</tt><tt class="py-op">)</tt> </tt>
+<a name="L343"></a><tt class="py-lineno">343</tt>  <tt class="py-line">        <tt class="py-name">el</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-260" class="py-name"><a title="lxml.etree.XML
+lxml.objectify.XML
+lxml.tests.test_objectify.ObjectifyTestCase.XML
+lxml.tests.test_pyclasslookup.PyClassLookupTestCase.XML" class="py-name" href="#" onclick="return doclink('link-260', 'XML', 'link-36');">XML</a></tt><tt class="py-op">(</tt><tt class="py-string">'&lt;a&gt;&lt;!-- hello world --&gt;&lt;/a&gt;'</tt><tt class="py-op">)</tt> </tt>
+<a name="L344"></a><tt class="py-lineno">344</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-261" class="py-name"><a title="lxml.etree._Comment.tag
+lxml.etree._Element.tag
+lxml.etree._Entity.tag
+lxml.etree._ProcessingInstruction.tag
+lxml.tests.test_xpathevaluator.tag
+xml.etree.ElementTree.Element.tag" class="py-name" href="#" onclick="return doclink('link-261', 'tag', 'link-53');">tag</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-262" class="py-name"><a title="lxml.etree
+lxml.sax.ElementTreeContentHandler.etree
+lxml.tests.test_elementtree.CElementTreeTestCase.etree
+lxml.tests.test_elementtree._ETreeTestCaseBase.etree
+lxml.tests.test_elementtree._XMLPullParserTest.etree
+lxml.tests.test_io._IOTestCaseBase.etree" class="py-name" href="#" onclick="return doclink('link-262', 'etree', 'link-9');">etree</a></tt><tt class="py-op">.</tt><tt id="link-263" class="py-name" targets="Function lxml.etree.Comment()=lxml.etree-module.html#Comment"><a title="lxml.etree.Comment" class="py-name" href="#" onclick="return doclink('link-263', 'Comment', 'link-263');">Comment</a></tt><tt class="py-op">)</tt> </tt>
+<a name="L345"></a><tt class="py-lineno">345</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">assertEqual</tt><tt class="py-op">(</tt><tt class="py-name">el</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-264" class="py-name"><a title="lxml.etree.QName.text
+lxml.etree._Element.text
+lxml.etree._Entity.text
+lxml.objectify.ObjectifiedElement.text
+xml.etree.ElementTree.Element.text" class="py-name" href="#" onclick="return doclink('link-264', 'text', 'link-64');">text</a></tt><tt class="py-op">,</tt> <tt class="py-string">" hello world "</tt><tt class="py-op">)</tt> </tt>
+</div></div><a name="L346"></a><tt class="py-lineno">346</tt>  <tt class="py-line"> </tt>
+<a name="L347"></a><tt class="py-lineno">347</tt>  <tt class="py-line"> </tt>
+<a name="test_suite"></a><div id="test_suite-def"><a name="L348"></a><tt class="py-lineno">348</tt> <a class="py-toggle" href="#" id="test_suite-toggle" onclick="return toggle('test_suite');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="lxml.tests.test_pyclasslookup-module.html#test_suite">test_suite</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="test_suite-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="test_suite-expanded"><a name="L349"></a><tt class="py-lineno">349</tt>  <tt class="py-line">    <tt class="py-name">suite</tt> <tt class="py-op">=</tt> <tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">TestSuite</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L350"></a><tt class="py-lineno">350</tt>  <tt class="py-line">    <tt class="py-name">suite</tt><tt class="py-op">.</tt><tt class="py-name">addTests</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">unittest</tt><tt class="py-op">.</tt><tt class="py-name">makeSuite</tt><tt class="py-op">(</tt><tt id="link-265" class="py-name"><a title="lxml.tests.test_pyclasslookup.PyClassLookupTestCase" class="py-name" href="#" onclick="return doclink('link-265', 'PyClassLookupTestCase', 'link-31');">PyClassLookupTestCase</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L351"></a><tt class="py-lineno">351</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">suite</tt> </tt>
+</div><a name="L352"></a><tt class="py-lineno">352</tt>  <tt class="py-line"> </tt>
+<a name="L353"></a><tt class="py-lineno">353</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
+<a name="L354"></a><tt class="py-lineno">354</tt>  <tt class="py-line">    <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">'to test use test.py %s'</tt> <tt class="py-op">%</tt> <tt class="py-name">__file__</tt><tt class="py-op">)</tt> </tt>
+<a name="L355"></a><tt class="py-lineno">355</tt>  <tt class="py-line"> </tt><script type="text/javascript">
 <!--
 expandto(location.href);
 // -->
@@ -877,7 +903,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 99aed8c6fd961a8dcf99930c7eaa75aa0c230fed..26cf850bdfc2c23d78a39401161ec9142886345d 100644 (file)
@@ -558,6 +558,22 @@ Test cases for the lxml.pyclasslookup class lookup mechanism.
       
     </td>
   </tr>
+<tr>
+    <td width="15%" align="right" valign="top" class="summary">
+      <span class="summary-type">&nbsp;</span>
+    </td><td class="summary">
+      <table width="100%" cellpadding="0" cellspacing="0" border="0">
+        <tr>
+          <td><span class="summary-sig"><a name="test_comments_fallback"></a><span class="summary-sig-name">test_comments_fallback</span>(<span class="summary-sig-arg">self</span>)</span></td>
+          <td align="right" valign="top">
+            <span class="codelink"><a href="lxml.tests.test_pyclasslookup-pysrc.html#PyClassLookupTestCase.test_comments_fallback">source&nbsp;code</a></span>
+            
+          </td>
+        </tr>
+      </table>
+      
+    </td>
+  </tr>
   <tr>
     <td colspan="2" class="summary">
     <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lxml.tests.common_imports.HelperTestCase-class.html">common_imports.HelperTestCase</a></code></b>:
@@ -855,7 +871,7 @@ Test cases for the lxml.pyclasslookup class lookup mechanism.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index be669c6630fb23ac0afb205ff962d2fe6b192d57..d80d17df05dd316850a09777b03f01991568e9bf 100644 (file)
@@ -239,7 +239,7 @@ Test cases related to RelaxNG parsing and validation
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index fd975274d14124943744c1cea4491a4413947b4d..f0e8017870ba2e11930fcb8114f218ac106e6198 100644 (file)
@@ -718,7 +718,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d5cddf802d303f142f50ded3be23ac064c2ddea2..0c653f5ac465a9fda35477fb11a559665d834813 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index f9852196619be366c4911b23be0a6dcb3fd1a93c..4af5adaf72228a083182357976c6a2f69b9409b9 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index faef65187adfe65aada9df22f86f94a1ccc3a2a4..c0005b4dd65d169d25e8fa59acbd1175aaf1f1f8 100644 (file)
@@ -224,7 +224,7 @@ Test cases related to SAX I/O
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 320bbaea2cabc20400d434f49dc572410cc0942b..d38e3d33e79add3233ca14a6e5bf2005805eeedd 100644 (file)
@@ -659,7 +659,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1aabb9cb9aaa71dc13ef203e58b28d21c1e0b4cb..aa17cdf23416c8c7113e2e28d80b959ec8485e8d 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e23d72a20cdca039b176c8a9b67506c730bdabc9..3bbace8ab57b839cb124045e1904d4d396a6fbd9 100644 (file)
@@ -224,7 +224,7 @@ Test cases related to Schematron parsing and validation
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d83cee01378423354c0bf3950742aa66bb0ce9a1..fe1def505d1f67983157a1b2ba14901ccd0f6ff4 100644 (file)
@@ -354,7 +354,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b47ec52328e693811ebb0082197b4b7dabd2168a..49a0c8d3e4bd83af8f1150bca763db98752351f3 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c66087c83d98de4ba13b5aa66f426f7c3b0f86fe..485f4339e464b2a9c53da219f0205d5f669d2ded 100644 (file)
@@ -233,7 +233,7 @@ Tests for thread usage in lxml.etree.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 72971fba268c37f5496c02feeec4c380979be98f..1d3eb6775f508ee12908a9f361090dd7b54efc87 100644 (file)
@@ -1251,7 +1251,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6a5a8650a54b4894a49d9f7ede7c58a8a9c4c11c..7b7cf12269e8c585067c0b1eb0597c199c9e8ca4 100644 (file)
@@ -522,7 +522,7 @@ Threading tests based on a thread worker pipeline.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a5185e69e30c78b6985aec1735e65dbb039244f6..ff90e151f5488abd58139a6b77639aa20a461078 100644 (file)
         <tr>
           <td><span class="summary-sig"><a href="lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndExtendWorker-class.html#handle" class="summary-sig-name">handle</a>(<span class="summary-sig-arg">self</span>,
         <span class="summary-sig-arg">element</span>,
-        <span class="summary-sig-arg">_fromstring</span>=<span class="summary-sig-default">&lt;cyfunction fromstring at 0x7f5c6769d350&gt;</span>)</span></td>
+        <span class="summary-sig-arg">_fromstring</span>=<span class="summary-sig-default">&lt;cyfunction fromstring at 0x7f153b6d7290&gt;</span>)</span></td>
           <td align="right" valign="top">
             <span class="codelink"><a href="lxml.tests.test_threading-pysrc.html#ThreadPipelineTestCase.ParseAndExtendWorker.handle">source&nbsp;code</a></span>
             
   <tr valign="top"><td>
   <h3 class="epydoc"><span class="sig"><span class="sig-name">handle</span>(<span class="sig-arg">self</span>,
         <span class="sig-arg">element</span>,
-        <span class="sig-arg">_fromstring</span>=<span class="sig-default">&lt;cyfunction fromstring at 0x7f5c6769d350&gt;</span>)</span>
+        <span class="sig-arg">_fromstring</span>=<span class="sig-default">&lt;cyfunction fromstring at 0x7f153b6d7290&gt;</span>)</span>
   </h3>
   </td><td align="right" valign="top"
     ><span class="codelink"><a href="lxml.tests.test_threading-pysrc.html#ThreadPipelineTestCase.ParseAndExtendWorker.handle">source&nbsp;code</a></span>&nbsp;
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 3d1297aae9bda6b2e8e25907daa948b57eea9508..9ff92be18123545e68136d0792f37359bdd124b3 100644 (file)
         <tr>
           <td><span class="summary-sig"><a href="lxml.tests.test_threading.ThreadPipelineTestCase.ParseAndInjectWorker-class.html#handle" class="summary-sig-name">handle</a>(<span class="summary-sig-arg">self</span>,
         <span class="summary-sig-arg">element</span>,
-        <span class="summary-sig-arg">_fromstring</span>=<span class="summary-sig-default">&lt;cyfunction fromstring at 0x7f5c6769d350&gt;</span>)</span></td>
+        <span class="summary-sig-arg">_fromstring</span>=<span class="summary-sig-default">&lt;cyfunction fromstring at 0x7f153b6d7290&gt;</span>)</span></td>
           <td align="right" valign="top">
             <span class="codelink"><a href="lxml.tests.test_threading-pysrc.html#ThreadPipelineTestCase.ParseAndInjectWorker.handle">source&nbsp;code</a></span>
             
   <tr valign="top"><td>
   <h3 class="epydoc"><span class="sig"><span class="sig-name">handle</span>(<span class="sig-arg">self</span>,
         <span class="sig-arg">element</span>,
-        <span class="sig-arg">_fromstring</span>=<span class="sig-default">&lt;cyfunction fromstring at 0x7f5c6769d350&gt;</span>)</span>
+        <span class="sig-arg">_fromstring</span>=<span class="sig-default">&lt;cyfunction fromstring at 0x7f153b6d7290&gt;</span>)</span>
   </h3>
   </td><td align="right" valign="top"
     ><span class="codelink"><a href="lxml.tests.test_threading-pysrc.html#ThreadPipelineTestCase.ParseAndInjectWorker.handle">source&nbsp;code</a></span>&nbsp;
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ccd332e81c09c7a78387fb6c6092c584e2e2c4d1..b9e05095a623db9ccc0107a0e1d6db8f714b2f0e 100644 (file)
         <tr>
           <td><span class="summary-sig"><a href="lxml.tests.test_threading.ThreadPipelineTestCase.ParseWorker-class.html#handle" class="summary-sig-name">handle</a>(<span class="summary-sig-arg">self</span>,
         <span class="summary-sig-arg">xml</span>,
-        <span class="summary-sig-arg">_fromstring</span>=<span class="summary-sig-default">&lt;cyfunction fromstring at 0x7f5c6769d350&gt;</span>)</span></td>
+        <span class="summary-sig-arg">_fromstring</span>=<span class="summary-sig-default">&lt;cyfunction fromstring at 0x7f153b6d7290&gt;</span>)</span></td>
           <td align="right" valign="top">
             <span class="codelink"><a href="lxml.tests.test_threading-pysrc.html#ThreadPipelineTestCase.ParseWorker.handle">source&nbsp;code</a></span>
             
   <tr valign="top"><td>
   <h3 class="epydoc"><span class="sig"><span class="sig-name">handle</span>(<span class="sig-arg">self</span>,
         <span class="sig-arg">xml</span>,
-        <span class="sig-arg">_fromstring</span>=<span class="sig-default">&lt;cyfunction fromstring at 0x7f5c6769d350&gt;</span>)</span>
+        <span class="sig-arg">_fromstring</span>=<span class="sig-default">&lt;cyfunction fromstring at 0x7f153b6d7290&gt;</span>)</span>
   </h3>
   </td><td align="right" valign="top"
     ><span class="codelink"><a href="lxml.tests.test_threading-pysrc.html#ThreadPipelineTestCase.ParseWorker.handle">source&nbsp;code</a></span>&nbsp;
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 17a0cb6d0223682a65c96f1d109ebc2d41aa1d9e..e71144cd4fe685aabd2a1955b5f354f4e7c0ee94 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9ccec9f31da2d2a966e41fe6f335a3584e14e0e5..2ce1b66035877e48e912f348839b4e880e2745ae 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 30ec184166e2fb58b16e5aea0085c529fa43c1e5..d944ab9383593a5aadce00dd994a0c1afc6778d3 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1d396e1ded0907c63eeb7ac9ca06ede15a6246ba..feb51c08f338996cc5b42b2087cf23777882482a 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 09b19dbc139ceeb93c4b1e753d2a6746cfc57a28..6a2a06f6de2a5979e352487d2ce5b62c394a91d9 100644 (file)
@@ -339,7 +339,7 @@ from the args and kwargs arguments, respectively.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7d8b3d15d2d7bc87301db50d8094085f76e9b4a0..56334ef4e53c2f1960b7dfc22e10164a333a8108 100644 (file)
@@ -563,7 +563,7 @@ Threading tests
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 25ea224115e01af3a31d3db59c1abf5525a3361c..e4f2c18b258ca9e59b25b0ef68276cc92ab98ab1 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index b77064de9e8e689eb80e0b4d26a380fe7b62b336..1f77f5abbe49b53774195fc46c60df82a50c43c1 100644 (file)
@@ -691,7 +691,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 47c1166586908b7996c11fbdcedaeaa09709cc89..f6b7731da835351d562c0f244d4671f7008076f9 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c7bfb2681ba6b2a34d4bd2bd3c316ad9696008a0..d6688a05f250a9c2b278bca52a2d25dfed1b79a2 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index ba9dd5f0032bc5e7fed644eca36b1fdf43c5e53f..cec002fe718aab3b2adee7fb01606949e2b8a871 100644 (file)
@@ -231,7 +231,7 @@ Test cases related to XML Schema parsing and validation
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index eb1ec4cd545dc4d41cdaba65a7d0e90a44699f51..17ab5fb4343fc573f6f28855c20a8832da27f41a 100644 (file)
@@ -1371,7 +1371,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c45be73c6f716e984abec5d908ab3293ee6e155b..c641f0fa596520d0baa9b9b238697d9f56ddbf0e 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5c19a0579f6f9d7cc1277d1a1ec3cdc8d7de38eb..97e0e36dd6fec72bb3ea7f95d0d2b29d376361a6 100644 (file)
@@ -285,7 +285,7 @@ opaque context object.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index e0b9e4028bb99f8a6cb42fb663d3bcf9eb55fc50..016e7313c98b8dc3166d4ba2080c5b6a1d03952d 100644 (file)
@@ -695,7 +695,7 @@ it wasn't bogus.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index bed819428789c34c6457588a914773b47505dcc7..2019c5433e38599c1f74ffedd438e866d433b014 100644 (file)
@@ -525,7 +525,7 @@ Test cases related to XPath evaluation and the XPath class
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 54cad9895db0e8921d42214d33c6e558ff740dae..ba80faf761d73f089f7c4783049443d6311b87b4 100644 (file)
@@ -2000,7 +2000,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 6eb2dc0069a761b2be011ea6caac7c3cdc66bcbb..80aeebbdafb063ed5817f3177698a9d38cfe2215 100644 (file)
@@ -357,7 +357,7 @@ Tests for the ETXPath class
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index c585c626583abc9214ef4eb41e60615ed8c8926c..d9346b5950bc307fad75318942275026545b5391 100644 (file)
@@ -405,7 +405,7 @@ Tests for the XPath class
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 00de1ea4cd2026cf17303e4b25355d15b75ebee0..30c9b9d8cf74ab78d641bd26f90c81d490505ab9 100644 (file)
@@ -407,7 +407,7 @@ Tests for the EXSLT support in XPath (requires libxslt 1.1.25+)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4518bec82f11c52bb0e75bacdea5fd9aee02e997..b6d99ff70aea13244db1143430fe6ce506d31f27 100644 (file)
@@ -1029,7 +1029,7 @@ XPath tests etree
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 31c7bc3d196bc6c50942694f5b0eab1fc30a2e7d..259d72a12c527b8cf1219421adb22412a1e9c8ed 100644 (file)
@@ -280,7 +280,7 @@ Test cases related to XSLT processing
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4ef591f74cc44dbe9c2176171d241d19aa92c22f..37069185b02a2d662288cda918d502ac30f4ad2f 100644 (file)
@@ -4415,7 +4415,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 30c97c8cd8cfb95f7fb2c6fc620fd15d01e92b8d..842b146a9e45c42cf9471edc491b24e825319bda 100644 (file)
@@ -501,7 +501,7 @@ EXSLT tests
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 382d7e4918056bceae160dd9cfa8333a76628416..d0a815a79a67952d33dfeeb99588c6458a5d3fd8 100644 (file)
@@ -581,7 +581,7 @@ Tests for extension elements in XSLT.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 14305fd52c24944620eaba3f8888c8c6493e364d..4f30553b0f1d173fc97539ac7c80611bc7a4ee95 100644 (file)
@@ -405,7 +405,7 @@ Tests for XPath extension functions in XSLT.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d1cff3a2f1b2e94416a1033d61c6db42fc14a099..45f00cc8f4a682ad4a8416475591c3593b865bd6 100644 (file)
@@ -1281,7 +1281,7 @@ XSLT tests etree
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 26e1d6a7aeabd6cdfe6b4e180611dfc689ec3f65..aebf56d32f519085de403c8438bbc62e797a6ca9 100644 (file)
@@ -380,7 +380,7 @@ XSLT tests for etree under Python 3
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 11cdcf88ed9d6105c6f83a70d47eeb5ee6712045..4d005873cc29e74b64692ff2afd62af83b88d48d 100644 (file)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 1a6179afd65fc683a07345fd540c482453aaaf59..03843cf9fd77d1728016e23b5a50e7934e6bc7ac 100644 (file)
@@ -113,7 +113,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4cd643f3219d000e11edf6c1a9b06edd0e9b3d12..ed8f2268130d536f8643ce970b7655ab4bd2aebe 100644 (file)
@@ -364,7 +364,7 @@ contains some hooks for decoding encoded and multipart messages.
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 01db76e8c171fa387efe8bd1a9107d01a69a2dc3..4f613a5c8ca33417b67995fa070043c458fc8795 100644 (file)
@@ -160,7 +160,7 @@ namespace registry mechanism</em>    </li>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 4262ed324a5e6c1bb5a647636b7fb460976aee85..553aaa66c4a0cde4a3e7a425827481f16f36d3dd 100644 (file)
@@ -1629,7 +1629,7 @@ arguments start and end are interpreted as in slice notation.</p>
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 5a7fc97963bb0ce08a5f90ae64c94abe22a50659..2d1c86edb1abb459428331232e25e9659f345eba 100644 (file)
      >lxml.tests.test_css.test_suite</a><br />    <a target="mainFrame" href="lxml.tests.test_doctestcompare-module.html#indent"
      >lxml.tests.test_doctestcompare.indent</a><br />    <a target="mainFrame" href="lxml.tests.test_doctestcompare-module.html#test_suite"
      >lxml.tests.test_doctestcompare.test_suite</a><br />    <a target="mainFrame" href="lxml.tests.test_dtd-module.html#test_suite"
-     >lxml.tests.test_dtd.test_suite</a><br />    <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#test_suite"
+     >lxml.tests.test_dtd.test_suite</a><br />    <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#normalize_crlf"
+     >lxml.tests.test_elementpath.normalize_crlf</a><br />    <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#summarize"
+     >lxml.tests.test_elementpath.summarize</a><br />    <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#summarize_list"
+     >lxml.tests.test_elementpath.summarize_list</a><br />    <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#test_suite"
      >lxml.tests.test_elementpath.test_suite</a><br />    <a target="mainFrame" href="lxml.tests.test_elementtree-module.html#test_suite"
      >lxml.tests.test_elementtree.test_suite</a><br />    <a target="mainFrame" href="lxml.tests.test_errors-module.html#test_suite"
      >lxml.tests.test_errors.test_suite</a><br />    <a target="mainFrame" href="lxml.tests.test_etree-module.html#test_suite"
index ac2a6037e2edeaf49d44a5fd98966905159a21ef..ea87fc9cfd73fa48161503c2be55595675b0c0bc 100644 (file)
   <h2 class="toc">Classes</h2>
     <a target="mainFrame" href="lxml.tests.test_elementpath.EtreeElementPathTestCase-class.html"
      >EtreeElementPathTestCase</a><br />  <h2 class="toc">Functions</h2>
-    <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#test_suite"
+    <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#normalize_crlf"
+     >normalize_crlf</a><br />    <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#summarize"
+     >summarize</a><br />    <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#summarize_list"
+     >summarize_list</a><br />    <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#test_suite"
      >test_suite</a><br />  <h2 class="toc">Variables</h2>
     <a target="mainFrame" href="lxml.tests.test_elementpath-module.html#__package__"
      >__package__</a><br /><hr />
index 4df8fdf95068b6512d618df740af5349e6bf94d7..192dab2ab4891ea81e53ecfcb3e914eb5ccbe375 100644 (file)
@@ -784,7 +784,7 @@ hash(x)
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index cca97ce82125b1c8b3fecf8c2db0035eb33a485f..e45cd6e27be76db18088932e969dd3e09c8d7633 100644 (file)
@@ -3174,7 +3174,7 @@ expandto(location.href);
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7f150dfa5b2ec3918f4c90db8f150e60d6355192..a444fe5a8444bbc022c3de3c9f8bb8512ffa79bc 100644 (file)
@@ -730,7 +730,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 26213428a8edef535be6c87115e4c7af3e8eb423..a3c4e42fc393ba6093ed04b82ef44d79c54060be 100644 (file)
@@ -424,7 +424,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index a64c10ad7b0e0fa3b9c4a13f180faada14b7fd76..a71950f0a1f8eb0e41190947230c76757d3f5ab6 100644 (file)
@@ -193,7 +193,7 @@ exceptions.BaseException --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 83f7df6787eba938c56ecca0b5c4588469ef2925..eab15a17fecfbdd727df01bfdcfabef1a13d3079 100644 (file)
@@ -325,7 +325,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 8af54ca0984010c02171e7d45a0e2f0a7cd4927b..bbd432f16b7d3642cf678aabcdfb2d9f6413763c 100644 (file)
@@ -310,7 +310,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 7994f5f5b0e9fb56dc7e5bf36f5806b7b49f56f6..d22efb0c07bb06b1026dd6b6939df2c93082ad0f 100644 (file)
@@ -476,7 +476,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index 9c13191cefa08a29766c20bcac357043b3605029..5e1d5bf6f961775f3e4e0c870eee0ffc7c23430b 100644 (file)
@@ -264,7 +264,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d20a9ca52ec43e77dba681c6af752960e3af94d2..a1c06dc2cac9d2f01476e580d37d66bcc5fdf038 100644 (file)
@@ -242,7 +242,7 @@ object --+
   <tr>
     <td align="left" class="footer">
     Generated by Epydoc 3.0.1
-    on Sun Sep 17 08:07:12 2017
+    on Fri Oct 13 15:46:58 2017
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"
index d0a9f65cea3ba1cc893cd50e883f736ae278d834..9e0a9bcab6736958640d48406575646b0b5e718e 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="how-to-build-lxml-from-source">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu current" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">How to build lxml from source</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu current" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">How to build lxml from source</h1>
 
 <p>To build lxml from source, you need libxml2 and libxslt properly
 installed, <em>including the header files</em>.  These are likely shipped in
@@ -303,7 +303,7 @@ installed using <tt class="docutils literal">dpkg <span class="pre">-i</span></t
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 2bcd2a5eee4b1b9efd20768d07662f75f27d5614..1bf16959d800610bc1eb69738d45091e8dbb236d 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="the-public-c-api-of-lxml-etree">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu current" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">The public C-API of lxml.etree</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu current" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">The public C-API of lxml.etree</h1>
 
 <p>As of version 1.1, lxml.etree provides a public C-API.  This allows external
 C extensions to efficiently access public functions and classes of lxml,
@@ -127,7 +127,7 @@ includes may not be sufficient.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
diff --git a/doc/html/changes-4.0.0.html b/doc/html/changes-4.0.0.html
deleted file mode 100644 (file)
index 5000233..0000000
+++ /dev/null
@@ -1,3293 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
-<title>lxml changelog</title>
-<link rel="stylesheet" href="style.css" type="text/css" />
-</head>
-<body>
-<div class="document" id="lxml-changelog">
-<h1 class="title">lxml changelog</h1>
-
-<div class="section" id="id1">
-<h1>4.0.0 (2017-09-17)</h1>
-<div class="section" id="features-added">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The ElementPath implementation is now compiled using Cython,
-which speeds up the <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods quite significantly.</li>
-<li>The modules <tt class="docutils literal">lxml.builder</tt>, <tt class="docutils literal">lxml.html.diff</tt> and <tt class="docutils literal">lxml.html.clean</tt>
-are also compiled using Cython in order to speed them up.</li>
-<li><tt class="docutils literal">xmlfile()</tt> supports async coroutines using <tt class="docutils literal">async with</tt> and <tt class="docutils literal">await</tt>.</li>
-<li><tt class="docutils literal">iterwalk()</tt> has a new method <tt class="docutils literal">skip_subtree()</tt> that prevents walking into
-the descendants of the current element.</li>
-<li><tt class="docutils literal">RelaxNG.from_rnc_string()</tt> accepts a <tt class="docutils literal">base_url</tt> argument to
-allow relative resource lookups.</li>
-<li>The XSLT result object has a new method <tt class="docutils literal">.write_output(file)</tt> that serialises
-output data into a file according to the <tt class="docutils literal">&lt;xsl:output&gt;</tt> configuration.</li>
-</ul>
-</div>
-<div class="section" id="bugs-fixed">
-<h2>Bugs fixed</h2>
-<ul>
-<li><p class="first"><a class="reference external" href="https://github.com/lxml/lxml/issues/251">GH#251</a>: HTML comments were handled incorrectly by the soupparser.
-Patch by mozbugbox.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1654544">LP#1654544</a>: The html5parser no longer passes the <tt class="docutils literal">useChardet</tt> option
-if the input is a Unicode string, unless explicitly requested.  When parsing
-files, the default is to enable it when a URL or file path is passed (because
-the file is then opened in binary mode), and to disable it when reading from
-a file(-like) object.</p>
-<p>Note: This is a backwards incompatible change of the default configuration.
-If your code parses byte strings/streams and depends on character detection,
-please pass the option <tt class="docutils literal">guess_charset=True</tt> explicitly, which already worked
-in older lxml versions.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1703810">LP#1703810</a>: <tt class="docutils literal">etree.fromstring()</tt> failed to parse UTF-32 data with BOM.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1526522">LP#1526522</a>: Some RelaxNG errors were not reported in the error log.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1567526">LP#1567526</a>: Empty and plain text input raised a TypeError in soupparser.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1710429">LP#1710429</a>: Uninitialised variable usage in HTML diff.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1415643">LP#1415643</a>: The closing tags context manager in <tt class="docutils literal">xmlfile()</tt> could continue
-to output end tags even after writing failed with an exception.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1465357">LP#1465357</a>: <tt class="docutils literal">xmlfile.write()</tt> now accepts and ignores None as input argument.</p>
-</li>
-<li><p class="first">Compilation under Py3.7-pre failed due to a modified function signature.</p>
-</li>
-</ul>
-</div>
-<div class="section" id="other-changes">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The main module source files were renamed from <tt class="docutils literal"><span class="pre">lxml.*.pyx</span></tt> to plain
-<tt class="docutils literal">*.pyx</tt> (e.g. <tt class="docutils literal">etree.pyx</tt>) to simplify their handling in the build
-process.  Care was taken to keep the old header files as fallbacks for
-code that compiles against the public C-API of lxml, but it might still
-be worth validating that third-party code does not notice this change.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id2">
-<h1>3.8.0 (2017-06-03)</h1>
-<div class="section" id="id3">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">ElementTree.write()</tt> has a new option <tt class="docutils literal">doctype</tt> that writes out a
-doctype string before the serialisation, in the same way as <tt class="docutils literal">tostring()</tt>.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/220">GH#220</a>: <tt class="docutils literal">xmlfile</tt> allows switching output methods at an element level.
-Patch by Burak Arslan.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1595781">LP#1595781</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/240">GH#240</a>: added a PyCapsule Python API and C-level API for
-passing externally generated libxml2 documents into lxml.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/244">GH#244</a>: error log entries have a new property <tt class="docutils literal">path</tt> with an XPath
-expression (if known, None otherwise) that points to the tree element
-responsible for the error. Patch by Bob Kline.</li>
-<li>The namespace prefix mapping that can be used in ElementPath now injects
-a default namespace when passing a None prefix.</li>
-</ul>
-</div>
-<div class="section" id="id4">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/238">GH#238</a>: Character escapes were not hex-encoded in the <tt class="docutils literal">xmlfile</tt> serialiser.
-Patch by matejcik.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/229">GH#229</a>: fix for externally created XML documents.  Patch by Theodore Dubois.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1665241">LP#1665241</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/228">GH#228</a>: Form data handling in lxml.html no longer strips the
-option values specified in form attributes but only the text values.
-Patch by Ashish Kulkarni.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: revert previous fix for XSLT error logging as it breaks
-multi-threaded XSLT processing.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1673355">LP#1673355</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/233">GH#233</a>: <tt class="docutils literal">fromstring()</tt> html5parser failed to parse byte strings.</li>
-</ul>
-</div>
-<div class="section" id="id5">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The previously undocumented <tt class="docutils literal">docstring</tt> option in <tt class="docutils literal">ElementTree.write()</tt>
-produces a deprecation warning and will eventually be removed.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id6">
-<h1>3.7.4 (2017-??-??)</h1>
-<div class="section" id="id7">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: revert previous fix for XSLT error logging as it breaks
-multi-threaded XSLT processing.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1673355">LP#1673355</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/233">GH#233</a>: <tt class="docutils literal">fromstring()</tt> html5parser failed to parse byte strings.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id11">
-<h1>3.7.3 (2017-02-18)</h1>
-<div class="section" id="id12">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/218">GH#218</a> was ineffective in Python 3.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/222">GH#222</a>: <tt class="docutils literal">lxml.html.submit_form()</tt> failed in Python 3.
-Patch by Jakub Wilk.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id13">
-<h1>3.7.2 (2017-01-08)</h1>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/220">GH#220</a>: <tt class="docutils literal">xmlfile</tt> allows switching output methods at an element level.
-Patch by Burak Arslan.</li>
-</ul>
-<div class="section" id="id15">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Work around installation problems in recent Python 2.7 versions
-due to FTP download failures.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/219">GH#219</a>: <tt class="docutils literal">xmlfile.element()</tt> was not properly quoting attribute values.
-Patch by Burak Arslan.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/218">GH#218</a>: <tt class="docutils literal">xmlfile.element()</tt> was not properly escaping text content of
-script/style tags.  Patch by Burak Arslan.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id17">
-<h1>3.7.1 (2016-12-23)</h1>
-<ul class="simple">
-<li>No source changes, issued only to solve problems with the
-binary packages released for 3.7.0.</li>
-</ul>
-</div>
-<div class="section" id="id18">
-<h1>3.7.0 (2016-12-10)</h1>
-<div class="section" id="id19">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/217">GH#217</a>: <tt class="docutils literal">XMLSyntaxError</tt> now behaves more like its <tt class="docutils literal">SyntaxError</tt>
-baseclass.  Patch by Philipp A.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/216">GH#216</a>: <tt class="docutils literal">HTMLParser()</tt> now supports the same <tt class="docutils literal">collect_ids</tt> parameter
-as <tt class="docutils literal">XMLParser()</tt>.  Patch by Burak Arslan.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/210">GH#210</a>: Allow specifying a serialisation method in <tt class="docutils literal">xmlfile.write()</tt>.
-Patch by Burak Arslan.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/203">GH#203</a>: New option <tt class="docutils literal">default_doctype</tt> in <tt class="docutils literal">HTMLParser</tt> that allows
-disabling the automatic doctype creation.  Patch by Shadab Zafar.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/201">GH#201</a>: Calling the method <tt class="docutils literal"><span class="pre">.set('attrname')</span></tt> without value argument
-(or <tt class="docutils literal">None</tt>) on HTML elements creates an attribute without value that
-serialises like <tt class="docutils literal">&lt;div <span class="pre">attrname&gt;&lt;/div&gt;</span></tt>.  Patch by Daniel Holth.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/197">GH#197</a>: Ignore form input fields in <tt class="docutils literal">form_values()</tt> when they are
-marked as <tt class="docutils literal">disabled</tt> in HTML.  Patch by Kristian Klemon.</li>
-</ul>
-</div>
-<div class="section" id="id20">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/206">GH#206</a>: File name and line number were missing from XSLT error messages.
-Patch by Marcus Brinkmann.</li>
-</ul>
-</div>
-<div class="section" id="id21">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Log entries no longer allow anything but plain string objects as message text
-and file name.</li>
-<li><tt class="docutils literal">zlib</tt> is included in the list of statically built libraries.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id22">
-<h1>3.6.4 (2016-08-20)</h1>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/204">GH#204</a>, <a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614693">LP#1614693</a>: build fix for MacOS-X.</li>
-</ul>
-</div>
-<div class="section" id="id23">
-<h1>3.6.3 (2016-08-18)</h1>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614603">LP#1614603</a>: change linker flags to build multi-linux wheels</li>
-</ul>
-</div>
-<div class="section" id="id24">
-<h1>3.6.2 (2016-08-18)</h1>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614603">LP#1614603</a>: release without source changes to provide cleanly built Linux wheels</li>
-</ul>
-</div>
-<div class="section" id="id26">
-<h1>3.6.1 (2016-07-24)</h1>
-<div class="section" id="id27">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/180">GH#180</a>: Separate option <tt class="docutils literal">inline_style</tt> for Cleaner that only removes <tt class="docutils literal">style</tt>
-attributes instead of all styles.  Patch by Christian Pedersen.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/196">GH#196</a>: Windows build support for Python 3.5.  Contribution by Maximilian Hils.</li>
-</ul>
-</div>
-<div class="section" id="id28">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/199">GH#199</a>: Exclude <tt class="docutils literal">file</tt> fields from <tt class="docutils literal">FormElement.form_values</tt> (as browsers do).
-Patch by Tomas Divis.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/198">GH#198</a>, <a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1568167">LP#1568167</a>: Try to provide base URL from <tt class="docutils literal">Resolver.resolve_string()</tt>.
-Patch by Michael van Tellingen.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/191">GH#191</a>: More accurate float serialisation in <tt class="docutils literal">objectify.FloatElement</tt>.
-Patch by Holger Joukl.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: Repair XSLT error logging. Patch by Marcus Brinkmann.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id30">
-<h1>3.6.0 (2016-03-17)</h1>
-<div class="section" id="id31">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/187">GH#187</a>: Now supports (only) version 5.x and later of PyPy.
-Patch by Armin Rigo.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/181">GH#181</a>: Direct support for <tt class="docutils literal">.rnc</tt> files in <cite>RelaxNG()</cite> if <tt class="docutils literal">rnc2rng</tt>
-is installed.  Patch by Dirkjan Ochtman.</li>
-</ul>
-</div>
-<div class="section" id="id32">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/189">GH#189</a>: Static builds honour FTP proxy configurations when downloading
-the external libs.  Patch by Youhei Sakurai.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/186">GH#186</a>: Soupparser failed to process entities in Python 3.x.
-Patch by Duncan Morris.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/185">GH#185</a>: Rare encoding related <tt class="docutils literal">TypeError</tt> on import was fixed.
-Patch by Petr Demin.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id33">
-<h1>3.5.0 (2015-11-13)</h1>
-<div class="section" id="id34">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Unicode string results failed XPath queries in PyPy.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1497051">LP#1497051</a>: HTML target parser failed to terminate on exceptions
-and continued parsing instead.</li>
-<li>Deprecated API usage in doctestcompare.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="b1-2015-09-18">
-<h1>3.5.0b1 (2015-09-18)</h1>
-<div class="section" id="id35">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">cleanup_namespaces()</tt> accepts a new argument <tt class="docutils literal">keep_ns_prefixes</tt>
-that does not remove definitions of the provided prefix-namespace
-mapping from the tree.</li>
-<li><tt class="docutils literal">cleanup_namespaces()</tt> accepts a new argument <tt class="docutils literal">top_nsmap</tt> that
-moves definitions of the provided prefix-namespace mapping to the
-top of the tree.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1490451">LP#1490451</a>: <tt class="docutils literal">Element</tt> objects gained a <tt class="docutils literal">cssselect()</tt> method as
-known from <tt class="docutils literal">lxml.html</tt>.  Patch by Simon Sapin.</li>
-<li>API functions and methods behave and look more like Python functions,
-which allows introspection on them etc.  One side effect to be aware of
-is that the functions now bind as methods when assigned to a class
-variable.  A quick fix is to wrap them in <tt class="docutils literal">staticmethod()</tt> (as for
-normal Python functions).</li>
-<li>ISO-Schematron support gained an option <tt class="docutils literal">error_finder</tt> that allows
-passing a filter function for picking validation errors from reports.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1243600">LP#1243600</a>: Elements in <tt class="docutils literal">lxml.html</tt> gained a <tt class="docutils literal">classes</tt> property
-that provides a set-like interface to the <tt class="docutils literal">class</tt> attribute.
-Original patch by masklinn.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1341964">LP#1341964</a>: The soupparser now handles DOCTYPE declarations, comments
-and processing instructions outside of the root element.
-Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421512">LP#1421512</a>: The <tt class="docutils literal">docinfo</tt> of a tree was made editable to allow
-setting and removing the public ID and system ID of the DOCTYPE.
-Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1442427">LP#1442427</a>: More work-arounds for quirks and bugs in pypy and pypy3.</li>
-<li><tt class="docutils literal">lxml.html.soupparser</tt> now uses BeautifulSoup version 4 instead
-of version 3 if available.</li>
-</ul>
-</div>
-<div class="section" id="id36">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory errors that occur during tree adaptations (e.g. moving subtrees
-to foreign documents) could leave the tree in a crash prone state.</li>
-<li>Calling <tt class="docutils literal">process_children()</tt> in an XSLT extension element without
-an <tt class="docutils literal">output_parent</tt> argument failed with a <tt class="docutils literal">TypeError</tt>.
-Fix by Jens Tröger.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/162">GH#162</a>: Image data in HTML <tt class="docutils literal">data</tt> URLs is considered safe and
-no longer removed by <tt class="docutils literal">lxml.html.clean</tt> JavaScript cleaner.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/166">GH#166</a>: Static build could link libraries in wrong order.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/172">GH#172</a>: Rely a bit more on libxml2 for encoding detection rather than
-rolling our own in some cases.  Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/159">GH#159</a>: Validity checks for names and string content were tightened
-to detect the use of illegal characters early.  Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421921">LP#1421921</a>: Comments/PIs before the DOCTYPE declaration were not
-serialised.  Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/659367">LP#659367</a>: Some HTML DOCTYPE declarations were not serialised.
-Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1238503">LP#1238503</a>: lxml.doctestcompare is now consistent with stdlib's doctest
-in how it uses <tt class="docutils literal">+</tt> and <tt class="docutils literal">-</tt> to refer to unexpected and missing output.</li>
-<li>Empty prefixes are explicitly rejected when a namespace mapping is used
-with ElementPath to avoid hiding bugs in user code.</li>
-<li>Several problems with PyPy were fixed by switching to Cython 0.23.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id37">
-<h1>3.4.4 (2015-04-25)</h1>
-<div class="section" id="id38">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>An ElementTree compatibility test added in lxml 3.4.3 that failed in
-Python 3.4+ was removed again.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id39">
-<h1>3.4.3 (2015-04-15)</h1>
-<div class="section" id="id40">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Expression cache in ElementPath was ignored.  Fix by Changaco.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1426868">LP#1426868</a>: Passing a default namespace and a prefixed namespace mapping
-as nsmap into <tt class="docutils literal">xmlfile.element()</tt> raised a <tt class="docutils literal">TypeError</tt>.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421927">LP#1421927</a>: DOCTYPE system URLs were incorrectly quoted when containing
-double quotes.  Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1419354">LP#1419354</a>: meta-redirect URLs were incorrectly processed by
-<tt class="docutils literal">iterlinks()</tt> if preceded by whitespace.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id41">
-<h1>3.4.2 (2015-02-07)</h1>
-<div class="section" id="id42">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1415907">LP#1415907</a>: Crash when creating an XMLSchema from a non-root element
-of an XML document.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1369362">LP#1369362</a>: HTML cleaning failed when hitting processing instructions
-with pseudo-attributes.</li>
-<li><tt class="docutils literal">CDATA()</tt> wrapped content was rejected for tail text.</li>
-<li>CDATA sections were not serialised as tail text of the top-level element.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id43">
-<h1>3.4.1 (2014-11-20)</h1>
-<div class="section" id="id44">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New <tt class="docutils literal">htmlfile</tt> HTML generator to accompany the incremental <tt class="docutils literal">xmlfile</tt>
-serialisation API.  Patch by Burak Arslan.</li>
-</ul>
-</div>
-<div class="section" id="id45">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.sax.ElementTreeContentHandler</tt> did not initialise its superclass.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id46">
-<h1>3.4.0 (2014-09-10)</h1>
-<div class="section" id="id47">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">xmlfile(buffered=False)</tt> disables output buffering and flushes the
-content after each API operation (starting/ending element blocks or writes).
-A new method <tt class="docutils literal">xf.flush()</tt> can alternatively be used to explicitly flush
-the output.</li>
-<li><tt class="docutils literal">lxml.html.document_fromstring</tt> has a new option <tt class="docutils literal">ensure_head_body=True</tt>
-which will add an empty head and/or body element to the result document if
-missing.</li>
-<li><tt class="docutils literal">lxml.html.iterlinks</tt> now returns links inside meta refresh tags.</li>
-<li>New <tt class="docutils literal">XMLParser</tt> option <tt class="docutils literal">collect_ids=False</tt> to disable ID hash table
-creation.  This can substantially speed up parsing of documents with many
-different IDs that are not used.</li>
-<li>The parser uses per-document hash tables for XML IDs.  This reduces the
-load of the global parser dict and speeds up parsing for documents with
-many different IDs.</li>
-<li><tt class="docutils literal">ElementTree.getelementpath(element)</tt> returns a structural ElementPath
-expression for the given element, which can be used for lookups later.</li>
-<li><tt class="docutils literal">xmlfile()</tt> accepts a new argument <tt class="docutils literal">close=True</tt> to close file(-like)
-objects after writing to them.  Before, <tt class="docutils literal">xmlfile()</tt> only closed the file
-if it had opened it internally.</li>
-<li>Allow &quot;bytearray&quot; type for ASCII text input.</li>
-</ul>
-</div>
-<div class="section" id="id48">
-<h2>Bugs fixed</h2>
-</div>
-<div class="section" id="id49">
-<h2>Other changes</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/400588">LP#400588</a>: decoding errors have become hard errors even in recovery mode.
-Previously, they could lead to an internal tree representation in a mixed
-encoding state, which lead to very late errors or even silently incorrect
-behaviour during tree traversal or serialisation.</li>
-<li>Requires Python 2.6, 2.7, 3.2 or later. No longer supports
-Python 2.4, 2.5 and 3.1, use lxml 3.3.x for those.</li>
-<li>Requires libxml2 2.7.0 or later and libxslt 1.1.23 or later,
-use lxml 3.3.x with older versions.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id50">
-<h1>3.3.6 (2014-08-28)</h1>
-<div class="section" id="id51">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Prevent tree cycle creation when adding Elements as siblings.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1361948">LP#1361948</a>: crash when deallocating Element siblings without parent.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1354652">LP#1354652</a>: crash when traversing internally loaded documents in XSLT
-extension functions.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id52">
-<h1>3.3.5 (2014-04-18)</h1>
-<div class="section" id="id53">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>HTML cleaning could fail to strip javascript links that mix control
-characters into the link scheme.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id54">
-<h1>3.3.4 (2014-04-03)</h1>
-<div class="section" id="id55">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Source line numbers above 65535 are available on Elements when
-using libxml2 2.9 or later.</li>
-</ul>
-</div>
-<div class="section" id="id56">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.html.fragment_fromstring()</tt> failed for bytes input in Py3.</li>
-</ul>
-</div>
-<div class="section" id="id57">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id58">
-<h1>3.3.3 (2014-03-04)</h1>
-<div class="section" id="id59">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1287118">LP#1287118</a>: Crash when using Element subtypes with <tt class="docutils literal">__slots__</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id60">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The internal classes <tt class="docutils literal">_LogEntry</tt> and <tt class="docutils literal">_Attrib</tt> can no longer be
-subclassed from Python code.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id61">
-<h1>3.3.2 (2014-02-26)</h1>
-<div class="section" id="id62">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The properties <tt class="docutils literal">resolvers</tt> and <tt class="docutils literal">version</tt>, as well as the methods
-<tt class="docutils literal">set_element_class_lookup()</tt> and <tt class="docutils literal">makeelement()</tt>, were lost from
-<tt class="docutils literal">iterparse</tt> objects in 3.3.0.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1222132">LP#1222132</a>: instances of <tt class="docutils literal">XMLSchema</tt>, <tt class="docutils literal">Schematron</tt> and <tt class="docutils literal">RelaxNG</tt>
-did not clear their local <tt class="docutils literal">error_log</tt> before running a validation.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1238500">LP#1238500</a>: lxml.doctestcompare mixed up &quot;expected&quot; and &quot;actual&quot; in
-attribute values.</li>
-<li>Some file I/O tests were failing in MS-Windows due to non-portable temp
-file usage.  Initial patch by Gabi Davar.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/910014">LP#910014</a>: duplicate IDs in a document were not reported by DTD validation.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1185332">LP#1185332</a>: <tt class="docutils literal"><span class="pre">tostring(method=&quot;html&quot;)</span></tt> did not use HTML serialisation
-semantics for trailing tail text.  Initial patch by Sylvain Viollon.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1281139">LP#1281139</a>: <tt class="docutils literal">.attrib</tt> value of Comments lost its mutation methods
-in 3.3.0.  Even though it is empty and immutable, it should still
-provide the same interface as that returned for Elements.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id63">
-<h1>3.3.1 (2014-02-12)</h1>
-<div class="section" id="id64">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id65">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1014290">LP#1014290</a>: HTML documents parsed with <tt class="docutils literal">parser.feed()</tt> failed to find
-elements during tag iteration.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1273709">LP#1273709</a>: Building in PyPy failed due to missing support for
-<tt class="docutils literal">PyUnicode_Compare()</tt> and <tt class="docutils literal"><span class="pre">PyByteArray_*()</span></tt> in PyPy's C-API.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1274413">LP#1274413</a>: Compilation in MSVC failed due to missing &quot;stdint.h&quot; standard
-header file.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1274118">LP#1274118</a>: iterparse() failed to parse BOM prefixed files.</li>
-</ul>
-</div>
-<div class="section" id="id66">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id67">
-<h1>3.3.0 (2014-01-26)</h1>
-<div class="section" id="id68">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id69">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The heuristic that distinguishes file paths from URLs was tightened
-to produce less false negatives.</li>
-</ul>
-</div>
-<div class="section" id="id70">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="beta5-2014-01-18">
-<h1>3.3.0beta5 (2014-01-18)</h1>
-<div class="section" id="id71">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The PEP 393 unicode parsing support gained a fallback for wchar strings
-which might still be somewhat common on Windows systems.</li>
-</ul>
-</div>
-<div class="section" id="id72">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Several error handling problems were fixed throughout the code base that
-could previously lead to exceptions being silently swallowed or not
-properly reported.</li>
-<li>The C-API function <tt class="docutils literal">appendChild()</tt> is now deprecated as it does not
-propagate exceptions (its return type is <tt class="docutils literal">void</tt>).  The new function
-<tt class="docutils literal">appendChildToElement()</tt> was added as a safe replacement.</li>
-<li>Passing a string into <tt class="docutils literal">fromstringlist()</tt> raises an exception instead of
-parsing the string character by character.</li>
-</ul>
-</div>
-<div class="section" id="id73">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Document cleanup code was simplified using the new GC features in
-Cython 0.20.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta4-2014-01-12">
-<h1>3.3.0beta4 (2014-01-12)</h1>
-<div class="section" id="id74">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id75">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The (empty) value returned by the <tt class="docutils literal">attrib</tt> property of Entity and Comment
-objects was mutable.</li>
-<li>Element class lookup wasn't available for the new pull parsers or when using
-a custom parser target.</li>
-<li>Setting Element attributes on instantiation with both the <tt class="docutils literal">attrib</tt> argument
-and keyword arguments could modify the mapping passed as <tt class="docutils literal">attrib</tt>.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1266171">LP#1266171</a>: DTDs instantiated from internal/external subsets (i.e. through
-the docinfo property) lost their attribute declarations.</li>
-</ul>
-</div>
-<div class="section" id="id76">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Built with Cython 0.20pre (gitrev 012ae82eb) to prepare support for
-Python 3.4.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta3-2014-01-02">
-<h1>3.3.0beta3 (2014-01-02)</h1>
-<div class="section" id="id77">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Unicode string parsing was optimised for Python 3.3 (PEP 393).</li>
-</ul>
-</div>
-<div class="section" id="id78">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>HTML parsing of Unicode strings could misdecode the input on some platforms.</li>
-<li>Crash in xmlfile() when closing open elements out of order in an error case.</li>
-</ul>
-</div>
-<div class="section" id="id79">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="beta2-2013-12-20">
-<h1>3.3.0beta2 (2013-12-20)</h1>
-<div class="section" id="id80">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">iterparse()</tt> supports the <tt class="docutils literal">recover</tt> option.</li>
-</ul>
-</div>
-<div class="section" id="id81">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in <tt class="docutils literal">iterparse()</tt> for HTML parsing.</li>
-<li>Crash in target parsing with attributes.</li>
-</ul>
-</div>
-<div class="section" id="id82">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The safety check in the read-only tree implementation (e.g. used by
-<tt class="docutils literal">PythonElementClassLookup</tt>) raises a more appropriate <tt class="docutils literal">ReferenceError</tt>
-for illegal access after tree disposal instead of an <tt class="docutils literal">AssertionError</tt>.
-This should only impact test code that specifically checks the original
-behaviour.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta1-2013-12-12">
-<h1>3.3.0beta1 (2013-12-12)</h1>
-<div class="section" id="id83">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New option <tt class="docutils literal">handle_failures</tt> in <tt class="docutils literal">make_links_absolute()</tt> and
-<tt class="docutils literal">resolve_base_href()</tt> (lxml.html) that enables ignoring or
-discarding links that fail to parse as URLs.</li>
-<li>New parser classes <tt class="docutils literal">XMLPullParser</tt> and <tt class="docutils literal">HTMLPullParser</tt> for
-incremental parsing, as implemented for ElementTree in Python 3.4.</li>
-<li><tt class="docutils literal">iterparse()</tt> enables recovery mode by default for HTML parsing
-(<tt class="docutils literal">html=True</tt>).</li>
-</ul>
-</div>
-<div class="section" id="id84">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1255132">LP#1255132</a>: crash when trying to run validation over non-Element (e.g.
-comment or PI).</li>
-<li>Error messages in the log and in exception messages that originated
-from libxml2 could accidentally be picked up from preceding warnings
-instead of the actual error.</li>
-<li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify did not accept a dict as
-argument for adding attributes to the element it's building. This
-works as in lxml.builder now.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1228881">LP#1228881</a>: <tt class="docutils literal">repr(XSLTAccessControl)</tt> failed in Python 3.</li>
-<li>Raise <tt class="docutils literal">ValueError</tt> when trying to append an Element to itself or
-to one of its own descendants, instead of running into an infinite
-loop.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1206077">LP#1206077</a>: htmldiff discarded whitespace from the output.</li>
-<li>Compressed plain-text serialisation to file-like objects was broken.</li>
-<li>lxml.html.formfill: Fix textarea form filling.
-The textarea used to be cleared before the new content was set,
-which removed the name attribute.</li>
-</ul>
-</div>
-<div class="section" id="id85">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Some basic API classes use freelists internally for faster
-instantiation.  This can speed up some <tt class="docutils literal">iterparse()</tt> scenarios,
-for example.</li>
-<li><tt class="docutils literal">iterparse()</tt> was rewritten to use the new <tt class="docutils literal">*PullParser</tt>
-classes internally instead of being a parser itself.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id86">
-<h1>3.2.5 (2014-01-02)</h1>
-<div class="section" id="id87">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id88">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in xmlfile() when closing open elements out of order in an error case.</li>
-<li>Crash in target parsing with attributes.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1255132">LP#1255132</a>: crash when trying to run validation over non-Element (e.g.
-comment or PI).</li>
-</ul>
-</div>
-<div class="section" id="id90">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id91">
-<h1>3.2.4 (2013-11-07)</h1>
-<div class="section" id="id92">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id93">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory leak when creating an XPath evaluator in a thread.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1228881">LP#1228881</a>: <tt class="docutils literal">repr(XSLTAccessControl)</tt> failed in Python 3.</li>
-<li>Raise <tt class="docutils literal">ValueError</tt> when trying to append an Element to itself or
-to one of its own descendants.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1206077">LP#1206077</a>: htmldiff discarded whitespace from the output.</li>
-<li>Compressed plain-text serialisation to file-like objects was broken.</li>
-</ul>
-</div>
-<div class="section" id="id96">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id97">
-<h1>3.2.3 (2013-07-28)</h1>
-<div class="section" id="id98">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fix support for Python 2.4 which was lost in 3.2.2.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id99">
-<h1>3.2.2 (2013-07-28)</h1>
-<div class="section" id="id100">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id101">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1185701">LP#1185701</a>: spurious XMLSyntaxError after finishing iterparse().</li>
-<li>Crash in lxml.objectify during xsi annotation.</li>
-</ul>
-</div>
-<div class="section" id="id102">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Return values of user provided element class lookup methods are now
-validated against the type of the XML node they represent to prevent
-API class mismatches.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id103">
-<h1>3.2.1 (2013-05-11)</h1>
-<div class="section" id="id104">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The methods <tt class="docutils literal">apply_templates()</tt> and <tt class="docutils literal">process_children()</tt> of XSLT
-extension elements have gained two new boolean options <tt class="docutils literal">elements_only</tt>
-and <tt class="docutils literal">remove_blank_text</tt> that discard either all strings or whitespace-only
-strings from the result list.</li>
-</ul>
-</div>
-<div class="section" id="id105">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>When moving Elements to another tree, the namespace cleanup mechanism
-no longer drops namespace prefixes from attributes for which it finds
-a default namespace declaration, to prevent them from appearing as
-unnamespaced attributes after serialisation.</li>
-<li>Returning non-type objects from a custom class lookup method could lead
-to a crash.</li>
-<li>Instantiating and using subtypes of Comments and ProcessingInstructions
-crashed.</li>
-</ul>
-</div>
-<div class="section" id="id106">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id107">
-<h1>3.2.0 (2013-04-28)</h1>
-<div class="section" id="id108">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id109">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/690319">LP#690319</a>: Leading whitespace could change the behaviour of the string
-parsing functions in <tt class="docutils literal">lxml.html</tt>.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/599318">LP#599318</a>: The string parsing functions in <tt class="docutils literal">lxml.html</tt> are more robust
-in the face of uncommon HTML content like framesets or missing body tags.
-Patch by Stefan Seelmann.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/712941">LP#712941</a>: I/O errors while trying to access files with paths that contain
-non-ASCII characters could raise <tt class="docutils literal">UnicodeDecodeError</tt> instead of properly
-reporting the <tt class="docutils literal">IOError</tt>.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/673205">LP#673205</a>: Parsing from in-memory strings disabled network access in the
-default parser and made subsequent attempts to parse from a URL fail.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/971754">LP#971754</a>: lxml.html.clean appends 'nofollow' to 'rel' attributes instead
-of overwriting the current value.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/715687">LP#715687</a>: lxml.html.clean no longer discards scripts that are explicitly
-allowed by the user provided whitelist.  Patch by Christine Koppelt.</li>
-</ul>
-</div>
-<div class="section" id="id110">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id111">
-<h1>3.1.2 (2013-04-12)</h1>
-<div class="section" id="id112">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id113">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1136509">LP#1136509</a>: Passing attributes through the namespace-unaware API of
-the sax bridge (i.e. the <tt class="docutils literal">handler.startElement()</tt> method) failed
-with a <tt class="docutils literal">TypeError</tt>.  Patch by Mike Bayer.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1123074">LP#1123074</a>: Fix serialisation error in XSLT output when converting
-the result tree to a Unicode string.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/105">GH#105</a>: Replace illegal usage of <tt class="docutils literal">xmlBufLength()</tt> in libxml2 2.9.0
-by properly exported API function <tt class="docutils literal">xmlBufUse()</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id114">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id115">
-<h1>3.1.1 (2013-03-29)</h1>
-<div class="section" id="id116">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id117">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1160386">LP#1160386</a>: Write access to <tt class="docutils literal">lxml.html.FormElement.fields</tt> raised
-an AttributeError in Py3.</li>
-<li>Illegal memory access during cleanup in incremental xmlfile writer.</li>
-</ul>
-</div>
-<div class="section" id="id118">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The externally useless class <tt class="docutils literal">lxml.etree._BaseParser</tt> was removed
-from the module dict.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id119">
-<h1>3.1.0 (2013-02-10)</h1>
-<div class="section" id="id120">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/89">GH#89</a>: lxml.html.clean allows overriding the set of attributes that it
-considers 'safe'.  Patch by Francis Devereux.</li>
-</ul>
-</div>
-<div class="section" id="id121">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1104370">LP#1104370</a>: <tt class="docutils literal">copy.copy(el.attrib)</tt> raised an exception.  It now returns
-a copy of the attributes as a plain Python dict.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/95">GH#95</a>: When used with namespace prefixes, the  <tt class="docutils literal"><span class="pre">el.find*()</span></tt> methods
-always used the first namespace mapping that was provided for each
-path expression instead of using the one that was actually passed
-in for the current run.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1092521">LP#1092521</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/91">GH#91</a>: Fix undefined C symbol in Python runtimes compiled
-without threading support.  Patch by Ulrich Seidl.</li>
-</ul>
-</div>
-<div class="section" id="id122">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="beta1-2012-12-21">
-<h1>3.1beta1 (2012-12-21)</h1>
-<div class="section" id="id123">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New build-time option <tt class="docutils literal"><span class="pre">--with-unicode-strings</span></tt> for Python 2 that
-makes the API always return Unicode strings for names and text
-instead of byte strings for plain ASCII content.</li>
-<li>New incremental XML file writing API <tt class="docutils literal">etree.xmlfile()</tt>.</li>
-<li>E factory in lxml.objectify is callable to simplify the creation of
-tags with non-identifier names without having to resort to getattr().</li>
-</ul>
-</div>
-<div class="section" id="id124">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>When starting from a non-namespaced element in lxml.objectify, searching
-for a child without explicitly specifying a namespace incorrectly found
-namespaced elements with the requested local name, instead of restricting
-the search to non-namespaced children.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/85">GH#85</a>: Deprecation warnings were fixed for Python 3.x.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/33">GH#33</a>: lxml.html.fromstring() failed to accept bytes input in Py3.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1080792">LP#1080792</a>: Static build of libxml2 2.9.0 failed due to missing file.</li>
-</ul>
-</div>
-<div class="section" id="id125">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The externally useless class <tt class="docutils literal">_ObjectifyElementMakerCaller</tt> was
-removed from the module API of lxml.objectify.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1075622">LP#1075622</a>: lxml.builder is faster for adding text to elements with
-many children.  Patch by Anders Hammarquist.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id126">
-<h1>3.0.2 (2012-12-14)</h1>
-<div class="section" id="id127">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id128">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fix crash during interpreter shutdown by switching to Cython 0.17.3 for building.</li>
-</ul>
-</div>
-<div class="section" id="id129">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id130">
-<h1>3.0.1 (2012-10-14)</h1>
-<div class="section" id="id131">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id132">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1065924">LP#1065924</a>: Element proxies could disappear during garbage collection
-in PyPy without proper cleanup.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/71">GH#71</a>: Failure to work with libxml2 2.6.x.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1065139">LP#1065139</a>: static MacOS-X build failed in Py3.</li>
-</ul>
-</div>
-<div class="section" id="id133">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id134">
-<h1>3.0 (2012-10-08)</h1>
-<div class="section" id="id135">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id136">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>End-of-file handling was incorrect in iterparse() when reading from
-a low-level C file stream and failed in libxml2 2.9.0 due to its
-improved consistency checks.</li>
-</ul>
-</div>
-<div class="section" id="id137">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The build no longer uses Cython by default unless the generated C files
-are missing.  To use Cython, pass the option &quot;--with-cython&quot;.  To ignore
-the fatal build error when Cython is required but not available (e.g. to
-run special setup.py commands that do not actually run a build), pass
-&quot;--without-cython&quot;.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta1-2012-09-26">
-<h1>3.0beta1 (2012-09-26)</h1>
-<div class="section" id="id138">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Python level access to (optional) libxml2 memory debugging features
-to simplify debugging of memory leaks etc.</li>
-</ul>
-</div>
-<div class="section" id="id139">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fix a memory leak in XPath by switching to Cython 0.17.1.</li>
-<li>Some tests were adapted to work with PyPy.</li>
-</ul>
-</div>
-<div class="section" id="id140">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The code was adapted to work with the upcoming libxml2 2.9.0 release.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="alpha2-2012-08-23">
-<h1>3.0alpha2 (2012-08-23)</h1>
-<div class="section" id="id141">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The <tt class="docutils literal">.iter()</tt> method of elements now accepts <tt class="docutils literal">tag</tt> arguments like
-<tt class="docutils literal"><span class="pre">&quot;{*}name&quot;</span></tt> to search for elements with a given local name in any
-namespace. With this addition, all combinations of wildcards now work
-as expected:
-<tt class="docutils literal">&quot;{ns}name&quot;</tt>, <tt class="docutils literal"><span class="pre">&quot;{}name&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{*}name&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{ns}*&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{}*&quot;</span></tt>
-and <tt class="docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt>.  Note that <tt class="docutils literal">&quot;name&quot;</tt> is equivalent to <tt class="docutils literal"><span class="pre">&quot;{}name&quot;</span></tt>,
-but <tt class="docutils literal">&quot;*&quot;</tt> is <tt class="docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt>.
-The same change applies to the <tt class="docutils literal">.getiterator()</tt>, <tt class="docutils literal">.itersiblings()</tt>,
-<tt class="docutils literal">.iterancestors()</tt>, <tt class="docutils literal">.iterdescendants()</tt>, <tt class="docutils literal">.iterchildren()</tt>
-and <tt class="docutils literal">.itertext()</tt> methods;the <tt class="docutils literal">strip_attributes()</tt>,
-<tt class="docutils literal">strip_elements()</tt> and <tt class="docutils literal">strip_tags()</tt> functions as well as the
-<tt class="docutils literal">iterparse()</tt> class.  Patch by Simon Sapin.</li>
-<li>C14N allows specifying the inclusive prefixes to be promoted
-to top-level during exclusive serialisation.</li>
-</ul>
-</div>
-<div class="section" id="id142">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Passing long Unicode strings into the <tt class="docutils literal">feed()</tt> parser interface
-failed to read the entire string.</li>
-</ul>
-</div>
-<div class="section" id="id143">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="alpha1-2012-07-31">
-<h1>3.0alpha1 (2012-07-31)</h1>
-<div class="section" id="id144">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Initial support for building in PyPy (through cpyext).</li>
-<li>DTD objects gained an API that allows read access to their
-declarations.</li>
-<li><tt class="docutils literal">xpathgrep.py</tt> gained support for parsing line-by-line (e.g.
-from grep output) and for surrounding the output with a new root
-tag.</li>
-<li><tt class="docutils literal"><span class="pre">E-factory</span></tt> in <tt class="docutils literal">lxml.builder</tt> accepts subtypes of known data
-types (such as string subtypes) when building elements around them.</li>
-<li>Tree iteration and <tt class="docutils literal">iterparse()</tt> with a selective <tt class="docutils literal">tag</tt>
-argument supports passing a set of tags.  Tree nodes will be
-returned by the iterators if they match any of the tags.</li>
-</ul>
-</div>
-<div class="section" id="id145">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods in <tt class="docutils literal">lxml.objectify</tt> no longer use XPath
-internally, which makes them faster in many cases (especially when
-short circuiting after a single or couple of elements) and fixes
-some behavioural differences compared to <tt class="docutils literal">lxml.etree</tt>.  Note that
-this means that they no longer support arbitrary XPath expressions
-but only the subset that the <tt class="docutils literal">ElementPath</tt> language supports.
-The previous implementation was also redundant with the normal
-XPath support, which can be used as a replacement.</li>
-<li><tt class="docutils literal"><span class="pre">el.find('*')</span></tt> could accidentally return a comment or processing
-instruction that happened to be in the wrong spot.  (Same for the
-other <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods.)</li>
-<li>The error logging is less intrusive and avoids a global setup where
-possible.</li>
-<li>Fixed undefined names in html5lib parser.</li>
-<li><tt class="docutils literal">xpathgrep.py</tt> did not work in Python 3.</li>
-<li><tt class="docutils literal">Element.attrib.update()</tt> did not accept an <tt class="docutils literal">attrib</tt> of
-another Element as parameter.</li>
-<li>For subtypes of <tt class="docutils literal">ElementBase</tt> that make the <tt class="docutils literal">.text</tt> or <tt class="docutils literal">.tail</tt>
-properties immutable (as in objectify, for example), inserting text
-when creating Elements through the E-Factory feature of the class
-constructor would fail with an exception, stating that the text
-cannot be modified.</li>
-</ul>
-</div>
-<div class="section" id="id146">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The code base was overhauled to properly use 'const' where the API
-of libxml2 and libxslt requests it.  This also has an impact on the
-public C-API of lxml itself, as defined in <tt class="docutils literal">etreepublic.pxd</tt>, as
-well as the provided declarations in the <tt class="docutils literal">lxml/includes/</tt> directory.
-Code that uses these declarations may have to be adapted.  On the
-plus side, this fixes several C compiler warnings, also for user
-code, thus making it easier to spot real problems again.</li>
-<li>The functionality of &quot;lxml.cssselect&quot; was moved into a separate PyPI
-package called &quot;cssselect&quot;.  To continue using it, you must install
-that package separately.  The &quot;lxml.cssselect&quot; module is still
-available and provides the same interface, provided the &quot;cssselect&quot;
-package can be imported at runtime.</li>
-<li>Element attributes passed in as an <tt class="docutils literal">attrib</tt> dict or as keyword
-arguments are now sorted by (namespaced) name before being created
-to make their order predictable for serialisation and iteration.
-Note that adding or deleting attributes afterwards does not take
-that order into account, i.e. setting a new attribute appends it
-after the existing ones.</li>
-<li>Several classes that are for internal use only were removed
-from the <tt class="docutils literal">lxml.etree</tt> module dict:
-<tt class="docutils literal">_InputDocument, _ResolverRegistry, _ResolverContext, _BaseContext,
-_ExsltRegExp, _IterparseContext, _TempStore, _ExceptionContext,
-__ContentOnlyElement, _AttribIterator, _NamespaceRegistry,
-_ClassNamespaceRegistry, _FunctionNamespaceRegistry,
-_XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
-_FileReaderContext, _ParserContext, _PythonSaxParserTarget,
-_TargetParserContext, _ReadOnlyProxy, _ReadOnlyPIProxy,
-_ReadOnlyEntityProxy, _ReadOnlyElementProxy, _OpaqueNodeWrapper,
-_OpaqueDocumentWrapper, _ModifyContentOnlyProxy,
-_ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
-_AppendOnlyElementProxy, _SaxParserContext, _FilelikeWriter,
-_ParserSchemaValidationContext, _XPathContext,
-_XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam</tt></li>
-<li>Several internal classes can no longer be inherited from:
-<tt class="docutils literal">_InputDocument, _ResolverRegistry, _ExsltRegExp, _ElementUnicodeResult,
-_IterparseContext, _TempStore, _AttribIterator, _ClassNamespaceRegistry,
-_XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
-_FileReaderContext, _PythonSaxParserTarget, _TargetParserContext,
-_ReadOnlyPIProxy, _ReadOnlyEntityProxy, _OpaqueDocumentWrapper,
-_ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
-_AppendOnlyElementProxy, _FilelikeWriter, _ParserSchemaValidationContext,
-_XPathContext, _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam,
-_XSLTResultTree, _XSLTProcessingInstruction</tt></li>
-</ul>
-</div>
-</div>
-<div class="section" id="id147">
-<h1>2.3.6 (2012-09-28)</h1>
-<div class="section" id="id148">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id149">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Passing long Unicode strings into the <tt class="docutils literal">feed()</tt> parser interface
-failed to read the entire string.</li>
-</ul>
-</div>
-<div class="section" id="id150">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id151">
-<h1>2.3.5 (2012-07-31)</h1>
-<div class="section" id="id152">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id153">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when merging text nodes in <tt class="docutils literal">element.remove()</tt>.</li>
-<li>Crash in sax/target parser when reporting empty doctype.</li>
-</ul>
-</div>
-<div class="section" id="id154">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id155">
-<h1>2.3.4 (2012-03-26)</h1>
-<div class="section" id="id156">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id157">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when building an nsmap (Element property) with empty
-namespace URIs.</li>
-<li>Crash due to race condition when errors (or user messages) occur
-during threaded XSLT processing.</li>
-<li>XSLT stylesheet compilation could ignore compilation errors.</li>
-</ul>
-</div>
-<div class="section" id="id158">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id159">
-<h1>2.3.3 (2012-01-04)</h1>
-<div class="section" id="id160">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.html.tostring()</tt> gained new serialisation options
-<tt class="docutils literal">with_tail</tt> and <tt class="docutils literal">doctype</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id161">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fixed a crash when using <tt class="docutils literal">iterparse()</tt> for HTML parsing and
-requesting start events.</li>
-<li>Fixed parsing of more selectors in cssselect.  Whitespace before
-pseudo-elements and pseudo-classes is significant as it is a
-descendant combinator.
-&quot;E :pseudo&quot; should parse the same as &quot;E *:pseudo&quot;, not &quot;E:pseudo&quot;.
-Patch by Simon Sapin.</li>
-<li>lxml.html.diff no longer raises an exception when hitting
-'img' tags without 'src' attribute.</li>
-</ul>
-</div>
-<div class="section" id="id162">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id163">
-<h1>2.3.2 (2011-11-11)</h1>
-<div class="section" id="id164">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.objectify.deannotate()</tt> has a new boolean option
-<tt class="docutils literal">cleanup_namespaces</tt> to remove the objectify namespace
-declarations (and generally clean up the namespace declarations)
-after removing the type annotations.</li>
-<li><tt class="docutils literal">lxml.objectify</tt> gained its own <tt class="docutils literal">SubElement()</tt> function as a
-copy of <tt class="docutils literal">etree.SubElement</tt> to avoid an otherwise redundant import
-of <tt class="docutils literal">lxml.etree</tt> on the user side.</li>
-</ul>
-</div>
-<div class="section" id="id165">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fixed the &quot;descendant&quot; bug in cssselect a second time (after a first
-fix in lxml 2.3.1).  The previous change resulted in a serious
-performance regression for the XPath based evaluation of the
-translated expression.  Note that this breaks the usage of some of
-the generated XPath expressions as XSLT location paths that
-previously worked in 2.3.1.</li>
-<li>Fixed parsing of some selectors in cssselect. Whitespace after combinators
-&quot;&gt;&quot;, &quot;+&quot; and &quot;~&quot; is now correctly ignored. Previously it was parsed as
-a descendant combinator. For example, &quot;div&gt; .foo&quot; was parsed the same as
-&quot;div&gt;* .foo&quot; instead of &quot;div&gt;.foo&quot;. Patch by Simon Sapin.</li>
-</ul>
-</div>
-<div class="section" id="id166">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id167">
-<h1>2.3.1 (2011-09-25)</h1>
-<div class="section" id="id168">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New option <tt class="docutils literal">kill_tags</tt> in <tt class="docutils literal">lxml.html.clean</tt> to remove specific
-tags and their content (i.e. their whole subtree).</li>
-<li><tt class="docutils literal">pi.get()</tt> and <tt class="docutils literal">pi.attrib</tt> on processing instructions to parse
-pseudo-attributes from the text content of processing instructions.</li>
-<li><tt class="docutils literal">lxml.get_include()</tt> returns a list of include paths that can be
-used to compile external C code against lxml.etree.  This is
-specifically required for statically linked lxml builds when code
-needs to compile against the exact same header file versions as lxml
-itself.</li>
-<li><tt class="docutils literal">Resolver.resolve_file()</tt> takes an additional option
-<tt class="docutils literal">close_file</tt> that configures if the file(-like) object will be
-closed after reading or not.  By default, the file will be closed,
-as the user is not expected to keep a reference to it.</li>
-</ul>
-</div>
-<div class="section" id="id169">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>HTML cleaning didn't remove 'data:' links.</li>
-<li>The html5lib parser integration now uses the 'official'
-implementation in html5lib itself, which makes it work with newer
-releases of the library.</li>
-<li>In <tt class="docutils literal">lxml.sax</tt>, <tt class="docutils literal">endElementNS()</tt> could incorrectly reject a plain
-tag name when the corresponding start event inferred the same plain
-tag name to be in the default namespace.</li>
-<li>When an open file-like object is passed into <tt class="docutils literal">parse()</tt> or
-<tt class="docutils literal">iterparse()</tt>, the parser will no longer close it after use.  This
-reverts a change in lxml 2.3 where all files would be closed.  It is
-the users responsibility to properly close the file(-like) object,
-also in error cases.</li>
-<li>Assertion error in lxml.html.cleaner when discarding top-level elements.</li>
-<li>In lxml.cssselect, use the xpath 'A//B' (short for
-'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for
-the css descendant selector ('A B').  This makes a few edge cases
-like <tt class="docutils literal">&quot;div <span class="pre">*:last-child&quot;</span></tt> consistent with the selector behavior in
-WebKit and Firefox, and makes more css expressions valid location
-paths (for use in xsl:template match).</li>
-<li>In lxml.html, non-selected <tt class="docutils literal">&lt;option&gt;</tt> tags no longer show up in the
-collected form values.</li>
-<li>Adding/removing <tt class="docutils literal">&lt;option&gt;</tt> values to/from a multiple select form
-field properly selects them and unselects them.</li>
-</ul>
-</div>
-<div class="section" id="id170">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Static builds can specify the download directory with the
-<tt class="docutils literal"><span class="pre">--download-dir</span></tt> option.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id171">
-<h1>2.3 (2011-02-06)</h1>
-<div class="section" id="id172">
-<h2>Features added</h2>
-<ul class="simple">
-<li>When looking for children, <tt class="docutils literal">lxml.objectify</tt> takes '{}tag' as
-meaning an empty namespace, as opposed to the parent namespace.</li>
-</ul>
-</div>
-<div class="section" id="id173">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>When finished reading from a file-like object, the parser
-immediately calls its <tt class="docutils literal">.close()</tt> method.</li>
-<li>When finished parsing, <tt class="docutils literal">iterparse()</tt> immediately closes the input
-file.</li>
-<li>Work-around for libxml2 bug that can leave the HTML parser in a
-non-functional state after parsing a severely broken document (fixed
-in libxml2 2.7.8).</li>
-<li><tt class="docutils literal">marque</tt> tag in HTML cleanup code is correctly named <tt class="docutils literal">marquee</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id174">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Some public functions in the Cython-level C-API have more explicit
-return types.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta1-2010-09-06">
-<h1>2.3beta1 (2010-09-06)</h1>
-<div class="section" id="id175">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id176">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in newer libxml2 versions when moving elements between
-documents that had attributes on replaced XInclude nodes.</li>
-<li><tt class="docutils literal">XMLID()</tt> function was missing the optional <tt class="docutils literal">parser</tt> and
-<tt class="docutils literal">base_url</tt> parameters.</li>
-<li>Searching for wildcard tags in <tt class="docutils literal">iterparse()</tt> was broken in Py3.</li>
-<li><tt class="docutils literal">lxml.html.open_in_browser()</tt> didn't work in Python 3 due to the
-use of os.tempnam.  It now takes an optional 'encoding' parameter.</li>
-</ul>
-</div>
-<div class="section" id="id177">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="alpha2-2010-07-24">
-<h1>2.3alpha2 (2010-07-24)</h1>
-<div class="section" id="id178">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id179">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in XSLT when generating text-only result documents with a
-stylesheet created in a different thread.</li>
-</ul>
-</div>
-<div class="section" id="id180">
-<h2>Other changes</h2>
-<ul class="simple">
-<li><tt class="docutils literal">repr()</tt> of Element objects shows the hex ID with leading 0x
-(following ElementTree 1.3).</li>
-</ul>
-</div>
-</div>
-<div class="section" id="alpha1-2010-06-19">
-<h1>2.3alpha1 (2010-06-19)</h1>
-<div class="section" id="id181">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Keyword argument <tt class="docutils literal">namespaces</tt> in <tt class="docutils literal">lxml.cssselect.CSSSelector()</tt>
-to pass a prefix-to-namespace mapping for the selector.</li>
-<li>New function <tt class="docutils literal">lxml.etree.register_namespace(prefix, uri)</tt> that
-globally registers a namespace prefix for a namespace that newly
-created Elements in that namespace will use automatically.  Follows
-ElementTree 1.3.</li>
-<li>Support 'unicode' string name as encoding parameter in
-<tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
-<li>Support 'c14n' serialisation method in <tt class="docutils literal">ElementTree.write()</tt> and
-<tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
-<li>The ElementPath expression syntax (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) was extended to
-match the upcoming ElementTree 1.3 that will ship in the standard
-library of Python 3.2/2.7.  This includes extended support for
-predicates as well as namespace prefixes (as known from XPath).</li>
-<li>During regular XPath evaluation, various ESXLT functions are
-available within their namespace when using libxslt 1.1.26 or later.</li>
-<li>Support passing a readily configured logger instance into
-<tt class="docutils literal">PyErrorLog</tt>, instead of a logger name.</li>
-<li>On serialisation, the new <tt class="docutils literal">doctype</tt> parameter can be used to
-override the DOCTYPE (internal subset) of the document.</li>
-<li>New parameter <tt class="docutils literal">output_parent</tt> to <tt class="docutils literal">XSLTExtension.apply_templates()</tt>
-to append the resulting content directly to an output element.</li>
-<li><tt class="docutils literal">XSLTExtension.process_children()</tt> to process the content of the
-XSLT extension element itself.</li>
-<li>ISO-Schematron support based on the de-facto Schematron reference
-'skeleton implementation'.</li>
-<li>XSLT objects now take XPath object as <tt class="docutils literal">__call__</tt> stylesheet
-parameters.</li>
-<li>Enable path caching in ElementPath (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) to avoid parsing
-overhead.</li>
-<li>Setting the value of a namespaced attribute always uses a prefixed
-namespace instead of the default namespace even if both declare the
-same namespace URI.  This avoids serialisation problems when an
-attribute from a default namespace is set on an element from a
-different namespace.</li>
-<li>XSLT extension elements: support for XSLT context nodes other than
-elements: document root, comments, processing instructions.</li>
-<li>Support for strings (in addition to Elements) in node-sets returned
-by extension functions.</li>
-<li>Forms that lack an <tt class="docutils literal">action</tt> attribute default to the base URL of
-the document on submit.</li>
-<li>XPath attribute result strings have an <tt class="docutils literal">attrname</tt> property.</li>
-<li>Namespace URIs get validated against RFC 3986 at the API level
-(required by the XML namespace specification).</li>
-<li>Target parsers show their target object in the <tt class="docutils literal">.target</tt> property
-(compatible with ElementTree).</li>
-</ul>
-</div>
-<div class="section" id="id182">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>API is hardened against invalid proxy instances to prevent crashes
-due to incorrectly instantiated Element instances.</li>
-<li>Prevent crash when instantiating <tt class="docutils literal">CommentBase</tt> and friends.</li>
-<li>Export ElementTree compatible XML parser class as
-<tt class="docutils literal">XMLTreeBuilder</tt>, as it is called in ET 1.2.</li>
-<li>ObjectifiedDataElements in lxml.objectify were not hashable.  They
-now use the hash value of the underlying Python value (string,
-number, etc.) to which they compare equal.</li>
-<li>Parsing broken fragments in lxml.html could fail if the fragment
-contained an orphaned closing '&lt;/div&gt;' tag.</li>
-<li>Using XSLT extension elements around the root of the output document
-crashed.</li>
-<li><tt class="docutils literal">lxml.cssselect</tt> did not distinguish between <tt class="docutils literal"><span class="pre">x[attr=&quot;val&quot;]</span></tt> and
-<tt class="docutils literal">x <span class="pre">[attr=&quot;val&quot;]</span></tt> (with a space).  The latter now matches the
-attribute independent of the element.</li>
-<li>Rewriting multiple links inside of HTML text content could end up
-replacing unrelated content as replacements could impact the
-reported position of subsequent matches.  Modifications are now
-simplified by letting the <tt class="docutils literal">iterlinks()</tt> generator in <tt class="docutils literal">lxml.html</tt>
-return links in reversed order if they appear inside the same text
-node.  Thus, replacements and link-internal modifications no longer
-change the position of links reported afterwards.</li>
-<li>The <tt class="docutils literal">.value</tt> attribute of <tt class="docutils literal">textarea</tt> elements in lxml.html did
-not represent the complete raw value (including child tags etc.). It
-now serialises the complete content on read and replaces the
-complete content by a string on write.</li>
-<li>Target parser didn't call <tt class="docutils literal">.close()</tt> on the target object if
-parsing failed.  Now it is guaranteed that <tt class="docutils literal">.close()</tt> will be
-called after parsing, regardless of the outcome.</li>
-</ul>
-</div>
-<div class="section" id="id183">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Official support for Python 3.1.2 and later.</li>
-<li>Static MS Windows builds can now download their dependencies
-themselves.</li>
-<li><tt class="docutils literal">Element.attrib</tt> no longer uses a cyclic reference back to its
-Element object.  It therefore no longer requires the garbage
-collector to clean up.</li>
-<li>Static builds include libiconv, in addition to libxml2 and libxslt.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id184">
-<h1>2.2.8 (2010-09-02)</h1>
-<div class="section" id="id185">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in newer libxml2 versions when moving elements between
-documents that had attributes on replaced XInclude nodes.</li>
-<li>Import fix for urljoin in Python 3.1+.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id186">
-<h1>2.2.7 (2010-07-24)</h1>
-<div class="section" id="id187">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in XSLT when generating text-only result documents with a
-stylesheet created in a different thread.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id188">
-<h1>2.2.6 (2010-03-02)</h1>
-<div class="section" id="id189">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fixed several Python 3 regressions by building with Cython 0.11.3.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id190">
-<h1>2.2.5 (2010-02-28)</h1>
-<div class="section" id="id191">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support for running XSLT extension elements on the input root node
-(e.g. in a template matching on &quot;/&quot;).</li>
-</ul>
-</div>
-<div class="section" id="id192">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in XPath evaluation when reading smart strings from a document
-other than the original context document.</li>
-<li>Support recent versions of html5lib by not requiring its
-<tt class="docutils literal">XHTMLParser</tt> in <tt class="docutils literal">htmlparser.py</tt> anymore.</li>
-<li>Manually instantiating the custom element classes in
-<tt class="docutils literal">lxml.objectify</tt> could crash.</li>
-<li>Invalid XML text characters were not rejected by the API when they
-appeared in unicode strings directly after non-ASCII characters.</li>
-<li>lxml.html.open_http_urllib() did not work in Python 3.</li>
-<li>The functions <tt class="docutils literal">strip_tags()</tt> and <tt class="docutils literal">strip_elements()</tt> in
-<tt class="docutils literal">lxml.etree</tt> did not remove all occurrences of a tag in all cases.</li>
-<li>Crash in XSLT extension elements when the XSLT context node is not
-an element.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id193">
-<h1>2.2.4 (2009-11-11)</h1>
-<div class="section" id="id194">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Static build of libxml2/libxslt was broken.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id195">
-<h1>2.2.3 (2009-10-30)</h1>
-<div class="section" id="id196">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id197">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The <tt class="docutils literal">resolve_entities</tt> option did not work in the incremental feed
-parser.</li>
-<li>Looking up and deleting attributes without a namespace could hit a
-namespaced attribute of the same name instead.</li>
-<li>Late errors during calls to <tt class="docutils literal">SubElement()</tt> (e.g. attribute related
-ones) could leave a partially initialised element in the tree.</li>
-<li>Modifying trees that contain parsed entity references could result
-in an infinite loop.</li>
-<li>ObjectifiedElement.__setattr__ created an empty-string child element when the
-attribute value was rejected as a non-unicode/non-ascii string</li>
-<li>Syntax errors in <tt class="docutils literal">lxml.cssselect</tt> could result in misleading error
-messages.</li>
-<li>Invalid syntax in CSS expressions could lead to an infinite loop in
-the parser of <tt class="docutils literal">lxml.cssselect</tt>.</li>
-<li>CSS special character escapes were not properly handled in
-<tt class="docutils literal">lxml.cssselect</tt>.</li>
-<li>CSS Unicode escapes were not properly decoded in <tt class="docutils literal">lxml.cssselect</tt>.</li>
-<li>Select options in HTML forms that had no explicit <tt class="docutils literal">value</tt>
-attribute were not handled correctly.  The HTML standard dictates
-that their value is defined by their text content.  This is now
-supported by lxml.html.</li>
-<li>XPath raised a TypeError when finding CDATA sections.  This is now
-fully supported.</li>
-<li>Calling <tt class="docutils literal">help(lxml.objectify)</tt> didn't work at the prompt.</li>
-<li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify no longer defines the default
-namespaces when annotation is disabled.</li>
-<li>Feed parser failed to honour the 'recover' option on parse errors.</li>
-<li>Diverting the error logging to Python's logging system was broken.</li>
-</ul>
-</div>
-<div class="section" id="id198">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id199">
-<h1>2.2.2 (2009-06-21)</h1>
-<div class="section" id="id200">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New helper functions <tt class="docutils literal">strip_attributes()</tt>, <tt class="docutils literal">strip_elements()</tt>,
-<tt class="docutils literal">strip_tags()</tt> in lxml.etree to remove attributes/subtrees/tags
-from a subtree.</li>
-</ul>
-</div>
-<div class="section" id="id201">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Namespace cleanup on subtree insertions could result in missing
-namespace declarations (and potentially crashes) if the element
-defining a namespace was deleted and the namespace was not used by
-the top element of the inserted subtree but only in deeper subtrees.</li>
-<li>Raising an exception from a parser target callback didn't always
-terminate the parser.</li>
-<li>Only {true, false, 1, 0} are accepted as the lexical representation for
-BoolElement ({True, False, T, F, t, f} not any more), restoring lxml &lt;= 2.0
-behaviour.</li>
-</ul>
-</div>
-<div class="section" id="id202">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id203">
-<h1>2.2.1 (2009-06-02)</h1>
-<div class="section" id="id204">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Injecting default attributes into a document during XML Schema
-validation (also at parse time).</li>
-<li>Pass <tt class="docutils literal">huge_tree</tt> parser option to disable parser security
-restrictions imposed by libxml2 2.7.</li>
-</ul>
-</div>
-<div class="section" id="id205">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The script for statically building libxml2 and libxslt didn't work
-in Py3.</li>
-<li><tt class="docutils literal">XMLSchema()</tt> also passes invalid schema documents on to libxml2
-for parsing (which could lead to a crash before release 2.6.24).</li>
-</ul>
-</div>
-<div class="section" id="id206">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id207">
-<h1>2.2 (2009-03-21)</h1>
-<div class="section" id="id208">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support for <tt class="docutils literal">standalone</tt> flag in XML declaration through
-<tt class="docutils literal">tree.docinfo.standalone</tt> and by passing <tt class="docutils literal">standalone=True/False</tt>
-on serialisation.</li>
-</ul>
-</div>
-<div class="section" id="id209">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when parsing an XML Schema with external imports from a
-filename.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta4-2009-02-27">
-<h1>2.2beta4 (2009-02-27)</h1>
-<div class="section" id="id210">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support strings and instantiable Element classes as child arguments
-to the constructor of custom Element classes.</li>
-<li>GZip compression support for serialisation to files and file-like
-objects.</li>
-</ul>
-</div>
-<div class="section" id="id211">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Deep-copying an ElementTree copied neither its sibling PIs and
-comments nor its internal/external DTD subsets.</li>
-<li>Soupparser failed on broken attributes without values.</li>
-<li>Crash in XSLT when overwriting an already defined attribute using
-<tt class="docutils literal">xsl:attribute</tt>.</li>
-<li>Crash bug in exception handling code under Python 3.  This was due
-to a problem in Cython, not lxml itself.</li>
-<li><tt class="docutils literal">lxml.html.FormElement._name()</tt> failed for non top-level forms.</li>
-<li><tt class="docutils literal">TAG</tt> special attribute in constructor of custom Element classes
-was evaluated incorrectly.</li>
-</ul>
-</div>
-<div class="section" id="id212">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Official support for Python 3.0.1.</li>
-<li><tt class="docutils literal">Element.findtext()</tt> now returns an empty string instead of None
-for Elements without text content.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta3-2009-02-17">
-<h1>2.2beta3 (2009-02-17)</h1>
-<div class="section" id="id213">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">XSLT.strparam()</tt> class method to wrap quoted string parameters
-that require escaping.</li>
-</ul>
-</div>
-<div class="section" id="id214">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory leak in XPath evaluators.</li>
-<li>Crash when parsing indented XML in one thread and merging it with
-other documents parsed in another thread.</li>
-<li>Setting the <tt class="docutils literal">base</tt> attribute in <tt class="docutils literal">lxml.objectify</tt> from a unicode
-string failed.</li>
-<li>Fixes following changes in Python 3.0.1.</li>
-<li>Minor fixes for Python 3.</li>
-</ul>
-</div>
-<div class="section" id="id215">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The global error log (which is copied into the exception log) is now
-local to a thread, which fixes some race conditions.</li>
-<li>More robust error handling on serialisation.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta2-2009-01-25">
-<h1>2.2beta2 (2009-01-25)</h1>
-<div class="section" id="id216">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Potential memory leak on exception handling.  This was due to a
-problem in Cython, not lxml itself.</li>
-<li><tt class="docutils literal">iter_links</tt> (and related link-rewriting functions) in
-<tt class="docutils literal">lxml.html</tt> would interpret CSS like <tt class="docutils literal"><span class="pre">url(&quot;link&quot;)</span></tt> incorrectly
-(treating the quotation marks as part of the link).</li>
-<li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id217">
-<h1>2.1.5 (2009-01-06)</h1>
-<div class="section" id="id218">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Potential memory leak on exception handling.  This was due to a
-problem in Cython, not lxml itself.</li>
-<li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta1-2008-12-12">
-<h1>2.2beta1 (2008-12-12)</h1>
-<div class="section" id="id219">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Allow <tt class="docutils literal">lxml.html.diff.htmldiff</tt> to accept Element objects, not
-just HTML strings.</li>
-</ul>
-</div>
-<div class="section" id="id220">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when using an XPath evaluator in multiple threads.</li>
-<li>Fixed missing whitespace before <tt class="docutils literal"><span class="pre">Link:...</span></tt> in <tt class="docutils literal">lxml.html.diff</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id221">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Export <tt class="docutils literal">lxml.html.parse</tt>.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id222">
-<h1>2.1.4 (2008-12-12)</h1>
-<div class="section" id="id223">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when using an XPath evaluator in multiple threads.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id224">
-<h1>2.0.11 (2008-12-12)</h1>
-<div class="section" id="id225">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when using an XPath evaluator in multiple threads.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="alpha1-2008-11-23">
-<h1>2.2alpha1 (2008-11-23)</h1>
-<div class="section" id="id226">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support for XSLT result tree fragments in XPath/XSLT extension
-functions.</li>
-<li>QName objects have new properties <tt class="docutils literal">namespace</tt> and <tt class="docutils literal">localname</tt>.</li>
-<li>New options for exclusive C14N and C14N without comments.</li>
-<li>Instantiating a custom Element classes creates a new Element.</li>
-</ul>
-</div>
-<div class="section" id="id227">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>XSLT didn't inherit the parse options of the input document.</li>
-<li>0-bytes could slip through the API when used inside of Unicode
-strings.</li>
-<li>With <tt class="docutils literal">lxml.html.clean.autolink</tt>, links with balanced parenthesis,
-that end in a parenthesis, will be linked in their entirety (typical
-with Wikipedia links).</li>
-</ul>
-</div>
-<div class="section" id="id228">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id229">
-<h1>2.1.3 (2008-11-17)</h1>
-<div class="section" id="id230">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id231">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Ref-count leaks when lxml enters a try-except statement while an
-outside exception lives in sys.exc_*(). This was due to a problem in
-Cython, not lxml itself.</li>
-<li>Parser Unicode decoding errors could get swallowed by other
-exceptions.</li>
-<li>Name/import errors in some Python modules.</li>
-<li>Internal DTD subsets that did not specify a system or public ID were
-not serialised and did not appear in the docinfo property of
-ElementTrees.</li>
-<li>Fix a pre-Py3k warning when parsing from a gzip file in Py2.6.</li>
-<li>Test suite fixes for libxml2 2.7.</li>
-<li>Resolver.resolve_string() did not work for non-ASCII byte strings.</li>
-<li>Resolver.resolve_file() was broken.</li>
-<li>Overriding the parser encoding didn't work for many encodings.</li>
-</ul>
-</div>
-<div class="section" id="id232">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id233">
-<h1>2.0.10 (2008-11-17)</h1>
-<div class="section" id="id234">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Ref-count leaks when lxml enters a try-except statement while an
-outside exception lives in sys.exc_*(). This was due to a problem in
-Cython, not lxml itself.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id235">
-<h1>2.1.2 (2008-09-05)</h1>
-<div class="section" id="id236">
-<h2>Features added</h2>
-<ul class="simple">
-<li>lxml.etree now tries to find the absolute path name of files when
-parsing from a file-like object.  This helps custom resolvers when
-resolving relative URLs, as lixbml2 can prepend them with the path
-of the source document.</li>
-</ul>
-</div>
-<div class="section" id="id237">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory problem when passing documents between threads.</li>
-<li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
-exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
-</ul>
-</div>
-<div class="section" id="id238">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id239">
-<h1>2.0.9 (2008-09-05)</h1>
-<div class="section" id="id240">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory problem when passing documents between threads.</li>
-<li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
-exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id241">
-<h1>2.1.1 (2008-07-24)</h1>
-<div class="section" id="id242">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id243">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when parsing XSLT stylesheets in a thread and using them in
-another.</li>
-<li>Encoding problem when including text with ElementInclude under
-Python 3.</li>
-</ul>
-</div>
-<div class="section" id="id244">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id245">
-<h1>2.0.8 (2008-07-24)</h1>
-<div class="section" id="id246">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
-with whitespace in URL attributes.</li>
-</ul>
-</div>
-<div class="section" id="id247">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when parsing XSLT stylesheets in a thread and using them in
-another.</li>
-<li>CSS selector parser dropped remaining expression after a function
-with parameters.</li>
-</ul>
-</div>
-<div class="section" id="id248">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id249">
-<h1>2.1 (2008-07-09)</h1>
-<div class="section" id="id250">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Smart strings can be switched off in XPath (<tt class="docutils literal">smart_strings</tt>
-keyword option).</li>
-<li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
-with whitespace in URL attributes.</li>
-</ul>
-</div>
-<div class="section" id="id251">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Custom resolvers were not used for XMLSchema includes/imports and
-XInclude processing.</li>
-<li>CSS selector parser dropped remaining expression after a function
-with parameters.</li>
-</ul>
-</div>
-<div class="section" id="id252">
-<h2>Other changes</h2>
-<ul class="simple">
-<li><tt class="docutils literal">objectify.enableRecursiveStr()</tt> was removed, use
-<tt class="docutils literal">objectify.enable_recursive_str()</tt> instead</li>
-<li>Speed-up when running XSLTs on documents from other threads</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id253">
-<h1>2.0.7 (2008-06-20)</h1>
-<div class="section" id="id254">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
-</ul>
-</div>
-<div class="section" id="id255">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Descending dot-separated classes in CSS selectors were not resolved
-correctly.</li>
-<li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
-<li>Potential threading problem in XInclude.</li>
-<li>Crash in Element class lookup classes when the __init__() method of
-the super class is not called from Python subclasses.</li>
-</ul>
-</div>
-<div class="section" id="id256">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Non-ASCII characters in attribute values are no longer escaped on
-serialisation.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta3-2008-06-19">
-<h1>2.1beta3 (2008-06-19)</h1>
-<div class="section" id="id257">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Major overhaul of <tt class="docutils literal">tools/xpathgrep.py</tt> script.</li>
-<li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
-<li>Support for parsing from file-like objects that return unicode
-strings.</li>
-<li>New function <tt class="docutils literal">etree.cleanup_namespaces(el)</tt> that removes unused
-namespace declarations from a (sub)tree (experimental).</li>
-<li>XSLT results support the buffer protocol in Python 3.</li>
-<li>Polymorphic functions in <tt class="docutils literal">lxml.html</tt> that accept either a tree or
-a parsable string will return either a UTF-8 encoded byte string, a
-unicode string or a tree, based on the type of the input.
-Previously, the result was always a byte string or a tree.</li>
-<li>Support for Python 2.6 and 3.0 beta.</li>
-<li>File name handling now uses a heuristic to convert between byte
-strings (usually filenames) and unicode strings (usually URLs).</li>
-<li>Parsing from a plain file object frees the GIL under Python 2.x.</li>
-<li>Running <tt class="docutils literal">iterparse()</tt> on a plain file (or filename) frees the GIL
-on reading under Python 2.x.</li>
-<li>Conversion functions <tt class="docutils literal">html_to_xhtml()</tt> and <tt class="docutils literal">xhtml_to_html()</tt> in
-lxml.html (experimental).</li>
-<li>Most features in lxml.html work for XHTML namespaced tag names
-(experimental).</li>
-</ul>
-</div>
-<div class="section" id="id258">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
-<li>Crash in Element class lookup classes when the __init__() method of
-the super class is not called from Python subclasses.</li>
-<li>A number of problems related to unicode/byte string conversion of
-filenames and error messages were fixed.</li>
-<li>Building on MacOS-X now passes the &quot;flat_namespace&quot; option to the C
-compiler, which reportedly prevents build quirks and crashes on this
-platform.</li>
-<li>Windows build was broken.</li>
-<li>Rare crash when serialising to a file object with certain encodings.</li>
-</ul>
-</div>
-<div class="section" id="id259">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Non-ASCII characters in attribute values are no longer escaped on
-serialisation.</li>
-<li>Passing non-ASCII byte strings or invalid unicode strings as .tag,
-namespaces, etc. will result in a ValueError instead of an
-AssertionError (just like the tag well-formedness check).</li>
-<li>Up to several times faster attribute access (i.e. tree traversal) in
-lxml.objectify.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id260">
-<h1>2.0.6 (2008-05-31)</h1>
-<div class="section" id="id261">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id262">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Incorrect evaluation of <tt class="docutils literal"><span class="pre">el.find(&quot;tag[child]&quot;)</span></tt>.</li>
-<li>Windows build was broken.</li>
-<li>Moving a subtree from a document created in one thread into a
-document of another thread could crash when the rest of the source
-document is deleted while the subtree is still in use.</li>
-<li>Rare crash when serialising to a file object with certain encodings.</li>
-</ul>
-</div>
-<div class="section" id="id263">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>lxml should now build without problems on MacOS-X.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta2-2008-05-02">
-<h1>2.1beta2 (2008-05-02)</h1>
-<div class="section" id="id264">
-<h2>Features added</h2>
-<ul class="simple">
-<li>All parse functions in lxml.html take a <tt class="docutils literal">parser</tt> keyword argument.</li>
-<li>lxml.html has a new parser class <tt class="docutils literal">XHTMLParser</tt> and a module
-attribute <tt class="docutils literal">xhtml_parser</tt> that provide XML parsers that are
-pre-configured for the lxml.html package.</li>
-</ul>
-</div>
-<div class="section" id="id265">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Moving a subtree from a document created in one thread into a
-document of another thread could crash when the rest of the source
-document is deleted while the subtree is still in use.</li>
-<li>Passing an nsmap when creating an Element will no longer strip
-redundantly defined namespace URIs.  This prevented the definition
-of more than one prefix for a namespace on the same Element.</li>
-</ul>
-</div>
-<div class="section" id="id266">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>If the default namespace is redundantly defined with a prefix on the
-same Element, the prefix will now be preferred for subelements and
-attributes.  This allows users to work around a problem in libxml2
-where attributes from the default namespace could serialise without
-a prefix even when they appear on an Element with a different
-namespace (i.e. they would end up in the wrong namespace).</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id267">
-<h1>2.0.5 (2008-05-01)</h1>
-<div class="section" id="id268">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id269">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Resolving to a filename in custom resolvers didn't work.</li>
-<li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
-let some XSLT errors pass silently.</li>
-<li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
-</ul>
-</div>
-<div class="section" id="id270">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="beta1-2008-04-15">
-<h1>2.1beta1 (2008-04-15)</h1>
-<div class="section" id="id271">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Error logging in Schematron (requires libxml2 2.6.32 or later).</li>
-<li>Parser option <tt class="docutils literal">strip_cdata</tt> for normalising or keeping CDATA
-sections.  Defaults to <tt class="docutils literal">True</tt> as before, thus replacing CDATA
-sections by their text content.</li>
-<li><tt class="docutils literal">CDATA()</tt> factory to wrap string content as CDATA section.</li>
-</ul>
-</div>
-<div class="section" id="id272">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Resolving to a filename in custom resolvers didn't work.</li>
-<li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
-let some XSLT errors pass silently.</li>
-<li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
-<li>lxml.etree accepted non well-formed namespace prefix names.</li>
-</ul>
-</div>
-<div class="section" id="id273">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Major cleanup in internal <tt class="docutils literal">moveNodeToDocument()</tt> function, which
-takes care of namespace cleanup when moving elements between
-different namespace contexts.</li>
-<li>New Elements created through the <tt class="docutils literal">makeelement()</tt> method of an HTML
-parser or through lxml.html now end up in a new HTML document
-(doctype HTML 4.01 Transitional) instead of a generic XML document.
-This mostly impacts the serialisation and the availability of a DTD
-context.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id274">
-<h1>2.0.4 (2008-04-13)</h1>
-<div class="section" id="id275">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id276">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Hanging thread in conjunction with GTK threading.</li>
-<li>Crash bug in iterparse when moving elements into other documents.</li>
-<li>HTML elements' <tt class="docutils literal">.cssselect()</tt> method was broken.</li>
-<li><tt class="docutils literal"><span class="pre">ElementTree.find*()</span></tt> didn't accept QName objects.</li>
-</ul>
-</div>
-<div class="section" id="id277">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="alpha1-2008-03-27">
-<h1>2.1alpha1 (2008-03-27)</h1>
-<div class="section" id="id278">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New event types 'comment' and 'pi' in <tt class="docutils literal">iterparse()</tt>.</li>
-<li><tt class="docutils literal">XSLTAccessControl</tt> instances have a property <tt class="docutils literal">options</tt> that
-returns a dict of access configuration options.</li>
-<li>Constant instances <tt class="docutils literal">DENY_ALL</tt> and <tt class="docutils literal">DENY_WRITE</tt> on
-<tt class="docutils literal">XSLTAccessControl</tt> class.</li>
-<li>Extension elements for XSLT (experimental!)</li>
-<li><tt class="docutils literal">Element.base</tt> property returns the xml:base or HTML base URL of
-an Element.</li>
-<li><tt class="docutils literal">docinfo.URL</tt> property is writable.</li>
-</ul>
-</div>
-<div class="section" id="id279">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Default encoding for plain text serialisation was different from
-that of XML serialisation (UTF-8 instead of ASCII).</li>
-</ul>
-</div>
-<div class="section" id="id280">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Minor API speed-ups.</li>
-<li>The benchmark suite now uses tail text in the trees, which makes the
-absolute numbers incomparable to previous results.</li>
-<li>Generating the HTML documentation now requires <a class="reference external" href="http://pygments.org/">Pygments</a>, which is
-used to enable syntax highlighting for the doctest examples.</li>
-</ul>
-<p>Most long-time deprecated functions and methods were removed:</p>
-<ul>
-<li><p class="first"><tt class="docutils literal">etree.clearErrorLog()</tt>, use <tt class="docutils literal">etree.clear_error_log()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">etree.useGlobalPythonLog()</tt>, use
-<tt class="docutils literal">etree.use_global_python_log()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">etree.ElementClassLookup.setFallback()</tt>, use
-<tt class="docutils literal">etree.ElementClassLookup.set_fallback()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">etree.getDefaultParser()</tt>, use <tt class="docutils literal">etree.get_default_parser()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">etree.setDefaultParser()</tt>, use <tt class="docutils literal">etree.set_default_parser()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">etree.setElementClassLookup()</tt>, use
-<tt class="docutils literal">etree.set_element_class_lookup()</tt></p>
-<p>Note that <tt class="docutils literal">parser.setElementClassLookup()</tt> has not been removed
-yet, although <tt class="docutils literal">parser.set_element_class_lookup()</tt> should be used
-instead.</p>
-</li>
-<li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespace()</tt>, use
-<tt class="docutils literal">xpath_evaluator.register_namespace()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespaces()</tt>, use
-<tt class="docutils literal">xpath_evaluator.register_namespaces()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">objectify.setPytypeAttributeTag</tt>, use
-<tt class="docutils literal">objectify.set_pytype_attribute_tag</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">objectify.setDefaultParser()</tt>, use
-<tt class="docutils literal">objectify.set_default_parser()</tt></p>
-</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id281">
-<h1>2.0.3 (2008-03-26)</h1>
-<div class="section" id="id282">
-<h2>Features added</h2>
-<ul class="simple">
-<li>soupparser.parse() allows passing keyword arguments on to
-BeautifulSoup.</li>
-<li><tt class="docutils literal">fromstring()</tt> method in <tt class="docutils literal">lxml.html.soupparser</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id283">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.html.diff</tt> didn't treat empty tags properly (e.g.,
-<tt class="docutils literal">&lt;br&gt;</tt>).</li>
-<li>Handle entity replacements correctly in target parser.</li>
-<li>Crash when using <tt class="docutils literal">iterparse()</tt> with XML Schema validation.</li>
-<li>The BeautifulSoup parser (soupparser.py) did not replace entities,
-which made them turn up in text content.</li>
-<li>Attribute assignment of custom PyTypes in objectify could fail to
-correctly serialise the value to a string.</li>
-</ul>
-</div>
-<div class="section" id="id284">
-<h2>Other changes</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.html.ElementSoup</tt> was replaced by a new module
-<tt class="docutils literal">lxml.html.soupparser</tt> with a more consistent API.  The old module
-remains for compatibility with ElementTree's own ElementSoup module.</li>
-<li>Setting the XSLT_CONFIG and XML2_CONFIG environment variables at
-build time will let setup.py pick up the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> and
-<tt class="docutils literal"><span class="pre">xslt-config</span></tt> scripts from the supplied path name.</li>
-<li>Passing <tt class="docutils literal"><span class="pre">--with-xml2-config=/path/to/xml2-config</span></tt> to setup.py will
-override the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> script that is used to determine the C
-compiler options.  The same applies for the <tt class="docutils literal"><span class="pre">--with-xslt-config</span></tt>
-option.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id285">
-<h1>2.0.2 (2008-02-22)</h1>
-<div class="section" id="id286">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support passing <tt class="docutils literal">base_url</tt> to file parser functions to override
-the filename of the file(-like) object.</li>
-</ul>
-</div>
-<div class="section" id="id287">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The prefix for objectify's pytype namespace was missing from the set
-of default prefixes.</li>
-<li>Memory leak in Schematron (fixed only for libxml2 2.6.31+).</li>
-<li>Error type names in RelaxNG were reported incorrectly.</li>
-<li>Slice deletion bug fixed in objectify.</li>
-</ul>
-</div>
-<div class="section" id="id288">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Enabled doctests for some Python modules (especially <tt class="docutils literal">lxml.html</tt>).</li>
-<li>Add a <tt class="docutils literal">method</tt> argument to <tt class="docutils literal">lxml.html.tostring()</tt>
-(<tt class="docutils literal"><span class="pre">method=&quot;xml&quot;</span></tt> for XHTML output).</li>
-<li>Make it clearer that methods like <tt class="docutils literal">lxml.html.fromstring()</tt> take a
-<tt class="docutils literal">base_url</tt> argument.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id289">
-<h1>2.0.1 (2008-02-13)</h1>
-<div class="section" id="id290">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Child iteration in <tt class="docutils literal">lxml.pyclasslookup</tt>.</li>
-<li>Loads of new docstrings reflect the signature of functions and
-methods to make them visible in API docs and <tt class="docutils literal">help()</tt></li>
-</ul>
-</div>
-<div class="section" id="id291">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The module <tt class="docutils literal">lxml.html.builder</tt> was duplicated as
-<tt class="docutils literal">lxml.htmlbuilder</tt></li>
-<li>Form elements would return None for <tt class="docutils literal">form.fields.keys()</tt> if there
-was an unnamed input field.  Now unnamed input fields are completely
-ignored.</li>
-<li>Setting an element slice in objectify could insert slice-overlapping
-elements at the wrong position.</li>
-</ul>
-</div>
-<div class="section" id="id292">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The generated API documentation was cleaned up and disburdened from
-non-public classes etc.</li>
-<li>The previously public module <tt class="docutils literal">lxml.html.setmixin</tt> was renamed to
-<tt class="docutils literal">lxml.html._setmixin</tt> as it is not an official part of lxml.  If
-you want to use it, feel free to copy it over to your own source
-base.</li>
-<li>Passing <tt class="docutils literal"><span class="pre">--with-xslt-config=/path/to/xslt-config</span></tt> to setup.py will
-override the <tt class="docutils literal"><span class="pre">xslt-config</span></tt> script that is used to determine the C
-compiler options.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id293">
-<h1>2.0 (2008-02-01)</h1>
-<div class="section" id="id294">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Passing the <tt class="docutils literal">unicode</tt> type as <tt class="docutils literal">encoding</tt> to <tt class="docutils literal">tostring()</tt> will
-serialise to unicode.  The <tt class="docutils literal">tounicode()</tt> function is now
-deprecated.</li>
-<li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> can parse from StringIO.</li>
-<li><tt class="docutils literal">makeparser()</tt> function in <tt class="docutils literal">lxml.objectify</tt> to create a new
-parser with the usual objectify setup.</li>
-<li>Plain ASCII XPath string results are no longer forced into unicode
-objects as in 2.0beta1, but are returned as plain strings as before.</li>
-<li>All XPath string results are 'smart' objects that have a
-<tt class="docutils literal">getparent()</tt> method to retrieve their parent Element.</li>
-<li><tt class="docutils literal">with_tail</tt> option in serialiser functions.</li>
-<li>More accurate exception messages in validator creation.</li>
-<li>Parse-time XML schema validation (<tt class="docutils literal">schema</tt> parser keyword).</li>
-<li>XPath string results of the <tt class="docutils literal">text()</tt> function and attribute
-selection make their Element container accessible through a
-<tt class="docutils literal">getparent()</tt> method.  As a side-effect, they are now always
-unicode objects (even ASCII strings).</li>
-<li><tt class="docutils literal">XSLT</tt> objects are usable in any thread - at the cost of a deep
-copy if they were not created in that thread.</li>
-<li>Invalid entity names and character references will be rejected by
-the <tt class="docutils literal">Entity()</tt> factory.</li>
-<li><tt class="docutils literal">entity.text</tt> returns the textual representation of the entity,
-e.g. <tt class="docutils literal">&amp;amp;</tt>.</li>
-<li>New properties <tt class="docutils literal">position</tt> and <tt class="docutils literal">code</tt> on ParseError exception (as
-in ET 1.3)</li>
-<li>Rich comparison of <tt class="docutils literal">element.attrib</tt> proxies.</li>
-<li>ElementTree compatible TreeBuilder class.</li>
-<li>Use default prefixes for some common XML namespaces.</li>
-<li><tt class="docutils literal">lxml.html.clean.Cleaner</tt> now allows for a <tt class="docutils literal">host_whitelist</tt>, and
-two overridable methods: <tt class="docutils literal">allow_embedded_url(el, url)</tt> and the
-more general <tt class="docutils literal">allow_element(el)</tt>.</li>
-<li>Extended slicing of Elements as in <tt class="docutils literal"><span class="pre">element[1:-1:2]</span></tt>, both in
-etree and in objectify</li>
-<li>Resolvers can now provide a <tt class="docutils literal">base_url</tt> keyword argument when
-resolving a document as string data.</li>
-<li>When using <tt class="docutils literal">lxml.doctestcompare</tt> you can give the doctest option
-<tt class="docutils literal">NOPARSE_MARKUP</tt> (like <tt class="docutils literal"># doctest: +NOPARSE_MARKUP</tt>) to suppress
-the special checking for one test.</li>
-<li>Separate <tt class="docutils literal">feed_error_log</tt> property for the feed parser interface.
-The normal parser interface and <tt class="docutils literal">iterparse</tt> continue to use
-<tt class="docutils literal">error_log</tt>.</li>
-<li>The normal parsers and the feed parser interface are now separated
-and can be used concurrently on the same parser instance.</li>
-<li><tt class="docutils literal">fromstringlist()</tt> and <tt class="docutils literal">tostringlist()</tt> functions as in
-ElementTree 1.3</li>
-<li><tt class="docutils literal">iterparse()</tt> accepts an <tt class="docutils literal">html</tt> boolean keyword argument for
-parsing with the HTML parser (note that this interface may be
-subject to change)</li>
-<li>Parsers accept an <tt class="docutils literal">encoding</tt> keyword argument that overrides the encoding
-of the parsed documents.</li>
-<li>New C-API function <tt class="docutils literal">hasChild()</tt> to test for children</li>
-<li><tt class="docutils literal">annotate()</tt> function in objectify can annotate with Python types and XSI
-types in one step.  Accompanied by <tt class="docutils literal">xsiannotate()</tt> and <tt class="docutils literal">pyannotate()</tt>.</li>
-<li><tt class="docutils literal">ET.write()</tt>, <tt class="docutils literal">tostring()</tt> and <tt class="docutils literal">tounicode()</tt> now accept a keyword
-argument <tt class="docutils literal">method</tt> that can be one of 'xml' (or None), 'html' or 'text' to
-serialise as XML, HTML or plain text content.</li>
-<li><tt class="docutils literal">iterfind()</tt> method on Elements returns an iterator equivalent to
-<tt class="docutils literal">findall()</tt></li>
-<li><tt class="docutils literal">itertext()</tt> method on Elements</li>
-<li>Setting a QName object as value of the .text property or as an attribute
-will resolve its prefix in the respective context</li>
-<li>ElementTree-like parser target interface as described in
-<a class="reference external" href="http://effbot.org/elementtree/elementtree-xmlparser.htm">http://effbot.org/elementtree/elementtree-xmlparser.htm</a></li>
-<li>ElementTree-like feed parser interface on XMLParser and HTMLParser
-(<tt class="docutils literal">feed()</tt> and <tt class="docutils literal">close()</tt> methods)</li>
-<li>Reimplemented <tt class="docutils literal">objectify.E</tt> for better performance and improved
-integration with objectify.  Provides extended type support based on
-registered PyTypes.</li>
-<li>XSLT objects now support deep copying</li>
-<li>New <tt class="docutils literal">makeSubElement()</tt> C-API function that allows creating a new
-subelement straight with text, tail and attributes.</li>
-<li>XPath extension functions can now access the current context node
-(<tt class="docutils literal">context.context_node</tt>) and use a context dictionary
-(<tt class="docutils literal">context.eval_context</tt>) from the context provided in their first
-parameter</li>
-<li>HTML tag soup parser based on BeautifulSoup in <tt class="docutils literal">lxml.html.ElementSoup</tt></li>
-<li>New module <tt class="docutils literal">lxml.doctestcompare</tt> by Ian Bicking for writing simplified
-doctests based on XML/HTML output.  Use by importing <tt class="docutils literal">lxml.usedoctest</tt> or
-<tt class="docutils literal">lxml.html.usedoctest</tt> from within a doctest.</li>
-<li>New module <tt class="docutils literal">lxml.cssselect</tt> by Ian Bicking for selecting Elements with CSS
-selectors.</li>
-<li>New package <tt class="docutils literal">lxml.html</tt> written by Ian Bicking for advanced HTML
-treatment.</li>
-<li>Namespace class setup is now local to the <tt class="docutils literal">ElementNamespaceClassLookup</tt>
-instance and no longer global.</li>
-<li>Schematron validation (incomplete in libxml2)</li>
-<li>Additional <tt class="docutils literal">stringify</tt> argument to <tt class="docutils literal">objectify.PyType()</tt> takes a
-conversion function to strings to support setting text values from arbitrary
-types.</li>
-<li>Entity support through an <tt class="docutils literal">Entity</tt> factory and element classes.  XML
-parsers now have a <tt class="docutils literal">resolve_entities</tt> keyword argument that can be set to
-False to keep entities in the document.</li>
-<li><tt class="docutils literal">column</tt> field on error log entries to accompany the <tt class="docutils literal">line</tt> field</li>
-<li>Error specific messages in XPath parsing and evaluation
-NOTE: for evaluation errors, you will now get an XPathEvalError instead of
-an XPathSyntaxError.  To catch both, you can except on <tt class="docutils literal">XPathError</tt></li>
-<li>The regular expression functions in XPath now support passing a node-set
-instead of a string</li>
-<li>Extended type annotation in objectify: new <tt class="docutils literal">xsiannotate()</tt> function</li>
-<li>EXSLT RegExp support in standard XPath (not only XSLT)</li>
-</ul>
-</div>
-<div class="section" id="id295">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Missing import in <tt class="docutils literal">lxml.html.clean</tt>.</li>
-<li>Some Python 2.4-isms prevented lxml from building/running under
-Python 2.3.</li>
-<li>XPath on ElementTrees could crash when selecting the virtual root
-node of the ElementTree.</li>
-<li>Compilation <tt class="docutils literal"><span class="pre">--without-threading</span></tt> was buggy in alpha5/6.</li>
-<li>Memory leak in the <tt class="docutils literal">parse()</tt> function.</li>
-<li>Minor bugs in XSLT error message formatting.</li>
-<li>Result document memory leak in target parser.</li>
-<li>Target parser failed to report comments.</li>
-<li>In the <tt class="docutils literal">lxml.html</tt> <tt class="docutils literal">iter_links</tt> method, links in <tt class="docutils literal">&lt;object&gt;</tt>
-tags weren't recognized.  (Note: plugin-specific link parameters
-still aren't recognized.)  Also, the <tt class="docutils literal">&lt;embed&gt;</tt> tag, though not
-standard, is now included in <tt class="docutils literal">lxml.html.defs.special_inline_tags</tt>.</li>
-<li>Using custom resolvers on XSLT stylesheets parsed from a string
-could request ill-formed URLs.</li>
-<li>With <tt class="docutils literal">lxml.doctestcompare</tt> if you do <tt class="docutils literal">&lt;tag <span class="pre">xmlns=&quot;...&quot;&gt;</span></tt> in your
-output, it will then be namespace-neutral (before the ellipsis was
-treated as a real namespace).</li>
-<li>AttributeError in feed parser on parse errors</li>
-<li>XML feed parser setup problem</li>
-<li>Type annotation for unicode strings in <tt class="docutils literal">DataElement()</tt></li>
-<li>lxml failed to serialise namespace declarations of elements other than the
-root node of a tree</li>
-<li>Race condition in XSLT where the resolver context leaked between concurrent
-XSLT calls</li>
-<li>lxml.etree did not check tag/attribute names</li>
-<li>The XML parser did not report undefined entities as error</li>
-<li>The text in exceptions raised by XML parsers, validators and XPath
-evaluators now reports the first error that occurred instead of the last</li>
-<li>Passing '' as XPath namespace prefix did not raise an error</li>
-<li>Thread safety in XPath evaluators</li>
-</ul>
-</div>
-<div class="section" id="id296">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Exceptions carry only the part of the error log that is related to
-the operation that caused the error.</li>
-<li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> now enforce passing the source
-file/filename through the <tt class="docutils literal">file</tt> keyword argument.</li>
-<li>The test suite now skips most doctests under Python 2.3.</li>
-<li><tt class="docutils literal">make clean</tt> no longer removes the .c files (use <tt class="docutils literal">make
-realclean</tt> instead)</li>
-<li>Minor performance tweaks for Element instantiation and subelement
-creation</li>
-<li>Various places in the XPath, XSLT and iteration APIs now require
-keyword-only arguments.</li>
-<li>The argument order in <tt class="docutils literal">element.itersiblings()</tt> was changed to
-match the order used in all other iteration methods.  The second
-argument ('preceding') is now a keyword-only argument.</li>
-<li>The <tt class="docutils literal">getiterator()</tt> method on Elements and ElementTrees was
-reverted to return an iterator as it did in lxml 1.x.  The ET API
-specification allows it to return either a sequence or an iterator,
-and it traditionally returned a sequence in ET and an iterator in
-lxml.  However, it is now deprecated in favour of the <tt class="docutils literal">iter()</tt>
-method, which should be used in new code wherever possible.</li>
-<li>The 'pretty printed' serialisation of ElementTree objects now
-inserts newlines at the root level between processing instructions,
-comments and the root tag.</li>
-<li>A 'pretty printed' serialisation is now terminated with a newline.</li>
-<li>Second argument to <tt class="docutils literal">lxml.etree.Extension()</tt> helper is no longer
-required, third argument is now a keyword-only argument <tt class="docutils literal">ns</tt>.</li>
-<li><tt class="docutils literal">lxml.html.tostring</tt> takes an <tt class="docutils literal">encoding</tt> argument.</li>
-<li>The module source files were renamed to &quot;lxml.*.pyx&quot;, such as
-&quot;lxml.etree.pyx&quot;.  This was changed for consistency with the way
-Pyrex commonly handles package imports.  The main effect is that
-classes now know about their fully qualified class name, including
-the package name of their module.</li>
-<li>Keyword-only arguments in some API functions, especially in the
-parsers and serialisers.</li>
-<li>Tag name validation in lxml.etree (and lxml.html) now distinguishes
-between HTML tags and XML tags based on the parser that was used to
-parse or create them.  HTML tags no longer reject any non-ASCII
-characters in tag names but only spaces and the special characters
-<tt class="docutils literal"><span class="pre">&lt;&gt;&amp;/&quot;'</span></tt>.</li>
-<li>lxml.etree now emits a warning if you use XPath with libxml2 2.6.27
-(which can crash on certain XPath errors)</li>
-<li>Type annotation in objectify now preserves the already annotated type by
-default to prevent losing type information that is already there.</li>
-<li><tt class="docutils literal">element.getiterator()</tt> returns a list, use <tt class="docutils literal">element.iter()</tt> to retrieve
-an iterator (ElementTree 1.3 compatible behaviour)</li>
-<li>objectify.PyType for None is now called &quot;NoneType&quot;</li>
-<li><tt class="docutils literal">el.getiterator()</tt> renamed to <tt class="docutils literal">el.iter()</tt>, following ElementTree 1.3 -
-original name is still available as alias</li>
-<li>In the public C-API, <tt class="docutils literal">findOrBuildNodeNs()</tt> was replaced by the more
-generic <tt class="docutils literal">findOrBuildNodeNsPrefix</tt></li>
-<li>Major refactoring in XPath/XSLT extension function code</li>
-<li>Network access in parsers disabled by default</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id297">
-<h1>1.3.6 (2007-10-29)</h1>
-<div class="section" id="id298">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Backported decref crash fix from 2.0</li>
-<li>Well hidden free-while-in-use crash bug in ObjectPath</li>
-</ul>
-</div>
-<div class="section" id="id299">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The test suites now run <tt class="docutils literal">gc.collect()</tt> in the <tt class="docutils literal">tearDown()</tt>
-methods.  While this makes them take a lot longer to run, it also
-makes it easier to link a specific test to garbage collection
-problems that would otherwise appear in later tests.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id300">
-<h1>1.3.5 (2007-10-22)</h1>
-<div class="section" id="id301">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id302">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>lxml.etree could crash when adding more than 10000 namespaces to a
-document</li>
-<li>lxml failed to serialise namespace declarations of elements other
-than the root node of a tree</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id303">
-<h1>1.3.4 (2007-08-30)</h1>
-<div class="section" id="id304">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The <tt class="docutils literal">ElementMaker</tt> in <tt class="docutils literal">lxml.builder</tt> now accepts the keyword arguments
-<tt class="docutils literal">namespace</tt> and <tt class="docutils literal">nsmap</tt> to set a namespace and nsmap for the Elements it
-creates.</li>
-<li>The <tt class="docutils literal">docinfo</tt> on ElementTree objects has new properties <tt class="docutils literal">internalDTD</tt>
-and <tt class="docutils literal">externalDTD</tt> that return a DTD object for the internal or external
-subset of the document respectively.</li>
-<li>Serialising an ElementTree now includes any internal DTD subsets that are
-part of the document, as well as comments and PIs that are siblings of the
-root node.</li>
-</ul>
-</div>
-<div class="section" id="id305">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Parsing with the <tt class="docutils literal">no_network</tt> option could fail</li>
-</ul>
-</div>
-<div class="section" id="id306">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>lxml now raises a TagNameWarning about tag names containing ':' instead of
-an Error as 1.3.3 did.  The reason is that a number of projects currently
-misuse the previous lack of tag name validation to generate namespace
-prefixes without declaring namespaces.  Apart from the danger of generating
-broken XML this way, it also breaks most of the namespace-aware tools in
-XML, including XPath, XSLT and validation.  lxml 1.3.x will continue to
-support this bug with a Warning, while lxml 2.0 will be strict about
-well-formed tag names (not only regarding ':').</li>
-<li>Serialising an Element no longer includes its comment and PI siblings (only
-ElementTree serialisation includes them).</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id307">
-<h1>1.3.3 (2007-07-26)</h1>
-<div class="section" id="id308">
-<h2>Features added</h2>
-<ul class="simple">
-<li>ElementTree compatible parser <tt class="docutils literal">ETCompatXMLParser</tt> strips processing
-instructions and comments while parsing XML</li>
-<li>Parsers now support stripping PIs (keyword argument 'remove_pis')</li>
-<li><tt class="docutils literal">etree.fromstring()</tt> now supports parsing both HTML and XML, depending on
-the parser you pass.</li>
-<li>Support <tt class="docutils literal">base_url</tt> keyword argument in <tt class="docutils literal">HTML()</tt> and <tt class="docutils literal">XML()</tt></li>
-</ul>
-</div>
-<div class="section" id="id309">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Parsing from Python Unicode strings failed on some platforms</li>
-<li><tt class="docutils literal">Element()</tt> did not raise an exception on tag names containing ':'</li>
-<li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
-<tt class="docutils literal">ProcessingInstruction</tt> as tags. It also accepts <tt class="docutils literal">Element</tt> now.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id310">
-<h1>1.3.2 (2007-07-03)</h1>
-<div class="section" id="id311">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id312">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>&quot;deallocating None&quot; crash bug</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id313">
-<h1>1.3.1 (2007-07-02)</h1>
-<div class="section" id="id314">
-<h2>Features added</h2>
-<ul class="simple">
-<li>objectify.DataElement now supports setting values from existing data
-elements (not just plain Python types) and reuses defined namespaces etc.</li>
-<li>E-factory support for lxml.objectify (<tt class="docutils literal">objectify.E</tt>)</li>
-</ul>
-</div>
-<div class="section" id="id315">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Better way to prevent crashes in Element proxy cleanup code</li>
-<li>objectify.DataElement didn't set up None value correctly</li>
-<li>objectify.DataElement didn't check the value against the provided type hints</li>
-<li>Reference-counting bug in <tt class="docutils literal">Element.attrib.pop()</tt></li>
-</ul>
-</div>
-</div>
-<div class="section" id="id316">
-<h1>1.3 (2007-06-24)</h1>
-<div class="section" id="id317">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Module <tt class="docutils literal">lxml.pyclasslookup</tt> module implements an Element class lookup
-scheme that can access the entire tree in read-only mode to help determining
-a suitable Element class</li>
-<li>Parsers take a <tt class="docutils literal">remove_comments</tt> keyword argument that skips over comments</li>
-<li><tt class="docutils literal">parse()</tt> function in <tt class="docutils literal">objectify</tt>, corresponding to <tt class="docutils literal">XML()</tt> etc.</li>
-<li><tt class="docutils literal">Element.addnext(el)</tt> and <tt class="docutils literal">Element.addprevious(el)</tt> methods to support
-adding processing instructions and comments around the root node</li>
-<li><tt class="docutils literal">Element.attrib</tt> was missing <tt class="docutils literal">clear()</tt> and <tt class="docutils literal">pop()</tt> methods</li>
-<li>Extended type annotation in objectify: cleaner annotation namespace setup
-plus new <tt class="docutils literal">deannotate()</tt> function</li>
-<li>Support for custom Element class instantiation in lxml.sax: passing a
-<tt class="docutils literal">makeelement</tt> function to the ElementTreeContentHandler will reuse the
-lookup context of that function</li>
-<li>'.' represents empty ObjectPath (identity)</li>
-<li><tt class="docutils literal">Element.values()</tt> to accompany the existing <tt class="docutils literal">.keys()</tt> and <tt class="docutils literal">.items()</tt></li>
-<li><tt class="docutils literal">collectAttributes()</tt> C-function to build a list of attribute
-keys/values/items for a libxml2 node</li>
-<li><tt class="docutils literal">DTD</tt> validator class (like <tt class="docutils literal">RelaxNG</tt> and <tt class="docutils literal">XMLSchema</tt>)</li>
-<li>HTML generator helpers by Fredrik Lundh in <tt class="docutils literal">lxml.htmlbuilder</tt></li>
-<li><tt class="docutils literal">ElementMaker</tt> XML generator by Fredrik Lundh in <tt class="docutils literal">lxml.builder.E</tt></li>
-<li>Support for pickling <tt class="docutils literal">objectify.ObjectifiedElement</tt> objects to XML</li>
-<li><tt class="docutils literal">update()</tt> method on Element.attrib</li>
-<li>Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml
-a better handling of namespaces when moving elements between documents.</li>
-</ul>
-</div>
-<div class="section" id="id318">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Removing Elements from a tree could make them lose their namespace
-declarations</li>
-<li><tt class="docutils literal">ElementInclude</tt> didn't honour base URL of original document</li>
-<li>Replacing the children slice of an Element would cut off the tails of the
-original children</li>
-<li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
-<tt class="docutils literal">ProcessingInstruction</tt> as tags</li>
-<li>API functions now check incoming strings for XML conformity.  Zero bytes or
-low ASCII characters are no longer accepted (AssertionError).</li>
-<li>XSLT parsing failed to pass resolver context on to imported documents</li>
-<li>passing '' as namespace prefix in nsmap could be passed through to libxml2</li>
-<li>Objectify couldn't handle prefixed XSD type names in <tt class="docutils literal">xsi:type</tt></li>
-<li>More ET compatible behaviour when writing out XML declarations or not</li>
-<li>More robust error handling in <tt class="docutils literal">iterparse()</tt></li>
-<li>Documents lost their top-level PIs and comments on serialisation</li>
-<li>lxml.sax failed on comments and PIs. Comments are now properly ignored and
-PIs are copied.</li>
-<li>Possible memory leaks in namespace handling when moving elements between
-documents</li>
-</ul>
-</div>
-<div class="section" id="id319">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>major restructuring in the documentation</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id320">
-<h1>1.2.1 (2007-02-27)</h1>
-<div class="section" id="id321">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Build fixes for MS compiler</li>
-<li>Item assignments to special names like <tt class="docutils literal"><span class="pre">element[&quot;text&quot;]</span></tt> failed</li>
-<li>Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier
-to access</li>
-<li>The pattern for attribute names in ObjectPath was too restrictive</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id322">
-<h1>1.2 (2007-02-20)</h1>
-<div class="section" id="id323">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Rich comparison of QName objects</li>
-<li>Support for regular expressions in benchmark selection</li>
-<li>get/set emulation (not .attrib!) for attributes on processing instructions</li>
-<li>ElementInclude Python module for ElementTree compatible XInclude processing
-that honours custom resolvers registered with the source document</li>
-<li>ElementTree.parser property holds the parser used to parse the document</li>
-<li>setup.py has been refactored for greater readability and flexibility</li>
-<li>--rpath flag to setup.py to induce automatic linking-in of dynamic library
-runtime search paths has been renamed to --auto-rpath. This makes it
-possible to pass an --rpath directly to distutils; previously this was being
-shadowed.</li>
-</ul>
-</div>
-<div class="section" id="id324">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Element instantiation now uses locks to prevent race conditions with threads</li>
-<li>ElementTree.write() did not raise an exception when the file was not writable</li>
-<li>Error handling could crash under Python &lt;= 2.4.1 - fixed by disabling thread
-support in these environments</li>
-<li>Element.find*() did not accept QName objects as path</li>
-</ul>
-</div>
-<div class="section" id="id325">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>code cleanup: redundant _NodeBase super class merged into _Element class
-Note: although the impact should be zero in most cases, this change breaks
-the compatibility of the public C-API</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id326">
-<h1>1.1.2 (2006-10-30)</h1>
-<div class="section" id="id327">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Data elements in objectify support repr(), which is now used by dump()</li>
-<li>Source distribution now ships with a patched Pyrex</li>
-<li>New C-API function makeElement() to create new elements with text,
-tail, attributes and namespaces</li>
-<li>Reuse original parser flags for XInclude</li>
-<li>Simplified support for handling XSLT processing instructions</li>
-</ul>
-</div>
-<div class="section" id="id328">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Parser resources were not freed before the next parser run</li>
-<li>Open files and XML strings returned by Python resolvers were not
-closed/freed</li>
-<li>Crash in the IDDict returned by XMLDTDID</li>
-<li>Copying Comments and ProcessingInstructions failed</li>
-<li>Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()</li>
-<li>Memory leak when garbage collecting tailed root elements</li>
-<li>HTML script/style content was not propagated to .text</li>
-<li>Show text xincluded between text nodes correctly in .text and .tail</li>
-<li>'integer * objectify.StringElement' operation was not supported</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id329">
-<h1>1.1.1 (2006-09-21)</h1>
-<div class="section" id="id330">
-<h2>Features added</h2>
-<ul class="simple">
-<li>XSLT profiling support (<tt class="docutils literal">profile_run</tt> keyword)</li>
-<li>countchildren() method on objectify.ObjectifiedElement</li>
-<li>Support custom elements for tree nodes in lxml.objectify</li>
-</ul>
-</div>
-<div class="section" id="id331">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>lxml.objectify failed to support long data values (e.g., &quot;123L&quot;)</li>
-<li>Error messages from XSLT did not reach <tt class="docutils literal">XSLT.error_log</tt></li>
-<li>Factories objectify.Element() and objectify.DataElement() were missing
-<tt class="docutils literal">attrib</tt> and <tt class="docutils literal">nsmap</tt> keyword arguments</li>
-<li>Changing the default parser in lxml.objectify did not update the factories
-Element() and DataElement()</li>
-<li>Let lxml.objectify.Element() always generate tree elements (not data
-elements)</li>
-<li>Build under Windows failed ('0' bug in patched Pyrex version)</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id332">
-<h1>1.1 (2006-09-13)</h1>
-<div class="section" id="id333">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Comments and processing instructions return '&lt;!-- comment --&gt;' and
-'&lt;?pi-target content?&gt;' for repr()</li>
-<li>Parsers are now the preferred (and default) place where element class lookup
-schemes should be registered.  Namespace lookup is no longer supported by
-default.</li>
-<li>Support for Python 2.5 beta</li>
-<li>Unlock the GIL for deep copying documents and for XPath()</li>
-<li>New <tt class="docutils literal">compact</tt> keyword argument for parsing read-only documents</li>
-<li>Support for parser options in iterparse()</li>
-<li>The <tt class="docutils literal">namespace</tt> axis is supported in XPath and returns (prefix, URI)
-tuples</li>
-<li>The XPath expression &quot;/&quot; now returns an empty list instead of raising an
-exception</li>
-<li>XML-Object API on top of lxml (lxml.objectify)</li>
-<li>Customizable Element class lookup:<ul>
-<li>different pre-implemented lookup mechanisms</li>
-<li>support for externally provided lookup functions</li>
-</ul>
-</li>
-<li>Support for processing instructions (ET-like, not compatible)</li>
-<li>Public C-level API for independent extension modules</li>
-<li>Module level <tt class="docutils literal">iterwalk()</tt> function as 'iterparse' for trees</li>
-<li>Module level <tt class="docutils literal">iterparse()</tt> function similar to ElementTree (see
-documentation for differences)</li>
-<li>Element.nsmap property returns a mapping of all namespace prefixes known at
-the Element to their namespace URI</li>
-<li>Reentrant threading support in RelaxNG, XMLSchema and XSLT</li>
-<li>Threading support in parsers and serializers:<ul>
-<li>All in-memory operations (tostring, parse(StringIO), etc.) free the GIL</li>
-<li>File operations (on file names) free the GIL</li>
-<li>Reading from file-like objects frees the GIL and reacquires it for reading</li>
-<li>Serialisation to file-like objects is single-threaded (high lock overhead)</li>
-</ul>
-</li>
-<li>Element iteration over XPath axes:<ul>
-<li>Element.iterdescendants() iterates over the descendants of an element</li>
-<li>Element.iterancestors() iterates over the ancestors of an element (from
-parent to parent)</li>
-<li>Element.itersiblings() iterates over either the following or preceding
-siblings of an element</li>
-<li>Element.iterchildren() iterates over the children of an element in either
-direction</li>
-<li>All iterators support the <tt class="docutils literal">tag</tt> keyword argument to restrict the
-generated elements</li>
-</ul>
-</li>
-<li>Element.getnext() and Element.getprevious() return the direct siblings of an
-element</li>
-</ul>
-</div>
-<div class="section" id="id334">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>filenames with local 8-bit encoding were not supported</li>
-<li>1.1beta did not compile under Python 2.3</li>
-<li>ignore unknown 'pyval' attribute values in objectify</li>
-<li>objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists</li>
-<li>objectify.ObjectPath.setattr() failed to accept Elements and Lists</li>
-<li>XPathSyntaxError now inherits from XPathError</li>
-<li>Threading race conditions in RelaxNG and XMLSchema</li>
-<li>Crash when mixing elements from XSLT results into other trees, concurrent
-XSLT is only allowed when the stylesheet was parsed in the main thread</li>
-<li>The EXSLT <tt class="docutils literal">regexp:match</tt> function now works as defined (except for some
-differences in the regular expression syntax)</li>
-<li>Setting element.text to '' returned None on request, not the empty string</li>
-<li><tt class="docutils literal">iterparse()</tt> could crash on long XML files</li>
-<li>Creating documents no longer copies the parser for later URL resolving.  For
-performance reasons, only a reference is kept.  Resolver updates on the
-parser will now be reflected by documents that were parsed before the
-change.  Although this should rarely become visible, it is a behavioral
-change from 1.0.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id335">
-<h1>1.0.4 (2006-09-09)</h1>
-<div class="section" id="id336">
-<h2>Features added</h2>
-<ul class="simple">
-<li>List-like <tt class="docutils literal">Element.extend()</tt> method</li>
-</ul>
-</div>
-<div class="section" id="id337">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in tail handling in <tt class="docutils literal">Element.replace()</tt></li>
-</ul>
-</div>
-</div>
-<div class="section" id="id338">
-<h1>1.0.3 (2006-08-08)</h1>
-<div class="section" id="id339">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Element.replace(old, new) method to replace a subelement by another one</li>
-</ul>
-</div>
-<div class="section" id="id340">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when mixing elements from XSLT results into other trees</li>
-<li>Copying/deepcopying did not work for ElementTree objects</li>
-<li>Setting an attribute to a non-string value did not raise an exception</li>
-<li>Element.remove() deleted the tail text from the removed Element</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id341">
-<h1>1.0.2 (2006-06-27)</h1>
-<div class="section" id="id342">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support for setting a custom default Element class as opposed to namespace
-specific classes (which still override the default class)</li>
-</ul>
-</div>
-<div class="section" id="id343">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Rare exceptions in Python list functions were not handled</li>
-<li>Parsing accepted unicode strings with XML encoding declaration in certain
-cases</li>
-<li>Parsing 8-bit encoded strings from StringIO objects raised an exception</li>
-<li>Module function <tt class="docutils literal">initThread()</tt> was removed - useless (and never worked)</li>
-<li>XSLT and parser exception messages include the error line number</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id344">
-<h1>1.0.1 (2006-06-09)</h1>
-<div class="section" id="id345">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Repeated calls to Element.attrib now efficiently return the same instance</li>
-</ul>
-</div>
-<div class="section" id="id346">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Document deallocation could crash in certain garbage collection scenarios</li>
-<li>Extension function calls in XSLT variable declarations could break the
-stylesheet and crash on repeated calls</li>
-<li>Deep copying Elements could lose namespaces declared in parents</li>
-<li>Deep copying Elements did not copy tail</li>
-<li>Parsing file(-like) objects failed to load external entities</li>
-<li>Parsing 8-bit strings from file(-like) objects raised an exception</li>
-<li>xsl:include failed when the stylesheet was parsed from a file-like object</li>
-<li>lxml.sax.ElementTreeProducer did not call startDocument() / endDocument()</li>
-<li>MSVC compiler complained about long strings (supports only 2048 bytes)</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id347">
-<h1>1.0 (2006-06-01)</h1>
-<div class="section" id="id348">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Element.getiterator() and the findall() methods support finding arbitrary
-elements from a namespace (pattern <tt class="docutils literal">{namespace}*</tt>)</li>
-<li>Another speedup in tree iteration code</li>
-<li>General speedup of Python Element object creation and deallocation</li>
-<li>Writing C14N no longer serializes in memory (reduced memory footprint)</li>
-<li>PyErrorLog for error logging through the Python <tt class="docutils literal">logging</tt> module</li>
-<li><tt class="docutils literal">Element.getroottree()</tt> returns an ElementTree for the root node of the
-document that contains the element.</li>
-<li>ElementTree.getpath(element) returns a simple, absolute XPath expression to
-find the element in the tree structure</li>
-<li>Error logs have a <tt class="docutils literal">last_error</tt> attribute for convenience</li>
-<li>Comment texts can be changed through the API</li>
-<li>Formatted output via <tt class="docutils literal">pretty_print</tt> keyword in serialization functions</li>
-<li>XSLT can block access to file system and network via <tt class="docutils literal">XSLTAccessControl</tt></li>
-<li>ElementTree.write() no longer serializes in memory (reduced memory
-footprint)</li>
-<li>Speedup of Element.findall(tag) and Element.getiterator(tag)</li>
-<li>Support for writing the XML representation of Elements and ElementTrees to
-Python unicode strings via <tt class="docutils literal">etree.tounicode()</tt></li>
-<li>Support for writing XSLT results to Python unicode strings via <tt class="docutils literal">unicode()</tt></li>
-<li>Parsing a unicode string no longer copies the string (reduced memory
-footprint)</li>
-<li>Parsing file-like objects reads chunks rather than the whole file (reduced
-memory footprint)</li>
-<li>Parsing StringIO objects from the start avoids copying the string (reduced
-memory footprint)</li>
-<li>Read-only 'docinfo' attribute in ElementTree class holds DOCTYPE
-information, original encoding and XML version as seen by the parser</li>
-<li>etree module can be compiled without libxslt by commenting out the line
-<tt class="docutils literal">include &quot;xslt.pxi&quot;</tt> near the end of the etree.pyx source file</li>
-<li>Better error messages in parser exceptions</li>
-<li>Error reporting also works in XSLT</li>
-<li>Support for custom document loaders (URI resolvers) in parsers and XSLT,
-resolvers are registered at parser level</li>
-<li>Implementation of exslt:regexp for XSLT based on the Python 're' module,
-enabled by default, can be switched off with 'regexp=False' keyword argument</li>
-<li>Support for exslt extensions (libexslt) and libxslt extra functions
-(node-set, document, write, output)</li>
-<li>Substantial speedup in XPath.evaluate()</li>
-<li>HTMLParser for parsing (broken) HTML</li>
-<li>XMLDTDID function parses XML into tuple (root node, ID dict) based on xml:id
-implementation of libxml2 (as opposed to ET compatible XMLID)</li>
-</ul>
-</div>
-<div class="section" id="id349">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory leak in Element.__setitem__</li>
-<li>Memory leak in Element.attrib.items() and Element.attrib.values()</li>
-<li>Memory leak in XPath extension functions</li>
-<li>Memory leak in unicode related setup code</li>
-<li>Element now raises ValueError on empty tag names</li>
-<li>Namespace fixing after moving elements between documents could fail if the
-source document was freed too early</li>
-<li>Setting namespace-less tag names on namespaced elements ('{ns}t' -&gt; 't')
-didn't reset the namespace</li>
-<li>Unknown constants from newer libxml2 versions could raise exceptions in the
-error handlers</li>
-<li>lxml.etree compiles much faster</li>
-<li>On libxml2 &lt;= 2.6.22, parsing strings with encoding declaration could fail
-in certain cases</li>
-<li>Document reference in ElementTree objects was not updated when the root
-element was moved to a different document</li>
-<li>Running absolute XPath expressions on an Element now evaluates against the
-root tree</li>
-<li>Evaluating absolute XPath expressions (<tt class="docutils literal">/*</tt>) on an ElementTree could fail</li>
-<li>Crashes when calling XSLT, RelaxNG, etc. with uninitialized ElementTree
-objects</li>
-<li>Removed public function <tt class="docutils literal">initThreadLogging()</tt>, replaced by more general
-<tt class="docutils literal">initThread()</tt> which fixes a number of setup problems in threads</li>
-<li>Memory leak when using iconv encoders in tostring/write</li>
-<li>Deep copying Elements and ElementTrees maintains the document information</li>
-<li>Serialization functions raise LookupError for unknown encodings</li>
-<li>Memory deallocation crash resulting from deep copying elements</li>
-<li>Some ElementTree methods could crash if the root node was not initialized
-(neither file nor element passed to the constructor)</li>
-<li>Element/SubElement failed to set attribute namespaces from passed <tt class="docutils literal">attrib</tt>
-dictionary</li>
-<li><tt class="docutils literal">tostring()</tt> adds an XML declaration for non-ASCII encodings</li>
-<li><tt class="docutils literal">tostring()</tt> failed to serialize encodings that contain 0-bytes</li>
-<li>ElementTree.xpath() and XPathDocumentEvaluator were not using the
-ElementTree root node as reference point</li>
-<li>Calling <tt class="docutils literal"><span class="pre">document('')</span></tt> in XSLT failed to return the stylesheet</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id350">
-<h1>0.9.2 (2006-05-10)</h1>
-<div class="section" id="id351">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Speedup for Element.makeelement(): the new element reuses the original
-libxml2 document instead of creating a new empty one</li>
-<li>Speedup for reversed() iteration over element children (Py2.4+ only)</li>
-<li>ElementTree compatible QName class</li>
-<li>RelaxNG and XMLSchema accept any Element, not only ElementTrees</li>
-</ul>
-</div>
-<div class="section" id="id352">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>str(xslt_result) was broken for XSLT output other than UTF-8</li>
-<li>Memory leak if write_c14n fails to write the file after conversion</li>
-<li>Crash in XMLSchema and RelaxNG when passing non-schema documents</li>
-<li>Memory leak in RelaxNG() when RelaxNGParseError is raised</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id353">
-<h1>0.9.1 (2006-03-30)</h1>
-<div class="section" id="id354">
-<h2>Features added</h2>
-<ul class="simple">
-<li>lxml.sax.ElementTreeContentHandler checks closing elements and raises
-SaxError on mismatch</li>
-<li>lxml.sax.ElementTreeContentHandler supports namespace-less SAX events
-(startElement, endElement) and defaults to empty attributes (keyword
-argument)</li>
-<li>Speedup for repeatedly accessing element tag names</li>
-<li>Minor API performance improvements</li>
-</ul>
-</div>
-<div class="section" id="id355">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory deallocation bug when using XSLT output method &quot;html&quot;</li>
-<li>sax.py was handling UTF-8 encoded tag names where it shouldn't</li>
-<li>lxml.tests package will no longer be installed (is still in source tar)</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id356">
-<h1>0.9 (2006-03-20)</h1>
-<div class="section" id="id357">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Error logging API for libxml2 error messages</li>
-<li>Various performance improvements</li>
-<li>Benchmark script for lxml, ElementTree and cElementTree</li>
-<li>Support for registering extension functions through new FunctionNamespace
-class (see doc/extensions.txt)</li>
-<li>ETXPath class for XPath expressions in ElementTree notation ('//{ns}tag')</li>
-<li>Support for variables in XPath expressions (also in XPath class)</li>
-<li>XPath class for compiled XPath expressions</li>
-<li>XMLID module level function (ElementTree compatible)</li>
-<li>XMLParser API for customized libxml2 parser configuration</li>
-<li>Support for custom Element classes through new Namespace API (see
-doc/namespace_extensions.txt)</li>
-<li>Common exception base class LxmlError for module exceptions</li>
-<li>real iterator support in iter(Element), Element.getiterator()</li>
-<li>XSLT objects are callable, result trees support str()</li>
-<li>Added MANIFEST.in for easier creation of RPM files.</li>
-<li>'getparent' method on elements allows navigation to an element's
-parent element.</li>
-<li>Python core compatible SAX tree builder and SAX event generator. See
-doc/sax.txt for more information.</li>
-</ul>
-</div>
-<div class="section" id="id358">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Segfaults and memory leaks in various API functions of Element</li>
-<li>Segfault in XSLT.tostring()</li>
-<li>ElementTree objects no longer interfere, Elements can be root of different
-ElementTrees at the same time</li>
-<li>document('') works in XSLT documents read from files (in-memory documents
-cannot support this due to libxslt deficiencies)</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id359">
-<h1>0.8 (2005-11-03)</h1>
-<div class="section" id="id360">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support for copy.deepcopy() on elements. copy.copy() works also, but
-does the same thing, and does <em>not</em> create a shallow copy, as that
-makes no sense in the context of libxml2 trees. This means a
-potential incompatibility with ElementTree, but there's more chance
-that it works than if copy.copy() isn't supported at all.</li>
-<li>Increased compatibility with (c)ElementTree; .parse() on ElementTree is
-supported and parsing of gzipped XML files works.</li>
-<li>implemented index() on elements, allowing one to find the index of a
-SubElement.</li>
-</ul>
-</div>
-<div class="section" id="id361">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Use xslt-config instead of xml2-config to find out libxml2
-directories to take into account a case where libxslt is installed
-in a different directory than libxslt.</li>
-<li>Eliminate crash condition in iteration when text nodes are changed.</li>
-<li>Passing 'None' to tostring() does not result in a segfault anymore,
-but an AssertionError.</li>
-<li>Some test fixes for Windows.</li>
-<li>Raise XMLSyntaxError and XPathSyntaxError instead of plain python
-syntax errors. This should be less confusing.</li>
-<li>Fixed error with uncaught exception in Pyrex code.</li>
-<li>Calling lxml.etree.fromstring('') throws XMLSyntaxError instead of a
-segfault.</li>
-<li>has_key() works on attrib. 'in' tests also work correctly on attrib.</li>
-<li>INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported
-libxml2 version, as it should.</li>
-<li>Passing a UTF-8 encoded string to the XML() function would fail;
-fixed.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id362">
-<h1>0.7 (2005-06-15)</h1>
-<div class="section" id="id363">
-<h2>Features added</h2>
-<ul class="simple">
-<li>parameters (XPath expressions) can be passed to XSLT using keyword
-parameters.</li>
-<li>Simple XInclude support. Calling the xinclude() method on a tree
-will process any XInclude statements in the document.</li>
-<li>XMLSchema support. Use the XMLSchema class or the convenience
-xmlschema() method on a tree to do XML Schema (XSD) validation.</li>
-<li>Added convenience xslt() method on tree. This is less efficient
-than the XSLT object, but makes it easier to write quick code.</li>
-<li>Added convenience relaxng() method on tree. This is less efficient
-than the RelaxNG object, but makes it easier to write quick code.</li>
-<li>Make it possible to use XPathEvaluator with elements as well. The
-XPathEvaluator in this case will retain the element so multiple
-XPath queries can be made against one element efficiently. This
-replaces the second argument to the .evaluate() method that existed
-previously.</li>
-<li>Allow registerNamespace() to be called on an XPathEvaluator, after
-creation, to add additional namespaces. Also allow registerNamespaces(),
-which does the same for a namespace dictionary.</li>
-<li>Add 'prefix' attribute to element to be able to read prefix information.
-This is entirely read-only.</li>
-<li>It is possible to supply an extra nsmap keyword parameter to
-the Element() and SubElement() constructors, which supplies a
-prefix to namespace URI mapping. This will create namespace
-prefix declarations on these elements and these prefixes will show up
-in XML serialization.</li>
-</ul>
-</div>
-<div class="section" id="id364">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Killed yet another memory management related bug: trees created
-using newDoc would not get a libxml2-level dictionary, which caused
-problems when deallocating these documents later if they contained a
-node that came from a document with a dictionary.</li>
-<li>Moving namespaced elements between documents was problematic as
-references to the original document would remain. This has been fixed
-by applying xmlReconciliateNs() after each move operation.</li>
-<li>Can pass None to 'dump()' without segfaults.</li>
-<li>tostring() works properly for non-root elements as well.</li>
-<li>Cleaned out the tostring() method so it should handle encoding
-correctly.</li>
-<li>Cleaned out the ElementTree.write() method so it should handle encoding
-correctly. Writing directly to a file should also be faster, as there is no
-need to go through a Python string in that case. Made sure the test cases
-test both serializing to StringIO as well as serializing to a real file.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id365">
-<h1>0.6 (2005-05-14)</h1>
-<div class="section" id="id366">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Changed setup.py so that library_dirs is also guessed. This should
-help with compilation on the Mac OS X platform, where otherwise the
-wrong library (shipping with the OS) could be picked up.</li>
-<li>Tweaked setup.py so that it picks up the version from version.txt.</li>
-</ul>
-</div>
-<div class="section" id="id367">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Do the right thing when handling namespaced attributes.</li>
-<li>fix bug where tostring() moved nodes into new documents. tostring()
-had very nasty side-effects before this fix, sorry!</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id368">
-<h1>0.5.1 (2005-04-09)</h1>
-<ul class="simple">
-<li>Python 2.2 compatibility fixes.</li>
-<li>unicode fixes in Element() and Comment() as well as XML(); unicode
-input wasn't properly being UTF-8 encoded.</li>
-</ul>
-</div>
-<div class="section" id="id369">
-<h1>0.5 (2005-04-08)</h1>
-<p>Initial public release.</p>
-</div>
-</div>
-<div class="footer">
-<hr class="footer" />
-Generated on: 2017-09-17.
-
-</div>
-</body>
-</html>
diff --git a/doc/html/changes-4.1.0.html b/doc/html/changes-4.1.0.html
new file mode 100644 (file)
index 0000000..fca7efa
--- /dev/null
@@ -0,0 +1,3315 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
+<title>lxml changelog</title>
+<link rel="stylesheet" href="style.css" type="text/css" />
+</head>
+<body>
+<div class="document" id="lxml-changelog">
+<h1 class="title">lxml changelog</h1>
+
+<div class="section" id="id1">
+<h1>4.1.0 (2017-10-13)</h1>
+<div class="section" id="features-added">
+<h2>Features added</h2>
+<ul class="simple">
+<li>ElementPath supports text predicates for current node, like &quot;[.='text']&quot;.</li>
+<li>ElementPath allows spaces in predicates.</li>
+<li>Custom Element classes and XPath functions can now be registered with a
+decorator rather than explicit dict assignments.</li>
+<li>Static Linux wheels are now built with link time optimisation (LTO) enabled.
+This should have a beneficial impact on the overall performance by providing
+a tighter compiler integration between lxml and libxml2/libxslt.</li>
+</ul>
+</div>
+<div class="section" id="bugs-fixed">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1722776">LP#1722776</a>: Requesting non-Element objects like comments from a document with
+<tt class="docutils literal">PythonElementClassLookup</tt> could fail with a TypeError.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id2">
+<h1>4.0.0 (2017-09-17)</h1>
+<div class="section" id="id3">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The ElementPath implementation is now compiled using Cython,
+which speeds up the <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods quite significantly.</li>
+<li>The modules <tt class="docutils literal">lxml.builder</tt>, <tt class="docutils literal">lxml.html.diff</tt> and <tt class="docutils literal">lxml.html.clean</tt>
+are also compiled using Cython in order to speed them up.</li>
+<li><tt class="docutils literal">xmlfile()</tt> supports async coroutines using <tt class="docutils literal">async with</tt> and <tt class="docutils literal">await</tt>.</li>
+<li><tt class="docutils literal">iterwalk()</tt> has a new method <tt class="docutils literal">skip_subtree()</tt> that prevents walking into
+the descendants of the current element.</li>
+<li><tt class="docutils literal">RelaxNG.from_rnc_string()</tt> accepts a <tt class="docutils literal">base_url</tt> argument to
+allow relative resource lookups.</li>
+<li>The XSLT result object has a new method <tt class="docutils literal">.write_output(file)</tt> that serialises
+output data into a file according to the <tt class="docutils literal">&lt;xsl:output&gt;</tt> configuration.</li>
+</ul>
+</div>
+<div class="section" id="id4">
+<h2>Bugs fixed</h2>
+<ul>
+<li><p class="first"><a class="reference external" href="https://github.com/lxml/lxml/issues/251">GH#251</a>: HTML comments were handled incorrectly by the soupparser.
+Patch by mozbugbox.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1654544">LP#1654544</a>: The html5parser no longer passes the <tt class="docutils literal">useChardet</tt> option
+if the input is a Unicode string, unless explicitly requested.  When parsing
+files, the default is to enable it when a URL or file path is passed (because
+the file is then opened in binary mode), and to disable it when reading from
+a file(-like) object.</p>
+<p>Note: This is a backwards incompatible change of the default configuration.
+If your code parses byte strings/streams and depends on character detection,
+please pass the option <tt class="docutils literal">guess_charset=True</tt> explicitly, which already worked
+in older lxml versions.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1703810">LP#1703810</a>: <tt class="docutils literal">etree.fromstring()</tt> failed to parse UTF-32 data with BOM.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1526522">LP#1526522</a>: Some RelaxNG errors were not reported in the error log.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1567526">LP#1567526</a>: Empty and plain text input raised a TypeError in soupparser.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1710429">LP#1710429</a>: Uninitialised variable usage in HTML diff.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1415643">LP#1415643</a>: The closing tags context manager in <tt class="docutils literal">xmlfile()</tt> could continue
+to output end tags even after writing failed with an exception.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1465357">LP#1465357</a>: <tt class="docutils literal">xmlfile.write()</tt> now accepts and ignores None as input argument.</p>
+</li>
+<li><p class="first">Compilation under Py3.7-pre failed due to a modified function signature.</p>
+</li>
+</ul>
+</div>
+<div class="section" id="other-changes">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The main module source files were renamed from <tt class="docutils literal"><span class="pre">lxml.*.pyx</span></tt> to plain
+<tt class="docutils literal">*.pyx</tt> (e.g. <tt class="docutils literal">etree.pyx</tt>) to simplify their handling in the build
+process.  Care was taken to keep the old header files as fallbacks for
+code that compiles against the public C-API of lxml, but it might still
+be worth validating that third-party code does not notice this change.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id5">
+<h1>3.8.0 (2017-06-03)</h1>
+<div class="section" id="id6">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">ElementTree.write()</tt> has a new option <tt class="docutils literal">doctype</tt> that writes out a
+doctype string before the serialisation, in the same way as <tt class="docutils literal">tostring()</tt>.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/220">GH#220</a>: <tt class="docutils literal">xmlfile</tt> allows switching output methods at an element level.
+Patch by Burak Arslan.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1595781">LP#1595781</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/240">GH#240</a>: added a PyCapsule Python API and C-level API for
+passing externally generated libxml2 documents into lxml.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/244">GH#244</a>: error log entries have a new property <tt class="docutils literal">path</tt> with an XPath
+expression (if known, None otherwise) that points to the tree element
+responsible for the error. Patch by Bob Kline.</li>
+<li>The namespace prefix mapping that can be used in ElementPath now injects
+a default namespace when passing a None prefix.</li>
+</ul>
+</div>
+<div class="section" id="id7">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/238">GH#238</a>: Character escapes were not hex-encoded in the <tt class="docutils literal">xmlfile</tt> serialiser.
+Patch by matejcik.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/229">GH#229</a>: fix for externally created XML documents.  Patch by Theodore Dubois.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1665241">LP#1665241</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/228">GH#228</a>: Form data handling in lxml.html no longer strips the
+option values specified in form attributes but only the text values.
+Patch by Ashish Kulkarni.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: revert previous fix for XSLT error logging as it breaks
+multi-threaded XSLT processing.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1673355">LP#1673355</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/233">GH#233</a>: <tt class="docutils literal">fromstring()</tt> html5parser failed to parse byte strings.</li>
+</ul>
+</div>
+<div class="section" id="id8">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The previously undocumented <tt class="docutils literal">docstring</tt> option in <tt class="docutils literal">ElementTree.write()</tt>
+produces a deprecation warning and will eventually be removed.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id9">
+<h1>3.7.4 (2017-??-??)</h1>
+<div class="section" id="id10">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: revert previous fix for XSLT error logging as it breaks
+multi-threaded XSLT processing.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1673355">LP#1673355</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/233">GH#233</a>: <tt class="docutils literal">fromstring()</tt> html5parser failed to parse byte strings.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id14">
+<h1>3.7.3 (2017-02-18)</h1>
+<div class="section" id="id15">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/218">GH#218</a> was ineffective in Python 3.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/222">GH#222</a>: <tt class="docutils literal">lxml.html.submit_form()</tt> failed in Python 3.
+Patch by Jakub Wilk.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id16">
+<h1>3.7.2 (2017-01-08)</h1>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/220">GH#220</a>: <tt class="docutils literal">xmlfile</tt> allows switching output methods at an element level.
+Patch by Burak Arslan.</li>
+</ul>
+<div class="section" id="id18">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Work around installation problems in recent Python 2.7 versions
+due to FTP download failures.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/219">GH#219</a>: <tt class="docutils literal">xmlfile.element()</tt> was not properly quoting attribute values.
+Patch by Burak Arslan.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/218">GH#218</a>: <tt class="docutils literal">xmlfile.element()</tt> was not properly escaping text content of
+script/style tags.  Patch by Burak Arslan.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id20">
+<h1>3.7.1 (2016-12-23)</h1>
+<ul class="simple">
+<li>No source changes, issued only to solve problems with the
+binary packages released for 3.7.0.</li>
+</ul>
+</div>
+<div class="section" id="id21">
+<h1>3.7.0 (2016-12-10)</h1>
+<div class="section" id="id22">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/217">GH#217</a>: <tt class="docutils literal">XMLSyntaxError</tt> now behaves more like its <tt class="docutils literal">SyntaxError</tt>
+baseclass.  Patch by Philipp A.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/216">GH#216</a>: <tt class="docutils literal">HTMLParser()</tt> now supports the same <tt class="docutils literal">collect_ids</tt> parameter
+as <tt class="docutils literal">XMLParser()</tt>.  Patch by Burak Arslan.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/210">GH#210</a>: Allow specifying a serialisation method in <tt class="docutils literal">xmlfile.write()</tt>.
+Patch by Burak Arslan.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/203">GH#203</a>: New option <tt class="docutils literal">default_doctype</tt> in <tt class="docutils literal">HTMLParser</tt> that allows
+disabling the automatic doctype creation.  Patch by Shadab Zafar.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/201">GH#201</a>: Calling the method <tt class="docutils literal"><span class="pre">.set('attrname')</span></tt> without value argument
+(or <tt class="docutils literal">None</tt>) on HTML elements creates an attribute without value that
+serialises like <tt class="docutils literal">&lt;div <span class="pre">attrname&gt;&lt;/div&gt;</span></tt>.  Patch by Daniel Holth.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/197">GH#197</a>: Ignore form input fields in <tt class="docutils literal">form_values()</tt> when they are
+marked as <tt class="docutils literal">disabled</tt> in HTML.  Patch by Kristian Klemon.</li>
+</ul>
+</div>
+<div class="section" id="id23">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/206">GH#206</a>: File name and line number were missing from XSLT error messages.
+Patch by Marcus Brinkmann.</li>
+</ul>
+</div>
+<div class="section" id="id24">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Log entries no longer allow anything but plain string objects as message text
+and file name.</li>
+<li><tt class="docutils literal">zlib</tt> is included in the list of statically built libraries.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id25">
+<h1>3.6.4 (2016-08-20)</h1>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/204">GH#204</a>, <a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614693">LP#1614693</a>: build fix for MacOS-X.</li>
+</ul>
+</div>
+<div class="section" id="id26">
+<h1>3.6.3 (2016-08-18)</h1>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614603">LP#1614603</a>: change linker flags to build multi-linux wheels</li>
+</ul>
+</div>
+<div class="section" id="id27">
+<h1>3.6.2 (2016-08-18)</h1>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614603">LP#1614603</a>: release without source changes to provide cleanly built Linux wheels</li>
+</ul>
+</div>
+<div class="section" id="id29">
+<h1>3.6.1 (2016-07-24)</h1>
+<div class="section" id="id30">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/180">GH#180</a>: Separate option <tt class="docutils literal">inline_style</tt> for Cleaner that only removes <tt class="docutils literal">style</tt>
+attributes instead of all styles.  Patch by Christian Pedersen.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/196">GH#196</a>: Windows build support for Python 3.5.  Contribution by Maximilian Hils.</li>
+</ul>
+</div>
+<div class="section" id="id31">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/199">GH#199</a>: Exclude <tt class="docutils literal">file</tt> fields from <tt class="docutils literal">FormElement.form_values</tt> (as browsers do).
+Patch by Tomas Divis.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/198">GH#198</a>, <a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1568167">LP#1568167</a>: Try to provide base URL from <tt class="docutils literal">Resolver.resolve_string()</tt>.
+Patch by Michael van Tellingen.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/191">GH#191</a>: More accurate float serialisation in <tt class="docutils literal">objectify.FloatElement</tt>.
+Patch by Holger Joukl.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: Repair XSLT error logging. Patch by Marcus Brinkmann.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id33">
+<h1>3.6.0 (2016-03-17)</h1>
+<div class="section" id="id34">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/187">GH#187</a>: Now supports (only) version 5.x and later of PyPy.
+Patch by Armin Rigo.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/181">GH#181</a>: Direct support for <tt class="docutils literal">.rnc</tt> files in <cite>RelaxNG()</cite> if <tt class="docutils literal">rnc2rng</tt>
+is installed.  Patch by Dirkjan Ochtman.</li>
+</ul>
+</div>
+<div class="section" id="id35">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/189">GH#189</a>: Static builds honour FTP proxy configurations when downloading
+the external libs.  Patch by Youhei Sakurai.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/186">GH#186</a>: Soupparser failed to process entities in Python 3.x.
+Patch by Duncan Morris.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/185">GH#185</a>: Rare encoding related <tt class="docutils literal">TypeError</tt> on import was fixed.
+Patch by Petr Demin.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id36">
+<h1>3.5.0 (2015-11-13)</h1>
+<div class="section" id="id37">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Unicode string results failed XPath queries in PyPy.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1497051">LP#1497051</a>: HTML target parser failed to terminate on exceptions
+and continued parsing instead.</li>
+<li>Deprecated API usage in doctestcompare.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="b1-2015-09-18">
+<h1>3.5.0b1 (2015-09-18)</h1>
+<div class="section" id="id38">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">cleanup_namespaces()</tt> accepts a new argument <tt class="docutils literal">keep_ns_prefixes</tt>
+that does not remove definitions of the provided prefix-namespace
+mapping from the tree.</li>
+<li><tt class="docutils literal">cleanup_namespaces()</tt> accepts a new argument <tt class="docutils literal">top_nsmap</tt> that
+moves definitions of the provided prefix-namespace mapping to the
+top of the tree.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1490451">LP#1490451</a>: <tt class="docutils literal">Element</tt> objects gained a <tt class="docutils literal">cssselect()</tt> method as
+known from <tt class="docutils literal">lxml.html</tt>.  Patch by Simon Sapin.</li>
+<li>API functions and methods behave and look more like Python functions,
+which allows introspection on them etc.  One side effect to be aware of
+is that the functions now bind as methods when assigned to a class
+variable.  A quick fix is to wrap them in <tt class="docutils literal">staticmethod()</tt> (as for
+normal Python functions).</li>
+<li>ISO-Schematron support gained an option <tt class="docutils literal">error_finder</tt> that allows
+passing a filter function for picking validation errors from reports.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1243600">LP#1243600</a>: Elements in <tt class="docutils literal">lxml.html</tt> gained a <tt class="docutils literal">classes</tt> property
+that provides a set-like interface to the <tt class="docutils literal">class</tt> attribute.
+Original patch by masklinn.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1341964">LP#1341964</a>: The soupparser now handles DOCTYPE declarations, comments
+and processing instructions outside of the root element.
+Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421512">LP#1421512</a>: The <tt class="docutils literal">docinfo</tt> of a tree was made editable to allow
+setting and removing the public ID and system ID of the DOCTYPE.
+Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1442427">LP#1442427</a>: More work-arounds for quirks and bugs in pypy and pypy3.</li>
+<li><tt class="docutils literal">lxml.html.soupparser</tt> now uses BeautifulSoup version 4 instead
+of version 3 if available.</li>
+</ul>
+</div>
+<div class="section" id="id39">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory errors that occur during tree adaptations (e.g. moving subtrees
+to foreign documents) could leave the tree in a crash prone state.</li>
+<li>Calling <tt class="docutils literal">process_children()</tt> in an XSLT extension element without
+an <tt class="docutils literal">output_parent</tt> argument failed with a <tt class="docutils literal">TypeError</tt>.
+Fix by Jens Tröger.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/162">GH#162</a>: Image data in HTML <tt class="docutils literal">data</tt> URLs is considered safe and
+no longer removed by <tt class="docutils literal">lxml.html.clean</tt> JavaScript cleaner.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/166">GH#166</a>: Static build could link libraries in wrong order.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/172">GH#172</a>: Rely a bit more on libxml2 for encoding detection rather than
+rolling our own in some cases.  Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/159">GH#159</a>: Validity checks for names and string content were tightened
+to detect the use of illegal characters early.  Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421921">LP#1421921</a>: Comments/PIs before the DOCTYPE declaration were not
+serialised.  Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/659367">LP#659367</a>: Some HTML DOCTYPE declarations were not serialised.
+Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1238503">LP#1238503</a>: lxml.doctestcompare is now consistent with stdlib's doctest
+in how it uses <tt class="docutils literal">+</tt> and <tt class="docutils literal">-</tt> to refer to unexpected and missing output.</li>
+<li>Empty prefixes are explicitly rejected when a namespace mapping is used
+with ElementPath to avoid hiding bugs in user code.</li>
+<li>Several problems with PyPy were fixed by switching to Cython 0.23.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id40">
+<h1>3.4.4 (2015-04-25)</h1>
+<div class="section" id="id41">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>An ElementTree compatibility test added in lxml 3.4.3 that failed in
+Python 3.4+ was removed again.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id42">
+<h1>3.4.3 (2015-04-15)</h1>
+<div class="section" id="id43">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Expression cache in ElementPath was ignored.  Fix by Changaco.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1426868">LP#1426868</a>: Passing a default namespace and a prefixed namespace mapping
+as nsmap into <tt class="docutils literal">xmlfile.element()</tt> raised a <tt class="docutils literal">TypeError</tt>.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421927">LP#1421927</a>: DOCTYPE system URLs were incorrectly quoted when containing
+double quotes.  Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1419354">LP#1419354</a>: meta-redirect URLs were incorrectly processed by
+<tt class="docutils literal">iterlinks()</tt> if preceded by whitespace.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id44">
+<h1>3.4.2 (2015-02-07)</h1>
+<div class="section" id="id45">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1415907">LP#1415907</a>: Crash when creating an XMLSchema from a non-root element
+of an XML document.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1369362">LP#1369362</a>: HTML cleaning failed when hitting processing instructions
+with pseudo-attributes.</li>
+<li><tt class="docutils literal">CDATA()</tt> wrapped content was rejected for tail text.</li>
+<li>CDATA sections were not serialised as tail text of the top-level element.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id46">
+<h1>3.4.1 (2014-11-20)</h1>
+<div class="section" id="id47">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New <tt class="docutils literal">htmlfile</tt> HTML generator to accompany the incremental <tt class="docutils literal">xmlfile</tt>
+serialisation API.  Patch by Burak Arslan.</li>
+</ul>
+</div>
+<div class="section" id="id48">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.sax.ElementTreeContentHandler</tt> did not initialise its superclass.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id49">
+<h1>3.4.0 (2014-09-10)</h1>
+<div class="section" id="id50">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">xmlfile(buffered=False)</tt> disables output buffering and flushes the
+content after each API operation (starting/ending element blocks or writes).
+A new method <tt class="docutils literal">xf.flush()</tt> can alternatively be used to explicitly flush
+the output.</li>
+<li><tt class="docutils literal">lxml.html.document_fromstring</tt> has a new option <tt class="docutils literal">ensure_head_body=True</tt>
+which will add an empty head and/or body element to the result document if
+missing.</li>
+<li><tt class="docutils literal">lxml.html.iterlinks</tt> now returns links inside meta refresh tags.</li>
+<li>New <tt class="docutils literal">XMLParser</tt> option <tt class="docutils literal">collect_ids=False</tt> to disable ID hash table
+creation.  This can substantially speed up parsing of documents with many
+different IDs that are not used.</li>
+<li>The parser uses per-document hash tables for XML IDs.  This reduces the
+load of the global parser dict and speeds up parsing for documents with
+many different IDs.</li>
+<li><tt class="docutils literal">ElementTree.getelementpath(element)</tt> returns a structural ElementPath
+expression for the given element, which can be used for lookups later.</li>
+<li><tt class="docutils literal">xmlfile()</tt> accepts a new argument <tt class="docutils literal">close=True</tt> to close file(-like)
+objects after writing to them.  Before, <tt class="docutils literal">xmlfile()</tt> only closed the file
+if it had opened it internally.</li>
+<li>Allow &quot;bytearray&quot; type for ASCII text input.</li>
+</ul>
+</div>
+<div class="section" id="id51">
+<h2>Bugs fixed</h2>
+</div>
+<div class="section" id="id52">
+<h2>Other changes</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/400588">LP#400588</a>: decoding errors have become hard errors even in recovery mode.
+Previously, they could lead to an internal tree representation in a mixed
+encoding state, which lead to very late errors or even silently incorrect
+behaviour during tree traversal or serialisation.</li>
+<li>Requires Python 2.6, 2.7, 3.2 or later. No longer supports
+Python 2.4, 2.5 and 3.1, use lxml 3.3.x for those.</li>
+<li>Requires libxml2 2.7.0 or later and libxslt 1.1.23 or later,
+use lxml 3.3.x with older versions.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id53">
+<h1>3.3.6 (2014-08-28)</h1>
+<div class="section" id="id54">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Prevent tree cycle creation when adding Elements as siblings.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1361948">LP#1361948</a>: crash when deallocating Element siblings without parent.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1354652">LP#1354652</a>: crash when traversing internally loaded documents in XSLT
+extension functions.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id55">
+<h1>3.3.5 (2014-04-18)</h1>
+<div class="section" id="id56">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>HTML cleaning could fail to strip javascript links that mix control
+characters into the link scheme.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id57">
+<h1>3.3.4 (2014-04-03)</h1>
+<div class="section" id="id58">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Source line numbers above 65535 are available on Elements when
+using libxml2 2.9 or later.</li>
+</ul>
+</div>
+<div class="section" id="id59">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.html.fragment_fromstring()</tt> failed for bytes input in Py3.</li>
+</ul>
+</div>
+<div class="section" id="id60">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id61">
+<h1>3.3.3 (2014-03-04)</h1>
+<div class="section" id="id62">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1287118">LP#1287118</a>: Crash when using Element subtypes with <tt class="docutils literal">__slots__</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id63">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The internal classes <tt class="docutils literal">_LogEntry</tt> and <tt class="docutils literal">_Attrib</tt> can no longer be
+subclassed from Python code.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id64">
+<h1>3.3.2 (2014-02-26)</h1>
+<div class="section" id="id65">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The properties <tt class="docutils literal">resolvers</tt> and <tt class="docutils literal">version</tt>, as well as the methods
+<tt class="docutils literal">set_element_class_lookup()</tt> and <tt class="docutils literal">makeelement()</tt>, were lost from
+<tt class="docutils literal">iterparse</tt> objects in 3.3.0.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1222132">LP#1222132</a>: instances of <tt class="docutils literal">XMLSchema</tt>, <tt class="docutils literal">Schematron</tt> and <tt class="docutils literal">RelaxNG</tt>
+did not clear their local <tt class="docutils literal">error_log</tt> before running a validation.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1238500">LP#1238500</a>: lxml.doctestcompare mixed up &quot;expected&quot; and &quot;actual&quot; in
+attribute values.</li>
+<li>Some file I/O tests were failing in MS-Windows due to non-portable temp
+file usage.  Initial patch by Gabi Davar.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/910014">LP#910014</a>: duplicate IDs in a document were not reported by DTD validation.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1185332">LP#1185332</a>: <tt class="docutils literal"><span class="pre">tostring(method=&quot;html&quot;)</span></tt> did not use HTML serialisation
+semantics for trailing tail text.  Initial patch by Sylvain Viollon.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1281139">LP#1281139</a>: <tt class="docutils literal">.attrib</tt> value of Comments lost its mutation methods
+in 3.3.0.  Even though it is empty and immutable, it should still
+provide the same interface as that returned for Elements.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id66">
+<h1>3.3.1 (2014-02-12)</h1>
+<div class="section" id="id67">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id68">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1014290">LP#1014290</a>: HTML documents parsed with <tt class="docutils literal">parser.feed()</tt> failed to find
+elements during tag iteration.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1273709">LP#1273709</a>: Building in PyPy failed due to missing support for
+<tt class="docutils literal">PyUnicode_Compare()</tt> and <tt class="docutils literal"><span class="pre">PyByteArray_*()</span></tt> in PyPy's C-API.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1274413">LP#1274413</a>: Compilation in MSVC failed due to missing &quot;stdint.h&quot; standard
+header file.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1274118">LP#1274118</a>: iterparse() failed to parse BOM prefixed files.</li>
+</ul>
+</div>
+<div class="section" id="id69">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id70">
+<h1>3.3.0 (2014-01-26)</h1>
+<div class="section" id="id71">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id72">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The heuristic that distinguishes file paths from URLs was tightened
+to produce less false negatives.</li>
+</ul>
+</div>
+<div class="section" id="id73">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="beta5-2014-01-18">
+<h1>3.3.0beta5 (2014-01-18)</h1>
+<div class="section" id="id74">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The PEP 393 unicode parsing support gained a fallback for wchar strings
+which might still be somewhat common on Windows systems.</li>
+</ul>
+</div>
+<div class="section" id="id75">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Several error handling problems were fixed throughout the code base that
+could previously lead to exceptions being silently swallowed or not
+properly reported.</li>
+<li>The C-API function <tt class="docutils literal">appendChild()</tt> is now deprecated as it does not
+propagate exceptions (its return type is <tt class="docutils literal">void</tt>).  The new function
+<tt class="docutils literal">appendChildToElement()</tt> was added as a safe replacement.</li>
+<li>Passing a string into <tt class="docutils literal">fromstringlist()</tt> raises an exception instead of
+parsing the string character by character.</li>
+</ul>
+</div>
+<div class="section" id="id76">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Document cleanup code was simplified using the new GC features in
+Cython 0.20.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta4-2014-01-12">
+<h1>3.3.0beta4 (2014-01-12)</h1>
+<div class="section" id="id77">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id78">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The (empty) value returned by the <tt class="docutils literal">attrib</tt> property of Entity and Comment
+objects was mutable.</li>
+<li>Element class lookup wasn't available for the new pull parsers or when using
+a custom parser target.</li>
+<li>Setting Element attributes on instantiation with both the <tt class="docutils literal">attrib</tt> argument
+and keyword arguments could modify the mapping passed as <tt class="docutils literal">attrib</tt>.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1266171">LP#1266171</a>: DTDs instantiated from internal/external subsets (i.e. through
+the docinfo property) lost their attribute declarations.</li>
+</ul>
+</div>
+<div class="section" id="id79">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Built with Cython 0.20pre (gitrev 012ae82eb) to prepare support for
+Python 3.4.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta3-2014-01-02">
+<h1>3.3.0beta3 (2014-01-02)</h1>
+<div class="section" id="id80">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Unicode string parsing was optimised for Python 3.3 (PEP 393).</li>
+</ul>
+</div>
+<div class="section" id="id81">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>HTML parsing of Unicode strings could misdecode the input on some platforms.</li>
+<li>Crash in xmlfile() when closing open elements out of order in an error case.</li>
+</ul>
+</div>
+<div class="section" id="id82">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="beta2-2013-12-20">
+<h1>3.3.0beta2 (2013-12-20)</h1>
+<div class="section" id="id83">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">iterparse()</tt> supports the <tt class="docutils literal">recover</tt> option.</li>
+</ul>
+</div>
+<div class="section" id="id84">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in <tt class="docutils literal">iterparse()</tt> for HTML parsing.</li>
+<li>Crash in target parsing with attributes.</li>
+</ul>
+</div>
+<div class="section" id="id85">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The safety check in the read-only tree implementation (e.g. used by
+<tt class="docutils literal">PythonElementClassLookup</tt>) raises a more appropriate <tt class="docutils literal">ReferenceError</tt>
+for illegal access after tree disposal instead of an <tt class="docutils literal">AssertionError</tt>.
+This should only impact test code that specifically checks the original
+behaviour.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta1-2013-12-12">
+<h1>3.3.0beta1 (2013-12-12)</h1>
+<div class="section" id="id86">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New option <tt class="docutils literal">handle_failures</tt> in <tt class="docutils literal">make_links_absolute()</tt> and
+<tt class="docutils literal">resolve_base_href()</tt> (lxml.html) that enables ignoring or
+discarding links that fail to parse as URLs.</li>
+<li>New parser classes <tt class="docutils literal">XMLPullParser</tt> and <tt class="docutils literal">HTMLPullParser</tt> for
+incremental parsing, as implemented for ElementTree in Python 3.4.</li>
+<li><tt class="docutils literal">iterparse()</tt> enables recovery mode by default for HTML parsing
+(<tt class="docutils literal">html=True</tt>).</li>
+</ul>
+</div>
+<div class="section" id="id87">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1255132">LP#1255132</a>: crash when trying to run validation over non-Element (e.g.
+comment or PI).</li>
+<li>Error messages in the log and in exception messages that originated
+from libxml2 could accidentally be picked up from preceding warnings
+instead of the actual error.</li>
+<li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify did not accept a dict as
+argument for adding attributes to the element it's building. This
+works as in lxml.builder now.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1228881">LP#1228881</a>: <tt class="docutils literal">repr(XSLTAccessControl)</tt> failed in Python 3.</li>
+<li>Raise <tt class="docutils literal">ValueError</tt> when trying to append an Element to itself or
+to one of its own descendants, instead of running into an infinite
+loop.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1206077">LP#1206077</a>: htmldiff discarded whitespace from the output.</li>
+<li>Compressed plain-text serialisation to file-like objects was broken.</li>
+<li>lxml.html.formfill: Fix textarea form filling.
+The textarea used to be cleared before the new content was set,
+which removed the name attribute.</li>
+</ul>
+</div>
+<div class="section" id="id88">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Some basic API classes use freelists internally for faster
+instantiation.  This can speed up some <tt class="docutils literal">iterparse()</tt> scenarios,
+for example.</li>
+<li><tt class="docutils literal">iterparse()</tt> was rewritten to use the new <tt class="docutils literal">*PullParser</tt>
+classes internally instead of being a parser itself.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id89">
+<h1>3.2.5 (2014-01-02)</h1>
+<div class="section" id="id90">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id91">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in xmlfile() when closing open elements out of order in an error case.</li>
+<li>Crash in target parsing with attributes.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1255132">LP#1255132</a>: crash when trying to run validation over non-Element (e.g.
+comment or PI).</li>
+</ul>
+</div>
+<div class="section" id="id93">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id94">
+<h1>3.2.4 (2013-11-07)</h1>
+<div class="section" id="id95">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id96">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory leak when creating an XPath evaluator in a thread.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1228881">LP#1228881</a>: <tt class="docutils literal">repr(XSLTAccessControl)</tt> failed in Python 3.</li>
+<li>Raise <tt class="docutils literal">ValueError</tt> when trying to append an Element to itself or
+to one of its own descendants.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1206077">LP#1206077</a>: htmldiff discarded whitespace from the output.</li>
+<li>Compressed plain-text serialisation to file-like objects was broken.</li>
+</ul>
+</div>
+<div class="section" id="id99">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id100">
+<h1>3.2.3 (2013-07-28)</h1>
+<div class="section" id="id101">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fix support for Python 2.4 which was lost in 3.2.2.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id102">
+<h1>3.2.2 (2013-07-28)</h1>
+<div class="section" id="id103">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id104">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1185701">LP#1185701</a>: spurious XMLSyntaxError after finishing iterparse().</li>
+<li>Crash in lxml.objectify during xsi annotation.</li>
+</ul>
+</div>
+<div class="section" id="id105">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Return values of user provided element class lookup methods are now
+validated against the type of the XML node they represent to prevent
+API class mismatches.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id106">
+<h1>3.2.1 (2013-05-11)</h1>
+<div class="section" id="id107">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The methods <tt class="docutils literal">apply_templates()</tt> and <tt class="docutils literal">process_children()</tt> of XSLT
+extension elements have gained two new boolean options <tt class="docutils literal">elements_only</tt>
+and <tt class="docutils literal">remove_blank_text</tt> that discard either all strings or whitespace-only
+strings from the result list.</li>
+</ul>
+</div>
+<div class="section" id="id108">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>When moving Elements to another tree, the namespace cleanup mechanism
+no longer drops namespace prefixes from attributes for which it finds
+a default namespace declaration, to prevent them from appearing as
+unnamespaced attributes after serialisation.</li>
+<li>Returning non-type objects from a custom class lookup method could lead
+to a crash.</li>
+<li>Instantiating and using subtypes of Comments and ProcessingInstructions
+crashed.</li>
+</ul>
+</div>
+<div class="section" id="id109">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id110">
+<h1>3.2.0 (2013-04-28)</h1>
+<div class="section" id="id111">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id112">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/690319">LP#690319</a>: Leading whitespace could change the behaviour of the string
+parsing functions in <tt class="docutils literal">lxml.html</tt>.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/599318">LP#599318</a>: The string parsing functions in <tt class="docutils literal">lxml.html</tt> are more robust
+in the face of uncommon HTML content like framesets or missing body tags.
+Patch by Stefan Seelmann.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/712941">LP#712941</a>: I/O errors while trying to access files with paths that contain
+non-ASCII characters could raise <tt class="docutils literal">UnicodeDecodeError</tt> instead of properly
+reporting the <tt class="docutils literal">IOError</tt>.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/673205">LP#673205</a>: Parsing from in-memory strings disabled network access in the
+default parser and made subsequent attempts to parse from a URL fail.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/971754">LP#971754</a>: lxml.html.clean appends 'nofollow' to 'rel' attributes instead
+of overwriting the current value.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/715687">LP#715687</a>: lxml.html.clean no longer discards scripts that are explicitly
+allowed by the user provided whitelist.  Patch by Christine Koppelt.</li>
+</ul>
+</div>
+<div class="section" id="id113">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id114">
+<h1>3.1.2 (2013-04-12)</h1>
+<div class="section" id="id115">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id116">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1136509">LP#1136509</a>: Passing attributes through the namespace-unaware API of
+the sax bridge (i.e. the <tt class="docutils literal">handler.startElement()</tt> method) failed
+with a <tt class="docutils literal">TypeError</tt>.  Patch by Mike Bayer.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1123074">LP#1123074</a>: Fix serialisation error in XSLT output when converting
+the result tree to a Unicode string.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/105">GH#105</a>: Replace illegal usage of <tt class="docutils literal">xmlBufLength()</tt> in libxml2 2.9.0
+by properly exported API function <tt class="docutils literal">xmlBufUse()</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id117">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id118">
+<h1>3.1.1 (2013-03-29)</h1>
+<div class="section" id="id119">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id120">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1160386">LP#1160386</a>: Write access to <tt class="docutils literal">lxml.html.FormElement.fields</tt> raised
+an AttributeError in Py3.</li>
+<li>Illegal memory access during cleanup in incremental xmlfile writer.</li>
+</ul>
+</div>
+<div class="section" id="id121">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The externally useless class <tt class="docutils literal">lxml.etree._BaseParser</tt> was removed
+from the module dict.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id122">
+<h1>3.1.0 (2013-02-10)</h1>
+<div class="section" id="id123">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/89">GH#89</a>: lxml.html.clean allows overriding the set of attributes that it
+considers 'safe'.  Patch by Francis Devereux.</li>
+</ul>
+</div>
+<div class="section" id="id124">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1104370">LP#1104370</a>: <tt class="docutils literal">copy.copy(el.attrib)</tt> raised an exception.  It now returns
+a copy of the attributes as a plain Python dict.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/95">GH#95</a>: When used with namespace prefixes, the  <tt class="docutils literal"><span class="pre">el.find*()</span></tt> methods
+always used the first namespace mapping that was provided for each
+path expression instead of using the one that was actually passed
+in for the current run.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1092521">LP#1092521</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/91">GH#91</a>: Fix undefined C symbol in Python runtimes compiled
+without threading support.  Patch by Ulrich Seidl.</li>
+</ul>
+</div>
+<div class="section" id="id125">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="beta1-2012-12-21">
+<h1>3.1beta1 (2012-12-21)</h1>
+<div class="section" id="id126">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New build-time option <tt class="docutils literal"><span class="pre">--with-unicode-strings</span></tt> for Python 2 that
+makes the API always return Unicode strings for names and text
+instead of byte strings for plain ASCII content.</li>
+<li>New incremental XML file writing API <tt class="docutils literal">etree.xmlfile()</tt>.</li>
+<li>E factory in lxml.objectify is callable to simplify the creation of
+tags with non-identifier names without having to resort to getattr().</li>
+</ul>
+</div>
+<div class="section" id="id127">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>When starting from a non-namespaced element in lxml.objectify, searching
+for a child without explicitly specifying a namespace incorrectly found
+namespaced elements with the requested local name, instead of restricting
+the search to non-namespaced children.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/85">GH#85</a>: Deprecation warnings were fixed for Python 3.x.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/33">GH#33</a>: lxml.html.fromstring() failed to accept bytes input in Py3.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1080792">LP#1080792</a>: Static build of libxml2 2.9.0 failed due to missing file.</li>
+</ul>
+</div>
+<div class="section" id="id128">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The externally useless class <tt class="docutils literal">_ObjectifyElementMakerCaller</tt> was
+removed from the module API of lxml.objectify.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1075622">LP#1075622</a>: lxml.builder is faster for adding text to elements with
+many children.  Patch by Anders Hammarquist.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id129">
+<h1>3.0.2 (2012-12-14)</h1>
+<div class="section" id="id130">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id131">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fix crash during interpreter shutdown by switching to Cython 0.17.3 for building.</li>
+</ul>
+</div>
+<div class="section" id="id132">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id133">
+<h1>3.0.1 (2012-10-14)</h1>
+<div class="section" id="id134">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id135">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1065924">LP#1065924</a>: Element proxies could disappear during garbage collection
+in PyPy without proper cleanup.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/71">GH#71</a>: Failure to work with libxml2 2.6.x.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1065139">LP#1065139</a>: static MacOS-X build failed in Py3.</li>
+</ul>
+</div>
+<div class="section" id="id136">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id137">
+<h1>3.0 (2012-10-08)</h1>
+<div class="section" id="id138">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id139">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>End-of-file handling was incorrect in iterparse() when reading from
+a low-level C file stream and failed in libxml2 2.9.0 due to its
+improved consistency checks.</li>
+</ul>
+</div>
+<div class="section" id="id140">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The build no longer uses Cython by default unless the generated C files
+are missing.  To use Cython, pass the option &quot;--with-cython&quot;.  To ignore
+the fatal build error when Cython is required but not available (e.g. to
+run special setup.py commands that do not actually run a build), pass
+&quot;--without-cython&quot;.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta1-2012-09-26">
+<h1>3.0beta1 (2012-09-26)</h1>
+<div class="section" id="id141">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Python level access to (optional) libxml2 memory debugging features
+to simplify debugging of memory leaks etc.</li>
+</ul>
+</div>
+<div class="section" id="id142">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fix a memory leak in XPath by switching to Cython 0.17.1.</li>
+<li>Some tests were adapted to work with PyPy.</li>
+</ul>
+</div>
+<div class="section" id="id143">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The code was adapted to work with the upcoming libxml2 2.9.0 release.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="alpha2-2012-08-23">
+<h1>3.0alpha2 (2012-08-23)</h1>
+<div class="section" id="id144">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The <tt class="docutils literal">.iter()</tt> method of elements now accepts <tt class="docutils literal">tag</tt> arguments like
+<tt class="docutils literal"><span class="pre">&quot;{*}name&quot;</span></tt> to search for elements with a given local name in any
+namespace. With this addition, all combinations of wildcards now work
+as expected:
+<tt class="docutils literal">&quot;{ns}name&quot;</tt>, <tt class="docutils literal"><span class="pre">&quot;{}name&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{*}name&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{ns}*&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{}*&quot;</span></tt>
+and <tt class="docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt>.  Note that <tt class="docutils literal">&quot;name&quot;</tt> is equivalent to <tt class="docutils literal"><span class="pre">&quot;{}name&quot;</span></tt>,
+but <tt class="docutils literal">&quot;*&quot;</tt> is <tt class="docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt>.
+The same change applies to the <tt class="docutils literal">.getiterator()</tt>, <tt class="docutils literal">.itersiblings()</tt>,
+<tt class="docutils literal">.iterancestors()</tt>, <tt class="docutils literal">.iterdescendants()</tt>, <tt class="docutils literal">.iterchildren()</tt>
+and <tt class="docutils literal">.itertext()</tt> methods;the <tt class="docutils literal">strip_attributes()</tt>,
+<tt class="docutils literal">strip_elements()</tt> and <tt class="docutils literal">strip_tags()</tt> functions as well as the
+<tt class="docutils literal">iterparse()</tt> class.  Patch by Simon Sapin.</li>
+<li>C14N allows specifying the inclusive prefixes to be promoted
+to top-level during exclusive serialisation.</li>
+</ul>
+</div>
+<div class="section" id="id145">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Passing long Unicode strings into the <tt class="docutils literal">feed()</tt> parser interface
+failed to read the entire string.</li>
+</ul>
+</div>
+<div class="section" id="id146">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="alpha1-2012-07-31">
+<h1>3.0alpha1 (2012-07-31)</h1>
+<div class="section" id="id147">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Initial support for building in PyPy (through cpyext).</li>
+<li>DTD objects gained an API that allows read access to their
+declarations.</li>
+<li><tt class="docutils literal">xpathgrep.py</tt> gained support for parsing line-by-line (e.g.
+from grep output) and for surrounding the output with a new root
+tag.</li>
+<li><tt class="docutils literal"><span class="pre">E-factory</span></tt> in <tt class="docutils literal">lxml.builder</tt> accepts subtypes of known data
+types (such as string subtypes) when building elements around them.</li>
+<li>Tree iteration and <tt class="docutils literal">iterparse()</tt> with a selective <tt class="docutils literal">tag</tt>
+argument supports passing a set of tags.  Tree nodes will be
+returned by the iterators if they match any of the tags.</li>
+</ul>
+</div>
+<div class="section" id="id148">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods in <tt class="docutils literal">lxml.objectify</tt> no longer use XPath
+internally, which makes them faster in many cases (especially when
+short circuiting after a single or couple of elements) and fixes
+some behavioural differences compared to <tt class="docutils literal">lxml.etree</tt>.  Note that
+this means that they no longer support arbitrary XPath expressions
+but only the subset that the <tt class="docutils literal">ElementPath</tt> language supports.
+The previous implementation was also redundant with the normal
+XPath support, which can be used as a replacement.</li>
+<li><tt class="docutils literal"><span class="pre">el.find('*')</span></tt> could accidentally return a comment or processing
+instruction that happened to be in the wrong spot.  (Same for the
+other <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods.)</li>
+<li>The error logging is less intrusive and avoids a global setup where
+possible.</li>
+<li>Fixed undefined names in html5lib parser.</li>
+<li><tt class="docutils literal">xpathgrep.py</tt> did not work in Python 3.</li>
+<li><tt class="docutils literal">Element.attrib.update()</tt> did not accept an <tt class="docutils literal">attrib</tt> of
+another Element as parameter.</li>
+<li>For subtypes of <tt class="docutils literal">ElementBase</tt> that make the <tt class="docutils literal">.text</tt> or <tt class="docutils literal">.tail</tt>
+properties immutable (as in objectify, for example), inserting text
+when creating Elements through the E-Factory feature of the class
+constructor would fail with an exception, stating that the text
+cannot be modified.</li>
+</ul>
+</div>
+<div class="section" id="id149">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The code base was overhauled to properly use 'const' where the API
+of libxml2 and libxslt requests it.  This also has an impact on the
+public C-API of lxml itself, as defined in <tt class="docutils literal">etreepublic.pxd</tt>, as
+well as the provided declarations in the <tt class="docutils literal">lxml/includes/</tt> directory.
+Code that uses these declarations may have to be adapted.  On the
+plus side, this fixes several C compiler warnings, also for user
+code, thus making it easier to spot real problems again.</li>
+<li>The functionality of &quot;lxml.cssselect&quot; was moved into a separate PyPI
+package called &quot;cssselect&quot;.  To continue using it, you must install
+that package separately.  The &quot;lxml.cssselect&quot; module is still
+available and provides the same interface, provided the &quot;cssselect&quot;
+package can be imported at runtime.</li>
+<li>Element attributes passed in as an <tt class="docutils literal">attrib</tt> dict or as keyword
+arguments are now sorted by (namespaced) name before being created
+to make their order predictable for serialisation and iteration.
+Note that adding or deleting attributes afterwards does not take
+that order into account, i.e. setting a new attribute appends it
+after the existing ones.</li>
+<li>Several classes that are for internal use only were removed
+from the <tt class="docutils literal">lxml.etree</tt> module dict:
+<tt class="docutils literal">_InputDocument, _ResolverRegistry, _ResolverContext, _BaseContext,
+_ExsltRegExp, _IterparseContext, _TempStore, _ExceptionContext,
+__ContentOnlyElement, _AttribIterator, _NamespaceRegistry,
+_ClassNamespaceRegistry, _FunctionNamespaceRegistry,
+_XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
+_FileReaderContext, _ParserContext, _PythonSaxParserTarget,
+_TargetParserContext, _ReadOnlyProxy, _ReadOnlyPIProxy,
+_ReadOnlyEntityProxy, _ReadOnlyElementProxy, _OpaqueNodeWrapper,
+_OpaqueDocumentWrapper, _ModifyContentOnlyProxy,
+_ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
+_AppendOnlyElementProxy, _SaxParserContext, _FilelikeWriter,
+_ParserSchemaValidationContext, _XPathContext,
+_XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam</tt></li>
+<li>Several internal classes can no longer be inherited from:
+<tt class="docutils literal">_InputDocument, _ResolverRegistry, _ExsltRegExp, _ElementUnicodeResult,
+_IterparseContext, _TempStore, _AttribIterator, _ClassNamespaceRegistry,
+_XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
+_FileReaderContext, _PythonSaxParserTarget, _TargetParserContext,
+_ReadOnlyPIProxy, _ReadOnlyEntityProxy, _OpaqueDocumentWrapper,
+_ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
+_AppendOnlyElementProxy, _FilelikeWriter, _ParserSchemaValidationContext,
+_XPathContext, _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam,
+_XSLTResultTree, _XSLTProcessingInstruction</tt></li>
+</ul>
+</div>
+</div>
+<div class="section" id="id150">
+<h1>2.3.6 (2012-09-28)</h1>
+<div class="section" id="id151">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id152">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Passing long Unicode strings into the <tt class="docutils literal">feed()</tt> parser interface
+failed to read the entire string.</li>
+</ul>
+</div>
+<div class="section" id="id153">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id154">
+<h1>2.3.5 (2012-07-31)</h1>
+<div class="section" id="id155">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id156">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when merging text nodes in <tt class="docutils literal">element.remove()</tt>.</li>
+<li>Crash in sax/target parser when reporting empty doctype.</li>
+</ul>
+</div>
+<div class="section" id="id157">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id158">
+<h1>2.3.4 (2012-03-26)</h1>
+<div class="section" id="id159">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id160">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when building an nsmap (Element property) with empty
+namespace URIs.</li>
+<li>Crash due to race condition when errors (or user messages) occur
+during threaded XSLT processing.</li>
+<li>XSLT stylesheet compilation could ignore compilation errors.</li>
+</ul>
+</div>
+<div class="section" id="id161">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id162">
+<h1>2.3.3 (2012-01-04)</h1>
+<div class="section" id="id163">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.html.tostring()</tt> gained new serialisation options
+<tt class="docutils literal">with_tail</tt> and <tt class="docutils literal">doctype</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id164">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fixed a crash when using <tt class="docutils literal">iterparse()</tt> for HTML parsing and
+requesting start events.</li>
+<li>Fixed parsing of more selectors in cssselect.  Whitespace before
+pseudo-elements and pseudo-classes is significant as it is a
+descendant combinator.
+&quot;E :pseudo&quot; should parse the same as &quot;E *:pseudo&quot;, not &quot;E:pseudo&quot;.
+Patch by Simon Sapin.</li>
+<li>lxml.html.diff no longer raises an exception when hitting
+'img' tags without 'src' attribute.</li>
+</ul>
+</div>
+<div class="section" id="id165">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id166">
+<h1>2.3.2 (2011-11-11)</h1>
+<div class="section" id="id167">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.objectify.deannotate()</tt> has a new boolean option
+<tt class="docutils literal">cleanup_namespaces</tt> to remove the objectify namespace
+declarations (and generally clean up the namespace declarations)
+after removing the type annotations.</li>
+<li><tt class="docutils literal">lxml.objectify</tt> gained its own <tt class="docutils literal">SubElement()</tt> function as a
+copy of <tt class="docutils literal">etree.SubElement</tt> to avoid an otherwise redundant import
+of <tt class="docutils literal">lxml.etree</tt> on the user side.</li>
+</ul>
+</div>
+<div class="section" id="id168">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fixed the &quot;descendant&quot; bug in cssselect a second time (after a first
+fix in lxml 2.3.1).  The previous change resulted in a serious
+performance regression for the XPath based evaluation of the
+translated expression.  Note that this breaks the usage of some of
+the generated XPath expressions as XSLT location paths that
+previously worked in 2.3.1.</li>
+<li>Fixed parsing of some selectors in cssselect. Whitespace after combinators
+&quot;&gt;&quot;, &quot;+&quot; and &quot;~&quot; is now correctly ignored. Previously it was parsed as
+a descendant combinator. For example, &quot;div&gt; .foo&quot; was parsed the same as
+&quot;div&gt;* .foo&quot; instead of &quot;div&gt;.foo&quot;. Patch by Simon Sapin.</li>
+</ul>
+</div>
+<div class="section" id="id169">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id170">
+<h1>2.3.1 (2011-09-25)</h1>
+<div class="section" id="id171">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New option <tt class="docutils literal">kill_tags</tt> in <tt class="docutils literal">lxml.html.clean</tt> to remove specific
+tags and their content (i.e. their whole subtree).</li>
+<li><tt class="docutils literal">pi.get()</tt> and <tt class="docutils literal">pi.attrib</tt> on processing instructions to parse
+pseudo-attributes from the text content of processing instructions.</li>
+<li><tt class="docutils literal">lxml.get_include()</tt> returns a list of include paths that can be
+used to compile external C code against lxml.etree.  This is
+specifically required for statically linked lxml builds when code
+needs to compile against the exact same header file versions as lxml
+itself.</li>
+<li><tt class="docutils literal">Resolver.resolve_file()</tt> takes an additional option
+<tt class="docutils literal">close_file</tt> that configures if the file(-like) object will be
+closed after reading or not.  By default, the file will be closed,
+as the user is not expected to keep a reference to it.</li>
+</ul>
+</div>
+<div class="section" id="id172">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>HTML cleaning didn't remove 'data:' links.</li>
+<li>The html5lib parser integration now uses the 'official'
+implementation in html5lib itself, which makes it work with newer
+releases of the library.</li>
+<li>In <tt class="docutils literal">lxml.sax</tt>, <tt class="docutils literal">endElementNS()</tt> could incorrectly reject a plain
+tag name when the corresponding start event inferred the same plain
+tag name to be in the default namespace.</li>
+<li>When an open file-like object is passed into <tt class="docutils literal">parse()</tt> or
+<tt class="docutils literal">iterparse()</tt>, the parser will no longer close it after use.  This
+reverts a change in lxml 2.3 where all files would be closed.  It is
+the users responsibility to properly close the file(-like) object,
+also in error cases.</li>
+<li>Assertion error in lxml.html.cleaner when discarding top-level elements.</li>
+<li>In lxml.cssselect, use the xpath 'A//B' (short for
+'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for
+the css descendant selector ('A B').  This makes a few edge cases
+like <tt class="docutils literal">&quot;div <span class="pre">*:last-child&quot;</span></tt> consistent with the selector behavior in
+WebKit and Firefox, and makes more css expressions valid location
+paths (for use in xsl:template match).</li>
+<li>In lxml.html, non-selected <tt class="docutils literal">&lt;option&gt;</tt> tags no longer show up in the
+collected form values.</li>
+<li>Adding/removing <tt class="docutils literal">&lt;option&gt;</tt> values to/from a multiple select form
+field properly selects them and unselects them.</li>
+</ul>
+</div>
+<div class="section" id="id173">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Static builds can specify the download directory with the
+<tt class="docutils literal"><span class="pre">--download-dir</span></tt> option.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id174">
+<h1>2.3 (2011-02-06)</h1>
+<div class="section" id="id175">
+<h2>Features added</h2>
+<ul class="simple">
+<li>When looking for children, <tt class="docutils literal">lxml.objectify</tt> takes '{}tag' as
+meaning an empty namespace, as opposed to the parent namespace.</li>
+</ul>
+</div>
+<div class="section" id="id176">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>When finished reading from a file-like object, the parser
+immediately calls its <tt class="docutils literal">.close()</tt> method.</li>
+<li>When finished parsing, <tt class="docutils literal">iterparse()</tt> immediately closes the input
+file.</li>
+<li>Work-around for libxml2 bug that can leave the HTML parser in a
+non-functional state after parsing a severely broken document (fixed
+in libxml2 2.7.8).</li>
+<li><tt class="docutils literal">marque</tt> tag in HTML cleanup code is correctly named <tt class="docutils literal">marquee</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id177">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Some public functions in the Cython-level C-API have more explicit
+return types.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta1-2010-09-06">
+<h1>2.3beta1 (2010-09-06)</h1>
+<div class="section" id="id178">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id179">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in newer libxml2 versions when moving elements between
+documents that had attributes on replaced XInclude nodes.</li>
+<li><tt class="docutils literal">XMLID()</tt> function was missing the optional <tt class="docutils literal">parser</tt> and
+<tt class="docutils literal">base_url</tt> parameters.</li>
+<li>Searching for wildcard tags in <tt class="docutils literal">iterparse()</tt> was broken in Py3.</li>
+<li><tt class="docutils literal">lxml.html.open_in_browser()</tt> didn't work in Python 3 due to the
+use of os.tempnam.  It now takes an optional 'encoding' parameter.</li>
+</ul>
+</div>
+<div class="section" id="id180">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="alpha2-2010-07-24">
+<h1>2.3alpha2 (2010-07-24)</h1>
+<div class="section" id="id181">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id182">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in XSLT when generating text-only result documents with a
+stylesheet created in a different thread.</li>
+</ul>
+</div>
+<div class="section" id="id183">
+<h2>Other changes</h2>
+<ul class="simple">
+<li><tt class="docutils literal">repr()</tt> of Element objects shows the hex ID with leading 0x
+(following ElementTree 1.3).</li>
+</ul>
+</div>
+</div>
+<div class="section" id="alpha1-2010-06-19">
+<h1>2.3alpha1 (2010-06-19)</h1>
+<div class="section" id="id184">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Keyword argument <tt class="docutils literal">namespaces</tt> in <tt class="docutils literal">lxml.cssselect.CSSSelector()</tt>
+to pass a prefix-to-namespace mapping for the selector.</li>
+<li>New function <tt class="docutils literal">lxml.etree.register_namespace(prefix, uri)</tt> that
+globally registers a namespace prefix for a namespace that newly
+created Elements in that namespace will use automatically.  Follows
+ElementTree 1.3.</li>
+<li>Support 'unicode' string name as encoding parameter in
+<tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
+<li>Support 'c14n' serialisation method in <tt class="docutils literal">ElementTree.write()</tt> and
+<tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
+<li>The ElementPath expression syntax (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) was extended to
+match the upcoming ElementTree 1.3 that will ship in the standard
+library of Python 3.2/2.7.  This includes extended support for
+predicates as well as namespace prefixes (as known from XPath).</li>
+<li>During regular XPath evaluation, various ESXLT functions are
+available within their namespace when using libxslt 1.1.26 or later.</li>
+<li>Support passing a readily configured logger instance into
+<tt class="docutils literal">PyErrorLog</tt>, instead of a logger name.</li>
+<li>On serialisation, the new <tt class="docutils literal">doctype</tt> parameter can be used to
+override the DOCTYPE (internal subset) of the document.</li>
+<li>New parameter <tt class="docutils literal">output_parent</tt> to <tt class="docutils literal">XSLTExtension.apply_templates()</tt>
+to append the resulting content directly to an output element.</li>
+<li><tt class="docutils literal">XSLTExtension.process_children()</tt> to process the content of the
+XSLT extension element itself.</li>
+<li>ISO-Schematron support based on the de-facto Schematron reference
+'skeleton implementation'.</li>
+<li>XSLT objects now take XPath object as <tt class="docutils literal">__call__</tt> stylesheet
+parameters.</li>
+<li>Enable path caching in ElementPath (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) to avoid parsing
+overhead.</li>
+<li>Setting the value of a namespaced attribute always uses a prefixed
+namespace instead of the default namespace even if both declare the
+same namespace URI.  This avoids serialisation problems when an
+attribute from a default namespace is set on an element from a
+different namespace.</li>
+<li>XSLT extension elements: support for XSLT context nodes other than
+elements: document root, comments, processing instructions.</li>
+<li>Support for strings (in addition to Elements) in node-sets returned
+by extension functions.</li>
+<li>Forms that lack an <tt class="docutils literal">action</tt> attribute default to the base URL of
+the document on submit.</li>
+<li>XPath attribute result strings have an <tt class="docutils literal">attrname</tt> property.</li>
+<li>Namespace URIs get validated against RFC 3986 at the API level
+(required by the XML namespace specification).</li>
+<li>Target parsers show their target object in the <tt class="docutils literal">.target</tt> property
+(compatible with ElementTree).</li>
+</ul>
+</div>
+<div class="section" id="id185">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>API is hardened against invalid proxy instances to prevent crashes
+due to incorrectly instantiated Element instances.</li>
+<li>Prevent crash when instantiating <tt class="docutils literal">CommentBase</tt> and friends.</li>
+<li>Export ElementTree compatible XML parser class as
+<tt class="docutils literal">XMLTreeBuilder</tt>, as it is called in ET 1.2.</li>
+<li>ObjectifiedDataElements in lxml.objectify were not hashable.  They
+now use the hash value of the underlying Python value (string,
+number, etc.) to which they compare equal.</li>
+<li>Parsing broken fragments in lxml.html could fail if the fragment
+contained an orphaned closing '&lt;/div&gt;' tag.</li>
+<li>Using XSLT extension elements around the root of the output document
+crashed.</li>
+<li><tt class="docutils literal">lxml.cssselect</tt> did not distinguish between <tt class="docutils literal"><span class="pre">x[attr=&quot;val&quot;]</span></tt> and
+<tt class="docutils literal">x <span class="pre">[attr=&quot;val&quot;]</span></tt> (with a space).  The latter now matches the
+attribute independent of the element.</li>
+<li>Rewriting multiple links inside of HTML text content could end up
+replacing unrelated content as replacements could impact the
+reported position of subsequent matches.  Modifications are now
+simplified by letting the <tt class="docutils literal">iterlinks()</tt> generator in <tt class="docutils literal">lxml.html</tt>
+return links in reversed order if they appear inside the same text
+node.  Thus, replacements and link-internal modifications no longer
+change the position of links reported afterwards.</li>
+<li>The <tt class="docutils literal">.value</tt> attribute of <tt class="docutils literal">textarea</tt> elements in lxml.html did
+not represent the complete raw value (including child tags etc.). It
+now serialises the complete content on read and replaces the
+complete content by a string on write.</li>
+<li>Target parser didn't call <tt class="docutils literal">.close()</tt> on the target object if
+parsing failed.  Now it is guaranteed that <tt class="docutils literal">.close()</tt> will be
+called after parsing, regardless of the outcome.</li>
+</ul>
+</div>
+<div class="section" id="id186">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Official support for Python 3.1.2 and later.</li>
+<li>Static MS Windows builds can now download their dependencies
+themselves.</li>
+<li><tt class="docutils literal">Element.attrib</tt> no longer uses a cyclic reference back to its
+Element object.  It therefore no longer requires the garbage
+collector to clean up.</li>
+<li>Static builds include libiconv, in addition to libxml2 and libxslt.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id187">
+<h1>2.2.8 (2010-09-02)</h1>
+<div class="section" id="id188">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in newer libxml2 versions when moving elements between
+documents that had attributes on replaced XInclude nodes.</li>
+<li>Import fix for urljoin in Python 3.1+.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id189">
+<h1>2.2.7 (2010-07-24)</h1>
+<div class="section" id="id190">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in XSLT when generating text-only result documents with a
+stylesheet created in a different thread.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id191">
+<h1>2.2.6 (2010-03-02)</h1>
+<div class="section" id="id192">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fixed several Python 3 regressions by building with Cython 0.11.3.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id193">
+<h1>2.2.5 (2010-02-28)</h1>
+<div class="section" id="id194">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support for running XSLT extension elements on the input root node
+(e.g. in a template matching on &quot;/&quot;).</li>
+</ul>
+</div>
+<div class="section" id="id195">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in XPath evaluation when reading smart strings from a document
+other than the original context document.</li>
+<li>Support recent versions of html5lib by not requiring its
+<tt class="docutils literal">XHTMLParser</tt> in <tt class="docutils literal">htmlparser.py</tt> anymore.</li>
+<li>Manually instantiating the custom element classes in
+<tt class="docutils literal">lxml.objectify</tt> could crash.</li>
+<li>Invalid XML text characters were not rejected by the API when they
+appeared in unicode strings directly after non-ASCII characters.</li>
+<li>lxml.html.open_http_urllib() did not work in Python 3.</li>
+<li>The functions <tt class="docutils literal">strip_tags()</tt> and <tt class="docutils literal">strip_elements()</tt> in
+<tt class="docutils literal">lxml.etree</tt> did not remove all occurrences of a tag in all cases.</li>
+<li>Crash in XSLT extension elements when the XSLT context node is not
+an element.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id196">
+<h1>2.2.4 (2009-11-11)</h1>
+<div class="section" id="id197">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Static build of libxml2/libxslt was broken.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id198">
+<h1>2.2.3 (2009-10-30)</h1>
+<div class="section" id="id199">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id200">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The <tt class="docutils literal">resolve_entities</tt> option did not work in the incremental feed
+parser.</li>
+<li>Looking up and deleting attributes without a namespace could hit a
+namespaced attribute of the same name instead.</li>
+<li>Late errors during calls to <tt class="docutils literal">SubElement()</tt> (e.g. attribute related
+ones) could leave a partially initialised element in the tree.</li>
+<li>Modifying trees that contain parsed entity references could result
+in an infinite loop.</li>
+<li>ObjectifiedElement.__setattr__ created an empty-string child element when the
+attribute value was rejected as a non-unicode/non-ascii string</li>
+<li>Syntax errors in <tt class="docutils literal">lxml.cssselect</tt> could result in misleading error
+messages.</li>
+<li>Invalid syntax in CSS expressions could lead to an infinite loop in
+the parser of <tt class="docutils literal">lxml.cssselect</tt>.</li>
+<li>CSS special character escapes were not properly handled in
+<tt class="docutils literal">lxml.cssselect</tt>.</li>
+<li>CSS Unicode escapes were not properly decoded in <tt class="docutils literal">lxml.cssselect</tt>.</li>
+<li>Select options in HTML forms that had no explicit <tt class="docutils literal">value</tt>
+attribute were not handled correctly.  The HTML standard dictates
+that their value is defined by their text content.  This is now
+supported by lxml.html.</li>
+<li>XPath raised a TypeError when finding CDATA sections.  This is now
+fully supported.</li>
+<li>Calling <tt class="docutils literal">help(lxml.objectify)</tt> didn't work at the prompt.</li>
+<li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify no longer defines the default
+namespaces when annotation is disabled.</li>
+<li>Feed parser failed to honour the 'recover' option on parse errors.</li>
+<li>Diverting the error logging to Python's logging system was broken.</li>
+</ul>
+</div>
+<div class="section" id="id201">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id202">
+<h1>2.2.2 (2009-06-21)</h1>
+<div class="section" id="id203">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New helper functions <tt class="docutils literal">strip_attributes()</tt>, <tt class="docutils literal">strip_elements()</tt>,
+<tt class="docutils literal">strip_tags()</tt> in lxml.etree to remove attributes/subtrees/tags
+from a subtree.</li>
+</ul>
+</div>
+<div class="section" id="id204">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Namespace cleanup on subtree insertions could result in missing
+namespace declarations (and potentially crashes) if the element
+defining a namespace was deleted and the namespace was not used by
+the top element of the inserted subtree but only in deeper subtrees.</li>
+<li>Raising an exception from a parser target callback didn't always
+terminate the parser.</li>
+<li>Only {true, false, 1, 0} are accepted as the lexical representation for
+BoolElement ({True, False, T, F, t, f} not any more), restoring lxml &lt;= 2.0
+behaviour.</li>
+</ul>
+</div>
+<div class="section" id="id205">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id206">
+<h1>2.2.1 (2009-06-02)</h1>
+<div class="section" id="id207">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Injecting default attributes into a document during XML Schema
+validation (also at parse time).</li>
+<li>Pass <tt class="docutils literal">huge_tree</tt> parser option to disable parser security
+restrictions imposed by libxml2 2.7.</li>
+</ul>
+</div>
+<div class="section" id="id208">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The script for statically building libxml2 and libxslt didn't work
+in Py3.</li>
+<li><tt class="docutils literal">XMLSchema()</tt> also passes invalid schema documents on to libxml2
+for parsing (which could lead to a crash before release 2.6.24).</li>
+</ul>
+</div>
+<div class="section" id="id209">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id210">
+<h1>2.2 (2009-03-21)</h1>
+<div class="section" id="id211">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support for <tt class="docutils literal">standalone</tt> flag in XML declaration through
+<tt class="docutils literal">tree.docinfo.standalone</tt> and by passing <tt class="docutils literal">standalone=True/False</tt>
+on serialisation.</li>
+</ul>
+</div>
+<div class="section" id="id212">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when parsing an XML Schema with external imports from a
+filename.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta4-2009-02-27">
+<h1>2.2beta4 (2009-02-27)</h1>
+<div class="section" id="id213">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support strings and instantiable Element classes as child arguments
+to the constructor of custom Element classes.</li>
+<li>GZip compression support for serialisation to files and file-like
+objects.</li>
+</ul>
+</div>
+<div class="section" id="id214">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Deep-copying an ElementTree copied neither its sibling PIs and
+comments nor its internal/external DTD subsets.</li>
+<li>Soupparser failed on broken attributes without values.</li>
+<li>Crash in XSLT when overwriting an already defined attribute using
+<tt class="docutils literal">xsl:attribute</tt>.</li>
+<li>Crash bug in exception handling code under Python 3.  This was due
+to a problem in Cython, not lxml itself.</li>
+<li><tt class="docutils literal">lxml.html.FormElement._name()</tt> failed for non top-level forms.</li>
+<li><tt class="docutils literal">TAG</tt> special attribute in constructor of custom Element classes
+was evaluated incorrectly.</li>
+</ul>
+</div>
+<div class="section" id="id215">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Official support for Python 3.0.1.</li>
+<li><tt class="docutils literal">Element.findtext()</tt> now returns an empty string instead of None
+for Elements without text content.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta3-2009-02-17">
+<h1>2.2beta3 (2009-02-17)</h1>
+<div class="section" id="id216">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">XSLT.strparam()</tt> class method to wrap quoted string parameters
+that require escaping.</li>
+</ul>
+</div>
+<div class="section" id="id217">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory leak in XPath evaluators.</li>
+<li>Crash when parsing indented XML in one thread and merging it with
+other documents parsed in another thread.</li>
+<li>Setting the <tt class="docutils literal">base</tt> attribute in <tt class="docutils literal">lxml.objectify</tt> from a unicode
+string failed.</li>
+<li>Fixes following changes in Python 3.0.1.</li>
+<li>Minor fixes for Python 3.</li>
+</ul>
+</div>
+<div class="section" id="id218">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The global error log (which is copied into the exception log) is now
+local to a thread, which fixes some race conditions.</li>
+<li>More robust error handling on serialisation.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta2-2009-01-25">
+<h1>2.2beta2 (2009-01-25)</h1>
+<div class="section" id="id219">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Potential memory leak on exception handling.  This was due to a
+problem in Cython, not lxml itself.</li>
+<li><tt class="docutils literal">iter_links</tt> (and related link-rewriting functions) in
+<tt class="docutils literal">lxml.html</tt> would interpret CSS like <tt class="docutils literal"><span class="pre">url(&quot;link&quot;)</span></tt> incorrectly
+(treating the quotation marks as part of the link).</li>
+<li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id220">
+<h1>2.1.5 (2009-01-06)</h1>
+<div class="section" id="id221">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Potential memory leak on exception handling.  This was due to a
+problem in Cython, not lxml itself.</li>
+<li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta1-2008-12-12">
+<h1>2.2beta1 (2008-12-12)</h1>
+<div class="section" id="id222">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Allow <tt class="docutils literal">lxml.html.diff.htmldiff</tt> to accept Element objects, not
+just HTML strings.</li>
+</ul>
+</div>
+<div class="section" id="id223">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when using an XPath evaluator in multiple threads.</li>
+<li>Fixed missing whitespace before <tt class="docutils literal"><span class="pre">Link:...</span></tt> in <tt class="docutils literal">lxml.html.diff</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id224">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Export <tt class="docutils literal">lxml.html.parse</tt>.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id225">
+<h1>2.1.4 (2008-12-12)</h1>
+<div class="section" id="id226">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when using an XPath evaluator in multiple threads.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id227">
+<h1>2.0.11 (2008-12-12)</h1>
+<div class="section" id="id228">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when using an XPath evaluator in multiple threads.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="alpha1-2008-11-23">
+<h1>2.2alpha1 (2008-11-23)</h1>
+<div class="section" id="id229">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support for XSLT result tree fragments in XPath/XSLT extension
+functions.</li>
+<li>QName objects have new properties <tt class="docutils literal">namespace</tt> and <tt class="docutils literal">localname</tt>.</li>
+<li>New options for exclusive C14N and C14N without comments.</li>
+<li>Instantiating a custom Element classes creates a new Element.</li>
+</ul>
+</div>
+<div class="section" id="id230">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>XSLT didn't inherit the parse options of the input document.</li>
+<li>0-bytes could slip through the API when used inside of Unicode
+strings.</li>
+<li>With <tt class="docutils literal">lxml.html.clean.autolink</tt>, links with balanced parenthesis,
+that end in a parenthesis, will be linked in their entirety (typical
+with Wikipedia links).</li>
+</ul>
+</div>
+<div class="section" id="id231">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id232">
+<h1>2.1.3 (2008-11-17)</h1>
+<div class="section" id="id233">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id234">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Ref-count leaks when lxml enters a try-except statement while an
+outside exception lives in sys.exc_*(). This was due to a problem in
+Cython, not lxml itself.</li>
+<li>Parser Unicode decoding errors could get swallowed by other
+exceptions.</li>
+<li>Name/import errors in some Python modules.</li>
+<li>Internal DTD subsets that did not specify a system or public ID were
+not serialised and did not appear in the docinfo property of
+ElementTrees.</li>
+<li>Fix a pre-Py3k warning when parsing from a gzip file in Py2.6.</li>
+<li>Test suite fixes for libxml2 2.7.</li>
+<li>Resolver.resolve_string() did not work for non-ASCII byte strings.</li>
+<li>Resolver.resolve_file() was broken.</li>
+<li>Overriding the parser encoding didn't work for many encodings.</li>
+</ul>
+</div>
+<div class="section" id="id235">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id236">
+<h1>2.0.10 (2008-11-17)</h1>
+<div class="section" id="id237">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Ref-count leaks when lxml enters a try-except statement while an
+outside exception lives in sys.exc_*(). This was due to a problem in
+Cython, not lxml itself.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id238">
+<h1>2.1.2 (2008-09-05)</h1>
+<div class="section" id="id239">
+<h2>Features added</h2>
+<ul class="simple">
+<li>lxml.etree now tries to find the absolute path name of files when
+parsing from a file-like object.  This helps custom resolvers when
+resolving relative URLs, as lixbml2 can prepend them with the path
+of the source document.</li>
+</ul>
+</div>
+<div class="section" id="id240">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory problem when passing documents between threads.</li>
+<li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
+exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
+</ul>
+</div>
+<div class="section" id="id241">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id242">
+<h1>2.0.9 (2008-09-05)</h1>
+<div class="section" id="id243">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory problem when passing documents between threads.</li>
+<li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
+exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id244">
+<h1>2.1.1 (2008-07-24)</h1>
+<div class="section" id="id245">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id246">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when parsing XSLT stylesheets in a thread and using them in
+another.</li>
+<li>Encoding problem when including text with ElementInclude under
+Python 3.</li>
+</ul>
+</div>
+<div class="section" id="id247">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id248">
+<h1>2.0.8 (2008-07-24)</h1>
+<div class="section" id="id249">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
+with whitespace in URL attributes.</li>
+</ul>
+</div>
+<div class="section" id="id250">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when parsing XSLT stylesheets in a thread and using them in
+another.</li>
+<li>CSS selector parser dropped remaining expression after a function
+with parameters.</li>
+</ul>
+</div>
+<div class="section" id="id251">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id252">
+<h1>2.1 (2008-07-09)</h1>
+<div class="section" id="id253">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Smart strings can be switched off in XPath (<tt class="docutils literal">smart_strings</tt>
+keyword option).</li>
+<li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
+with whitespace in URL attributes.</li>
+</ul>
+</div>
+<div class="section" id="id254">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Custom resolvers were not used for XMLSchema includes/imports and
+XInclude processing.</li>
+<li>CSS selector parser dropped remaining expression after a function
+with parameters.</li>
+</ul>
+</div>
+<div class="section" id="id255">
+<h2>Other changes</h2>
+<ul class="simple">
+<li><tt class="docutils literal">objectify.enableRecursiveStr()</tt> was removed, use
+<tt class="docutils literal">objectify.enable_recursive_str()</tt> instead</li>
+<li>Speed-up when running XSLTs on documents from other threads</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id256">
+<h1>2.0.7 (2008-06-20)</h1>
+<div class="section" id="id257">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
+</ul>
+</div>
+<div class="section" id="id258">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Descending dot-separated classes in CSS selectors were not resolved
+correctly.</li>
+<li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
+<li>Potential threading problem in XInclude.</li>
+<li>Crash in Element class lookup classes when the __init__() method of
+the super class is not called from Python subclasses.</li>
+</ul>
+</div>
+<div class="section" id="id259">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Non-ASCII characters in attribute values are no longer escaped on
+serialisation.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta3-2008-06-19">
+<h1>2.1beta3 (2008-06-19)</h1>
+<div class="section" id="id260">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Major overhaul of <tt class="docutils literal">tools/xpathgrep.py</tt> script.</li>
+<li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
+<li>Support for parsing from file-like objects that return unicode
+strings.</li>
+<li>New function <tt class="docutils literal">etree.cleanup_namespaces(el)</tt> that removes unused
+namespace declarations from a (sub)tree (experimental).</li>
+<li>XSLT results support the buffer protocol in Python 3.</li>
+<li>Polymorphic functions in <tt class="docutils literal">lxml.html</tt> that accept either a tree or
+a parsable string will return either a UTF-8 encoded byte string, a
+unicode string or a tree, based on the type of the input.
+Previously, the result was always a byte string or a tree.</li>
+<li>Support for Python 2.6 and 3.0 beta.</li>
+<li>File name handling now uses a heuristic to convert between byte
+strings (usually filenames) and unicode strings (usually URLs).</li>
+<li>Parsing from a plain file object frees the GIL under Python 2.x.</li>
+<li>Running <tt class="docutils literal">iterparse()</tt> on a plain file (or filename) frees the GIL
+on reading under Python 2.x.</li>
+<li>Conversion functions <tt class="docutils literal">html_to_xhtml()</tt> and <tt class="docutils literal">xhtml_to_html()</tt> in
+lxml.html (experimental).</li>
+<li>Most features in lxml.html work for XHTML namespaced tag names
+(experimental).</li>
+</ul>
+</div>
+<div class="section" id="id261">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
+<li>Crash in Element class lookup classes when the __init__() method of
+the super class is not called from Python subclasses.</li>
+<li>A number of problems related to unicode/byte string conversion of
+filenames and error messages were fixed.</li>
+<li>Building on MacOS-X now passes the &quot;flat_namespace&quot; option to the C
+compiler, which reportedly prevents build quirks and crashes on this
+platform.</li>
+<li>Windows build was broken.</li>
+<li>Rare crash when serialising to a file object with certain encodings.</li>
+</ul>
+</div>
+<div class="section" id="id262">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Non-ASCII characters in attribute values are no longer escaped on
+serialisation.</li>
+<li>Passing non-ASCII byte strings or invalid unicode strings as .tag,
+namespaces, etc. will result in a ValueError instead of an
+AssertionError (just like the tag well-formedness check).</li>
+<li>Up to several times faster attribute access (i.e. tree traversal) in
+lxml.objectify.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id263">
+<h1>2.0.6 (2008-05-31)</h1>
+<div class="section" id="id264">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id265">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Incorrect evaluation of <tt class="docutils literal"><span class="pre">el.find(&quot;tag[child]&quot;)</span></tt>.</li>
+<li>Windows build was broken.</li>
+<li>Moving a subtree from a document created in one thread into a
+document of another thread could crash when the rest of the source
+document is deleted while the subtree is still in use.</li>
+<li>Rare crash when serialising to a file object with certain encodings.</li>
+</ul>
+</div>
+<div class="section" id="id266">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>lxml should now build without problems on MacOS-X.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta2-2008-05-02">
+<h1>2.1beta2 (2008-05-02)</h1>
+<div class="section" id="id267">
+<h2>Features added</h2>
+<ul class="simple">
+<li>All parse functions in lxml.html take a <tt class="docutils literal">parser</tt> keyword argument.</li>
+<li>lxml.html has a new parser class <tt class="docutils literal">XHTMLParser</tt> and a module
+attribute <tt class="docutils literal">xhtml_parser</tt> that provide XML parsers that are
+pre-configured for the lxml.html package.</li>
+</ul>
+</div>
+<div class="section" id="id268">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Moving a subtree from a document created in one thread into a
+document of another thread could crash when the rest of the source
+document is deleted while the subtree is still in use.</li>
+<li>Passing an nsmap when creating an Element will no longer strip
+redundantly defined namespace URIs.  This prevented the definition
+of more than one prefix for a namespace on the same Element.</li>
+</ul>
+</div>
+<div class="section" id="id269">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>If the default namespace is redundantly defined with a prefix on the
+same Element, the prefix will now be preferred for subelements and
+attributes.  This allows users to work around a problem in libxml2
+where attributes from the default namespace could serialise without
+a prefix even when they appear on an Element with a different
+namespace (i.e. they would end up in the wrong namespace).</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id270">
+<h1>2.0.5 (2008-05-01)</h1>
+<div class="section" id="id271">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id272">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Resolving to a filename in custom resolvers didn't work.</li>
+<li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
+let some XSLT errors pass silently.</li>
+<li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
+</ul>
+</div>
+<div class="section" id="id273">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="beta1-2008-04-15">
+<h1>2.1beta1 (2008-04-15)</h1>
+<div class="section" id="id274">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Error logging in Schematron (requires libxml2 2.6.32 or later).</li>
+<li>Parser option <tt class="docutils literal">strip_cdata</tt> for normalising or keeping CDATA
+sections.  Defaults to <tt class="docutils literal">True</tt> as before, thus replacing CDATA
+sections by their text content.</li>
+<li><tt class="docutils literal">CDATA()</tt> factory to wrap string content as CDATA section.</li>
+</ul>
+</div>
+<div class="section" id="id275">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Resolving to a filename in custom resolvers didn't work.</li>
+<li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
+let some XSLT errors pass silently.</li>
+<li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
+<li>lxml.etree accepted non well-formed namespace prefix names.</li>
+</ul>
+</div>
+<div class="section" id="id276">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Major cleanup in internal <tt class="docutils literal">moveNodeToDocument()</tt> function, which
+takes care of namespace cleanup when moving elements between
+different namespace contexts.</li>
+<li>New Elements created through the <tt class="docutils literal">makeelement()</tt> method of an HTML
+parser or through lxml.html now end up in a new HTML document
+(doctype HTML 4.01 Transitional) instead of a generic XML document.
+This mostly impacts the serialisation and the availability of a DTD
+context.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id277">
+<h1>2.0.4 (2008-04-13)</h1>
+<div class="section" id="id278">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id279">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Hanging thread in conjunction with GTK threading.</li>
+<li>Crash bug in iterparse when moving elements into other documents.</li>
+<li>HTML elements' <tt class="docutils literal">.cssselect()</tt> method was broken.</li>
+<li><tt class="docutils literal"><span class="pre">ElementTree.find*()</span></tt> didn't accept QName objects.</li>
+</ul>
+</div>
+<div class="section" id="id280">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="alpha1-2008-03-27">
+<h1>2.1alpha1 (2008-03-27)</h1>
+<div class="section" id="id281">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New event types 'comment' and 'pi' in <tt class="docutils literal">iterparse()</tt>.</li>
+<li><tt class="docutils literal">XSLTAccessControl</tt> instances have a property <tt class="docutils literal">options</tt> that
+returns a dict of access configuration options.</li>
+<li>Constant instances <tt class="docutils literal">DENY_ALL</tt> and <tt class="docutils literal">DENY_WRITE</tt> on
+<tt class="docutils literal">XSLTAccessControl</tt> class.</li>
+<li>Extension elements for XSLT (experimental!)</li>
+<li><tt class="docutils literal">Element.base</tt> property returns the xml:base or HTML base URL of
+an Element.</li>
+<li><tt class="docutils literal">docinfo.URL</tt> property is writable.</li>
+</ul>
+</div>
+<div class="section" id="id282">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Default encoding for plain text serialisation was different from
+that of XML serialisation (UTF-8 instead of ASCII).</li>
+</ul>
+</div>
+<div class="section" id="id283">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Minor API speed-ups.</li>
+<li>The benchmark suite now uses tail text in the trees, which makes the
+absolute numbers incomparable to previous results.</li>
+<li>Generating the HTML documentation now requires <a class="reference external" href="http://pygments.org/">Pygments</a>, which is
+used to enable syntax highlighting for the doctest examples.</li>
+</ul>
+<p>Most long-time deprecated functions and methods were removed:</p>
+<ul>
+<li><p class="first"><tt class="docutils literal">etree.clearErrorLog()</tt>, use <tt class="docutils literal">etree.clear_error_log()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">etree.useGlobalPythonLog()</tt>, use
+<tt class="docutils literal">etree.use_global_python_log()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">etree.ElementClassLookup.setFallback()</tt>, use
+<tt class="docutils literal">etree.ElementClassLookup.set_fallback()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">etree.getDefaultParser()</tt>, use <tt class="docutils literal">etree.get_default_parser()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">etree.setDefaultParser()</tt>, use <tt class="docutils literal">etree.set_default_parser()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">etree.setElementClassLookup()</tt>, use
+<tt class="docutils literal">etree.set_element_class_lookup()</tt></p>
+<p>Note that <tt class="docutils literal">parser.setElementClassLookup()</tt> has not been removed
+yet, although <tt class="docutils literal">parser.set_element_class_lookup()</tt> should be used
+instead.</p>
+</li>
+<li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespace()</tt>, use
+<tt class="docutils literal">xpath_evaluator.register_namespace()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespaces()</tt>, use
+<tt class="docutils literal">xpath_evaluator.register_namespaces()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">objectify.setPytypeAttributeTag</tt>, use
+<tt class="docutils literal">objectify.set_pytype_attribute_tag</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">objectify.setDefaultParser()</tt>, use
+<tt class="docutils literal">objectify.set_default_parser()</tt></p>
+</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id284">
+<h1>2.0.3 (2008-03-26)</h1>
+<div class="section" id="id285">
+<h2>Features added</h2>
+<ul class="simple">
+<li>soupparser.parse() allows passing keyword arguments on to
+BeautifulSoup.</li>
+<li><tt class="docutils literal">fromstring()</tt> method in <tt class="docutils literal">lxml.html.soupparser</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id286">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.html.diff</tt> didn't treat empty tags properly (e.g.,
+<tt class="docutils literal">&lt;br&gt;</tt>).</li>
+<li>Handle entity replacements correctly in target parser.</li>
+<li>Crash when using <tt class="docutils literal">iterparse()</tt> with XML Schema validation.</li>
+<li>The BeautifulSoup parser (soupparser.py) did not replace entities,
+which made them turn up in text content.</li>
+<li>Attribute assignment of custom PyTypes in objectify could fail to
+correctly serialise the value to a string.</li>
+</ul>
+</div>
+<div class="section" id="id287">
+<h2>Other changes</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.html.ElementSoup</tt> was replaced by a new module
+<tt class="docutils literal">lxml.html.soupparser</tt> with a more consistent API.  The old module
+remains for compatibility with ElementTree's own ElementSoup module.</li>
+<li>Setting the XSLT_CONFIG and XML2_CONFIG environment variables at
+build time will let setup.py pick up the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> and
+<tt class="docutils literal"><span class="pre">xslt-config</span></tt> scripts from the supplied path name.</li>
+<li>Passing <tt class="docutils literal"><span class="pre">--with-xml2-config=/path/to/xml2-config</span></tt> to setup.py will
+override the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> script that is used to determine the C
+compiler options.  The same applies for the <tt class="docutils literal"><span class="pre">--with-xslt-config</span></tt>
+option.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id288">
+<h1>2.0.2 (2008-02-22)</h1>
+<div class="section" id="id289">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support passing <tt class="docutils literal">base_url</tt> to file parser functions to override
+the filename of the file(-like) object.</li>
+</ul>
+</div>
+<div class="section" id="id290">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The prefix for objectify's pytype namespace was missing from the set
+of default prefixes.</li>
+<li>Memory leak in Schematron (fixed only for libxml2 2.6.31+).</li>
+<li>Error type names in RelaxNG were reported incorrectly.</li>
+<li>Slice deletion bug fixed in objectify.</li>
+</ul>
+</div>
+<div class="section" id="id291">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Enabled doctests for some Python modules (especially <tt class="docutils literal">lxml.html</tt>).</li>
+<li>Add a <tt class="docutils literal">method</tt> argument to <tt class="docutils literal">lxml.html.tostring()</tt>
+(<tt class="docutils literal"><span class="pre">method=&quot;xml&quot;</span></tt> for XHTML output).</li>
+<li>Make it clearer that methods like <tt class="docutils literal">lxml.html.fromstring()</tt> take a
+<tt class="docutils literal">base_url</tt> argument.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id292">
+<h1>2.0.1 (2008-02-13)</h1>
+<div class="section" id="id293">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Child iteration in <tt class="docutils literal">lxml.pyclasslookup</tt>.</li>
+<li>Loads of new docstrings reflect the signature of functions and
+methods to make them visible in API docs and <tt class="docutils literal">help()</tt></li>
+</ul>
+</div>
+<div class="section" id="id294">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The module <tt class="docutils literal">lxml.html.builder</tt> was duplicated as
+<tt class="docutils literal">lxml.htmlbuilder</tt></li>
+<li>Form elements would return None for <tt class="docutils literal">form.fields.keys()</tt> if there
+was an unnamed input field.  Now unnamed input fields are completely
+ignored.</li>
+<li>Setting an element slice in objectify could insert slice-overlapping
+elements at the wrong position.</li>
+</ul>
+</div>
+<div class="section" id="id295">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The generated API documentation was cleaned up and disburdened from
+non-public classes etc.</li>
+<li>The previously public module <tt class="docutils literal">lxml.html.setmixin</tt> was renamed to
+<tt class="docutils literal">lxml.html._setmixin</tt> as it is not an official part of lxml.  If
+you want to use it, feel free to copy it over to your own source
+base.</li>
+<li>Passing <tt class="docutils literal"><span class="pre">--with-xslt-config=/path/to/xslt-config</span></tt> to setup.py will
+override the <tt class="docutils literal"><span class="pre">xslt-config</span></tt> script that is used to determine the C
+compiler options.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id296">
+<h1>2.0 (2008-02-01)</h1>
+<div class="section" id="id297">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Passing the <tt class="docutils literal">unicode</tt> type as <tt class="docutils literal">encoding</tt> to <tt class="docutils literal">tostring()</tt> will
+serialise to unicode.  The <tt class="docutils literal">tounicode()</tt> function is now
+deprecated.</li>
+<li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> can parse from StringIO.</li>
+<li><tt class="docutils literal">makeparser()</tt> function in <tt class="docutils literal">lxml.objectify</tt> to create a new
+parser with the usual objectify setup.</li>
+<li>Plain ASCII XPath string results are no longer forced into unicode
+objects as in 2.0beta1, but are returned as plain strings as before.</li>
+<li>All XPath string results are 'smart' objects that have a
+<tt class="docutils literal">getparent()</tt> method to retrieve their parent Element.</li>
+<li><tt class="docutils literal">with_tail</tt> option in serialiser functions.</li>
+<li>More accurate exception messages in validator creation.</li>
+<li>Parse-time XML schema validation (<tt class="docutils literal">schema</tt> parser keyword).</li>
+<li>XPath string results of the <tt class="docutils literal">text()</tt> function and attribute
+selection make their Element container accessible through a
+<tt class="docutils literal">getparent()</tt> method.  As a side-effect, they are now always
+unicode objects (even ASCII strings).</li>
+<li><tt class="docutils literal">XSLT</tt> objects are usable in any thread - at the cost of a deep
+copy if they were not created in that thread.</li>
+<li>Invalid entity names and character references will be rejected by
+the <tt class="docutils literal">Entity()</tt> factory.</li>
+<li><tt class="docutils literal">entity.text</tt> returns the textual representation of the entity,
+e.g. <tt class="docutils literal">&amp;amp;</tt>.</li>
+<li>New properties <tt class="docutils literal">position</tt> and <tt class="docutils literal">code</tt> on ParseError exception (as
+in ET 1.3)</li>
+<li>Rich comparison of <tt class="docutils literal">element.attrib</tt> proxies.</li>
+<li>ElementTree compatible TreeBuilder class.</li>
+<li>Use default prefixes for some common XML namespaces.</li>
+<li><tt class="docutils literal">lxml.html.clean.Cleaner</tt> now allows for a <tt class="docutils literal">host_whitelist</tt>, and
+two overridable methods: <tt class="docutils literal">allow_embedded_url(el, url)</tt> and the
+more general <tt class="docutils literal">allow_element(el)</tt>.</li>
+<li>Extended slicing of Elements as in <tt class="docutils literal"><span class="pre">element[1:-1:2]</span></tt>, both in
+etree and in objectify</li>
+<li>Resolvers can now provide a <tt class="docutils literal">base_url</tt> keyword argument when
+resolving a document as string data.</li>
+<li>When using <tt class="docutils literal">lxml.doctestcompare</tt> you can give the doctest option
+<tt class="docutils literal">NOPARSE_MARKUP</tt> (like <tt class="docutils literal"># doctest: +NOPARSE_MARKUP</tt>) to suppress
+the special checking for one test.</li>
+<li>Separate <tt class="docutils literal">feed_error_log</tt> property for the feed parser interface.
+The normal parser interface and <tt class="docutils literal">iterparse</tt> continue to use
+<tt class="docutils literal">error_log</tt>.</li>
+<li>The normal parsers and the feed parser interface are now separated
+and can be used concurrently on the same parser instance.</li>
+<li><tt class="docutils literal">fromstringlist()</tt> and <tt class="docutils literal">tostringlist()</tt> functions as in
+ElementTree 1.3</li>
+<li><tt class="docutils literal">iterparse()</tt> accepts an <tt class="docutils literal">html</tt> boolean keyword argument for
+parsing with the HTML parser (note that this interface may be
+subject to change)</li>
+<li>Parsers accept an <tt class="docutils literal">encoding</tt> keyword argument that overrides the encoding
+of the parsed documents.</li>
+<li>New C-API function <tt class="docutils literal">hasChild()</tt> to test for children</li>
+<li><tt class="docutils literal">annotate()</tt> function in objectify can annotate with Python types and XSI
+types in one step.  Accompanied by <tt class="docutils literal">xsiannotate()</tt> and <tt class="docutils literal">pyannotate()</tt>.</li>
+<li><tt class="docutils literal">ET.write()</tt>, <tt class="docutils literal">tostring()</tt> and <tt class="docutils literal">tounicode()</tt> now accept a keyword
+argument <tt class="docutils literal">method</tt> that can be one of 'xml' (or None), 'html' or 'text' to
+serialise as XML, HTML or plain text content.</li>
+<li><tt class="docutils literal">iterfind()</tt> method on Elements returns an iterator equivalent to
+<tt class="docutils literal">findall()</tt></li>
+<li><tt class="docutils literal">itertext()</tt> method on Elements</li>
+<li>Setting a QName object as value of the .text property or as an attribute
+will resolve its prefix in the respective context</li>
+<li>ElementTree-like parser target interface as described in
+<a class="reference external" href="http://effbot.org/elementtree/elementtree-xmlparser.htm">http://effbot.org/elementtree/elementtree-xmlparser.htm</a></li>
+<li>ElementTree-like feed parser interface on XMLParser and HTMLParser
+(<tt class="docutils literal">feed()</tt> and <tt class="docutils literal">close()</tt> methods)</li>
+<li>Reimplemented <tt class="docutils literal">objectify.E</tt> for better performance and improved
+integration with objectify.  Provides extended type support based on
+registered PyTypes.</li>
+<li>XSLT objects now support deep copying</li>
+<li>New <tt class="docutils literal">makeSubElement()</tt> C-API function that allows creating a new
+subelement straight with text, tail and attributes.</li>
+<li>XPath extension functions can now access the current context node
+(<tt class="docutils literal">context.context_node</tt>) and use a context dictionary
+(<tt class="docutils literal">context.eval_context</tt>) from the context provided in their first
+parameter</li>
+<li>HTML tag soup parser based on BeautifulSoup in <tt class="docutils literal">lxml.html.ElementSoup</tt></li>
+<li>New module <tt class="docutils literal">lxml.doctestcompare</tt> by Ian Bicking for writing simplified
+doctests based on XML/HTML output.  Use by importing <tt class="docutils literal">lxml.usedoctest</tt> or
+<tt class="docutils literal">lxml.html.usedoctest</tt> from within a doctest.</li>
+<li>New module <tt class="docutils literal">lxml.cssselect</tt> by Ian Bicking for selecting Elements with CSS
+selectors.</li>
+<li>New package <tt class="docutils literal">lxml.html</tt> written by Ian Bicking for advanced HTML
+treatment.</li>
+<li>Namespace class setup is now local to the <tt class="docutils literal">ElementNamespaceClassLookup</tt>
+instance and no longer global.</li>
+<li>Schematron validation (incomplete in libxml2)</li>
+<li>Additional <tt class="docutils literal">stringify</tt> argument to <tt class="docutils literal">objectify.PyType()</tt> takes a
+conversion function to strings to support setting text values from arbitrary
+types.</li>
+<li>Entity support through an <tt class="docutils literal">Entity</tt> factory and element classes.  XML
+parsers now have a <tt class="docutils literal">resolve_entities</tt> keyword argument that can be set to
+False to keep entities in the document.</li>
+<li><tt class="docutils literal">column</tt> field on error log entries to accompany the <tt class="docutils literal">line</tt> field</li>
+<li>Error specific messages in XPath parsing and evaluation
+NOTE: for evaluation errors, you will now get an XPathEvalError instead of
+an XPathSyntaxError.  To catch both, you can except on <tt class="docutils literal">XPathError</tt></li>
+<li>The regular expression functions in XPath now support passing a node-set
+instead of a string</li>
+<li>Extended type annotation in objectify: new <tt class="docutils literal">xsiannotate()</tt> function</li>
+<li>EXSLT RegExp support in standard XPath (not only XSLT)</li>
+</ul>
+</div>
+<div class="section" id="id298">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Missing import in <tt class="docutils literal">lxml.html.clean</tt>.</li>
+<li>Some Python 2.4-isms prevented lxml from building/running under
+Python 2.3.</li>
+<li>XPath on ElementTrees could crash when selecting the virtual root
+node of the ElementTree.</li>
+<li>Compilation <tt class="docutils literal"><span class="pre">--without-threading</span></tt> was buggy in alpha5/6.</li>
+<li>Memory leak in the <tt class="docutils literal">parse()</tt> function.</li>
+<li>Minor bugs in XSLT error message formatting.</li>
+<li>Result document memory leak in target parser.</li>
+<li>Target parser failed to report comments.</li>
+<li>In the <tt class="docutils literal">lxml.html</tt> <tt class="docutils literal">iter_links</tt> method, links in <tt class="docutils literal">&lt;object&gt;</tt>
+tags weren't recognized.  (Note: plugin-specific link parameters
+still aren't recognized.)  Also, the <tt class="docutils literal">&lt;embed&gt;</tt> tag, though not
+standard, is now included in <tt class="docutils literal">lxml.html.defs.special_inline_tags</tt>.</li>
+<li>Using custom resolvers on XSLT stylesheets parsed from a string
+could request ill-formed URLs.</li>
+<li>With <tt class="docutils literal">lxml.doctestcompare</tt> if you do <tt class="docutils literal">&lt;tag <span class="pre">xmlns=&quot;...&quot;&gt;</span></tt> in your
+output, it will then be namespace-neutral (before the ellipsis was
+treated as a real namespace).</li>
+<li>AttributeError in feed parser on parse errors</li>
+<li>XML feed parser setup problem</li>
+<li>Type annotation for unicode strings in <tt class="docutils literal">DataElement()</tt></li>
+<li>lxml failed to serialise namespace declarations of elements other than the
+root node of a tree</li>
+<li>Race condition in XSLT where the resolver context leaked between concurrent
+XSLT calls</li>
+<li>lxml.etree did not check tag/attribute names</li>
+<li>The XML parser did not report undefined entities as error</li>
+<li>The text in exceptions raised by XML parsers, validators and XPath
+evaluators now reports the first error that occurred instead of the last</li>
+<li>Passing '' as XPath namespace prefix did not raise an error</li>
+<li>Thread safety in XPath evaluators</li>
+</ul>
+</div>
+<div class="section" id="id299">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Exceptions carry only the part of the error log that is related to
+the operation that caused the error.</li>
+<li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> now enforce passing the source
+file/filename through the <tt class="docutils literal">file</tt> keyword argument.</li>
+<li>The test suite now skips most doctests under Python 2.3.</li>
+<li><tt class="docutils literal">make clean</tt> no longer removes the .c files (use <tt class="docutils literal">make
+realclean</tt> instead)</li>
+<li>Minor performance tweaks for Element instantiation and subelement
+creation</li>
+<li>Various places in the XPath, XSLT and iteration APIs now require
+keyword-only arguments.</li>
+<li>The argument order in <tt class="docutils literal">element.itersiblings()</tt> was changed to
+match the order used in all other iteration methods.  The second
+argument ('preceding') is now a keyword-only argument.</li>
+<li>The <tt class="docutils literal">getiterator()</tt> method on Elements and ElementTrees was
+reverted to return an iterator as it did in lxml 1.x.  The ET API
+specification allows it to return either a sequence or an iterator,
+and it traditionally returned a sequence in ET and an iterator in
+lxml.  However, it is now deprecated in favour of the <tt class="docutils literal">iter()</tt>
+method, which should be used in new code wherever possible.</li>
+<li>The 'pretty printed' serialisation of ElementTree objects now
+inserts newlines at the root level between processing instructions,
+comments and the root tag.</li>
+<li>A 'pretty printed' serialisation is now terminated with a newline.</li>
+<li>Second argument to <tt class="docutils literal">lxml.etree.Extension()</tt> helper is no longer
+required, third argument is now a keyword-only argument <tt class="docutils literal">ns</tt>.</li>
+<li><tt class="docutils literal">lxml.html.tostring</tt> takes an <tt class="docutils literal">encoding</tt> argument.</li>
+<li>The module source files were renamed to &quot;lxml.*.pyx&quot;, such as
+&quot;lxml.etree.pyx&quot;.  This was changed for consistency with the way
+Pyrex commonly handles package imports.  The main effect is that
+classes now know about their fully qualified class name, including
+the package name of their module.</li>
+<li>Keyword-only arguments in some API functions, especially in the
+parsers and serialisers.</li>
+<li>Tag name validation in lxml.etree (and lxml.html) now distinguishes
+between HTML tags and XML tags based on the parser that was used to
+parse or create them.  HTML tags no longer reject any non-ASCII
+characters in tag names but only spaces and the special characters
+<tt class="docutils literal"><span class="pre">&lt;&gt;&amp;/&quot;'</span></tt>.</li>
+<li>lxml.etree now emits a warning if you use XPath with libxml2 2.6.27
+(which can crash on certain XPath errors)</li>
+<li>Type annotation in objectify now preserves the already annotated type by
+default to prevent losing type information that is already there.</li>
+<li><tt class="docutils literal">element.getiterator()</tt> returns a list, use <tt class="docutils literal">element.iter()</tt> to retrieve
+an iterator (ElementTree 1.3 compatible behaviour)</li>
+<li>objectify.PyType for None is now called &quot;NoneType&quot;</li>
+<li><tt class="docutils literal">el.getiterator()</tt> renamed to <tt class="docutils literal">el.iter()</tt>, following ElementTree 1.3 -
+original name is still available as alias</li>
+<li>In the public C-API, <tt class="docutils literal">findOrBuildNodeNs()</tt> was replaced by the more
+generic <tt class="docutils literal">findOrBuildNodeNsPrefix</tt></li>
+<li>Major refactoring in XPath/XSLT extension function code</li>
+<li>Network access in parsers disabled by default</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id300">
+<h1>1.3.6 (2007-10-29)</h1>
+<div class="section" id="id301">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Backported decref crash fix from 2.0</li>
+<li>Well hidden free-while-in-use crash bug in ObjectPath</li>
+</ul>
+</div>
+<div class="section" id="id302">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The test suites now run <tt class="docutils literal">gc.collect()</tt> in the <tt class="docutils literal">tearDown()</tt>
+methods.  While this makes them take a lot longer to run, it also
+makes it easier to link a specific test to garbage collection
+problems that would otherwise appear in later tests.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id303">
+<h1>1.3.5 (2007-10-22)</h1>
+<div class="section" id="id304">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id305">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>lxml.etree could crash when adding more than 10000 namespaces to a
+document</li>
+<li>lxml failed to serialise namespace declarations of elements other
+than the root node of a tree</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id306">
+<h1>1.3.4 (2007-08-30)</h1>
+<div class="section" id="id307">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The <tt class="docutils literal">ElementMaker</tt> in <tt class="docutils literal">lxml.builder</tt> now accepts the keyword arguments
+<tt class="docutils literal">namespace</tt> and <tt class="docutils literal">nsmap</tt> to set a namespace and nsmap for the Elements it
+creates.</li>
+<li>The <tt class="docutils literal">docinfo</tt> on ElementTree objects has new properties <tt class="docutils literal">internalDTD</tt>
+and <tt class="docutils literal">externalDTD</tt> that return a DTD object for the internal or external
+subset of the document respectively.</li>
+<li>Serialising an ElementTree now includes any internal DTD subsets that are
+part of the document, as well as comments and PIs that are siblings of the
+root node.</li>
+</ul>
+</div>
+<div class="section" id="id308">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Parsing with the <tt class="docutils literal">no_network</tt> option could fail</li>
+</ul>
+</div>
+<div class="section" id="id309">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>lxml now raises a TagNameWarning about tag names containing ':' instead of
+an Error as 1.3.3 did.  The reason is that a number of projects currently
+misuse the previous lack of tag name validation to generate namespace
+prefixes without declaring namespaces.  Apart from the danger of generating
+broken XML this way, it also breaks most of the namespace-aware tools in
+XML, including XPath, XSLT and validation.  lxml 1.3.x will continue to
+support this bug with a Warning, while lxml 2.0 will be strict about
+well-formed tag names (not only regarding ':').</li>
+<li>Serialising an Element no longer includes its comment and PI siblings (only
+ElementTree serialisation includes them).</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id310">
+<h1>1.3.3 (2007-07-26)</h1>
+<div class="section" id="id311">
+<h2>Features added</h2>
+<ul class="simple">
+<li>ElementTree compatible parser <tt class="docutils literal">ETCompatXMLParser</tt> strips processing
+instructions and comments while parsing XML</li>
+<li>Parsers now support stripping PIs (keyword argument 'remove_pis')</li>
+<li><tt class="docutils literal">etree.fromstring()</tt> now supports parsing both HTML and XML, depending on
+the parser you pass.</li>
+<li>Support <tt class="docutils literal">base_url</tt> keyword argument in <tt class="docutils literal">HTML()</tt> and <tt class="docutils literal">XML()</tt></li>
+</ul>
+</div>
+<div class="section" id="id312">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Parsing from Python Unicode strings failed on some platforms</li>
+<li><tt class="docutils literal">Element()</tt> did not raise an exception on tag names containing ':'</li>
+<li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
+<tt class="docutils literal">ProcessingInstruction</tt> as tags. It also accepts <tt class="docutils literal">Element</tt> now.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id313">
+<h1>1.3.2 (2007-07-03)</h1>
+<div class="section" id="id314">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id315">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>&quot;deallocating None&quot; crash bug</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id316">
+<h1>1.3.1 (2007-07-02)</h1>
+<div class="section" id="id317">
+<h2>Features added</h2>
+<ul class="simple">
+<li>objectify.DataElement now supports setting values from existing data
+elements (not just plain Python types) and reuses defined namespaces etc.</li>
+<li>E-factory support for lxml.objectify (<tt class="docutils literal">objectify.E</tt>)</li>
+</ul>
+</div>
+<div class="section" id="id318">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Better way to prevent crashes in Element proxy cleanup code</li>
+<li>objectify.DataElement didn't set up None value correctly</li>
+<li>objectify.DataElement didn't check the value against the provided type hints</li>
+<li>Reference-counting bug in <tt class="docutils literal">Element.attrib.pop()</tt></li>
+</ul>
+</div>
+</div>
+<div class="section" id="id319">
+<h1>1.3 (2007-06-24)</h1>
+<div class="section" id="id320">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Module <tt class="docutils literal">lxml.pyclasslookup</tt> module implements an Element class lookup
+scheme that can access the entire tree in read-only mode to help determining
+a suitable Element class</li>
+<li>Parsers take a <tt class="docutils literal">remove_comments</tt> keyword argument that skips over comments</li>
+<li><tt class="docutils literal">parse()</tt> function in <tt class="docutils literal">objectify</tt>, corresponding to <tt class="docutils literal">XML()</tt> etc.</li>
+<li><tt class="docutils literal">Element.addnext(el)</tt> and <tt class="docutils literal">Element.addprevious(el)</tt> methods to support
+adding processing instructions and comments around the root node</li>
+<li><tt class="docutils literal">Element.attrib</tt> was missing <tt class="docutils literal">clear()</tt> and <tt class="docutils literal">pop()</tt> methods</li>
+<li>Extended type annotation in objectify: cleaner annotation namespace setup
+plus new <tt class="docutils literal">deannotate()</tt> function</li>
+<li>Support for custom Element class instantiation in lxml.sax: passing a
+<tt class="docutils literal">makeelement</tt> function to the ElementTreeContentHandler will reuse the
+lookup context of that function</li>
+<li>'.' represents empty ObjectPath (identity)</li>
+<li><tt class="docutils literal">Element.values()</tt> to accompany the existing <tt class="docutils literal">.keys()</tt> and <tt class="docutils literal">.items()</tt></li>
+<li><tt class="docutils literal">collectAttributes()</tt> C-function to build a list of attribute
+keys/values/items for a libxml2 node</li>
+<li><tt class="docutils literal">DTD</tt> validator class (like <tt class="docutils literal">RelaxNG</tt> and <tt class="docutils literal">XMLSchema</tt>)</li>
+<li>HTML generator helpers by Fredrik Lundh in <tt class="docutils literal">lxml.htmlbuilder</tt></li>
+<li><tt class="docutils literal">ElementMaker</tt> XML generator by Fredrik Lundh in <tt class="docutils literal">lxml.builder.E</tt></li>
+<li>Support for pickling <tt class="docutils literal">objectify.ObjectifiedElement</tt> objects to XML</li>
+<li><tt class="docutils literal">update()</tt> method on Element.attrib</li>
+<li>Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml
+a better handling of namespaces when moving elements between documents.</li>
+</ul>
+</div>
+<div class="section" id="id321">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Removing Elements from a tree could make them lose their namespace
+declarations</li>
+<li><tt class="docutils literal">ElementInclude</tt> didn't honour base URL of original document</li>
+<li>Replacing the children slice of an Element would cut off the tails of the
+original children</li>
+<li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
+<tt class="docutils literal">ProcessingInstruction</tt> as tags</li>
+<li>API functions now check incoming strings for XML conformity.  Zero bytes or
+low ASCII characters are no longer accepted (AssertionError).</li>
+<li>XSLT parsing failed to pass resolver context on to imported documents</li>
+<li>passing '' as namespace prefix in nsmap could be passed through to libxml2</li>
+<li>Objectify couldn't handle prefixed XSD type names in <tt class="docutils literal">xsi:type</tt></li>
+<li>More ET compatible behaviour when writing out XML declarations or not</li>
+<li>More robust error handling in <tt class="docutils literal">iterparse()</tt></li>
+<li>Documents lost their top-level PIs and comments on serialisation</li>
+<li>lxml.sax failed on comments and PIs. Comments are now properly ignored and
+PIs are copied.</li>
+<li>Possible memory leaks in namespace handling when moving elements between
+documents</li>
+</ul>
+</div>
+<div class="section" id="id322">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>major restructuring in the documentation</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id323">
+<h1>1.2.1 (2007-02-27)</h1>
+<div class="section" id="id324">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Build fixes for MS compiler</li>
+<li>Item assignments to special names like <tt class="docutils literal"><span class="pre">element[&quot;text&quot;]</span></tt> failed</li>
+<li>Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier
+to access</li>
+<li>The pattern for attribute names in ObjectPath was too restrictive</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id325">
+<h1>1.2 (2007-02-20)</h1>
+<div class="section" id="id326">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Rich comparison of QName objects</li>
+<li>Support for regular expressions in benchmark selection</li>
+<li>get/set emulation (not .attrib!) for attributes on processing instructions</li>
+<li>ElementInclude Python module for ElementTree compatible XInclude processing
+that honours custom resolvers registered with the source document</li>
+<li>ElementTree.parser property holds the parser used to parse the document</li>
+<li>setup.py has been refactored for greater readability and flexibility</li>
+<li>--rpath flag to setup.py to induce automatic linking-in of dynamic library
+runtime search paths has been renamed to --auto-rpath. This makes it
+possible to pass an --rpath directly to distutils; previously this was being
+shadowed.</li>
+</ul>
+</div>
+<div class="section" id="id327">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Element instantiation now uses locks to prevent race conditions with threads</li>
+<li>ElementTree.write() did not raise an exception when the file was not writable</li>
+<li>Error handling could crash under Python &lt;= 2.4.1 - fixed by disabling thread
+support in these environments</li>
+<li>Element.find*() did not accept QName objects as path</li>
+</ul>
+</div>
+<div class="section" id="id328">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>code cleanup: redundant _NodeBase super class merged into _Element class
+Note: although the impact should be zero in most cases, this change breaks
+the compatibility of the public C-API</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id329">
+<h1>1.1.2 (2006-10-30)</h1>
+<div class="section" id="id330">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Data elements in objectify support repr(), which is now used by dump()</li>
+<li>Source distribution now ships with a patched Pyrex</li>
+<li>New C-API function makeElement() to create new elements with text,
+tail, attributes and namespaces</li>
+<li>Reuse original parser flags for XInclude</li>
+<li>Simplified support for handling XSLT processing instructions</li>
+</ul>
+</div>
+<div class="section" id="id331">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Parser resources were not freed before the next parser run</li>
+<li>Open files and XML strings returned by Python resolvers were not
+closed/freed</li>
+<li>Crash in the IDDict returned by XMLDTDID</li>
+<li>Copying Comments and ProcessingInstructions failed</li>
+<li>Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()</li>
+<li>Memory leak when garbage collecting tailed root elements</li>
+<li>HTML script/style content was not propagated to .text</li>
+<li>Show text xincluded between text nodes correctly in .text and .tail</li>
+<li>'integer * objectify.StringElement' operation was not supported</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id332">
+<h1>1.1.1 (2006-09-21)</h1>
+<div class="section" id="id333">
+<h2>Features added</h2>
+<ul class="simple">
+<li>XSLT profiling support (<tt class="docutils literal">profile_run</tt> keyword)</li>
+<li>countchildren() method on objectify.ObjectifiedElement</li>
+<li>Support custom elements for tree nodes in lxml.objectify</li>
+</ul>
+</div>
+<div class="section" id="id334">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>lxml.objectify failed to support long data values (e.g., &quot;123L&quot;)</li>
+<li>Error messages from XSLT did not reach <tt class="docutils literal">XSLT.error_log</tt></li>
+<li>Factories objectify.Element() and objectify.DataElement() were missing
+<tt class="docutils literal">attrib</tt> and <tt class="docutils literal">nsmap</tt> keyword arguments</li>
+<li>Changing the default parser in lxml.objectify did not update the factories
+Element() and DataElement()</li>
+<li>Let lxml.objectify.Element() always generate tree elements (not data
+elements)</li>
+<li>Build under Windows failed ('0' bug in patched Pyrex version)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id335">
+<h1>1.1 (2006-09-13)</h1>
+<div class="section" id="id336">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Comments and processing instructions return '&lt;!-- comment --&gt;' and
+'&lt;?pi-target content?&gt;' for repr()</li>
+<li>Parsers are now the preferred (and default) place where element class lookup
+schemes should be registered.  Namespace lookup is no longer supported by
+default.</li>
+<li>Support for Python 2.5 beta</li>
+<li>Unlock the GIL for deep copying documents and for XPath()</li>
+<li>New <tt class="docutils literal">compact</tt> keyword argument for parsing read-only documents</li>
+<li>Support for parser options in iterparse()</li>
+<li>The <tt class="docutils literal">namespace</tt> axis is supported in XPath and returns (prefix, URI)
+tuples</li>
+<li>The XPath expression &quot;/&quot; now returns an empty list instead of raising an
+exception</li>
+<li>XML-Object API on top of lxml (lxml.objectify)</li>
+<li>Customizable Element class lookup:<ul>
+<li>different pre-implemented lookup mechanisms</li>
+<li>support for externally provided lookup functions</li>
+</ul>
+</li>
+<li>Support for processing instructions (ET-like, not compatible)</li>
+<li>Public C-level API for independent extension modules</li>
+<li>Module level <tt class="docutils literal">iterwalk()</tt> function as 'iterparse' for trees</li>
+<li>Module level <tt class="docutils literal">iterparse()</tt> function similar to ElementTree (see
+documentation for differences)</li>
+<li>Element.nsmap property returns a mapping of all namespace prefixes known at
+the Element to their namespace URI</li>
+<li>Reentrant threading support in RelaxNG, XMLSchema and XSLT</li>
+<li>Threading support in parsers and serializers:<ul>
+<li>All in-memory operations (tostring, parse(StringIO), etc.) free the GIL</li>
+<li>File operations (on file names) free the GIL</li>
+<li>Reading from file-like objects frees the GIL and reacquires it for reading</li>
+<li>Serialisation to file-like objects is single-threaded (high lock overhead)</li>
+</ul>
+</li>
+<li>Element iteration over XPath axes:<ul>
+<li>Element.iterdescendants() iterates over the descendants of an element</li>
+<li>Element.iterancestors() iterates over the ancestors of an element (from
+parent to parent)</li>
+<li>Element.itersiblings() iterates over either the following or preceding
+siblings of an element</li>
+<li>Element.iterchildren() iterates over the children of an element in either
+direction</li>
+<li>All iterators support the <tt class="docutils literal">tag</tt> keyword argument to restrict the
+generated elements</li>
+</ul>
+</li>
+<li>Element.getnext() and Element.getprevious() return the direct siblings of an
+element</li>
+</ul>
+</div>
+<div class="section" id="id337">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>filenames with local 8-bit encoding were not supported</li>
+<li>1.1beta did not compile under Python 2.3</li>
+<li>ignore unknown 'pyval' attribute values in objectify</li>
+<li>objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists</li>
+<li>objectify.ObjectPath.setattr() failed to accept Elements and Lists</li>
+<li>XPathSyntaxError now inherits from XPathError</li>
+<li>Threading race conditions in RelaxNG and XMLSchema</li>
+<li>Crash when mixing elements from XSLT results into other trees, concurrent
+XSLT is only allowed when the stylesheet was parsed in the main thread</li>
+<li>The EXSLT <tt class="docutils literal">regexp:match</tt> function now works as defined (except for some
+differences in the regular expression syntax)</li>
+<li>Setting element.text to '' returned None on request, not the empty string</li>
+<li><tt class="docutils literal">iterparse()</tt> could crash on long XML files</li>
+<li>Creating documents no longer copies the parser for later URL resolving.  For
+performance reasons, only a reference is kept.  Resolver updates on the
+parser will now be reflected by documents that were parsed before the
+change.  Although this should rarely become visible, it is a behavioral
+change from 1.0.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id338">
+<h1>1.0.4 (2006-09-09)</h1>
+<div class="section" id="id339">
+<h2>Features added</h2>
+<ul class="simple">
+<li>List-like <tt class="docutils literal">Element.extend()</tt> method</li>
+</ul>
+</div>
+<div class="section" id="id340">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in tail handling in <tt class="docutils literal">Element.replace()</tt></li>
+</ul>
+</div>
+</div>
+<div class="section" id="id341">
+<h1>1.0.3 (2006-08-08)</h1>
+<div class="section" id="id342">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Element.replace(old, new) method to replace a subelement by another one</li>
+</ul>
+</div>
+<div class="section" id="id343">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when mixing elements from XSLT results into other trees</li>
+<li>Copying/deepcopying did not work for ElementTree objects</li>
+<li>Setting an attribute to a non-string value did not raise an exception</li>
+<li>Element.remove() deleted the tail text from the removed Element</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id344">
+<h1>1.0.2 (2006-06-27)</h1>
+<div class="section" id="id345">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support for setting a custom default Element class as opposed to namespace
+specific classes (which still override the default class)</li>
+</ul>
+</div>
+<div class="section" id="id346">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Rare exceptions in Python list functions were not handled</li>
+<li>Parsing accepted unicode strings with XML encoding declaration in certain
+cases</li>
+<li>Parsing 8-bit encoded strings from StringIO objects raised an exception</li>
+<li>Module function <tt class="docutils literal">initThread()</tt> was removed - useless (and never worked)</li>
+<li>XSLT and parser exception messages include the error line number</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id347">
+<h1>1.0.1 (2006-06-09)</h1>
+<div class="section" id="id348">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Repeated calls to Element.attrib now efficiently return the same instance</li>
+</ul>
+</div>
+<div class="section" id="id349">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Document deallocation could crash in certain garbage collection scenarios</li>
+<li>Extension function calls in XSLT variable declarations could break the
+stylesheet and crash on repeated calls</li>
+<li>Deep copying Elements could lose namespaces declared in parents</li>
+<li>Deep copying Elements did not copy tail</li>
+<li>Parsing file(-like) objects failed to load external entities</li>
+<li>Parsing 8-bit strings from file(-like) objects raised an exception</li>
+<li>xsl:include failed when the stylesheet was parsed from a file-like object</li>
+<li>lxml.sax.ElementTreeProducer did not call startDocument() / endDocument()</li>
+<li>MSVC compiler complained about long strings (supports only 2048 bytes)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id350">
+<h1>1.0 (2006-06-01)</h1>
+<div class="section" id="id351">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Element.getiterator() and the findall() methods support finding arbitrary
+elements from a namespace (pattern <tt class="docutils literal">{namespace}*</tt>)</li>
+<li>Another speedup in tree iteration code</li>
+<li>General speedup of Python Element object creation and deallocation</li>
+<li>Writing C14N no longer serializes in memory (reduced memory footprint)</li>
+<li>PyErrorLog for error logging through the Python <tt class="docutils literal">logging</tt> module</li>
+<li><tt class="docutils literal">Element.getroottree()</tt> returns an ElementTree for the root node of the
+document that contains the element.</li>
+<li>ElementTree.getpath(element) returns a simple, absolute XPath expression to
+find the element in the tree structure</li>
+<li>Error logs have a <tt class="docutils literal">last_error</tt> attribute for convenience</li>
+<li>Comment texts can be changed through the API</li>
+<li>Formatted output via <tt class="docutils literal">pretty_print</tt> keyword in serialization functions</li>
+<li>XSLT can block access to file system and network via <tt class="docutils literal">XSLTAccessControl</tt></li>
+<li>ElementTree.write() no longer serializes in memory (reduced memory
+footprint)</li>
+<li>Speedup of Element.findall(tag) and Element.getiterator(tag)</li>
+<li>Support for writing the XML representation of Elements and ElementTrees to
+Python unicode strings via <tt class="docutils literal">etree.tounicode()</tt></li>
+<li>Support for writing XSLT results to Python unicode strings via <tt class="docutils literal">unicode()</tt></li>
+<li>Parsing a unicode string no longer copies the string (reduced memory
+footprint)</li>
+<li>Parsing file-like objects reads chunks rather than the whole file (reduced
+memory footprint)</li>
+<li>Parsing StringIO objects from the start avoids copying the string (reduced
+memory footprint)</li>
+<li>Read-only 'docinfo' attribute in ElementTree class holds DOCTYPE
+information, original encoding and XML version as seen by the parser</li>
+<li>etree module can be compiled without libxslt by commenting out the line
+<tt class="docutils literal">include &quot;xslt.pxi&quot;</tt> near the end of the etree.pyx source file</li>
+<li>Better error messages in parser exceptions</li>
+<li>Error reporting also works in XSLT</li>
+<li>Support for custom document loaders (URI resolvers) in parsers and XSLT,
+resolvers are registered at parser level</li>
+<li>Implementation of exslt:regexp for XSLT based on the Python 're' module,
+enabled by default, can be switched off with 'regexp=False' keyword argument</li>
+<li>Support for exslt extensions (libexslt) and libxslt extra functions
+(node-set, document, write, output)</li>
+<li>Substantial speedup in XPath.evaluate()</li>
+<li>HTMLParser for parsing (broken) HTML</li>
+<li>XMLDTDID function parses XML into tuple (root node, ID dict) based on xml:id
+implementation of libxml2 (as opposed to ET compatible XMLID)</li>
+</ul>
+</div>
+<div class="section" id="id352">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory leak in Element.__setitem__</li>
+<li>Memory leak in Element.attrib.items() and Element.attrib.values()</li>
+<li>Memory leak in XPath extension functions</li>
+<li>Memory leak in unicode related setup code</li>
+<li>Element now raises ValueError on empty tag names</li>
+<li>Namespace fixing after moving elements between documents could fail if the
+source document was freed too early</li>
+<li>Setting namespace-less tag names on namespaced elements ('{ns}t' -&gt; 't')
+didn't reset the namespace</li>
+<li>Unknown constants from newer libxml2 versions could raise exceptions in the
+error handlers</li>
+<li>lxml.etree compiles much faster</li>
+<li>On libxml2 &lt;= 2.6.22, parsing strings with encoding declaration could fail
+in certain cases</li>
+<li>Document reference in ElementTree objects was not updated when the root
+element was moved to a different document</li>
+<li>Running absolute XPath expressions on an Element now evaluates against the
+root tree</li>
+<li>Evaluating absolute XPath expressions (<tt class="docutils literal">/*</tt>) on an ElementTree could fail</li>
+<li>Crashes when calling XSLT, RelaxNG, etc. with uninitialized ElementTree
+objects</li>
+<li>Removed public function <tt class="docutils literal">initThreadLogging()</tt>, replaced by more general
+<tt class="docutils literal">initThread()</tt> which fixes a number of setup problems in threads</li>
+<li>Memory leak when using iconv encoders in tostring/write</li>
+<li>Deep copying Elements and ElementTrees maintains the document information</li>
+<li>Serialization functions raise LookupError for unknown encodings</li>
+<li>Memory deallocation crash resulting from deep copying elements</li>
+<li>Some ElementTree methods could crash if the root node was not initialized
+(neither file nor element passed to the constructor)</li>
+<li>Element/SubElement failed to set attribute namespaces from passed <tt class="docutils literal">attrib</tt>
+dictionary</li>
+<li><tt class="docutils literal">tostring()</tt> adds an XML declaration for non-ASCII encodings</li>
+<li><tt class="docutils literal">tostring()</tt> failed to serialize encodings that contain 0-bytes</li>
+<li>ElementTree.xpath() and XPathDocumentEvaluator were not using the
+ElementTree root node as reference point</li>
+<li>Calling <tt class="docutils literal"><span class="pre">document('')</span></tt> in XSLT failed to return the stylesheet</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id353">
+<h1>0.9.2 (2006-05-10)</h1>
+<div class="section" id="id354">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Speedup for Element.makeelement(): the new element reuses the original
+libxml2 document instead of creating a new empty one</li>
+<li>Speedup for reversed() iteration over element children (Py2.4+ only)</li>
+<li>ElementTree compatible QName class</li>
+<li>RelaxNG and XMLSchema accept any Element, not only ElementTrees</li>
+</ul>
+</div>
+<div class="section" id="id355">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>str(xslt_result) was broken for XSLT output other than UTF-8</li>
+<li>Memory leak if write_c14n fails to write the file after conversion</li>
+<li>Crash in XMLSchema and RelaxNG when passing non-schema documents</li>
+<li>Memory leak in RelaxNG() when RelaxNGParseError is raised</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id356">
+<h1>0.9.1 (2006-03-30)</h1>
+<div class="section" id="id357">
+<h2>Features added</h2>
+<ul class="simple">
+<li>lxml.sax.ElementTreeContentHandler checks closing elements and raises
+SaxError on mismatch</li>
+<li>lxml.sax.ElementTreeContentHandler supports namespace-less SAX events
+(startElement, endElement) and defaults to empty attributes (keyword
+argument)</li>
+<li>Speedup for repeatedly accessing element tag names</li>
+<li>Minor API performance improvements</li>
+</ul>
+</div>
+<div class="section" id="id358">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory deallocation bug when using XSLT output method &quot;html&quot;</li>
+<li>sax.py was handling UTF-8 encoded tag names where it shouldn't</li>
+<li>lxml.tests package will no longer be installed (is still in source tar)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id359">
+<h1>0.9 (2006-03-20)</h1>
+<div class="section" id="id360">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Error logging API for libxml2 error messages</li>
+<li>Various performance improvements</li>
+<li>Benchmark script for lxml, ElementTree and cElementTree</li>
+<li>Support for registering extension functions through new FunctionNamespace
+class (see doc/extensions.txt)</li>
+<li>ETXPath class for XPath expressions in ElementTree notation ('//{ns}tag')</li>
+<li>Support for variables in XPath expressions (also in XPath class)</li>
+<li>XPath class for compiled XPath expressions</li>
+<li>XMLID module level function (ElementTree compatible)</li>
+<li>XMLParser API for customized libxml2 parser configuration</li>
+<li>Support for custom Element classes through new Namespace API (see
+doc/namespace_extensions.txt)</li>
+<li>Common exception base class LxmlError for module exceptions</li>
+<li>real iterator support in iter(Element), Element.getiterator()</li>
+<li>XSLT objects are callable, result trees support str()</li>
+<li>Added MANIFEST.in for easier creation of RPM files.</li>
+<li>'getparent' method on elements allows navigation to an element's
+parent element.</li>
+<li>Python core compatible SAX tree builder and SAX event generator. See
+doc/sax.txt for more information.</li>
+</ul>
+</div>
+<div class="section" id="id361">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Segfaults and memory leaks in various API functions of Element</li>
+<li>Segfault in XSLT.tostring()</li>
+<li>ElementTree objects no longer interfere, Elements can be root of different
+ElementTrees at the same time</li>
+<li>document('') works in XSLT documents read from files (in-memory documents
+cannot support this due to libxslt deficiencies)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id362">
+<h1>0.8 (2005-11-03)</h1>
+<div class="section" id="id363">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support for copy.deepcopy() on elements. copy.copy() works also, but
+does the same thing, and does <em>not</em> create a shallow copy, as that
+makes no sense in the context of libxml2 trees. This means a
+potential incompatibility with ElementTree, but there's more chance
+that it works than if copy.copy() isn't supported at all.</li>
+<li>Increased compatibility with (c)ElementTree; .parse() on ElementTree is
+supported and parsing of gzipped XML files works.</li>
+<li>implemented index() on elements, allowing one to find the index of a
+SubElement.</li>
+</ul>
+</div>
+<div class="section" id="id364">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Use xslt-config instead of xml2-config to find out libxml2
+directories to take into account a case where libxslt is installed
+in a different directory than libxslt.</li>
+<li>Eliminate crash condition in iteration when text nodes are changed.</li>
+<li>Passing 'None' to tostring() does not result in a segfault anymore,
+but an AssertionError.</li>
+<li>Some test fixes for Windows.</li>
+<li>Raise XMLSyntaxError and XPathSyntaxError instead of plain python
+syntax errors. This should be less confusing.</li>
+<li>Fixed error with uncaught exception in Pyrex code.</li>
+<li>Calling lxml.etree.fromstring('') throws XMLSyntaxError instead of a
+segfault.</li>
+<li>has_key() works on attrib. 'in' tests also work correctly on attrib.</li>
+<li>INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported
+libxml2 version, as it should.</li>
+<li>Passing a UTF-8 encoded string to the XML() function would fail;
+fixed.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id365">
+<h1>0.7 (2005-06-15)</h1>
+<div class="section" id="id366">
+<h2>Features added</h2>
+<ul class="simple">
+<li>parameters (XPath expressions) can be passed to XSLT using keyword
+parameters.</li>
+<li>Simple XInclude support. Calling the xinclude() method on a tree
+will process any XInclude statements in the document.</li>
+<li>XMLSchema support. Use the XMLSchema class or the convenience
+xmlschema() method on a tree to do XML Schema (XSD) validation.</li>
+<li>Added convenience xslt() method on tree. This is less efficient
+than the XSLT object, but makes it easier to write quick code.</li>
+<li>Added convenience relaxng() method on tree. This is less efficient
+than the RelaxNG object, but makes it easier to write quick code.</li>
+<li>Make it possible to use XPathEvaluator with elements as well. The
+XPathEvaluator in this case will retain the element so multiple
+XPath queries can be made against one element efficiently. This
+replaces the second argument to the .evaluate() method that existed
+previously.</li>
+<li>Allow registerNamespace() to be called on an XPathEvaluator, after
+creation, to add additional namespaces. Also allow registerNamespaces(),
+which does the same for a namespace dictionary.</li>
+<li>Add 'prefix' attribute to element to be able to read prefix information.
+This is entirely read-only.</li>
+<li>It is possible to supply an extra nsmap keyword parameter to
+the Element() and SubElement() constructors, which supplies a
+prefix to namespace URI mapping. This will create namespace
+prefix declarations on these elements and these prefixes will show up
+in XML serialization.</li>
+</ul>
+</div>
+<div class="section" id="id367">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Killed yet another memory management related bug: trees created
+using newDoc would not get a libxml2-level dictionary, which caused
+problems when deallocating these documents later if they contained a
+node that came from a document with a dictionary.</li>
+<li>Moving namespaced elements between documents was problematic as
+references to the original document would remain. This has been fixed
+by applying xmlReconciliateNs() after each move operation.</li>
+<li>Can pass None to 'dump()' without segfaults.</li>
+<li>tostring() works properly for non-root elements as well.</li>
+<li>Cleaned out the tostring() method so it should handle encoding
+correctly.</li>
+<li>Cleaned out the ElementTree.write() method so it should handle encoding
+correctly. Writing directly to a file should also be faster, as there is no
+need to go through a Python string in that case. Made sure the test cases
+test both serializing to StringIO as well as serializing to a real file.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id368">
+<h1>0.6 (2005-05-14)</h1>
+<div class="section" id="id369">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Changed setup.py so that library_dirs is also guessed. This should
+help with compilation on the Mac OS X platform, where otherwise the
+wrong library (shipping with the OS) could be picked up.</li>
+<li>Tweaked setup.py so that it picks up the version from version.txt.</li>
+</ul>
+</div>
+<div class="section" id="id370">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Do the right thing when handling namespaced attributes.</li>
+<li>fix bug where tostring() moved nodes into new documents. tostring()
+had very nasty side-effects before this fix, sorry!</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id371">
+<h1>0.5.1 (2005-04-09)</h1>
+<ul class="simple">
+<li>Python 2.2 compatibility fixes.</li>
+<li>unicode fixes in Element() and Comment() as well as XML(); unicode
+input wasn't properly being UTF-8 encoded.</li>
+</ul>
+</div>
+<div class="section" id="id372">
+<h1>0.5 (2005-04-08)</h1>
+<p>Initial public release.</p>
+</div>
+</div>
+<div class="footer">
+<hr class="footer" />
+Generated on: 2017-10-13.
+
+</div>
+</body>
+</html>
index 32f5e939e657a14acd1a132b0cad327a4abd6f55..e6b942f252e859e8f1ebd66ce67040e811ffd8bd 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="elementtree-compatibility-of-lxml-etree">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu current" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">ElementTree compatibility of lxml.etree</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu current" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">ElementTree compatibility of lxml.etree</h1>
 
 <p>A lot of care has been taken to ensure compatibility between etree and
 ElementTree.  Nonetheless, some differences and incompatibilities exist:</p>
@@ -199,7 +199,7 @@ enough to replace a shallow copy in your case.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 056561dc9c3f7d32e280968604931bc2fa0930fa..74efa0eafe329df240ea13553059584eb1b3e4d4 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="credits">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu current" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Credits</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu current" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Credits</h1>
 
 <div class="section" id="main-contributors">
 <h1>Main contributors</h1>
@@ -88,7 +88,7 @@ Holger Krekel for originally hosting lxml on codespeak.net</li>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index aaa0b76c19a9325fc6463592a56978b3cbc645dd..950cfc90bd2738d7a0c39395357839acf996cdbe 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="lxml-cssselect">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu current" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">lxml.cssselect</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu current" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">lxml.cssselect</h1>
 
 <p>lxml supports a number of interesting languages for tree traversal and element
 selection.  The most important is obviously <a class="reference external" href="xpathxslt.html#xpath">XPath</a>, but there is also
@@ -108,7 +108,7 @@ namespace URIs: the <tt class="docutils literal">CSSSelector</tt> class accepts
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 721349774116c2f7cc46612f254de963bf0729d7..88b974526e0c5e2c8cb1cb422f642fe8ed88b48c 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="using-custom-element-classes-in-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu current" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Using custom Element classes in lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu current" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Using custom Element classes in lxml</h1>
 
 <p>lxml has very sophisticated support for custom Element classes.  You
 can provide your own classes for Elements and have lxml use them by
@@ -193,7 +193,9 @@ this parser.</p>
 <h2>Default class lookup</h2>
 <p>This is the most simple lookup mechanism.  It always returns the default
 element class.  Consequently, no further fallbacks are supported, but this
-scheme is a nice fallback for other custom lookup mechanisms.</p>
+scheme is a nice fallback for other custom lookup mechanisms.  Specifically,
+it also handles comments and processing instructions, which are easy to
+forget about when mapping proxies to classes.</p>
 <p>Usage:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">lookup</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">ElementDefaultClassLookup</span><span class="p">()</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">parser</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">XMLParser</span><span class="p">()</span>
@@ -221,6 +223,13 @@ the constructor.  While it accepts classes for <tt class="docutils literal">elem
 <span class="go">b'&lt;myelement honking="true"/&gt;'</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">el</span><span class="o">.</span><span class="n">honking</span>
 <span class="go">True</span>
+
+<span class="gp">&gt;&gt;&gt; </span><span class="n">root</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">fromstring</span><span class="p">(</span>
+<span class="gp">... </span>    <span class="s1">'&lt;root honking="true"&gt;&lt;!--comment--&gt;&lt;/root&gt;'</span><span class="p">,</span> <span class="n">parser</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="o">.</span><span class="n">honking</span>
+<span class="go">True</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">root</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
+<span class="go">comment</span>
 </pre></div>
 </div>
 <div class="section" id="namespace-class-lookup">
@@ -240,6 +249,13 @@ desired fallback lookup scheme to the constructor:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">fallback</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">ElementDefaultClassLookup</span><span class="p">(</span><span class="n">element</span><span class="o">=</span><span class="n">honk</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">lookup</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">ElementNamespaceClassLookup</span><span class="p">(</span><span class="n">fallback</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">parser</span><span class="o">.</span><span class="n">set_element_class_lookup</span><span class="p">(</span><span class="n">lookup</span><span class="p">)</span>
+
+<span class="gp">&gt;&gt;&gt; </span><span class="n">root</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">fromstring</span><span class="p">(</span>
+<span class="gp">... </span>    <span class="s1">'&lt;root honking="true"&gt;&lt;!--comment--&gt;&lt;/root&gt;'</span><span class="p">,</span> <span class="n">parser</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="o">.</span><span class="n">honking</span>
+<span class="go">True</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">root</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
+<span class="go">comment</span>
 </pre></div>
 </div>
 <div class="section" id="attribute-based-lookup">
@@ -284,10 +300,20 @@ you can use this code:</p>
 basis.  It allows you to implement a custom lookup scheme in a subclass:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">class</span> <span class="nc">MyLookup</span><span class="p">(</span><span class="n">etree</span><span class="o">.</span><span class="n">CustomElementClassLookup</span><span class="p">):</span>
 <span class="gp">... </span>    <span class="k">def</span> <span class="nf">lookup</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">node_type</span><span class="p">,</span> <span class="n">document</span><span class="p">,</span> <span class="n">namespace</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
-<span class="gp">... </span>        <span class="k">return</span> <span class="n">honk</span> <span class="c1"># be a bit more selective here ...</span>
+<span class="gp">... </span>        <span class="k">if</span> <span class="n">node_type</span> <span class="o">==</span> <span class="s1">'element'</span><span class="p">:</span>
+<span class="gp">... </span>            <span class="k">return</span> <span class="n">honk</span>  <span class="c1"># be a bit more selective here ...</span>
+<span class="gp">... </span>        <span class="k">else</span><span class="p">:</span>
+<span class="gp">... </span>            <span class="k">return</span> <span class="bp">None</span>  <span class="c1"># pass on to (default) fallback</span>
 
 <span class="gp">&gt;&gt;&gt; </span><span class="n">parser</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">XMLParser</span><span class="p">()</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">parser</span><span class="o">.</span><span class="n">set_element_class_lookup</span><span class="p">(</span><span class="n">MyLookup</span><span class="p">())</span>
+
+<span class="gp">&gt;&gt;&gt; </span><span class="n">root</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">fromstring</span><span class="p">(</span>
+<span class="gp">... </span>    <span class="s1">'&lt;root honking="true"&gt;&lt;!--comment--&gt;&lt;/root&gt;'</span><span class="p">,</span> <span class="n">parser</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">root</span><span class="o">.</span><span class="n">honking</span>
+<span class="go">True</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">root</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
+<span class="go">comment</span>
 </pre></div>
 <p>The <tt class="docutils literal">.lookup()</tt> method must return either None (which triggers the
 fallback mechanism) or a subclass of <tt class="docutils literal">lxml.etree.ElementBase</tt>.  It
@@ -338,7 +364,7 @@ instantiated proxy classes.</p>
 Only lxml.etree could do that when creating an object representation
 of an existing XML element.  Since lxml 2.2, however, instantiating
 this class will simply create a new Element:</p>
-<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">el</span> <span class="o">=</span> <span class="n">honk</span><span class="p">(</span><span class="n">honking</span> <span class="o">=</span> <span class="s1">'true'</span><span class="p">)</span>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">el</span> <span class="o">=</span> <span class="n">honk</span><span class="p">(</span><span class="n">honking</span><span class="o">=</span><span class="s1">'true'</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">el</span><span class="o">.</span><span class="n">tag</span>
 <span class="go">'honk'</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">el</span><span class="o">.</span><span class="n">honking</span>
@@ -379,7 +405,7 @@ name <tt class="docutils literal">honk</tt>:</p>
 </pre></div>
 <p>If you have many Element classes declared in one module, and they are
 all named like the elements they create, you can simply use
-<tt class="docutils literal"><span class="pre">namespace.update(vars())</span></tt> at the end of your module to declare them
+<tt class="docutils literal"><span class="pre">namespace.update(globals())</span></tt> at the end of your module to declare them
 automatically.  The implementation is smart enough to ignore
 everything that is not an Element class.</p>
 <p>After this, you create and use your XML elements through the normal API of
@@ -398,26 +424,30 @@ lxml:</p>
 <p>Essentially, what this allows you to do, is to give Elements a custom API
 based on their namespace and tag name.</p>
 <p>A somewhat related topic are <a class="reference external" href="extensions.html">extension functions</a> which use a similar
-mechanism for registering extension functions in XPath and XSLT.</p>
+mechanism for registering Python functions for use in XPath and XSLT.</p>
 <p>In the setup example above, we associated the <tt class="docutils literal">honk</tt> Element class
 only with the 'honk' element.  If an XML tree contains different
 elements in the same namespace, they do not pick up the same
 implementation:</p>
-<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">xml</span> <span class="o">=</span> <span class="s1">'&lt;honk xmlns="http://hui.de/honk" honking="true"&gt;&lt;bla/&gt;&lt;/honk&gt;'</span>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">xml</span> <span class="o">=</span> <span class="p">(</span><span class="s1">'&lt;honk xmlns="http://hui.de/honk" honking="true"&gt;'</span>
+<span class="gp">... </span>       <span class="s1">'&lt;bla/&gt;&lt;!--comment--&gt;'</span>
+<span class="gp">... </span>       <span class="s1">'&lt;/honk&gt;'</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">honk_element</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">XML</span><span class="p">(</span><span class="n">xml</span><span class="p">,</span> <span class="n">parser</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">honk_element</span><span class="o">.</span><span class="n">honking</span><span class="p">)</span>
 <span class="go">True</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">honk_element</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">honking</span><span class="p">)</span>
 <span class="gt">Traceback (most recent call last):</span>
-<span class="c">...</span>
+  <span class="c">...</span>
 <span class="gr">AttributeError</span>: <span class="n">'lxml.etree._Element' object has no attribute 'honking'</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">honk_element</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
+<span class="go">comment</span>
 </pre></div>
 <p>You can therefore provide one implementation per element name in each
 namespace and have lxml select the right one on the fly.  If you want one
 element implementation per namespace (ignoring the element name) or prefer
 having a common class for most elements except a few, you can specify a
 default implementation for an entire namespace by registering that class with
-the empty element name (None).</p>
+the empty element name (<tt class="docutils literal">None</tt>).</p>
 <p>You may consider following an object oriented approach here.  If you build a
 class hierarchy of element classes, you can also implement a base class for a
 namespace that is used if no specific element class is provided.  Again, you
@@ -425,18 +455,20 @@ can just pass None as an element name:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">class</span> <span class="nc">HonkNSElement</span><span class="p">(</span><span class="n">etree</span><span class="o">.</span><span class="n">ElementBase</span><span class="p">):</span>
 <span class="gp">... </span>   <span class="k">def</span> <span class="nf">honk</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
 <span class="gp">... </span>      <span class="k">return</span> <span class="s2">"HONK"</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">namespace</span><span class="p">[</span><span class="bp">None</span><span class="p">]</span> <span class="o">=</span> <span class="n">HonkNSElement</span> <span class="c1"># default Element for namespace</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">namespace</span><span class="p">[</span><span class="bp">None</span><span class="p">]</span> <span class="o">=</span> <span class="n">HonkNSElement</span>  <span class="c1"># default Element for namespace</span>
 
 <span class="gp">&gt;&gt;&gt; </span><span class="k">class</span> <span class="nc">HonkElement</span><span class="p">(</span><span class="n">HonkNSElement</span><span class="p">):</span>
 <span class="gp">... </span>   <span class="nd">@property</span>
 <span class="gp">... </span>   <span class="k">def</span> <span class="nf">honking</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
 <span class="gp">... </span>      <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'honking'</span><span class="p">)</span> <span class="o">==</span> <span class="s1">'true'</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">namespace</span><span class="p">[</span><span class="s1">'honk'</span><span class="p">]</span> <span class="o">=</span> <span class="n">HonkElement</span> <span class="c1"># Element for specific tag</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">namespace</span><span class="p">[</span><span class="s1">'honk'</span><span class="p">]</span> <span class="o">=</span> <span class="n">HonkElement</span>  <span class="c1"># Element for specific tag</span>
 </pre></div>
 <p>Now you can rely on lxml to always return objects of type HonkNSElement or its
 subclasses for elements of this namespace:</p>
-<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">xml</span> <span class="o">=</span> <span class="s1">'&lt;honk xmlns="http://hui.de/honk" honking="true"&gt;&lt;bla/&gt;&lt;/honk&gt;'</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">honk_element</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">XML</span><span class="p">(</span><span class="n">xml</span><span class="p">,</span> <span class="n">parser</span><span class="p">)</span>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">xml</span> <span class="o">=</span> <span class="p">(</span><span class="s1">'&lt;honk xmlns="http://hui.de/honk" honking="true"&gt;'</span>
+<span class="gp">... </span>       <span class="s1">'&lt;bla/&gt;&lt;!--comment--&gt;'</span>
+<span class="gp">... </span>       <span class="s1">'&lt;/honk&gt;'</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">honk_element</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">fromstring</span><span class="p">(</span><span class="n">xml</span><span class="p">,</span> <span class="n">parser</span><span class="p">)</span>
 
 <span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="nb">type</span><span class="p">(</span><span class="n">honk_element</span><span class="p">))</span>
 <span class="go">&lt;class 'HonkElement'&gt;</span>
@@ -454,12 +486,46 @@ subclasses for elements of this namespace:</p>
 <span class="gt">Traceback (most recent call last):</span>
 <span class="c">...</span>
 <span class="gr">AttributeError</span>: <span class="n">'HonkNSElement' object has no attribute 'honking'</span>
+
+<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">honk_element</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>  <span class="c1"># uses fallback for non-elements</span>
+<span class="go">comment</span>
 </pre></div>
+<p>Since lxml 4.1, the registration is more conveniently done with
+class decorators.  The namespace registry object is callable with
+a name (or <tt class="docutils literal">None</tt>) as argument and can then be used as decorator.</p>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">honk_elements</span> <span class="o">=</span> <span class="n">lookup</span><span class="o">.</span><span class="n">get_namespace</span><span class="p">(</span><span class="s1">'http://hui.de/honk'</span><span class="p">)</span>
+
+<span class="gp">&gt;&gt;&gt; </span><span class="nd">@honk_elements</span><span class="p">(</span><span class="bp">None</span><span class="p">)</span>
+<span class="gp">... </span><span class="k">class</span> <span class="nc">HonkNSElement</span><span class="p">(</span><span class="n">etree</span><span class="o">.</span><span class="n">ElementBase</span><span class="p">):</span>
+<span class="gp">... </span>   <span class="k">def</span> <span class="nf">honk</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+<span class="gp">... </span>      <span class="k">return</span> <span class="s2">"HONK"</span>
+</pre></div>
+<p>If the class has the same name as the tag, you can also leave out the call
+and use the blank decorator instead:</p>
+<blockquote>
+<pre class="doctest-block">
+&gt;&gt;&gt; @honk_elements
+... class honkel(HonkNSElement):
+...    @property
+...    def honking(self):
+...       return self.get('honking') == 'true'
+</pre>
+<pre class="doctest-block">
+&gt;&gt;&gt; xml = '&lt;honkel xmlns="http://hui.de/honk" honking="true"&gt;&lt;bla/&gt;&lt;!--comment--&gt;&lt;/honkel&gt;'
+&gt;&gt;&gt; honk_element = etree.fromstring(xml, parser)
+</pre>
+<pre class="doctest-block">
+&gt;&gt;&gt; print(type(honk_element))
+&lt;class 'honkel'&gt;
+&gt;&gt;&gt; print(type(honk_element[0]))
+&lt;class 'HonkNSElement'&gt;
+</pre>
+</blockquote>
 </div>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 5d27f1f4af64aca5272919ecefab339ad4601cda..37fdb69dae1bc64761209815f2990dbe76ad9c4a 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="beautifulsoup-parser">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu current" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">BeautifulSoup Parser</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu current" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">BeautifulSoup Parser</h1>
 
 <p><a class="reference external" href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> is a Python package for working with real-world and broken HTML,
 just like <a class="reference external" href="lxmlhtml.html">lxml.html</a>.  As of version 4.x, it can use
@@ -203,7 +203,7 @@ you can simply pass the resulting Unicode string into lxml's parser.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index e90ca697323cdc612adfc130f5193cd280fea7ab..338caebee1a4381de387280e9dde732a03f0d92b 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="python-extensions-for-xpath-and-xslt">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu current" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Python extensions for XPath and XSLT</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu current" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Python extensions for XPath and XSLT</h1>
 
 <p>This document describes how to use Python extension functions in XPath
 and XSLT like this:</p>
@@ -82,8 +82,15 @@ the empty namespace (None):</p>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">ns</span><span class="p">[</span><span class="s1">'countargs'</span><span class="p">]</span> <span class="o">=</span> <span class="n">loadsofargs</span>
 </pre></div>
 <p>This registers the function <cite>hello</cite> with the name <cite>hello</cite> in the default
-namespace (None), and the function <cite>loadsofargs</cite> with the name <cite>countargs</cite>.
-Now we're going to create a document that we can run XPath expressions
+namespace (None), and the function <cite>loadsofargs</cite> with the name <cite>countargs</cite>.</p>
+<p>Since lxml 4.1, it is preferred to use the <tt class="docutils literal">FunctionNamespace</tt> as a decorator.
+Either pass an explicit function name (<tt class="docutils literal"><span class="pre">@ns("countargs")</span></tt>), or just use the
+bare decorator to register the function under its own name:</p>
+<div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="nd">@ns</span>
+<span class="gp">... </span><span class="k">def</span> <span class="nf">hello</span><span class="p">(</span><span class="n">context</span><span class="p">,</span> <span class="n">a</span><span class="p">):</span>
+<span class="gp">... </span>   <span class="k">return</span> <span class="s2">"Hello </span><span class="si">%s</span><span class="s2">"</span> <span class="o">%</span> <span class="n">a</span>
+</pre></div>
+<p>Now we're going to create a document that we can run XPath expressions
 against:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">root</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">XML</span><span class="p">(</span><span class="s1">'&lt;a&gt;&lt;b&gt;Haegar&lt;/b&gt;&lt;/a&gt;'</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">doc</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">ElementTree</span><span class="p">(</span><span class="n">root</span><span class="p">)</span>
@@ -98,12 +105,13 @@ against:</p>
 <span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">root</span><span class="o">.</span><span class="n">xpath</span><span class="p">(</span><span class="s1">'countargs(., b, ./*)'</span><span class="p">))</span>
 <span class="go">Got 3 arguments.</span>
 </pre></div>
-<p>Note how we call both a Python function (<cite>hello</cite>) and an XPath built-in
-function (<cite>string</cite>) in exactly the same way.  Normally, however, you would
+<p>Note how we call both a Python function (<tt class="docutils literal">hello()</tt>) and an XPath built-in
+function (<tt class="docutils literal">string()</tt>) in exactly the same way.  Normally, however, you would
 want to separate the two in different namespaces.  The FunctionNamespace class
 allows you to do this:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">ns</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">FunctionNamespace</span><span class="p">(</span><span class="s1">'http://mydomain.org/myfunctions'</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">ns</span><span class="p">[</span><span class="s1">'hello'</span><span class="p">]</span> <span class="o">=</span> <span class="n">hello</span>
+
 <span class="gp">&gt;&gt;&gt; </span><span class="n">prefixmap</span> <span class="o">=</span> <span class="p">{</span><span class="s1">'f'</span> <span class="p">:</span> <span class="s1">'http://mydomain.org/myfunctions'</span><span class="p">}</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">root</span><span class="o">.</span><span class="n">xpath</span><span class="p">(</span><span class="s1">'f:hello(local-name(*))'</span><span class="p">,</span> <span class="n">namespaces</span><span class="o">=</span><span class="n">prefixmap</span><span class="p">))</span>
 <span class="go">Hello b</span>
@@ -117,6 +125,7 @@ register it with the namespace:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">ns</span> <span class="o">=</span> <span class="n">etree</span><span class="o">.</span><span class="n">FunctionNamespace</span><span class="p">(</span><span class="s1">'http://mydomain.org/myother/functions'</span><span class="p">)</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">ns</span><span class="o">.</span><span class="n">prefix</span> <span class="o">=</span> <span class="s1">'es'</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">ns</span><span class="p">[</span><span class="s1">'hello'</span><span class="p">]</span> <span class="o">=</span> <span class="n">ola</span>
+
 <span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">root</span><span class="o">.</span><span class="n">xpath</span><span class="p">(</span><span class="s1">'es:hello(local-name(*))'</span><span class="p">))</span>
 <span class="go">Ola b</span>
 </pre></div>
@@ -521,7 +530,7 @@ will work:</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 6b677111870832d4e254d0899eaffd84453a793a..2fcf209e9f4ff4f35a6c9a135a019d19b2169455 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="html5lib-parser">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu current" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">html5lib Parser</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu current" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">html5lib Parser</h1>
 
 <p><a class="reference external" href="http://code.google.com/p/html5lib/">html5lib</a> is a Python package that implements the HTML5 parsing algorithm
 which is heavily influenced by current browsers and based on the <a class="reference external" href="http://www.whatwg.org/specs/web-apps/current-work/">WHATWG
@@ -90,7 +90,7 @@ module.  Note that these are the parser classes provided by html5lib.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 233a97c4f50438dee2cddc3f35e6a421601433db..06b2ad4d75f796d6c9bc82c33c35ba360f155570 100644 (file)
@@ -26,7 +26,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu current" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">lxml - XML and HTML with Python</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu current" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">lxml - XML and HTML with Python</h1>
 
 <div class="pagequote line-block">
 <div class="line"><a class="reference external" href="http://thread.gmane.org/gmane.comp.python.lxml.devel/3252/focus=3258">&#187; lxml takes all the pain out of XML. &#171;</a></div>
@@ -67,7 +67,7 @@ fast Python XML processing.</p>
 </div>
 <div class="section" id="documentation">
 <h1>Documentation</h1>
-<p>The complete lxml documentation is available for download as <a class="reference external" href="lxmldoc-4.0.0.pdf">PDF
+<p>The complete lxml documentation is available for download as <a class="reference external" href="lxmldoc-4.1.0.pdf">PDF
 documentation</a>.  The HTML documentation from this web site is part of
 the normal <a class="reference external" href="#download">source download</a>.</p>
 <ul class="simple">
@@ -130,8 +130,8 @@ external C modules, including fast custom element class support.</p>
 Index</a> (PyPI).  It has the source
 that compiles on various platforms.  The source distribution is signed
 with <a class="reference external" href="pubkey.asc">this key</a>.</p>
-<p>The latest version is <a class="reference external" href="/files/lxml-4.0.0.tgz">lxml 4.0.0</a>, released 2017-09-17
-(<a class="reference external" href="/changes-4.0.0.html">changes for 4.0.0</a>).  <a class="reference external" href="#old-versions">Older versions</a>
+<p>The latest version is <a class="reference external" href="/files/lxml-4.1.0.tgz">lxml 4.1.0</a>, released 2017-10-13
+(<a class="reference external" href="/changes-4.1.0.html">changes for 4.1.0</a>).  <a class="reference external" href="#old-versions">Older versions</a>
 are listed below.</p>
 <p>Please take a look at the
 <a class="reference external" href="installation.html">installation instructions</a> !</p>
@@ -139,7 +139,7 @@ are listed below.</p>
 part of the source distribution, so if you want to download the
 documentation for offline use, take the source archive and copy the
 <tt class="docutils literal">doc/html</tt> directory out of the source tree, or use the
-<a class="reference external" href="lxmldoc-4.0.0.pdf">PDF documentation</a>.</p>
+<a class="reference external" href="lxmldoc-4.1.0.pdf">PDF documentation</a>.</p>
 <p>The latest installable developer sources should usually be available from the
 <a class="reference external" href="http://lxml.de/build/">build server</a>.  It's also possible to check out
 the latest development version of lxml from github directly, using a command
@@ -192,20 +192,17 @@ obstacle to using lxml in your codebase.</p>
 <a class="reference external" href="http://lxml.de/3.5/">3.5</a>,
 <a class="reference external" href="http://lxml.de/3.6/">3.6</a>,
 <a class="reference external" href="http://lxml.de/3.7/">3.7</a>
-<a class="reference external" href="http://lxml.de/3.8/">3.8</a></p>
+<a class="reference external" href="http://lxml.de/3.8/">3.8</a>
+<a class="reference external" href="http://lxml.de/4.0/">4.0</a></p>
 <ul class="simple">
+<li><a class="reference external" href="/files/lxml-4.1.0.tgz">lxml 4.1.0</a>, released 2017-10-13 (<a class="reference external" href="/changes-4.1.0.html">changes for 4.1.0</a>)</li>
 <li><a class="reference external" href="/files/lxml-4.0.0.tgz">lxml 4.0.0</a>, released 2017-09-17 (<a class="reference external" href="/changes-4.0.0.html">changes for 4.0.0</a>)</li>
 <li><a class="reference external" href="/files/lxml-3.8.0.tgz">lxml 3.8.0</a>, released 2017-06-03 (<a class="reference external" href="/changes-3.8.0.html">changes for 3.8.0</a>)</li>
 <li><a class="reference external" href="/files/lxml-3.7.3.tgz">lxml 3.7.3</a>, released 2017-02-18 (<a class="reference external" href="/changes-3.7.3.html">changes for 3.7.3</a>)</li>
 <li><a class="reference external" href="/files/lxml-3.7.2.tgz">lxml 3.7.2</a>, released 2017-01-08 (<a class="reference external" href="/changes-3.7.2.html">changes for 3.7.2</a>)</li>
 <li><a class="reference external" href="/files/lxml-3.7.1.tgz">lxml 3.7.1</a>, released 2016-12-22 (<a class="reference external" href="/changes-3.7.1.html">changes for 3.7.1</a>)</li>
 <li><a class="reference external" href="/files/lxml-3.7.0.tgz">lxml 3.7.0</a>, released 2016-12-10 (<a class="reference external" href="/changes-3.7.0.html">changes for 3.7.0</a>)</li>
-<li><a class="reference external" href="/files/lxml-3.6.4.tgz">lxml 3.6.4</a>, released 2016-08-18 (<a class="reference external" href="/changes-3.6.4.html">changes for 3.6.4</a>)</li>
-<li><a class="reference external" href="/files/lxml-3.6.3.tgz">lxml 3.6.3</a>, released 2016-08-18 (<a class="reference external" href="/changes-3.6.3.html">changes for 3.6.3</a>)</li>
-<li><a class="reference external" href="/files/lxml-3.6.2.tgz">lxml 3.6.2</a>, released 2016-08-18 (<a class="reference external" href="/changes-3.6.2.html">changes for 3.6.2</a>)</li>
-<li><a class="reference external" href="/files/lxml-3.6.1.tgz">lxml 3.6.1</a>, released 2016-07-24 (<a class="reference external" href="/changes-3.6.1.html">changes for 3.6.1</a>)</li>
-<li><a class="reference external" href="/files/lxml-3.6.0.tgz">lxml 3.6.0</a>, released 2016-03-17 (<a class="reference external" href="/changes-3.6.0.html">changes for 3.6.0</a>)</li>
-<li><a class="reference external" href="http://lxml.de/3.6/#old-versions">older releases</a></li>
+<li><a class="reference external" href="http://lxml.de/3.7/#old-versions">older releases</a></li>
 </ul>
 </div><div class="section" id="legal-notice-for-donations">
 <h1>Legal Notice for Donations</h1>
@@ -228,7 +225,7 @@ donation is non-refundable.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 29bb56d87a378953c7aa4bc04b33696a8e8b26c0..4670b85a44529d70daf4634e13e1e3c82f8820f9 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="installing-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu current" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Installing lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu current" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Installing lxml</h1>
 
 <div class="contents topic" id="contents">
 <p class="topic-title first">Contents</p>
@@ -215,7 +215,7 @@ read the
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index b9fefaebd55f5faefc3a6ad5182c0fd999dfd8a8..274f93c21e9343991897e1ab6a68629e29e4a3c8 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="why-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu current" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Why lxml?</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu current" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Why lxml?</h1>
 
 <div class="contents topic" id="contents">
 <p class="topic-title first">Contents</p>
@@ -82,7 +82,7 @@ having to learn new things -- XML is complicated enough.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 9abdd485fb21725685cdba3107c0740270fc30a8..b8c1760669bbd7e16c6e7ef8c912ce4f71e3e62d 100644 (file)
@@ -27,7 +27,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="how-to-read-the-source-of-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu current" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">How to read the source of lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu current" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">How to read the source of lxml</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -286,7 +286,7 @@ implemented in pure Python.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 0f69ea64416e4656ee4b6b00fd1e7257346a315d..b32263e41b61a669dfdc50a38bdfefacea428869 100644 (file)
@@ -25,7 +25,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="lxml-html">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu current" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">lxml.html</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu current" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">lxml.html</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -696,7 +696,7 @@ microformat.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 55e0e25bb4bd5b40bb715ed1f6679c9d0e5506d6..ad2d77be7cccce3a1883c4345381b189fc186631 100644 (file)
@@ -25,7 +25,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="lxml-objectify">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu current" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">lxml.objectify</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu current" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">lxml.objectify</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -1165,7 +1165,7 @@ support any XPath expression.</li>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 2f2132fe9a923ae2659cf1ea450a5383923cd7cd..2956f1eda2acb5169c6f656756cd8213f31414d9 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="parsing-xml-and-html-with-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu current" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Parsing XML and HTML with lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu current" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Parsing XML and HTML with lxml</h1>
 
 <p>lxml provides a very simple and powerful API for parsing XML and HTML.  It
 supports one-step parsing as well as step-by-step parsing using an
@@ -892,7 +892,7 @@ with UTF-8 is also considerably faster in most cases.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index a5facf5af1d8c37264bdcfae7dc2da5668148b03..b8f9e39fe58def7336515c93077e040641a2fda8 100644 (file)
@@ -27,7 +27,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="benchmarks-and-speed">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu current" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Benchmarks and Speed</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu current" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Benchmarks and Speed</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -798,7 +798,7 @@ random.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index fb3cad96508bbdb03cbe5d2080c98ca4d3782e66..35c22dd2be8473164fb1a55c976d6509137b6912 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="document-loading-and-url-resolving">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu current" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Document loading and URL resolving</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu current" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Document loading and URL resolving</h1>
 
 <div class="contents topic" id="contents">
 <p class="topic-title first">Contents</p>
@@ -250,7 +250,7 @@ documents or raises exceptions if access is denied.</li>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 44a9016f3010fbd65e94e85cdddddf9c88ffcc9f..c6d70652dddb13d85853b2b7e3889a99b3a14ddf 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="sax-support">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu current" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Sax support</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu current" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Sax support</h1>
 
 <p>In this document we'll describe lxml's SAX support.  lxml has support for
 producing SAX events for an ElementTree or Element.  lxml can also turn SAX
@@ -124,7 +124,7 @@ DOM implementation cannot generate SAX events from a DOM tree.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 6e5e824bcf9b308ad744ad15e89e20b0067ee3c9..d4906945ee6e219c528780319ec22ffc73d7a1ca 100644 (file)
@@ -8,5 +8,5 @@
   </head>
   <body>
     <h1>Sitemap of lxml.de - Processing XML and HTML with Python</h1>
-  <div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li></ul><li><a href="http://lxml.de/files/">Download files</a></li></div></div></body>
+  <div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li></ul><li><a href="http://lxml.de/files/">Download files</a></li></div></div></body>
 </html>
\ No newline at end of file
index e8f609a9f4743642d804ab8e4691c94b8608ca9d..d36a59d0ba21ba570e8769eb4daa2309d0141508 100644 (file)
@@ -27,7 +27,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="the-lxml-etree-tutorial">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu current" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">The lxml.etree Tutorial</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu current" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">The lxml.etree Tutorial</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -1184,7 +1184,7 @@ whereas the other two examples would raise a <tt class="docutils literal">StopIt
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 2052a3d24e964d78db779eaa5433dfd0ec395eb5..49ff4bc5a945a97e5420d5f5242b91187675d4cb 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="validation-with-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu current" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Validation with lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu current" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">Validation with lxml</h1>
 
 <p>Apart from the built-in DTD support in parsers, lxml currently supports three
 schema languages: <a class="reference external" href="http://en.wikipedia.org/wiki/Document_Type_Definition">DTD</a>, <a class="reference external" href="http://www.relaxng.org/">Relax NG</a> and <a class="reference external" href="http://www.w3.org/XML/Schema">XML Schema</a>.  All three provide
@@ -556,7 +556,7 @@ reporting during validation.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index a237dde94796d93314fda7d33c2322ea4c298307..84eb7bfb82569e1b5a34e703a1c6e89d63f331e7 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta content="width=device-width, initial-scale=1" name="viewport" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="xpath-and-xslt-with-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu current" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 0 0-menu"><li class="menu title"><a href="changes-4.0.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">XPath and XSLT with lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="api index-menu"><li class="menu title"><a href="api/index.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li><li class="menu item"><a href="api.html#write-c14n-on-elementtree">write_c14n on ElementTree</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu current" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 1 0-menu"><li class="menu title"><a href="changes-4.1.0.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="http://lxml.de/sitemap.html">Sitemap</a></li></ul></div></div><h1 class="title">XPath and XSLT with lxml</h1>
 
 <p>lxml supports XPath 1.0, XSLT 1.0 and the EXSLT extensions through
 libxml2 and libxslt in a standards compliant way.</p>
@@ -632,7 +632,7 @@ If you want to free it from memory, just do:</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2017-09-17.
+Generated on: 2017-10-13.
 
 </div>
 </body>
index 8a7c9fdef6656b83b43f6e6c08443ac4f0cca8f4..ad77f72d7a8051115b17daf17ff7d8806e03a1dd 100644 (file)
@@ -157,8 +157,8 @@ Index <http://pypi.python.org/pypi/lxml/>`_ (PyPI).  It has the source
 that compiles on various platforms.  The source distribution is signed
 with `this key <pubkey.asc>`_.
 
-The latest version is `lxml 4.0.0`_, released 2017-09-17
-(`changes for 4.0.0`_).  `Older versions <#old-versions>`_
+The latest version is `lxml 4.1.0`_, released 2017-10-13
+(`changes for 4.1.0`_).  `Older versions <#old-versions>`_
 are listed below.
 
 Please take a look at the
@@ -244,11 +244,14 @@ See the websites of lxml
 `3.6 <http://lxml.de/3.6/>`_,
 `3.7 <http://lxml.de/3.7/>`_
 `3.8 <http://lxml.de/3.8/>`_
+`4.0 <http://lxml.de/4.0/>`_
 
 ..
    and the `latest in-development version <http://lxml.de/dev/>`_.
 
-.. _`PDF documentation`: lxmldoc-4.0.0.pdf
+.. _`PDF documentation`: lxmldoc-4.1.0.pdf
+
+* `lxml 4.1.0`_, released 2017-10-13 (`changes for 4.1.0`_)
 
 * `lxml 4.0.0`_, released 2017-09-17 (`changes for 4.0.0`_)
 
@@ -262,18 +265,9 @@ See the websites of lxml
 
 * `lxml 3.7.0`_, released 2016-12-10 (`changes for 3.7.0`_)
 
-* `lxml 3.6.4`_, released 2016-08-18 (`changes for 3.6.4`_)
-
-* `lxml 3.6.3`_, released 2016-08-18 (`changes for 3.6.3`_)
-
-* `lxml 3.6.2`_, released 2016-08-18 (`changes for 3.6.2`_)
-
-* `lxml 3.6.1`_, released 2016-07-24 (`changes for 3.6.1`_)
-
-* `lxml 3.6.0`_, released 2016-03-17 (`changes for 3.6.0`_)
-
-* `older releases <http://lxml.de/3.6/#old-versions>`_
+* `older releases <http://lxml.de/3.7/#old-versions>`_
 
+.. _`lxml 4.1.0`: /files/lxml-4.1.0.tgz
 .. _`lxml 4.0.0`: /files/lxml-4.0.0.tgz
 .. _`lxml 3.8.0`: /files/lxml-3.8.0.tgz
 .. _`lxml 3.7.3`: /files/lxml-3.7.3.tgz
@@ -286,6 +280,7 @@ See the websites of lxml
 .. _`lxml 3.6.1`: /files/lxml-3.6.1.tgz
 .. _`lxml 3.6.0`: /files/lxml-3.6.0.tgz
 
+.. _`changes for 4.1.0`: /changes-4.1.0.html
 .. _`changes for 4.0.0`: /changes-4.0.0.html
 .. _`changes for 3.8.0`: /changes-3.8.0.html
 .. _`changes for 3.7.3`: /changes-3.7.3.html
index 861a9f554263efb088d8636c4f17a30696e495ad..6bc2ff32b5c8328546dda0aa97a5198e7f71cf0b 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [egg_info]
-tag_build = 
 tag_date = 0
+tag_build = 
 tag_svn_revision = 0
 
index 050fe46b7d275e1531349bbb7428db8ac9f661ba..8907f72a36fd44ab26d4ceb0d738575da6d70447 100644 (file)
@@ -347,6 +347,9 @@ def define_macros():
         macros.append(('LXML_UNICODE_STRINGS', '1'))
     if OPTION_WITH_COVERAGE:
         macros.append(('CYTHON_TRACE_NOGIL', '1'))
+    # Explicitly enable showing C lines in tracebacks.
+    # There is also a bug in Cython 0.27.[01] that suggests a compile time setting.
+    macros.append(('CYTHON_CLINE_IN_TRACEBACK', '1'))
     return macros
 
 _ERROR_PRINTED = False
index 535f725af8197b259deef84659af32dcc5113687..06477a3c24f18d1f799675d0d7fb1a43bca031b2 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: lxml
-Version: 4.0.0
+Version: 4.1.0
 Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
 Home-page: http://lxml.de/
 Author: lxml dev team
@@ -29,76 +29,35 @@ Description: lxml is a Pythonic, mature binding for the libxml2 and libxslt libr
         
         After an official release of a new stable series, bug fixes may become
         available at
-        https://github.com/lxml/lxml/tree/lxml-4.0 .
-        Running ``easy_install lxml==4.0bugfix`` will install
+        https://github.com/lxml/lxml/tree/lxml-4.1 .
+        Running ``easy_install lxml==4.1bugfix`` will install
         the unreleased branch state from
-        https://github.com/lxml/lxml/tarball/lxml-4.0#egg=lxml-4.0bugfix
+        https://github.com/lxml/lxml/tarball/lxml-4.1#egg=lxml-4.1bugfix
         as soon as a maintenance branch has been established.  Note that this
         requires Cython to be installed at an appropriate version for the build.
         
-        4.0.0 (2017-09-17)
+        4.1.0 (2017-10-13)
         ==================
         
         Features added
         --------------
         
-        * The ElementPath implementation is now compiled using Cython,
-          which speeds up the ``.find*()`` methods quite significantly.
+        * ElementPath supports text predicates for current node, like "[.='text']".
         
-        * The modules ``lxml.builder``, ``lxml.html.diff`` and ``lxml.html.clean``
-          are also compiled using Cython in order to speed them up.
+        * ElementPath allows spaces in predicates.
         
-        * ``xmlfile()`` supports async coroutines using ``async with`` and ``await``.
+        * Custom Element classes and XPath functions can now be registered with a
+          decorator rather than explicit dict assignments.
         
-        * ``iterwalk()`` has a new method ``skip_subtree()`` that prevents walking into
-          the descendants of the current element.
-        
-        * ``RelaxNG.from_rnc_string()`` accepts a ``base_url`` argument to
-          allow relative resource lookups.
-        
-        * The XSLT result object has a new method ``.write_output(file)`` that serialises
-          output data into a file according to the ``<xsl:output>`` configuration.
+        * Static Linux wheels are now built with link time optimisation (LTO) enabled.
+          This should have a beneficial impact on the overall performance by providing
+          a tighter compiler integration between lxml and libxml2/libxslt.
         
         Bugs fixed
         ----------
         
-        * GH#251: HTML comments were handled incorrectly by the soupparser.
-          Patch by mozbugbox.
-        
-        * LP#1654544: The html5parser no longer passes the ``useChardet`` option
-          if the input is a Unicode string, unless explicitly requested.  When parsing
-          files, the default is to enable it when a URL or file path is passed (because
-          the file is then opened in binary mode), and to disable it when reading from
-          a file(-like) object.
-        
-          Note: This is a backwards incompatible change of the default configuration.
-          If your code parses byte strings/streams and depends on character detection,
-          please pass the option ``guess_charset=True`` explicitly, which already worked
-          in older lxml versions.
-        
-        * LP#1703810: ``etree.fromstring()`` failed to parse UTF-32 data with BOM.
-        
-        * LP#1526522: Some RelaxNG errors were not reported in the error log.
-        
-        * LP#1567526: Empty and plain text input raised a TypeError in soupparser.
-        
-        * LP#1710429: Uninitialised variable usage in HTML diff.
-        
-        * LP#1415643: The closing tags context manager in ``xmlfile()`` could continue
-          to output end tags even after writing failed with an exception.
-        
-        * LP#1465357: ``xmlfile.write()`` now accepts and ignores None as input argument.
-        
-        * Compilation under Py3.7-pre failed due to a modified function signature.
-        
-        Other changes
-        -------------
-        
-        * The main module source files were renamed from ``lxml.*.pyx`` to plain
-          ``*.pyx`` (e.g. ``etree.pyx``) to simplify their handling in the build
-          process.  Care was taken to keep the old header files as fallbacks for
-          code that compiles against the public C-API of lxml, but it might still
-          be worth validating that third-party code does not notice this change.
+        * LP#1722776: Requesting non-Element objects like comments from a document with
+          ``PythonElementClassLookup`` could fail with a TypeError.
         
         
         
index 27fd9c7a21534e9d7bc0af21058467d79329ffe3..8cb92c67254fa6c9353edb8c87b1942359f7d73e 100644 (file)
@@ -57,7 +57,7 @@ doc/html/FAQ.html
 doc/html/api.html
 doc/html/build.html
 doc/html/capi.html
-doc/html/changes-4.0.0.html
+doc/html/changes-4.1.0.html
 doc/html/compatibility.html
 doc/html/credits.html
 doc/html/cssselect.html
index 17083b8765c22b7c22e39e32ae8547a3d1bc438c..ba1aea8348c5fa87e0974fab8512e9f4109cdbe1 100644 (file)
@@ -1,8 +1,14 @@
-/* Generated by Cython 0.26.1 */
+/* Generated by Cython 0.27.1 */
 
 /* BEGIN: Cython Metadata
 {
     "distutils": {
+        "define_macros": [
+            [
+                "CYTHON_CLINE_IN_TRACEBACK", 
+                "1"
+            ]
+        ], 
         "extra_compile_args": [
             "-w"
         ], 
@@ -32,10 +38,11 @@ END: Cython Metadata */
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
-    #error Cython requires Python 2.6+ or Python 3.2+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+    #error Cython requires Python 2.6+ or Python 3.3+.
 #else
-#define CYTHON_ABI "0_26_1"
+#define CYTHON_ABI "0_27_1"
+#define CYTHON_FUTURE_DIVISION 0
 #include <stddef.h>
 #ifndef offsetof
   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
@@ -59,7 +66,7 @@ END: Cython Metadata */
 #endif
 #define __PYX_COMMA ,
 #ifndef HAVE_LONG_LONG
-  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+  #if PY_VERSION_HEX >= 0x02070000
     #define HAVE_LONG_LONG
   #endif
 #endif
@@ -77,8 +84,12 @@ END: Cython Metadata */
   #define CYTHON_USE_TYPE_SLOTS 0
   #undef CYTHON_USE_PYTYPE_LOOKUP
   #define CYTHON_USE_PYTYPE_LOOKUP 0
-  #undef CYTHON_USE_ASYNC_SLOTS
-  #define CYTHON_USE_ASYNC_SLOTS 0
+  #if PY_VERSION_HEX < 0x03050000
+    #undef CYTHON_USE_ASYNC_SLOTS
+    #define CYTHON_USE_ASYNC_SLOTS 0
+  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+    #define CYTHON_USE_ASYNC_SLOTS 1
+  #endif
   #undef CYTHON_USE_PYLIST_INTERNALS
   #define CYTHON_USE_PYLIST_INTERNALS 0
   #undef CYTHON_USE_UNICODE_INTERNALS
@@ -97,6 +108,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #elif defined(PYSTON_VERSION)
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 1
@@ -130,6 +145,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #else
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 0
@@ -182,6 +201,12 @@ END: Cython Metadata */
   #ifndef CYTHON_FAST_PYCALL
     #define CYTHON_FAST_PYCALL 1
   #endif
+  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+    #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
+  #endif
+  #ifndef CYTHON_USE_TP_FINALIZE
+    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+  #endif
 #endif
 #if !defined(CYTHON_FAST_PYCCALL)
 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
@@ -237,6 +262,27 @@ END: Cython Metadata */
 #else
 #define __Pyx_PyFastCFunction_Check(func) 0
 #endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+  #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
+#else
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
@@ -320,7 +366,6 @@ END: Cython Metadata */
 #ifndef PySet_CheckExact
   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
 #endif
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
 #if PY_MAJOR_VERSION >= 3
   #define PyIntObject                  PyLongObject
@@ -371,15 +416,17 @@ END: Cython Metadata */
     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
   #else
+    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+  #endif
+#else
+  #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
     typedef struct {
         unaryfunc am_await;
         unaryfunc am_aiter;
         unaryfunc am_anext;
     } __Pyx_PyAsyncMethodsStruct;
-    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
-  #endif
-#else
-  #define __Pyx_PyType_AsAsync(obj) NULL
 #endif
 #ifndef CYTHON_RESTRICT
   #if defined(__GNUC__)
@@ -489,14 +536,6 @@ static CYTHON_INLINE float __PYX_NAN() {
   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
 }
 
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
-#else
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
-#endif
-
 #ifndef __PYX_EXTERN_C
   #ifdef __cplusplus
     #define __PYX_EXTERN_C extern "C"
@@ -511,7 +550,7 @@ static CYTHON_INLINE float __PYX_NAN() {
 #include <omp.h>
 #endif /* _OPENMP */
 
-#ifdef PYREX_WITHOUT_ASSERTIONS
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
@@ -542,8 +581,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc
     #define __Pyx_sst_abs(value) abs(value)
 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
     #define __Pyx_sst_abs(value) labs(value)
-#elif defined (_MSC_VER) && defined (_M_X64)
-    #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (_MSC_VER)
+    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
     #define __Pyx_sst_abs(value) llabs(value)
 #elif defined (__GNUC__)
@@ -565,6 +604,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
 #endif
+#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
@@ -575,16 +620,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
     const Py_UNICODE *u_end = u;
     while (*u_end++) ;
     return (size_t)(u_end - u - 1);
 }
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
@@ -593,6 +633,8 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 #if CYTHON_ASSUME_SAFE_MACROS
@@ -693,7 +735,7 @@ bad:
 #endif /* __GNUC__ */
 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
 
-static PyObject *__pyx_m;
+static PyObject *__pyx_m = NULL;
 static PyObject *__pyx_d;
 static PyObject *__pyx_b;
 static PyObject *__pyx_cython_runtime;
@@ -724,8 +766,9 @@ struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_9_select;
 struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_10_select;
 struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_11_select;
 struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select;
-struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator;
-struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr;
+struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select;
+struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator;
+struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr;
 
 /* "lxml/_elementpath.py":70
  *     )
@@ -877,7 +920,7 @@ struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_7_prepare_predicate {
 };
 
 
-/* "lxml/_elementpath.py":152
+/* "lxml/_elementpath.py":155
  *         # [@attribute] predicate
  *         key = predicate[1]
  *         def select(result):             # <<<<<<<<<<<<<<
@@ -895,7 +938,7 @@ struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_8_select {
 };
 
 
-/* "lxml/_elementpath.py":161
+/* "lxml/_elementpath.py":164
  *         key = predicate[1]
  *         value = predicate[-1]
  *         def select(result):             # <<<<<<<<<<<<<<
@@ -913,7 +956,7 @@ struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_9_select {
 };
 
 
-/* "lxml/_elementpath.py":169
+/* "lxml/_elementpath.py":172
  *         # [tag]
  *         tag = predicate[0]
  *         def select(result):             # <<<<<<<<<<<<<<
@@ -935,12 +978,12 @@ struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_10_select {
 };
 
 
-/* "lxml/_elementpath.py":179
- *         tag = predicate[0]
+/* "lxml/_elementpath.py":183
  *         value = predicate[-1]
- *         def select(result):             # <<<<<<<<<<<<<<
- *             for elem in result:
- *                 for e in elem.iterchildren(tag):
+ *         if tag:
+ *             def select(result):             # <<<<<<<<<<<<<<
+ *                 for elem in result:
+ *                     for e in elem.iterchildren(tag):
  */
 struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_11_select {
   PyObject_HEAD
@@ -957,14 +1000,32 @@ struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_11_select {
 };
 
 
-/* "lxml/_elementpath.py":207
+/* "lxml/_elementpath.py":190
+ *                             break
+ *         else:
+ *             def select(result):             # <<<<<<<<<<<<<<
+ *                 for elem in result:
+ *                     if "".join(elem.itertext()) == value:
+ */
+struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select {
+  PyObject_HEAD
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_7_prepare_predicate *__pyx_outer_scope;
+  PyObject *__pyx_v_elem;
+  PyObject *__pyx_v_result;
+  PyObject *__pyx_t_0;
+  Py_ssize_t __pyx_t_1;
+  PyObject *(*__pyx_t_2)(PyObject *);
+};
+
+
+/* "lxml/_elementpath.py":216
  *             else:
  *                 index = -1
  *         def select(result):             # <<<<<<<<<<<<<<
  *             for elem in result:
  *                 parent = elem.getparent()
  */
-struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select {
+struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select {
   PyObject_HEAD
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_7_prepare_predicate *__pyx_outer_scope;
   PyObject *__pyx_v_elem;
@@ -980,29 +1041,29 @@ struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select {
 };
 
 
-/* "lxml/_elementpath.py":237
+/* "lxml/_elementpath.py":246
  * 
  * 
  * def _build_path_iterator(path, namespaces):             # <<<<<<<<<<<<<<
  *     """compile selector pattern"""
  *     if path[-1:] == "/":
  */
-struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator {
+struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator {
   PyObject_HEAD
   PyObject *__pyx_v_namespaces;
 };
 
 
-/* "lxml/_elementpath.py":248
+/* "lxml/_elementpath.py":257
  *         if None in namespaces:
  *             cache_key += (namespaces[None],) + tuple(sorted(
  *                 item for item in namespaces.items() if item[0] is not None))             # <<<<<<<<<<<<<<
  *         else:
  *             cache_key += tuple(sorted(namespaces.items()))
  */
-struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr {
+struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr {
   PyObject_HEAD
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *__pyx_outer_scope;
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *__pyx_outer_scope;
   PyObject *__pyx_v_item;
 };
 
@@ -1156,7 +1217,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                               int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                      int is_list, int wraparound, int boundscheck);
 
@@ -1197,21 +1258,31 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
 /* PyThreadStateGet.proto */
 #if CYTHON_FAST_THREAD_STATE
 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
+#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
 #else
 #define __Pyx_PyThreadState_declare
 #define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
 #endif
 
 /* PyErrFetchRestore.proto */
 #if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
 #else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
@@ -1356,12 +1427,6 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
 #endif
 
-/* PyObjectCallMethod1.proto */
-static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
-
-/* append.proto */
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
-
 /* PyIntBinop.proto */
 #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
@@ -1449,6 +1514,18 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 /* CIntFromPy.proto */
 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+
 /* SwapException.proto */
 #if CYTHON_FAST_THREAD_STATE
 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
@@ -1457,8 +1534,12 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject *
 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
 #endif
 
+/* PyObjectCallMethod1.proto */
+static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
+static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
+
 /* CoroutineBase.proto */
-typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *);
+typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
 typedef struct {
     PyObject_HEAD
     __pyx_coroutine_body_t body;
@@ -1478,12 +1559,30 @@ typedef struct {
 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
     PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure,
     PyObject *name, PyObject *qualname, PyObject *module_name);
+static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
+            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
+            PyObject *name, PyObject *qualname, PyObject *module_name);
 static int __Pyx_Coroutine_clear(PyObject *self);
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
+static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
+static PyObject *__Pyx_Coroutine_Close(PyObject *self);
+static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
+#define __Pyx_Coroutine_SwapException(self) {\
+    __Pyx_ExceptionSwap(&(self)->exc_type, &(self)->exc_value, &(self)->exc_traceback);\
+    __Pyx_Coroutine_ResetFrameBackpointer(self);\
+    }
+#define __Pyx_Coroutine_ResetAndClearException(self) {\
+    __Pyx_ExceptionReset((self)->exc_type, (self)->exc_value, (self)->exc_traceback);\
+    (self)->exc_type = (self)->exc_value = (self)->exc_traceback = NULL;\
+    }
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
+    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
 #else
-#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
+#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
+    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
 #endif
+static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
+static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *self);
 
 /* PatchModuleWithCoroutine.proto */
 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
@@ -1521,8 +1620,9 @@ static PyTypeObject *__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_9_selec
 static PyTypeObject *__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_10_select = 0;
 static PyTypeObject *__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_11_select = 0;
 static PyTypeObject *__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_12_select = 0;
-static PyTypeObject *__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator = 0;
-static PyTypeObject *__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_14_genexpr = 0;
+static PyTypeObject *__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_13_select = 0;
+static PyTypeObject *__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator = 0;
+static PyTypeObject *__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_15_genexpr = 0;
 #define __Pyx_MODULE_NAME "lxml._elementpath"
 int __pyx_module_is_main_lxml___elementpath = 0;
 
@@ -1543,20 +1643,21 @@ static const char __pyx_k__2[] = "{";
   static const char __pyx_k_re[] = "re";
   static const char __pyx_k__18[] = "";
   static const char __pyx_k__19[] = "]";
-  static const char __pyx_k__21[] = "'\"";
-  static const char __pyx_k__22[] = "'";
-  static const char __pyx_k__24[] = "-";
-  static const char __pyx_k__25[] = "@-";
-  static const char __pyx_k__28[] = "@-='";
-  static const char __pyx_k__31[] = "_";
-  static const char __pyx_k__34[] = "-='";
-  static const char __pyx_k__37[] = "-()";
-  static const char __pyx_k__38[] = "-()-";
-  static const char __pyx_k__47[] = "/";
-  static const char __pyx_k__69[] = ".";
-  static const char __pyx_k__70[] = "..";
-  static const char __pyx_k__71[] = "//";
-  static const char __pyx_k__72[] = "[";
+  static const char __pyx_k__22[] = "'\"";
+  static const char __pyx_k__23[] = "'";
+  static const char __pyx_k__25[] = "-";
+  static const char __pyx_k__26[] = "@-";
+  static const char __pyx_k__29[] = "@-='";
+  static const char __pyx_k__32[] = "_";
+  static const char __pyx_k__35[] = ".='";
+  static const char __pyx_k__36[] = "-='";
+  static const char __pyx_k__41[] = "-()";
+  static const char __pyx_k__42[] = "-()-";
+  static const char __pyx_k__51[] = "/";
+  static const char __pyx_k__73[] = ".";
+  static const char __pyx_k__74[] = "..";
+  static const char __pyx_k__75[] = "//";
+  static const char __pyx_k__76[] = "[";
   static const char __pyx_k_get[] = "get";
   static const char __pyx_k_key[] = "key";
   static const char __pyx_k_ops[] = "ops";
@@ -1586,7 +1687,6 @@ static const char __pyx_k_split[] = "split";
 static const char __pyx_k_throw[] = "throw";
 static const char __pyx_k_token[] = "token";
 static const char __pyx_k_value[] = "value";
-static const char __pyx_k_append[] = "append";
 static const char __pyx_k_import[] = "__import__";
 static const char __pyx_k_next_2[] = "__next__";
 static const char __pyx_k_next_3[] = "_next";
@@ -1657,23 +1757,23 @@ static PyObject *__pyx_n_s_ValueError;
 static PyObject *__pyx_kp_s__18;
 static PyObject *__pyx_kp_s__19;
 static PyObject *__pyx_kp_s__2;
-static PyObject *__pyx_kp_s__21;
 static PyObject *__pyx_kp_s__22;
-static PyObject *__pyx_kp_s__24;
+static PyObject *__pyx_kp_s__23;
 static PyObject *__pyx_kp_s__25;
-static PyObject *__pyx_kp_s__28;
+static PyObject *__pyx_kp_s__26;
+static PyObject *__pyx_kp_s__29;
 static PyObject *__pyx_kp_s__3;
-static PyObject *__pyx_n_s__31;
-static PyObject *__pyx_kp_s__34;
-static PyObject *__pyx_kp_s__37;
-static PyObject *__pyx_kp_s__38;
-static PyObject *__pyx_kp_s__47;
-static PyObject *__pyx_kp_s__69;
+static PyObject *__pyx_n_s__32;
+static PyObject *__pyx_kp_s__35;
+static PyObject *__pyx_kp_s__36;
+static PyObject *__pyx_kp_s__41;
+static PyObject *__pyx_kp_s__42;
+static PyObject *__pyx_kp_s__51;
 static PyObject *__pyx_kp_s__7;
-static PyObject *__pyx_kp_s__70;
-static PyObject *__pyx_kp_s__71;
-static PyObject *__pyx_kp_s__72;
-static PyObject *__pyx_n_s_append;
+static PyObject *__pyx_kp_s__73;
+static PyObject *__pyx_kp_s__74;
+static PyObject *__pyx_kp_s__75;
+static PyObject *__pyx_kp_s__76;
 static PyObject *__pyx_n_s_args;
 static PyObject *__pyx_n_s_build_path_iterator;
 static PyObject *__pyx_n_s_build_path_iterator_locals_gene;
@@ -1779,6 +1879,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_3select(PyObj
 static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_6select(PyObject *__pyx_self, PyObject *__pyx_v_result); /* proto */
 static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_9select(PyObject *__pyx_self, PyObject *__pyx_v_result); /* proto */
 static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_12select(PyObject *__pyx_self, PyObject *__pyx_v_result); /* proto */
+static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_15select(PyObject *__pyx_self, PyObject *__pyx_v_result); /* proto */
 static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_next, PyObject *__pyx_v_token); /* proto */
 static PyObject *__pyx_pf_4lxml_12_elementpath_20_build_path_iterator_genexpr(PyObject *__pyx_self); /* proto */
 static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_namespaces); /* proto */
@@ -1799,8 +1900,9 @@ static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_9_select(P
 static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_10_select(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
 static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_11_select(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
 static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_12_select(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_13_select(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_15_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
 static PyObject *__pyx_int_0;
 static PyObject *__pyx_int_1;
 static PyObject *__pyx_int_neg_1;
@@ -1809,69 +1911,72 @@ static PyObject *__pyx_tuple__4;
 static PyObject *__pyx_tuple__5;
 static PyObject *__pyx_tuple__8;
 static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__20;
-static PyObject *__pyx_slice__23;
-static PyObject *__pyx_slice__46;
-static PyObject *__pyx_slice__49;
+static PyObject *__pyx_slice__21;
+static PyObject *__pyx_slice__24;
+static PyObject *__pyx_slice__50;
+static PyObject *__pyx_slice__53;
 static PyObject *__pyx_tuple__11;
 static PyObject *__pyx_tuple__13;
 static PyObject *__pyx_tuple__14;
 static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__26;
-static PyObject *__pyx_tuple__29;
-static PyObject *__pyx_tuple__32;
-static PyObject *__pyx_tuple__35;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__27;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__33;
+static PyObject *__pyx_tuple__37;
 static PyObject *__pyx_tuple__39;
-static PyObject *__pyx_tuple__40;
-static PyObject *__pyx_tuple__41;
-static PyObject *__pyx_tuple__42;
 static PyObject *__pyx_tuple__43;
+static PyObject *__pyx_tuple__44;
 static PyObject *__pyx_tuple__45;
-static PyObject *__pyx_tuple__48;
-static PyObject *__pyx_tuple__50;
-static PyObject *__pyx_tuple__51;
+static PyObject *__pyx_tuple__46;
+static PyObject *__pyx_tuple__47;
+static PyObject *__pyx_tuple__49;
 static PyObject *__pyx_tuple__52;
-static PyObject *__pyx_tuple__53;
 static PyObject *__pyx_tuple__54;
+static PyObject *__pyx_tuple__55;
 static PyObject *__pyx_tuple__56;
 static PyObject *__pyx_tuple__57;
-static PyObject *__pyx_tuple__59;
+static PyObject *__pyx_tuple__58;
+static PyObject *__pyx_tuple__60;
 static PyObject *__pyx_tuple__61;
 static PyObject *__pyx_tuple__63;
 static PyObject *__pyx_tuple__65;
 static PyObject *__pyx_tuple__67;
-static PyObject *__pyx_tuple__73;
-static PyObject *__pyx_tuple__75;
+static PyObject *__pyx_tuple__69;
+static PyObject *__pyx_tuple__71;
 static PyObject *__pyx_tuple__77;
-static PyObject *__pyx_tuple__78;
-static PyObject *__pyx_tuple__80;
+static PyObject *__pyx_tuple__79;
 static PyObject *__pyx_tuple__81;
-static PyObject *__pyx_tuple__83;
+static PyObject *__pyx_tuple__82;
 static PyObject *__pyx_tuple__84;
-static PyObject *__pyx_tuple__86;
+static PyObject *__pyx_tuple__85;
+static PyObject *__pyx_tuple__87;
+static PyObject *__pyx_tuple__88;
+static PyObject *__pyx_tuple__90;
 static PyObject *__pyx_codeobj__6;
 static PyObject *__pyx_codeobj__10;
 static PyObject *__pyx_codeobj__12;
 static PyObject *__pyx_codeobj__15;
 static PyObject *__pyx_codeobj__17;
-static PyObject *__pyx_codeobj__27;
-static PyObject *__pyx_codeobj__30;
-static PyObject *__pyx_codeobj__33;
-static PyObject *__pyx_codeobj__36;
-static PyObject *__pyx_codeobj__44;
-static PyObject *__pyx_codeobj__55;
-static PyObject *__pyx_codeobj__58;
-static PyObject *__pyx_codeobj__60;
+static PyObject *__pyx_codeobj__28;
+static PyObject *__pyx_codeobj__31;
+static PyObject *__pyx_codeobj__34;
+static PyObject *__pyx_codeobj__38;
+static PyObject *__pyx_codeobj__40;
+static PyObject *__pyx_codeobj__48;
+static PyObject *__pyx_codeobj__59;
 static PyObject *__pyx_codeobj__62;
 static PyObject *__pyx_codeobj__64;
 static PyObject *__pyx_codeobj__66;
 static PyObject *__pyx_codeobj__68;
-static PyObject *__pyx_codeobj__74;
-static PyObject *__pyx_codeobj__76;
-static PyObject *__pyx_codeobj__79;
-static PyObject *__pyx_codeobj__82;
-static PyObject *__pyx_codeobj__85;
-static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_codeobj__70;
+static PyObject *__pyx_codeobj__72;
+static PyObject *__pyx_codeobj__78;
+static PyObject *__pyx_codeobj__80;
+static PyObject *__pyx_codeobj__83;
+static PyObject *__pyx_codeobj__86;
+static PyObject *__pyx_codeobj__89;
+static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "lxml/_elementpath.py":70
  *     )
@@ -1983,7 +2088,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_xpath_tokenizer(CYTHON_UNUSED PyO
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct__xpath_tokenizer *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct__xpath_tokenizer *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -2003,7 +2108,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject
   int __pyx_t_14;
   PyObject *__pyx_t_15 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("xpath_tokenizer", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L21_resume_from_yield;
@@ -2129,7 +2234,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 72, __pyx_L1_error)
         }
         break;
@@ -2266,8 +2371,6 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject
  *                         raise KeyError
  */
         {
-          __Pyx_PyThreadState_declare
-          __Pyx_PyThreadState_assign
           __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
           __Pyx_XGOTREF(__pyx_t_11);
           __Pyx_XGOTREF(__pyx_t_12);
@@ -2348,6 +2451,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject
             __pyx_cur_scope->__pyx_t_5 = __pyx_t_13;
             __Pyx_XGIVEREF(__pyx_r);
             __Pyx_RefNannyFinishContext();
+            __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
             /* return from generator, yielding value */
             __pyx_generator->resume_label = 1;
             return __pyx_r;
@@ -2381,7 +2485,6 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject
           __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
           goto __pyx_L19_try_end;
           __pyx_L12_error:;
-          __Pyx_PyThreadState_assign
           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -2433,7 +2536,6 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject
  *                     if not namespaces:
  *                         raise KeyError
  */
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_11);
           __Pyx_XGIVEREF(__pyx_t_12);
           __Pyx_XGIVEREF(__pyx_t_13);
@@ -2498,6 +2600,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject
         __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
         __Pyx_XGIVEREF(__pyx_r);
         __Pyx_RefNannyFinishContext();
+        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
         /* return from generator, yielding value */
         __pyx_generator->resume_label = 2;
         return __pyx_r;
@@ -2535,6 +2638,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject
         __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
         __Pyx_XGIVEREF(__pyx_r);
         __Pyx_RefNannyFinishContext();
+        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
         /* return from generator, yielding value */
         __pyx_generator->resume_label = 3;
         return __pyx_r;
@@ -2574,6 +2678,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject
       __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 4;
       return __pyx_r;
@@ -2619,6 +2724,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_2generator(__pyx_CoroutineObject
   __Pyx_AddTraceback("xpath_tokenizer", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -2694,7 +2800,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_4prepare_child(PyObject *__pyx_se
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_12_elementpath_13prepare_child_2generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_12_elementpath_13prepare_child_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "lxml/_elementpath.py":93
  * def prepare_child(next, token):
@@ -2754,7 +2860,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_child_select(PyObject *
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_13prepare_child_2generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_13prepare_child_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_2_select *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_2_select *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -2768,7 +2874,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_13prepare_child_2generator1(__pyx
   Py_ssize_t __pyx_t_8;
   PyObject *(*__pyx_t_9)(PyObject *);
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("select", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L8_resume_from_yield;
@@ -2818,7 +2924,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_13prepare_child_2generator1(__pyx
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 94, __pyx_L1_error)
         }
         break;
@@ -2916,7 +3022,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_13prepare_child_2generator1(__pyx
         if (unlikely(!__pyx_t_4)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 95, __pyx_L1_error)
           }
           break;
@@ -2947,6 +3053,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_13prepare_child_2generator1(__pyx
       __pyx_cur_scope->__pyx_t_5 = __pyx_t_9;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -3004,6 +3111,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_13prepare_child_2generator1(__pyx
   __Pyx_AddTraceback("select", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -3161,7 +3269,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_6prepare_star(PyObject *__pyx_sel
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_12_elementpath_12prepare_star_2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_12_elementpath_12prepare_star_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "lxml/_elementpath.py":100
  * 
@@ -3218,7 +3326,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_12prepare_star_select(CYTHON_UNUS
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_12prepare_star_2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_12prepare_star_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_3_select *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_3_select *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -3230,7 +3338,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_12prepare_star_2generator2(__pyx_
   Py_ssize_t __pyx_t_6;
   PyObject *(*__pyx_t_7)(PyObject *);
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("select", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L8_resume_from_yield;
@@ -3280,7 +3388,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_12prepare_star_2generator2(__pyx_
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 101, __pyx_L1_error)
         }
         break;
@@ -3337,7 +3445,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_12prepare_star_2generator2(__pyx_
         if (unlikely(!__pyx_t_5)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 102, __pyx_L1_error)
           }
           break;
@@ -3368,6 +3476,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_12prepare_star_2generator2(__pyx_
       __pyx_cur_scope->__pyx_t_5 = __pyx_t_7;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -3423,6 +3532,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_12prepare_star_2generator2(__pyx_
   __Pyx_AddTraceback("select", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -3740,7 +3850,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_10prepare_descendant(PyObject *__
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_12_elementpath_18prepare_descendant_2generator3(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_12_elementpath_18prepare_descendant_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "lxml/_elementpath.py":119
  *     else:
@@ -3800,7 +3910,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_18prepare_descendant_select(PyObj
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_18prepare_descendant_2generator3(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_18prepare_descendant_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_5_select *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_5_select *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -3814,7 +3924,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_18prepare_descendant_2generator3(
   Py_ssize_t __pyx_t_8;
   PyObject *(*__pyx_t_9)(PyObject *);
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("select", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L8_resume_from_yield;
@@ -3864,7 +3974,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_18prepare_descendant_2generator3(
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 120, __pyx_L1_error)
         }
         break;
@@ -3962,7 +4072,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_18prepare_descendant_2generator3(
         if (unlikely(!__pyx_t_4)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 121, __pyx_L1_error)
           }
           break;
@@ -3993,6 +4103,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_18prepare_descendant_2generator3(
       __pyx_cur_scope->__pyx_t_5 = __pyx_t_9;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -4050,6 +4161,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_18prepare_descendant_2generator3(
   __Pyx_AddTraceback("select", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -4318,7 +4430,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_12prepare_parent(PyObject *__pyx_
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_12_elementpath_14prepare_parent_2generator4(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_12_elementpath_14prepare_parent_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "lxml/_elementpath.py":126
  * 
@@ -4375,7 +4487,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_14prepare_parent_select(CYTHON_UN
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_14prepare_parent_2generator4(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_14prepare_parent_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_6_select *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_6_select *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -4388,7 +4500,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_14prepare_parent_2generator4(__py
   int __pyx_t_7;
   int __pyx_t_8;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("select", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L7_resume_from_yield;
@@ -4438,7 +4550,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_14prepare_parent_2generator4(__py
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 127, __pyx_L1_error)
         }
         break;
@@ -4508,6 +4620,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_14prepare_parent_2generator4(__py
       __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -4558,6 +4671,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_14prepare_parent_2generator4(__py
   __Pyx_AddTraceback("select", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -4692,9 +4806,9 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_14prepare_predicate(PyObject *__p
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "lxml/_elementpath.py":152
+/* "lxml/_elementpath.py":155
  *         # [@attribute] predicate
  *         key = predicate[1]
  *         def select(result):             # <<<<<<<<<<<<<<
@@ -4725,7 +4839,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_select(PyObje
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_8_select *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(0, 152, __pyx_L1_error)
+    __PYX_ERR(0, 155, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -4736,7 +4850,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_select(PyObje
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_result);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_result);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 152, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 155, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -4752,7 +4866,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_select(PyObje
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_8_select *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_8_select *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -4766,7 +4880,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
   int __pyx_t_8;
   int __pyx_t_9;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("select", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L7_resume_from_yield;
@@ -4775,9 +4889,9 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 152, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 155, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":153
+  /* "lxml/_elementpath.py":156
  *         key = predicate[1]
  *         def select(result):
  *             for elem in result:             # <<<<<<<<<<<<<<
@@ -4788,26 +4902,26 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
     __pyx_t_1 = __pyx_cur_scope->__pyx_v_result; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
     __pyx_t_3 = NULL;
   } else {
-    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
+    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
+    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_3)) {
       if (likely(PyList_CheckExact(__pyx_t_1))) {
         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 153, __pyx_L1_error)
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       } else {
         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 153, __pyx_L1_error)
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       }
@@ -4816,8 +4930,8 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 153, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 156, __pyx_L1_error)
         }
         break;
       }
@@ -4828,16 +4942,16 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
     __Pyx_GIVEREF(__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/_elementpath.py":154
+    /* "lxml/_elementpath.py":157
  *         def select(result):
  *             for elem in result:
  *                 if elem.get(key) is not None:             # <<<<<<<<<<<<<<
  *                     yield elem
  *         return select
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 154, __pyx_L1_error) }
+    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 157, __pyx_L1_error) }
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
@@ -4849,13 +4963,13 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
       }
     }
     if (!__pyx_t_6) {
-      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key};
-        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_4);
       } else
@@ -4863,19 +4977,19 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key};
-        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_4);
       } else
       #endif
       {
-        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error)
+        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
         __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_key);
         __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_key);
         PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key);
-        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       }
@@ -4886,7 +5000,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
     __pyx_t_9 = (__pyx_t_8 != 0);
     if (__pyx_t_9) {
 
-      /* "lxml/_elementpath.py":155
+      /* "lxml/_elementpath.py":158
  *             for elem in result:
  *                 if elem.get(key) is not None:
  *                     yield elem             # <<<<<<<<<<<<<<
@@ -4901,6 +5015,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
       __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -4910,9 +5025,9 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
       __Pyx_XGOTREF(__pyx_t_1);
       __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
       __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 155, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 158, __pyx_L1_error)
 
-      /* "lxml/_elementpath.py":154
+      /* "lxml/_elementpath.py":157
  *         def select(result):
  *             for elem in result:
  *                 if elem.get(key) is not None:             # <<<<<<<<<<<<<<
@@ -4921,7 +5036,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
  */
     }
 
-    /* "lxml/_elementpath.py":153
+    /* "lxml/_elementpath.py":156
  *         key = predicate[1]
  *         def select(result):
  *             for elem in result:             # <<<<<<<<<<<<<<
@@ -4932,7 +5047,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "lxml/_elementpath.py":152
+  /* "lxml/_elementpath.py":155
  *         # [@attribute] predicate
  *         key = predicate[1]
  *         def select(result):             # <<<<<<<<<<<<<<
@@ -4952,14 +5067,15 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_2generator5(_
   __Pyx_AddTraceback("select", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "lxml/_elementpath.py":161
+/* "lxml/_elementpath.py":164
  *         key = predicate[1]
  *         value = predicate[-1]
  *         def select(result):             # <<<<<<<<<<<<<<
@@ -4990,7 +5106,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_3select(PyObj
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_9_select *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(0, 161, __pyx_L1_error)
+    __PYX_ERR(0, 164, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -5001,7 +5117,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_3select(PyObj
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_result);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_result);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 161, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 164, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -5017,7 +5133,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_3select(PyObj
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_9_select *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_9_select *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -5030,7 +5146,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
   PyObject *__pyx_t_7 = NULL;
   int __pyx_t_8;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("select", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L7_resume_from_yield;
@@ -5039,9 +5155,9 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 161, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 164, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":162
+  /* "lxml/_elementpath.py":165
  *         value = predicate[-1]
  *         def select(result):
  *             for elem in result:             # <<<<<<<<<<<<<<
@@ -5052,26 +5168,26 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
     __pyx_t_1 = __pyx_cur_scope->__pyx_v_result; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
     __pyx_t_3 = NULL;
   } else {
-    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
+    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
+    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_3)) {
       if (likely(PyList_CheckExact(__pyx_t_1))) {
         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       } else {
         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       }
@@ -5080,8 +5196,8 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 162, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 165, __pyx_L1_error)
         }
         break;
       }
@@ -5092,16 +5208,16 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
     __Pyx_GIVEREF(__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/_elementpath.py":163
+    /* "lxml/_elementpath.py":166
  *         def select(result):
  *             for elem in result:
  *                 if elem.get(key) == value:             # <<<<<<<<<<<<<<
  *                     yield elem
  *         return select
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 163, __pyx_L1_error) }
+    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 166, __pyx_L1_error) }
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
@@ -5113,13 +5229,13 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
       }
     }
     if (!__pyx_t_6) {
-      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key};
-        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_4);
       } else
@@ -5127,32 +5243,32 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key};
-        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_4);
       } else
       #endif
       {
-        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
+        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
         __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_key);
         __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_key);
         PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_key);
-        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       }
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 163, __pyx_L1_error) }
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
+    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 166, __pyx_L1_error) }
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 166, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     if (__pyx_t_8) {
 
-      /* "lxml/_elementpath.py":164
+      /* "lxml/_elementpath.py":167
  *             for elem in result:
  *                 if elem.get(key) == value:
  *                     yield elem             # <<<<<<<<<<<<<<
@@ -5167,6 +5283,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
       __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -5176,9 +5293,9 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
       __Pyx_XGOTREF(__pyx_t_1);
       __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
       __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 164, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 167, __pyx_L1_error)
 
-      /* "lxml/_elementpath.py":163
+      /* "lxml/_elementpath.py":166
  *         def select(result):
  *             for elem in result:
  *                 if elem.get(key) == value:             # <<<<<<<<<<<<<<
@@ -5187,7 +5304,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
  */
     }
 
-    /* "lxml/_elementpath.py":162
+    /* "lxml/_elementpath.py":165
  *         value = predicate[-1]
  *         def select(result):
  *             for elem in result:             # <<<<<<<<<<<<<<
@@ -5198,7 +5315,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "lxml/_elementpath.py":161
+  /* "lxml/_elementpath.py":164
  *         key = predicate[1]
  *         value = predicate[-1]
  *         def select(result):             # <<<<<<<<<<<<<<
@@ -5218,14 +5335,15 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_5generator6(_
   __Pyx_AddTraceback("select", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "lxml/_elementpath.py":169
+/* "lxml/_elementpath.py":172
  *         # [tag]
  *         tag = predicate[0]
  *         def select(result):             # <<<<<<<<<<<<<<
@@ -5256,7 +5374,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_6select(PyObj
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_10_select *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(0, 169, __pyx_L1_error)
+    __PYX_ERR(0, 172, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -5267,7 +5385,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_6select(PyObj
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_result);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_result);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 169, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 172, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -5283,7 +5401,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_6select(PyObj
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_10_select *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_10_select *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -5297,7 +5415,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
   Py_ssize_t __pyx_t_8;
   PyObject *(*__pyx_t_9)(PyObject *);
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("select", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L8_resume_from_yield;
@@ -5306,9 +5424,9 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 169, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 172, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":170
+  /* "lxml/_elementpath.py":173
  *         tag = predicate[0]
  *         def select(result):
  *             for elem in result:             # <<<<<<<<<<<<<<
@@ -5319,26 +5437,26 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
     __pyx_t_1 = __pyx_cur_scope->__pyx_v_result; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
     __pyx_t_3 = NULL;
   } else {
-    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
+    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_3)) {
       if (likely(PyList_CheckExact(__pyx_t_1))) {
         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 170, __pyx_L1_error)
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       } else {
         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 170, __pyx_L1_error)
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       }
@@ -5347,8 +5465,8 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 170, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 173, __pyx_L1_error)
         }
         break;
       }
@@ -5359,16 +5477,16 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
     __Pyx_GIVEREF(__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/_elementpath.py":171
+    /* "lxml/_elementpath.py":174
  *         def select(result):
  *             for elem in result:
  *                 for _ in elem.iterchildren(tag):             # <<<<<<<<<<<<<<
  *                     yield elem
  *                     break
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_iterchildren); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_iterchildren); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag)) { __Pyx_RaiseClosureNameError("tag"); __PYX_ERR(0, 171, __pyx_L1_error) }
+    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag)) { __Pyx_RaiseClosureNameError("tag"); __PYX_ERR(0, 174, __pyx_L1_error) }
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
@@ -5380,13 +5498,13 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
       }
     }
     if (!__pyx_t_6) {
-      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag};
-        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_4);
       } else
@@ -5394,19 +5512,19 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag};
-        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_4);
       } else
       #endif
       {
-        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error)
+        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
         __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag);
         __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag);
         PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag);
-        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       }
@@ -5416,9 +5534,9 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
       __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
       __pyx_t_9 = NULL;
     } else {
-      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
+      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error)
+      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 174, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     for (;;) {
@@ -5426,17 +5544,17 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
         if (likely(PyList_CheckExact(__pyx_t_5))) {
           if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
+          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 174, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         } else {
           if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
+          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 174, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -5445,8 +5563,8 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
         if (unlikely(!__pyx_t_4)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 171, __pyx_L1_error)
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            else __PYX_ERR(0, 174, __pyx_L1_error)
           }
           break;
         }
@@ -5457,7 +5575,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
       __Pyx_GIVEREF(__pyx_t_4);
       __pyx_t_4 = 0;
 
-      /* "lxml/_elementpath.py":172
+      /* "lxml/_elementpath.py":175
  *             for elem in result:
  *                 for _ in elem.iterchildren(tag):
  *                     yield elem             # <<<<<<<<<<<<<<
@@ -5476,6 +5594,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
       __pyx_cur_scope->__pyx_t_5 = __pyx_t_9;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -5490,18 +5609,18 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
       __Pyx_XGOTREF(__pyx_t_5);
       __pyx_t_8 = __pyx_cur_scope->__pyx_t_4;
       __pyx_t_9 = __pyx_cur_scope->__pyx_t_5;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 172, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 175, __pyx_L1_error)
 
-      /* "lxml/_elementpath.py":173
+      /* "lxml/_elementpath.py":176
  *                 for _ in elem.iterchildren(tag):
  *                     yield elem
  *                     break             # <<<<<<<<<<<<<<
  *         return select
- *     if signature == "-='" and not re.match(r"-?\d+$", predicate[0]):
+ *     if signature == ".='" or (signature == "-='" and not re.match(r"-?\d+$", predicate[0])):
  */
       goto __pyx_L7_break;
 
-      /* "lxml/_elementpath.py":171
+      /* "lxml/_elementpath.py":174
  *         def select(result):
  *             for elem in result:
  *                 for _ in elem.iterchildren(tag):             # <<<<<<<<<<<<<<
@@ -5512,7 +5631,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
     __pyx_L7_break:;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/_elementpath.py":170
+    /* "lxml/_elementpath.py":173
  *         tag = predicate[0]
  *         def select(result):
  *             for elem in result:             # <<<<<<<<<<<<<<
@@ -5523,7 +5642,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "lxml/_elementpath.py":169
+  /* "lxml/_elementpath.py":172
  *         # [tag]
  *         tag = predicate[0]
  *         def select(result):             # <<<<<<<<<<<<<<
@@ -5543,19 +5662,20 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_8generator7(_
   __Pyx_AddTraceback("select", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "lxml/_elementpath.py":179
- *         tag = predicate[0]
+/* "lxml/_elementpath.py":183
  *         value = predicate[-1]
- *         def select(result):             # <<<<<<<<<<<<<<
- *             for elem in result:
- *                 for e in elem.iterchildren(tag):
+ *         if tag:
+ *             def select(result):             # <<<<<<<<<<<<<<
+ *                 for elem in result:
+ *                     for e in elem.iterchildren(tag):
  */
 
 /* Python wrapper */
@@ -5581,7 +5701,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_9select(PyObj
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_11_select *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(0, 179, __pyx_L1_error)
+    __PYX_ERR(0, 183, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -5592,7 +5712,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_9select(PyObj
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_result);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_result);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 179, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 183, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -5608,7 +5728,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_9select(PyObj
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_11_select *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_11_select *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -5623,7 +5743,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
   PyObject *(*__pyx_t_9)(PyObject *);
   int __pyx_t_10;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("select", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L9_resume_from_yield;
@@ -5632,39 +5752,39 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 179, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 183, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":180
- *         value = predicate[-1]
- *         def select(result):
- *             for elem in result:             # <<<<<<<<<<<<<<
- *                 for e in elem.iterchildren(tag):
- *                     if "".join(e.itertext()) == value:
+  /* "lxml/_elementpath.py":184
+ *         if tag:
+ *             def select(result):
+ *                 for elem in result:             # <<<<<<<<<<<<<<
+ *                     for e in elem.iterchildren(tag):
+ *                         if "".join(e.itertext()) == value:
  */
   if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_result)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_result)) {
     __pyx_t_1 = __pyx_cur_scope->__pyx_v_result; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
     __pyx_t_3 = NULL;
   } else {
-    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
+    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
+    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_3)) {
       if (likely(PyList_CheckExact(__pyx_t_1))) {
         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 184, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       } else {
         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 184, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       }
@@ -5673,8 +5793,8 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 180, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 184, __pyx_L1_error)
         }
         break;
       }
@@ -5685,16 +5805,16 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
     __Pyx_GIVEREF(__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/_elementpath.py":181
- *         def select(result):
- *             for elem in result:
- *                 for e in elem.iterchildren(tag):             # <<<<<<<<<<<<<<
- *                     if "".join(e.itertext()) == value:
- *                         yield elem
+    /* "lxml/_elementpath.py":185
+ *             def select(result):
+ *                 for elem in result:
+ *                     for e in elem.iterchildren(tag):             # <<<<<<<<<<<<<<
+ *                         if "".join(e.itertext()) == value:
+ *                             yield elem
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_iterchildren); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_iterchildren); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag)) { __Pyx_RaiseClosureNameError("tag"); __PYX_ERR(0, 181, __pyx_L1_error) }
+    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag)) { __Pyx_RaiseClosureNameError("tag"); __PYX_ERR(0, 185, __pyx_L1_error) }
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
@@ -5706,13 +5826,13 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
       }
     }
     if (!__pyx_t_6) {
-      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag};
-        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_4);
       } else
@@ -5720,19 +5840,19 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag};
-        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_4);
       } else
       #endif
       {
-        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error)
+        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
         __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag);
         __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag);
         PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tag);
-        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       }
@@ -5742,9 +5862,9 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
       __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
       __pyx_t_9 = NULL;
     } else {
-      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error)
+      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error)
+      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 185, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     for (;;) {
@@ -5752,17 +5872,17 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
         if (likely(PyList_CheckExact(__pyx_t_5))) {
           if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
+          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 185, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         } else {
           if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
+          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 185, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -5771,8 +5891,8 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
         if (unlikely(!__pyx_t_4)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 181, __pyx_L1_error)
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            else __PYX_ERR(0, 185, __pyx_L1_error)
           }
           break;
         }
@@ -5783,14 +5903,14 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
       __Pyx_GIVEREF(__pyx_t_4);
       __pyx_t_4 = 0;
 
-      /* "lxml/_elementpath.py":182
- *             for elem in result:
- *                 for e in elem.iterchildren(tag):
- *                     if "".join(e.itertext()) == value:             # <<<<<<<<<<<<<<
- *                         yield elem
- *                         break
+      /* "lxml/_elementpath.py":186
+ *                 for elem in result:
+ *                     for e in elem.iterchildren(tag):
+ *                         if "".join(e.itertext()) == value:             # <<<<<<<<<<<<<<
+ *                             yield elem
+ *                             break
  */
-      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_e, __pyx_n_s_itertext); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_e, __pyx_n_s_itertext); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __pyx_t_6 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
@@ -5803,27 +5923,27 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
         }
       }
       if (__pyx_t_6) {
-        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       } else {
-        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_7 = __Pyx_PyString_Join(__pyx_kp_s__18, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyString_Join(__pyx_kp_s__18, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 182, __pyx_L1_error) }
-      __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 182, __pyx_L1_error)
+      if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 186, __pyx_L1_error) }
+      __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 186, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       if (__pyx_t_10) {
 
-        /* "lxml/_elementpath.py":183
- *                 for e in elem.iterchildren(tag):
- *                     if "".join(e.itertext()) == value:
- *                         yield elem             # <<<<<<<<<<<<<<
- *                         break
- *         return select
+        /* "lxml/_elementpath.py":187
+ *                     for e in elem.iterchildren(tag):
+ *                         if "".join(e.itertext()) == value:
+ *                             yield elem             # <<<<<<<<<<<<<<
+ *                             break
+ *         else:
  */
         __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elem);
         __pyx_r = __pyx_cur_scope->__pyx_v_elem;
@@ -5837,6 +5957,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
         __pyx_cur_scope->__pyx_t_5 = __pyx_t_9;
         __Pyx_XGIVEREF(__pyx_r);
         __Pyx_RefNannyFinishContext();
+        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
         /* return from generator, yielding value */
         __pyx_generator->resume_label = 1;
         return __pyx_r;
@@ -5851,54 +5972,54 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
         __Pyx_XGOTREF(__pyx_t_5);
         __pyx_t_8 = __pyx_cur_scope->__pyx_t_4;
         __pyx_t_9 = __pyx_cur_scope->__pyx_t_5;
-        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 183, __pyx_L1_error)
+        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 187, __pyx_L1_error)
 
-        /* "lxml/_elementpath.py":184
- *                     if "".join(e.itertext()) == value:
- *                         yield elem
- *                         break             # <<<<<<<<<<<<<<
- *         return select
- *     if signature == "-" or signature == "-()" or signature == "-()-":
+        /* "lxml/_elementpath.py":188
+ *                         if "".join(e.itertext()) == value:
+ *                             yield elem
+ *                             break             # <<<<<<<<<<<<<<
+ *         else:
+ *             def select(result):
  */
         goto __pyx_L7_break;
 
-        /* "lxml/_elementpath.py":182
- *             for elem in result:
- *                 for e in elem.iterchildren(tag):
- *                     if "".join(e.itertext()) == value:             # <<<<<<<<<<<<<<
- *                         yield elem
- *                         break
+        /* "lxml/_elementpath.py":186
+ *                 for elem in result:
+ *                     for e in elem.iterchildren(tag):
+ *                         if "".join(e.itertext()) == value:             # <<<<<<<<<<<<<<
+ *                             yield elem
+ *                             break
  */
       }
 
-      /* "lxml/_elementpath.py":181
- *         def select(result):
- *             for elem in result:
- *                 for e in elem.iterchildren(tag):             # <<<<<<<<<<<<<<
- *                     if "".join(e.itertext()) == value:
- *                         yield elem
+      /* "lxml/_elementpath.py":185
+ *             def select(result):
+ *                 for elem in result:
+ *                     for e in elem.iterchildren(tag):             # <<<<<<<<<<<<<<
+ *                         if "".join(e.itertext()) == value:
+ *                             yield elem
  */
     }
     __pyx_L7_break:;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/_elementpath.py":180
- *         value = predicate[-1]
- *         def select(result):
- *             for elem in result:             # <<<<<<<<<<<<<<
- *                 for e in elem.iterchildren(tag):
- *                     if "".join(e.itertext()) == value:
+    /* "lxml/_elementpath.py":184
+ *         if tag:
+ *             def select(result):
+ *                 for elem in result:             # <<<<<<<<<<<<<<
+ *                     for e in elem.iterchildren(tag):
+ *                         if "".join(e.itertext()) == value:
  */
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "lxml/_elementpath.py":179
- *         tag = predicate[0]
+  /* "lxml/_elementpath.py":183
  *         value = predicate[-1]
- *         def select(result):             # <<<<<<<<<<<<<<
- *             for elem in result:
- *                 for e in elem.iterchildren(tag):
+ *         if tag:
+ *             def select(result):             # <<<<<<<<<<<<<<
+ *                 for elem in result:
+ *                     for e in elem.iterchildren(tag):
  */
 
   /* function exit code */
@@ -5913,19 +6034,20 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_11generator8(
   __Pyx_AddTraceback("select", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "lxml/_elementpath.py":207
- *             else:
- *                 index = -1
- *         def select(result):             # <<<<<<<<<<<<<<
- *             for elem in result:
- *                 parent = elem.getparent()
+/* "lxml/_elementpath.py":190
+ *                             break
+ *         else:
+ *             def select(result):             # <<<<<<<<<<<<<<
+ *                 for elem in result:
+ *                     if "".join(elem.itertext()) == value:
  */
 
 /* Python wrapper */
@@ -5951,7 +6073,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_12select(PyOb
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(0, 207, __pyx_L1_error)
+    __PYX_ERR(0, 190, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -5962,7 +6084,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_12select(PyOb
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_result);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_result);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 207, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 190, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -5978,7 +6100,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_12select(PyOb
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -5989,56 +6111,49 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
   PyObject *__pyx_t_5 = NULL;
   PyObject *__pyx_t_6 = NULL;
   int __pyx_t_7;
-  int __pyx_t_8;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
-  int __pyx_t_14;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("select", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
-    case 1: goto __pyx_L16_resume_from_yield;
+    case 1: goto __pyx_L7_resume_from_yield;
     default: /* CPython raises the right error here */
     __Pyx_RefNannyFinishContext();
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 207, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 190, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":208
- *                 index = -1
- *         def select(result):
- *             for elem in result:             # <<<<<<<<<<<<<<
- *                 parent = elem.getparent()
- *                 if parent is None:
+  /* "lxml/_elementpath.py":191
+ *         else:
+ *             def select(result):
+ *                 for elem in result:             # <<<<<<<<<<<<<<
+ *                     if "".join(elem.itertext()) == value:
+ *                         yield elem
  */
   if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_result)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_result)) {
     __pyx_t_1 = __pyx_cur_scope->__pyx_v_result; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
     __pyx_t_3 = NULL;
   } else {
-    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
+    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
+    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_3)) {
       if (likely(PyList_CheckExact(__pyx_t_1))) {
         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 208, __pyx_L1_error)
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       } else {
         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 208, __pyx_L1_error)
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       }
@@ -6047,8 +6162,8 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 208, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 191, __pyx_L1_error)
         }
         break;
       }
@@ -6059,14 +6174,14 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
     __Pyx_GIVEREF(__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/_elementpath.py":209
- *         def select(result):
- *             for elem in result:
- *                 parent = elem.getparent()             # <<<<<<<<<<<<<<
- *                 if parent is None:
- *                     continue
+    /* "lxml/_elementpath.py":192
+ *             def select(result):
+ *                 for elem in result:
+ *                     if "".join(elem.itertext()) == value:             # <<<<<<<<<<<<<<
+ *                         yield elem
+ *         return select
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_getparent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_itertext); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 192, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -6079,93 +6194,339 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
       }
     }
     if (__pyx_t_6) {
-      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     } else {
-      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
     }
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_parent);
-    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_parent, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-
-    /* "lxml/_elementpath.py":210
- *             for elem in result:
- *                 parent = elem.getparent()
- *                 if parent is None:             # <<<<<<<<<<<<<<
- *                     continue
- *                 try:
- */
-    __pyx_t_7 = (__pyx_cur_scope->__pyx_v_parent == Py_None);
-    __pyx_t_8 = (__pyx_t_7 != 0);
-    if (__pyx_t_8) {
+    __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__18, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 192, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 192, __pyx_L1_error) }
+    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (__pyx_t_7) {
 
-      /* "lxml/_elementpath.py":211
- *                 parent = elem.getparent()
- *                 if parent is None:
- *                     continue             # <<<<<<<<<<<<<<
- *                 try:
- *                     # FIXME: what if the selector is "*" ?
+      /* "lxml/_elementpath.py":193
+ *                 for elem in result:
+ *                     if "".join(elem.itertext()) == value:
+ *                         yield elem             # <<<<<<<<<<<<<<
+ *         return select
+ *     if signature == "-" or signature == "-()" or signature == "-()-":
  */
-      goto __pyx_L4_continue;
+      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_elem);
+      __pyx_r = __pyx_cur_scope->__pyx_v_elem;
+      __Pyx_XGIVEREF(__pyx_t_1);
+      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
+      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
+      __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
+      __Pyx_XGIVEREF(__pyx_r);
+      __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+      /* return from generator, yielding value */
+      __pyx_generator->resume_label = 1;
+      return __pyx_r;
+      __pyx_L7_resume_from_yield:;
+      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
+      __pyx_cur_scope->__pyx_t_0 = 0;
+      __Pyx_XGOTREF(__pyx_t_1);
+      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
+      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 193, __pyx_L1_error)
 
-      /* "lxml/_elementpath.py":210
- *             for elem in result:
- *                 parent = elem.getparent()
- *                 if parent is None:             # <<<<<<<<<<<<<<
- *                     continue
- *                 try:
+      /* "lxml/_elementpath.py":192
+ *             def select(result):
+ *                 for elem in result:
+ *                     if "".join(elem.itertext()) == value:             # <<<<<<<<<<<<<<
+ *                         yield elem
+ *         return select
  */
     }
 
-    /* "lxml/_elementpath.py":212
- *                 if parent is None:
- *                     continue
- *                 try:             # <<<<<<<<<<<<<<
- *                     # FIXME: what if the selector is "*" ?
- *                     elems = list(parent.iterchildren(elem.tag))
+    /* "lxml/_elementpath.py":191
+ *         else:
+ *             def select(result):
+ *                 for elem in result:             # <<<<<<<<<<<<<<
+ *                     if "".join(elem.itertext()) == value:
+ *                         yield elem
  */
-    {
-      __Pyx_PyThreadState_declare
-      __Pyx_PyThreadState_assign
-      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_9);
-      __Pyx_XGOTREF(__pyx_t_10);
-      __Pyx_XGOTREF(__pyx_t_11);
-      /*try:*/ {
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-        /* "lxml/_elementpath.py":214
- *                 try:
- *                     # FIXME: what if the selector is "*" ?
- *                     elems = list(parent.iterchildren(elem.tag))             # <<<<<<<<<<<<<<
- *                     if elems[index] is elem:
- *                         yield elem
+  /* "lxml/_elementpath.py":190
+ *                             break
+ *         else:
+ *             def select(result):             # <<<<<<<<<<<<<<
+ *                 for elem in result:
+ *                     if "".join(elem.itertext()) == value:
  */
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_parent, __pyx_n_s_iterchildren); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L7_error)
-        __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L7_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_12 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
-          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
-          if (likely(__pyx_t_12)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
-            __Pyx_INCREF(__pyx_t_12);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_5, function);
-          }
-        }
-        if (!__pyx_t_12) {
-          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L7_error)
+
+  /* function exit code */
+  PyErr_SetNone(PyExc_StopIteration);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("select", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+  __pyx_generator->resume_label = -1;
+  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_17generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
+
+/* "lxml/_elementpath.py":216
+ *             else:
+ *                 index = -1
+ *         def select(result):             # <<<<<<<<<<<<<<
+ *             for elem in result:
+ *                 parent = elem.getparent()
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4lxml_12_elementpath_17prepare_predicate_16select(PyObject *__pyx_self, PyObject *__pyx_v_result); /*proto*/
+static PyMethodDef __pyx_mdef_4lxml_12_elementpath_17prepare_predicate_16select = {"select", (PyCFunction)__pyx_pw_4lxml_12_elementpath_17prepare_predicate_16select, METH_O, 0};
+static PyObject *__pyx_pw_4lxml_12_elementpath_17prepare_predicate_16select(PyObject *__pyx_self, PyObject *__pyx_v_result) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("select (wrapper)", 0);
+  __pyx_r = __pyx_pf_4lxml_12_elementpath_17prepare_predicate_15select(__pyx_self, ((PyObject *)__pyx_v_result));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_4lxml_12_elementpath_17prepare_predicate_15select(PyObject *__pyx_self, PyObject *__pyx_v_result) {
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *__pyx_cur_scope;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("select", 0);
+  __pyx_cur_scope = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *)__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_13_select(__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_13_select, __pyx_empty_tuple, NULL);
+  if (unlikely(!__pyx_cur_scope)) {
+    __pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *)Py_None);
+    __Pyx_INCREF(Py_None);
+    __PYX_ERR(0, 216, __pyx_L1_error)
+  } else {
+    __Pyx_GOTREF(__pyx_cur_scope);
+  }
+  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_7_prepare_predicate *) __Pyx_CyFunction_GetClosure(__pyx_self);
+  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
+  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
+  __pyx_cur_scope->__pyx_v_result = __pyx_v_result;
+  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_result);
+  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_result);
+  {
+    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_17prepare_predicate_17generator10, (PyObject *) __pyx_cur_scope, __pyx_n_s_select, __pyx_n_s_prepare_predicate_locals_select, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 216, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_cur_scope);
+    __Pyx_RefNannyFinishContext();
+    return (PyObject *) gen;
+  }
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("lxml._elementpath.prepare_predicate.select", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_17generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
+{
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *)__pyx_generator->closure);
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_t_1 = NULL;
+  Py_ssize_t __pyx_t_2;
+  PyObject *(*__pyx_t_3)(PyObject *);
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  PyObject *__pyx_t_6 = NULL;
+  int __pyx_t_7;
+  int __pyx_t_8;
+  PyObject *__pyx_t_9 = NULL;
+  PyObject *__pyx_t_10 = NULL;
+  PyObject *__pyx_t_11 = NULL;
+  PyObject *__pyx_t_12 = NULL;
+  PyObject *__pyx_t_13 = NULL;
+  int __pyx_t_14;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("select", 0);
+  switch (__pyx_generator->resume_label) {
+    case 0: goto __pyx_L3_first_run;
+    case 1: goto __pyx_L16_resume_from_yield;
+    default: /* CPython raises the right error here */
+    __Pyx_RefNannyFinishContext();
+    return NULL;
+  }
+  __pyx_L3_first_run:;
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 216, __pyx_L1_error)
+
+  /* "lxml/_elementpath.py":217
+ *                 index = -1
+ *         def select(result):
+ *             for elem in result:             # <<<<<<<<<<<<<<
+ *                 parent = elem.getparent()
+ *                 if parent is None:
+ */
+  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_result)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_result)) {
+    __pyx_t_1 = __pyx_cur_scope->__pyx_v_result; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+    __pyx_t_3 = NULL;
+  } else {
+    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
+  }
+  for (;;) {
+    if (likely(!__pyx_t_3)) {
+      if (likely(PyList_CheckExact(__pyx_t_1))) {
+        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 217, __pyx_L1_error)
+        #else
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        #endif
+      } else {
+        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 217, __pyx_L1_error)
+        #else
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        #endif
+      }
+    } else {
+      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
+      if (unlikely(!__pyx_t_4)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 217, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_4);
+    }
+    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_elem);
+    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_elem, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __pyx_t_4 = 0;
+
+    /* "lxml/_elementpath.py":218
+ *         def select(result):
+ *             for elem in result:
+ *                 parent = elem.getparent()             # <<<<<<<<<<<<<<
+ *                 if parent is None:
+ *                     continue
+ */
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_getparent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    if (__pyx_t_6) {
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    } else {
+      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
+    }
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_parent);
+    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_parent, __pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_4);
+    __pyx_t_4 = 0;
+
+    /* "lxml/_elementpath.py":219
+ *             for elem in result:
+ *                 parent = elem.getparent()
+ *                 if parent is None:             # <<<<<<<<<<<<<<
+ *                     continue
+ *                 try:
+ */
+    __pyx_t_7 = (__pyx_cur_scope->__pyx_v_parent == Py_None);
+    __pyx_t_8 = (__pyx_t_7 != 0);
+    if (__pyx_t_8) {
+
+      /* "lxml/_elementpath.py":220
+ *                 parent = elem.getparent()
+ *                 if parent is None:
+ *                     continue             # <<<<<<<<<<<<<<
+ *                 try:
+ *                     # FIXME: what if the selector is "*" ?
+ */
+      goto __pyx_L4_continue;
+
+      /* "lxml/_elementpath.py":219
+ *             for elem in result:
+ *                 parent = elem.getparent()
+ *                 if parent is None:             # <<<<<<<<<<<<<<
+ *                     continue
+ *                 try:
+ */
+    }
+
+    /* "lxml/_elementpath.py":221
+ *                 if parent is None:
+ *                     continue
+ *                 try:             # <<<<<<<<<<<<<<
+ *                     # FIXME: what if the selector is "*" ?
+ *                     elems = list(parent.iterchildren(elem.tag))
+ */
+    {
+      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      /*try:*/ {
+
+        /* "lxml/_elementpath.py":223
+ *                 try:
+ *                     # FIXME: what if the selector is "*" ?
+ *                     elems = list(parent.iterchildren(elem.tag))             # <<<<<<<<<<<<<<
+ *                     if elems[index] is elem:
+ *                         yield elem
+ */
+        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_parent, __pyx_n_s_iterchildren); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_elem, __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_12 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
+          if (likely(__pyx_t_12)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+            __Pyx_INCREF(__pyx_t_12);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_5, function);
+          }
+        }
+        if (!__pyx_t_12) {
+          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L7_error)
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_GOTREF(__pyx_t_4);
         } else {
           #if CYTHON_FAST_PYCALL
           if (PyFunction_Check(__pyx_t_5)) {
             PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_6};
-            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L7_error)
+            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L7_error)
             __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -6174,26 +6535,26 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
           #if CYTHON_FAST_PYCCALL
           if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
             PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_6};
-            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L7_error)
+            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L7_error)
             __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           } else
           #endif
           {
-            __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 214, __pyx_L7_error)
+            __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L7_error)
             __Pyx_GOTREF(__pyx_t_13);
             __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL;
             __Pyx_GIVEREF(__pyx_t_6);
             PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_6);
             __pyx_t_6 = 0;
-            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L7_error)
+            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L7_error)
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
           }
         }
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_t_5 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L7_error)
+        __pyx_t_5 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L7_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_elems);
@@ -6201,22 +6562,22 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
         __Pyx_GIVEREF(__pyx_t_5);
         __pyx_t_5 = 0;
 
-        /* "lxml/_elementpath.py":215
+        /* "lxml/_elementpath.py":224
  *                     # FIXME: what if the selector is "*" ?
  *                     elems = list(parent.iterchildren(elem.tag))
  *                     if elems[index] is elem:             # <<<<<<<<<<<<<<
  *                         yield elem
  *                 except IndexError:
  */
-        if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_index)) { __Pyx_RaiseClosureNameError("index"); __PYX_ERR(0, 215, __pyx_L7_error) }
-        __pyx_t_5 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_elems, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L7_error)
+        if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_index)) { __Pyx_RaiseClosureNameError("index"); __PYX_ERR(0, 224, __pyx_L7_error) }
+        __pyx_t_5 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_elems, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L7_error)
         __Pyx_GOTREF(__pyx_t_5);
         __pyx_t_8 = (__pyx_t_5 == __pyx_cur_scope->__pyx_v_elem);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __pyx_t_7 = (__pyx_t_8 != 0);
         if (__pyx_t_7) {
 
-          /* "lxml/_elementpath.py":216
+          /* "lxml/_elementpath.py":225
  *                     elems = list(parent.iterchildren(elem.tag))
  *                     if elems[index] is elem:
  *                         yield elem             # <<<<<<<<<<<<<<
@@ -6237,6 +6598,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
           __pyx_cur_scope->__pyx_t_5 = __pyx_t_11;
           __Pyx_XGIVEREF(__pyx_r);
           __Pyx_RefNannyFinishContext();
+          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
           /* return from generator, yielding value */
           __pyx_generator->resume_label = 1;
           return __pyx_r;
@@ -6255,9 +6617,9 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
           __pyx_t_11 = __pyx_cur_scope->__pyx_t_5;
           __pyx_cur_scope->__pyx_t_5 = 0;
           __Pyx_XGOTREF(__pyx_t_11);
-          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 216, __pyx_L7_error)
+          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 225, __pyx_L7_error)
 
-          /* "lxml/_elementpath.py":215
+          /* "lxml/_elementpath.py":224
  *                     # FIXME: what if the selector is "*" ?
  *                     elems = list(parent.iterchildren(elem.tag))
  *                     if elems[index] is elem:             # <<<<<<<<<<<<<<
@@ -6266,7 +6628,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
  */
         }
 
-        /* "lxml/_elementpath.py":212
+        /* "lxml/_elementpath.py":221
  *                 if parent is None:
  *                     continue
  *                 try:             # <<<<<<<<<<<<<<
@@ -6279,14 +6641,13 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
       goto __pyx_L14_try_end;
       __pyx_L7_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "lxml/_elementpath.py":217
+      /* "lxml/_elementpath.py":226
  *                     if elems[index] is elem:
  *                         yield elem
  *                 except IndexError:             # <<<<<<<<<<<<<<
@@ -6301,21 +6662,19 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
       goto __pyx_L9_except_error;
       __pyx_L9_except_error:;
 
-      /* "lxml/_elementpath.py":212
+      /* "lxml/_elementpath.py":221
  *                 if parent is None:
  *                     continue
  *                 try:             # <<<<<<<<<<<<<<
  *                     # FIXME: what if the selector is "*" ?
  *                     elems = list(parent.iterchildren(elem.tag))
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
       goto __pyx_L1_error;
       __pyx_L8_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
@@ -6323,7 +6682,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
       __pyx_L14_try_end:;
     }
 
-    /* "lxml/_elementpath.py":208
+    /* "lxml/_elementpath.py":217
  *                 index = -1
  *         def select(result):
  *             for elem in result:             # <<<<<<<<<<<<<<
@@ -6335,7 +6694,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "lxml/_elementpath.py":207
+  /* "lxml/_elementpath.py":216
  *             else:
  *                 index = -1
  *         def select(result):             # <<<<<<<<<<<<<<
@@ -6356,6 +6715,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_17prepare_predicate_14generator9(
   __Pyx_AddTraceback("select", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -6404,18 +6764,16 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
   /* "lxml/_elementpath.py":137
  *     # http://effbot.org/zone/simple-iterator-parser.htm
  *     # http://javascript.crockford.com/tdop/tdop.html
- *     signature = []             # <<<<<<<<<<<<<<
+ *     signature = ''             # <<<<<<<<<<<<<<
  *     predicate = []
  *     while 1:
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_signature = __pyx_t_1;
-  __pyx_t_1 = 0;
+  __Pyx_INCREF(__pyx_kp_s__18);
+  __pyx_v_signature = __pyx_kp_s__18;
 
   /* "lxml/_elementpath.py":138
  *     # http://javascript.crockford.com/tdop/tdop.html
- *     signature = []
+ *     signature = ''
  *     predicate = []             # <<<<<<<<<<<<<<
  *     while 1:
  *         token = next()
@@ -6426,7 +6784,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
   __pyx_t_1 = 0;
 
   /* "lxml/_elementpath.py":139
- *     signature = []
+ *     signature = ''
  *     predicate = []
  *     while 1:             # <<<<<<<<<<<<<<
  *         token = next()
@@ -6468,7 +6826,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  *         token = next()
  *         if token[0] == "]":             # <<<<<<<<<<<<<<
  *             break
- *         if token[0] and token[0][:1] in "'\"":
+ *         if token == ('', ''):
  */
     __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
@@ -6480,8 +6838,8 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  *         token = next()
  *         if token[0] == "]":
  *             break             # <<<<<<<<<<<<<<
- *         if token[0] and token[0][:1] in "'\"":
- *             token = "'", token[0][1:-1]
+ *         if token == ('', ''):
+ *             # ignore whitespace
  */
       goto __pyx_L4_break;
 
@@ -6490,156 +6848,178 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  *         token = next()
  *         if token[0] == "]":             # <<<<<<<<<<<<<<
  *             break
- *         if token[0] and token[0][:1] in "'\"":
+ *         if token == ('', ''):
  */
     }
 
     /* "lxml/_elementpath.py":143
  *         if token[0] == "]":
  *             break
+ *         if token == ('', ''):             # <<<<<<<<<<<<<<
+ *             # ignore whitespace
+ *             continue
+ */
+    __pyx_t_1 = PyObject_RichCompare(__pyx_v_token, __pyx_tuple__20, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 143, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_4) {
+
+      /* "lxml/_elementpath.py":145
+ *         if token == ('', ''):
+ *             # ignore whitespace
+ *             continue             # <<<<<<<<<<<<<<
+ *         if token[0] and token[0][:1] in "'\"":
+ *             token = "'", token[0][1:-1]
+ */
+      goto __pyx_L3_continue;
+
+      /* "lxml/_elementpath.py":143
+ *         if token[0] == "]":
+ *             break
+ *         if token == ('', ''):             # <<<<<<<<<<<<<<
+ *             # ignore whitespace
+ *             continue
+ */
+    }
+
+    /* "lxml/_elementpath.py":146
+ *             # ignore whitespace
+ *             continue
  *         if token[0] and token[0][:1] in "'\"":             # <<<<<<<<<<<<<<
  *             token = "'", token[0][1:-1]
- *         signature.append(token[0] or "-")
+ *         signature += token[0] or "-"
  */
-    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 143, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (__pyx_t_5) {
     } else {
       __pyx_t_4 = __pyx_t_5;
-      goto __pyx_L7_bool_binop_done;
+      goto __pyx_L8_bool_binop_done;
     }
-    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 1, NULL, NULL, &__pyx_slice__20, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 1, NULL, NULL, &__pyx_slice__21, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_kp_s__21, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 143, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_kp_s__22, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_t_6 = (__pyx_t_5 != 0);
     __pyx_t_4 = __pyx_t_6;
-    __pyx_L7_bool_binop_done:;
+    __pyx_L8_bool_binop_done:;
     if (__pyx_t_4) {
 
-      /* "lxml/_elementpath.py":144
- *             break
+      /* "lxml/_elementpath.py":147
+ *             continue
  *         if token[0] and token[0][:1] in "'\"":
  *             token = "'", token[0][1:-1]             # <<<<<<<<<<<<<<
- *         signature.append(token[0] or "-")
+ *         signature += token[0] or "-"
  *         predicate.append(token[1])
  */
-      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, -1L, NULL, NULL, &__pyx_slice__23, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, -1L, NULL, NULL, &__pyx_slice__24, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_kp_s__22);
-      __Pyx_GIVEREF(__pyx_kp_s__22);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s__22);
+      __Pyx_INCREF(__pyx_kp_s__23);
+      __Pyx_GIVEREF(__pyx_kp_s__23);
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s__23);
       __Pyx_GIVEREF(__pyx_t_1);
       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
       __pyx_t_1 = 0;
       __Pyx_DECREF_SET(__pyx_v_token, __pyx_t_2);
       __pyx_t_2 = 0;
 
-      /* "lxml/_elementpath.py":143
- *         if token[0] == "]":
- *             break
+      /* "lxml/_elementpath.py":146
+ *             # ignore whitespace
+ *             continue
  *         if token[0] and token[0][:1] in "'\"":             # <<<<<<<<<<<<<<
  *             token = "'", token[0][1:-1]
- *         signature.append(token[0] or "-")
+ *         signature += token[0] or "-"
  */
     }
 
-    /* "lxml/_elementpath.py":145
+    /* "lxml/_elementpath.py":148
  *         if token[0] and token[0][:1] in "'\"":
  *             token = "'", token[0][1:-1]
- *         signature.append(token[0] or "-")             # <<<<<<<<<<<<<<
+ *         signature += token[0] or "-"             # <<<<<<<<<<<<<<
  *         predicate.append(token[1])
- *     signature = "".join(signature)
+ * 
  */
-    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
     if (!__pyx_t_4) {
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     } else {
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_2 = __pyx_t_1;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L9_bool_binop_done;
+      goto __pyx_L10_bool_binop_done;
     }
-    __Pyx_INCREF(__pyx_kp_s__24);
-    __pyx_t_2 = __pyx_kp_s__24;
-    __pyx_L9_bool_binop_done:;
-    __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_signature, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __Pyx_INCREF(__pyx_kp_s__25);
+    __pyx_t_2 = __pyx_kp_s__25;
+    __pyx_L10_bool_binop_done:;
+    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_signature, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_signature, __pyx_t_1);
+    __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":146
+    /* "lxml/_elementpath.py":149
  *             token = "'", token[0][1:-1]
- *         signature.append(token[0] or "-")
+ *         signature += token[0] or "-"
  *         predicate.append(token[1])             # <<<<<<<<<<<<<<
- *     signature = "".join(signature)
+ * 
  *     # use signature to determine predicate type
  */
-    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_token, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_predicate, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 146, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_token, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_predicate, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_L3_continue:;
   }
   __pyx_L4_break:;
 
-  /* "lxml/_elementpath.py":147
- *         signature.append(token[0] or "-")
- *         predicate.append(token[1])
- *     signature = "".join(signature)             # <<<<<<<<<<<<<<
- *     # use signature to determine predicate type
- *     if signature == "@-":
- */
-  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__18, __pyx_v_signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF_SET(__pyx_v_signature, __pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "lxml/_elementpath.py":149
- *     signature = "".join(signature)
+  /* "lxml/_elementpath.py":152
+ * 
  *     # use signature to determine predicate type
  *     if signature == "@-":             # <<<<<<<<<<<<<<
  *         # [@attribute] predicate
  *         key = predicate[1]
  */
-  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__25, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__26, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
   if (__pyx_t_4) {
 
-    /* "lxml/_elementpath.py":151
+    /* "lxml/_elementpath.py":154
  *     if signature == "@-":
  *         # [@attribute] predicate
  *         key = predicate[1]             # <<<<<<<<<<<<<<
  *         def select(result):
  *             for elem in result:
  */
-    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_predicate, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_cur_scope->__pyx_v_key = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_predicate, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_cur_scope->__pyx_v_key = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":152
+    /* "lxml/_elementpath.py":155
  *         # [@attribute] predicate
  *         key = predicate[1]
  *         def select(result):             # <<<<<<<<<<<<<<
  *             for elem in result:
  *                 if elem.get(key) is not None:
  */
-    __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_1select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_select = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_1select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_select = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":156
+    /* "lxml/_elementpath.py":159
  *                 if elem.get(key) is not None:
  *                     yield elem
  *         return select             # <<<<<<<<<<<<<<
@@ -6651,8 +7031,8 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
     __pyx_r = __pyx_v_select;
     goto __pyx_L0;
 
-    /* "lxml/_elementpath.py":149
- *     signature = "".join(signature)
+    /* "lxml/_elementpath.py":152
+ * 
  *     # use signature to determine predicate type
  *     if signature == "@-":             # <<<<<<<<<<<<<<
  *         # [@attribute] predicate
@@ -6660,55 +7040,55 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  */
   }
 
-  /* "lxml/_elementpath.py":157
+  /* "lxml/_elementpath.py":160
  *                     yield elem
  *         return select
  *     if signature == "@-='":             # <<<<<<<<<<<<<<
  *         # [@attribute='value']
  *         key = predicate[1]
  */
-  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__28, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__29, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
   if (__pyx_t_4) {
 
-    /* "lxml/_elementpath.py":159
+    /* "lxml/_elementpath.py":162
  *     if signature == "@-='":
  *         # [@attribute='value']
  *         key = predicate[1]             # <<<<<<<<<<<<<<
  *         value = predicate[-1]
  *         def select(result):
  */
-    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_predicate, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_cur_scope->__pyx_v_key = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_predicate, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_cur_scope->__pyx_v_key = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":160
+    /* "lxml/_elementpath.py":163
  *         # [@attribute='value']
  *         key = predicate[1]
  *         value = predicate[-1]             # <<<<<<<<<<<<<<
  *         def select(result):
  *             for elem in result:
  */
-    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_predicate, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_cur_scope->__pyx_v_value = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_predicate, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_cur_scope->__pyx_v_value = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":161
+    /* "lxml/_elementpath.py":164
  *         key = predicate[1]
  *         value = predicate[-1]
  *         def select(result):             # <<<<<<<<<<<<<<
  *             for elem in result:
  *                 if elem.get(key) == value:
  */
-    __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_4select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_select = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_4select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_select = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":165
+    /* "lxml/_elementpath.py":168
  *                 if elem.get(key) == value:
  *                     yield elem
  *         return select             # <<<<<<<<<<<<<<
@@ -6720,7 +7100,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
     __pyx_r = __pyx_v_select;
     goto __pyx_L0;
 
-    /* "lxml/_elementpath.py":157
+    /* "lxml/_elementpath.py":160
  *                     yield elem
  *         return select
  *     if signature == "@-='":             # <<<<<<<<<<<<<<
@@ -6729,26 +7109,26 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  */
   }
 
-  /* "lxml/_elementpath.py":166
+  /* "lxml/_elementpath.py":169
  *                     yield elem
  *         return select
  *     if signature == "-" and not re.match(r"-?\d+$", predicate[0]):             # <<<<<<<<<<<<<<
  *         # [tag]
  *         tag = predicate[0]
  */
-  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__24, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 166, __pyx_L1_error)
+  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__25, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
   if (__pyx_t_6) {
   } else {
     __pyx_t_4 = __pyx_t_6;
-    goto __pyx_L14_bool_binop_done;
+    goto __pyx_L15_bool_binop_done;
   }
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_8 = NULL;
   __pyx_t_9 = 0;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -6763,24 +7143,24 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
   }
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_s_d, __pyx_t_1};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
+    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_s_d, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_s_d, __pyx_t_1};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
+    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_s_d, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   } else
   #endif
   {
-    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 166, __pyx_L1_error)
+    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 169, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
     if (__pyx_t_8) {
       __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
@@ -6788,59 +7168,59 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
     __Pyx_INCREF(__pyx_kp_s_d);
     __Pyx_GIVEREF(__pyx_kp_s_d);
     PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_kp_s_d);
-    __Pyx_GIVEREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   }
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 166, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_5 = ((!__pyx_t_6) != 0);
   __pyx_t_4 = __pyx_t_5;
-  __pyx_L14_bool_binop_done:;
+  __pyx_L15_bool_binop_done:;
   if (__pyx_t_4) {
 
-    /* "lxml/_elementpath.py":168
+    /* "lxml/_elementpath.py":171
  *     if signature == "-" and not re.match(r"-?\d+$", predicate[0]):
  *         # [tag]
  *         tag = predicate[0]             # <<<<<<<<<<<<<<
  *         def select(result):
  *             for elem in result:
  */
-    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_cur_scope->__pyx_v_tag = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_cur_scope->__pyx_v_tag = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":169
+    /* "lxml/_elementpath.py":172
  *         # [tag]
  *         tag = predicate[0]
  *         def select(result):             # <<<<<<<<<<<<<<
  *             for elem in result:
  *                 for _ in elem.iterchildren(tag):
  */
-    __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_7select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_select = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_7select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_select = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":174
+    /* "lxml/_elementpath.py":177
  *                     yield elem
  *                     break
  *         return select             # <<<<<<<<<<<<<<
- *     if signature == "-='" and not re.match(r"-?\d+$", predicate[0]):
- *         # [tag='value']
+ *     if signature == ".='" or (signature == "-='" and not re.match(r"-?\d+$", predicate[0])):
+ *         # [.='value'] or [tag='value']
  */
     __Pyx_XDECREF(__pyx_r);
     __Pyx_INCREF(__pyx_v_select);
     __pyx_r = __pyx_v_select;
     goto __pyx_L0;
 
-    /* "lxml/_elementpath.py":166
+    /* "lxml/_elementpath.py":169
  *                     yield elem
  *         return select
  *     if signature == "-" and not re.match(r"-?\d+$", predicate[0]):             # <<<<<<<<<<<<<<
@@ -6849,33 +7229,39 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  */
   }
 
-  /* "lxml/_elementpath.py":175
+  /* "lxml/_elementpath.py":178
  *                     break
  *         return select
- *     if signature == "-='" and not re.match(r"-?\d+$", predicate[0]):             # <<<<<<<<<<<<<<
- *         # [tag='value']
+ *     if signature == ".='" or (signature == "-='" and not re.match(r"-?\d+$", predicate[0])):             # <<<<<<<<<<<<<<
+ *         # [.='value'] or [tag='value']
  *         tag = predicate[0]
  */
-  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__34, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__35, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
+  if (!__pyx_t_5) {
+  } else {
+    __pyx_t_4 = __pyx_t_5;
+    goto __pyx_L18_bool_binop_done;
+  }
+  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__36, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
   if (__pyx_t_5) {
   } else {
     __pyx_t_4 = __pyx_t_5;
-    goto __pyx_L17_bool_binop_done;
+    goto __pyx_L18_bool_binop_done;
   }
-  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_match); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_match); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = NULL;
+  __pyx_t_2 = NULL;
   __pyx_t_9 = 0;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
-    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
-    if (likely(__pyx_t_1)) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
+    if (likely(__pyx_t_2)) {
       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
-      __Pyx_INCREF(__pyx_t_1);
+      __Pyx_INCREF(__pyx_t_2);
       __Pyx_INCREF(function);
       __Pyx_DECREF_SET(__pyx_t_10, function);
       __pyx_t_9 = 1;
@@ -6883,27 +7269,27 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
   }
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_10)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_d, __pyx_t_3};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_GOTREF(__pyx_t_2);
+    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_d, __pyx_t_3};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_d, __pyx_t_3};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_GOTREF(__pyx_t_2);
+    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_d, __pyx_t_3};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else
   #endif
   {
-    __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 175, __pyx_L1_error)
+    __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
-    if (__pyx_t_1) {
-      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL;
+    if (__pyx_t_2) {
+      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
     }
     __Pyx_INCREF(__pyx_kp_s_d);
     __Pyx_GIVEREF(__pyx_kp_s_d);
@@ -6911,59 +7297,94 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
     __Pyx_GIVEREF(__pyx_t_3);
     PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_t_3);
     __pyx_t_3 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   }
   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_6 = ((!__pyx_t_5) != 0);
   __pyx_t_4 = __pyx_t_6;
-  __pyx_L17_bool_binop_done:;
+  __pyx_L18_bool_binop_done:;
   if (__pyx_t_4) {
 
-    /* "lxml/_elementpath.py":177
- *     if signature == "-='" and not re.match(r"-?\d+$", predicate[0]):
- *         # [tag='value']
+    /* "lxml/_elementpath.py":180
+ *     if signature == ".='" or (signature == "-='" and not re.match(r"-?\d+$", predicate[0])):
+ *         # [.='value'] or [tag='value']
  *         tag = predicate[0]             # <<<<<<<<<<<<<<
  *         value = predicate[-1]
- *         def select(result):
+ *         if tag:
  */
-    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_cur_scope->__pyx_v_tag = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_cur_scope->__pyx_v_tag = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":178
- *         # [tag='value']
+    /* "lxml/_elementpath.py":181
+ *         # [.='value'] or [tag='value']
  *         tag = predicate[0]
  *         value = predicate[-1]             # <<<<<<<<<<<<<<
- *         def select(result):
- *             for elem in result:
+ *         if tag:
+ *             def select(result):
  */
-    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_predicate, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_cur_scope->__pyx_v_value = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_predicate, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_cur_scope->__pyx_v_value = __pyx_t_1;
+    __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":179
+    /* "lxml/_elementpath.py":182
  *         tag = predicate[0]
  *         value = predicate[-1]
- *         def select(result):             # <<<<<<<<<<<<<<
- *             for elem in result:
- *                 for e in elem.iterchildren(tag):
+ *         if tag:             # <<<<<<<<<<<<<<
+ *             def select(result):
+ *                 for elem in result:
  */
-    __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_10select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_select = __pyx_t_2;
-    __pyx_t_2 = 0;
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_tag); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 182, __pyx_L1_error)
+    if (__pyx_t_4) {
 
-    /* "lxml/_elementpath.py":185
+      /* "lxml/_elementpath.py":183
+ *         value = predicate[-1]
+ *         if tag:
+ *             def select(result):             # <<<<<<<<<<<<<<
+ *                 for elem in result:
+ *                     for e in elem.iterchildren(tag):
+ */
+      __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_10select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_v_select = __pyx_t_1;
+      __pyx_t_1 = 0;
+
+      /* "lxml/_elementpath.py":182
+ *         tag = predicate[0]
+ *         value = predicate[-1]
+ *         if tag:             # <<<<<<<<<<<<<<
+ *             def select(result):
+ *                 for elem in result:
+ */
+      goto __pyx_L21;
+    }
+
+    /* "lxml/_elementpath.py":190
+ *                             break
+ *         else:
+ *             def select(result):             # <<<<<<<<<<<<<<
+ *                 for elem in result:
+ *                     if "".join(elem.itertext()) == value:
+ */
+    /*else*/ {
+      __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_13select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_v_select = __pyx_t_1;
+      __pyx_t_1 = 0;
+    }
+    __pyx_L21:;
+
+    /* "lxml/_elementpath.py":194
+ *                     if "".join(elem.itertext()) == value:
  *                         yield elem
- *                         break
  *         return select             # <<<<<<<<<<<<<<
  *     if signature == "-" or signature == "-()" or signature == "-()-":
  *         # [index] or [last()] or [last()-index]
@@ -6973,107 +7394,107 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
     __pyx_r = __pyx_v_select;
     goto __pyx_L0;
 
-    /* "lxml/_elementpath.py":175
+    /* "lxml/_elementpath.py":178
  *                     break
  *         return select
- *     if signature == "-='" and not re.match(r"-?\d+$", predicate[0]):             # <<<<<<<<<<<<<<
- *         # [tag='value']
+ *     if signature == ".='" or (signature == "-='" and not re.match(r"-?\d+$", predicate[0])):             # <<<<<<<<<<<<<<
+ *         # [.='value'] or [tag='value']
  *         tag = predicate[0]
  */
   }
 
-  /* "lxml/_elementpath.py":186
- *                         break
+  /* "lxml/_elementpath.py":195
+ *                         yield elem
  *         return select
  *     if signature == "-" or signature == "-()" or signature == "-()-":             # <<<<<<<<<<<<<<
  *         # [index] or [last()] or [last()-index]
  *         if signature == "-":
  */
-  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__24, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__25, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 195, __pyx_L1_error)
   if (!__pyx_t_6) {
   } else {
     __pyx_t_4 = __pyx_t_6;
-    goto __pyx_L20_bool_binop_done;
+    goto __pyx_L23_bool_binop_done;
   }
-  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__37, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__41, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 195, __pyx_L1_error)
   if (!__pyx_t_6) {
   } else {
     __pyx_t_4 = __pyx_t_6;
-    goto __pyx_L20_bool_binop_done;
+    goto __pyx_L23_bool_binop_done;
   }
-  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__38, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__42, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 195, __pyx_L1_error)
   __pyx_t_4 = __pyx_t_6;
-  __pyx_L20_bool_binop_done:;
+  __pyx_L23_bool_binop_done:;
   if (__pyx_t_4) {
 
-    /* "lxml/_elementpath.py":188
+    /* "lxml/_elementpath.py":197
  *     if signature == "-" or signature == "-()" or signature == "-()-":
  *         # [index] or [last()] or [last()-index]
  *         if signature == "-":             # <<<<<<<<<<<<<<
  *             # [index]
  *             index = int(predicate[0]) - 1
  */
-    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__24, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 188, __pyx_L1_error)
+    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__25, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
     if (__pyx_t_4) {
 
-      /* "lxml/_elementpath.py":190
+      /* "lxml/_elementpath.py":199
  *         if signature == "-":
  *             # [index]
  *             index = int(predicate[0]) - 1             # <<<<<<<<<<<<<<
  *             if index < 0:
  *                 if index == -1:
  */
-      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 199, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_cur_scope->__pyx_v_index = __pyx_t_2;
-      __pyx_t_2 = 0;
+      __Pyx_GIVEREF(__pyx_t_1);
+      __pyx_cur_scope->__pyx_v_index = __pyx_t_1;
+      __pyx_t_1 = 0;
 
-      /* "lxml/_elementpath.py":191
+      /* "lxml/_elementpath.py":200
  *             # [index]
  *             index = int(predicate[0]) - 1
  *             if index < 0:             # <<<<<<<<<<<<<<
  *                 if index == -1:
  *                     raise SyntaxError(
  */
-      __pyx_t_2 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 200, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       if (__pyx_t_4) {
 
-        /* "lxml/_elementpath.py":192
+        /* "lxml/_elementpath.py":201
  *             index = int(predicate[0]) - 1
  *             if index < 0:
  *                 if index == -1:             # <<<<<<<<<<<<<<
  *                     raise SyntaxError(
  *                         "indices in path predicates are 1-based, not 0-based")
  */
-        __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_cur_scope->__pyx_v_index, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_cur_scope->__pyx_v_index, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         if (__pyx_t_4) {
 
-          /* "lxml/_elementpath.py":193
+          /* "lxml/_elementpath.py":202
  *             if index < 0:
  *                 if index == -1:
  *                     raise SyntaxError(             # <<<<<<<<<<<<<<
  *                         "indices in path predicates are 1-based, not 0-based")
  *                 else:
  */
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __PYX_ERR(0, 193, __pyx_L1_error)
+          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __PYX_ERR(0, 202, __pyx_L1_error)
 
-          /* "lxml/_elementpath.py":192
+          /* "lxml/_elementpath.py":201
  *             index = int(predicate[0]) - 1
  *             if index < 0:
  *                 if index == -1:             # <<<<<<<<<<<<<<
@@ -7082,7 +7503,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  */
         }
 
-        /* "lxml/_elementpath.py":196
+        /* "lxml/_elementpath.py":205
  *                         "indices in path predicates are 1-based, not 0-based")
  *                 else:
  *                     raise SyntaxError("path index >= 1 expected")             # <<<<<<<<<<<<<<
@@ -7090,14 +7511,14 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  *             if predicate[0] != "last":
  */
         /*else*/ {
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __PYX_ERR(0, 196, __pyx_L1_error)
+          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __PYX_ERR(0, 205, __pyx_L1_error)
         }
 
-        /* "lxml/_elementpath.py":191
+        /* "lxml/_elementpath.py":200
  *             # [index]
  *             index = int(predicate[0]) - 1
  *             if index < 0:             # <<<<<<<<<<<<<<
@@ -7106,17 +7527,17 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  */
       }
 
-      /* "lxml/_elementpath.py":188
+      /* "lxml/_elementpath.py":197
  *     if signature == "-" or signature == "-()" or signature == "-()-":
  *         # [index] or [last()] or [last()-index]
  *         if signature == "-":             # <<<<<<<<<<<<<<
  *             # [index]
  *             index = int(predicate[0]) - 1
  */
-      goto __pyx_L23;
+      goto __pyx_L26;
     }
 
-    /* "lxml/_elementpath.py":198
+    /* "lxml/_elementpath.py":207
  *                     raise SyntaxError("path index >= 1 expected")
  *         else:
  *             if predicate[0] != "last":             # <<<<<<<<<<<<<<
@@ -7124,26 +7545,26 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  *             if signature == "-()-":
  */
     /*else*/ {
-      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_last, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 198, __pyx_L1_error)
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_predicate, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_last, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 207, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       if (__pyx_t_4) {
 
-        /* "lxml/_elementpath.py":199
+        /* "lxml/_elementpath.py":208
  *         else:
  *             if predicate[0] != "last":
  *                 raise SyntaxError("unsupported function")             # <<<<<<<<<<<<<<
  *             if signature == "-()-":
  *                 try:
  */
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __PYX_ERR(0, 199, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __PYX_ERR(0, 208, __pyx_L1_error)
 
-        /* "lxml/_elementpath.py":198
+        /* "lxml/_elementpath.py":207
  *                     raise SyntaxError("path index >= 1 expected")
  *         else:
  *             if predicate[0] != "last":             # <<<<<<<<<<<<<<
@@ -7152,17 +7573,17 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  */
       }
 
-      /* "lxml/_elementpath.py":200
+      /* "lxml/_elementpath.py":209
  *             if predicate[0] != "last":
  *                 raise SyntaxError("unsupported function")
  *             if signature == "-()-":             # <<<<<<<<<<<<<<
  *                 try:
  *                     index = int(predicate[2]) - 1
  */
-      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__38, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 200, __pyx_L1_error)
+      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_signature, __pyx_kp_s__42, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 209, __pyx_L1_error)
       if (__pyx_t_4) {
 
-        /* "lxml/_elementpath.py":201
+        /* "lxml/_elementpath.py":210
  *                 raise SyntaxError("unsupported function")
  *             if signature == "-()-":
  *                 try:             # <<<<<<<<<<<<<<
@@ -7178,26 +7599,26 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
           __Pyx_XGOTREF(__pyx_t_13);
           /*try:*/ {
 
-            /* "lxml/_elementpath.py":202
+            /* "lxml/_elementpath.py":211
  *             if signature == "-()-":
  *                 try:
  *                     index = int(predicate[2]) - 1             # <<<<<<<<<<<<<<
  *                 except ValueError:
  *                     raise SyntaxError("unsupported expression")
  */
-            __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_predicate, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L28_error)
-            __Pyx_GOTREF(__pyx_t_2);
-            __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 202, __pyx_L28_error)
+            __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_predicate, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L31_error)
+            __Pyx_GOTREF(__pyx_t_1);
+            __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 211, __pyx_L31_error)
             __Pyx_GOTREF(__pyx_t_10);
-            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-            __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L28_error)
-            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+            __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L31_error)
+            __Pyx_GOTREF(__pyx_t_1);
             __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-            __Pyx_GIVEREF(__pyx_t_2);
-            __pyx_cur_scope->__pyx_v_index = __pyx_t_2;
-            __pyx_t_2 = 0;
+            __Pyx_GIVEREF(__pyx_t_1);
+            __pyx_cur_scope->__pyx_v_index = __pyx_t_1;
+            __pyx_t_1 = 0;
 
-            /* "lxml/_elementpath.py":201
+            /* "lxml/_elementpath.py":210
  *                 raise SyntaxError("unsupported function")
  *             if signature == "-()-":
  *                 try:             # <<<<<<<<<<<<<<
@@ -7208,16 +7629,15 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
           __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
           __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
           __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-          goto __pyx_L33_try_end;
-          __pyx_L28_error:;
-          __Pyx_PyThreadState_assign
-          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          goto __pyx_L36_try_end;
+          __pyx_L31_error:;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
           __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
           __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-          /* "lxml/_elementpath.py":203
+          /* "lxml/_elementpath.py":212
  *                 try:
  *                     index = int(predicate[2]) - 1
  *                 except ValueError:             # <<<<<<<<<<<<<<
@@ -7227,54 +7647,53 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
           __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
           if (__pyx_t_9) {
             __Pyx_AddTraceback("lxml._elementpath.prepare_predicate", __pyx_clineno, __pyx_lineno, __pyx_filename);
-            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_10, &__pyx_t_8) < 0) __PYX_ERR(0, 203, __pyx_L30_except_error)
-            __Pyx_GOTREF(__pyx_t_2);
+            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_10, &__pyx_t_8) < 0) __PYX_ERR(0, 212, __pyx_L33_except_error)
+            __Pyx_GOTREF(__pyx_t_1);
             __Pyx_GOTREF(__pyx_t_10);
             __Pyx_GOTREF(__pyx_t_8);
 
-            /* "lxml/_elementpath.py":204
+            /* "lxml/_elementpath.py":213
  *                     index = int(predicate[2]) - 1
  *                 except ValueError:
  *                     raise SyntaxError("unsupported expression")             # <<<<<<<<<<<<<<
  *             else:
  *                 index = -1
  */
-            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L30_except_error)
+            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L33_except_error)
             __Pyx_GOTREF(__pyx_t_3);
             __Pyx_Raise(__pyx_t_3, 0, 0, 0);
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-            __PYX_ERR(0, 204, __pyx_L30_except_error)
+            __PYX_ERR(0, 213, __pyx_L33_except_error)
           }
-          goto __pyx_L30_except_error;
-          __pyx_L30_except_error:;
+          goto __pyx_L33_except_error;
+          __pyx_L33_except_error:;
 
-          /* "lxml/_elementpath.py":201
+          /* "lxml/_elementpath.py":210
  *                 raise SyntaxError("unsupported function")
  *             if signature == "-()-":
  *                 try:             # <<<<<<<<<<<<<<
  *                     index = int(predicate[2]) - 1
  *                 except ValueError:
  */
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_11);
           __Pyx_XGIVEREF(__pyx_t_12);
           __Pyx_XGIVEREF(__pyx_t_13);
           __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
           goto __pyx_L1_error;
-          __pyx_L33_try_end:;
+          __pyx_L36_try_end:;
         }
 
-        /* "lxml/_elementpath.py":200
+        /* "lxml/_elementpath.py":209
  *             if predicate[0] != "last":
  *                 raise SyntaxError("unsupported function")
  *             if signature == "-()-":             # <<<<<<<<<<<<<<
  *                 try:
  *                     index = int(predicate[2]) - 1
  */
-        goto __pyx_L27;
+        goto __pyx_L30;
       }
 
-      /* "lxml/_elementpath.py":206
+      /* "lxml/_elementpath.py":215
  *                     raise SyntaxError("unsupported expression")
  *             else:
  *                 index = -1             # <<<<<<<<<<<<<<
@@ -7286,23 +7705,23 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
         __Pyx_GIVEREF(__pyx_int_neg_1);
         __pyx_cur_scope->__pyx_v_index = __pyx_int_neg_1;
       }
-      __pyx_L27:;
+      __pyx_L30:;
     }
-    __pyx_L23:;
+    __pyx_L26:;
 
-    /* "lxml/_elementpath.py":207
+    /* "lxml/_elementpath.py":216
  *             else:
  *                 index = -1
  *         def select(result):             # <<<<<<<<<<<<<<
  *             for elem in result:
  *                 parent = elem.getparent()
  */
-    __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_13select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_17prepare_predicate_16select, 0, __pyx_n_s_prepare_predicate_locals_select, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 216, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     __pyx_v_select = __pyx_t_8;
     __pyx_t_8 = 0;
 
-    /* "lxml/_elementpath.py":219
+    /* "lxml/_elementpath.py":228
  *                 except IndexError:
  *                     pass
  *         return select             # <<<<<<<<<<<<<<
@@ -7314,8 +7733,8 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
     __pyx_r = __pyx_v_select;
     goto __pyx_L0;
 
-    /* "lxml/_elementpath.py":186
- *                         break
+    /* "lxml/_elementpath.py":195
+ *                         yield elem
  *         return select
  *     if signature == "-" or signature == "-()" or signature == "-()-":             # <<<<<<<<<<<<<<
  *         # [index] or [last()] or [last()-index]
@@ -7323,18 +7742,18 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
  */
   }
 
-  /* "lxml/_elementpath.py":220
+  /* "lxml/_elementpath.py":229
  *                     pass
  *         return select
  *     raise SyntaxError("invalid predicate")             # <<<<<<<<<<<<<<
  * 
  * ops = {
  */
-  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 229, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_Raise(__pyx_t_8, 0, 0, 0);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __PYX_ERR(0, 220, __pyx_L1_error)
+  __PYX_ERR(0, 229, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":133
  *     return select
@@ -7364,7 +7783,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_13prepare_predicate(CYTHON_UNUSED
   return __pyx_r;
 }
 
-/* "lxml/_elementpath.py":237
+/* "lxml/_elementpath.py":246
  * 
  * 
  * def _build_path_iterator(path, namespaces):             # <<<<<<<<<<<<<<
@@ -7405,11 +7824,11 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_16_build_path_iterator(PyObject *
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_namespaces)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_build_path_iterator", 1, 2, 2, 1); __PYX_ERR(0, 237, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_build_path_iterator", 1, 2, 2, 1); __PYX_ERR(0, 246, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_build_path_iterator") < 0)) __PYX_ERR(0, 237, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_build_path_iterator") < 0)) __PYX_ERR(0, 246, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -7422,7 +7841,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_16_build_path_iterator(PyObject *
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_build_path_iterator", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 237, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_build_path_iterator", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 246, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml._elementpath._build_path_iterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -7434,9 +7853,9 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_16_build_path_iterator(PyObject *
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator10(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "lxml/_elementpath.py":248
+/* "lxml/_elementpath.py":257
  *         if None in namespaces:
  *             cache_key += (namespaces[None],) + tuple(sorted(
  *                 item for item in namespaces.items() if item[0] is not None))             # <<<<<<<<<<<<<<
@@ -7445,23 +7864,23 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator
  */
 
 static PyObject *__pyx_pf_4lxml_12_elementpath_20_build_path_iterator_genexpr(PyObject *__pyx_self) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *__pyx_cur_scope;
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *__pyx_cur_scope;
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("genexpr", 0);
-  __pyx_cur_scope = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *)__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_14_genexpr(__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL);
+  __pyx_cur_scope = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *)__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_15_genexpr(__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_15_genexpr, __pyx_empty_tuple, NULL);
   if (unlikely(!__pyx_cur_scope)) {
-    __pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *)Py_None);
+    __pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(0, 248, __pyx_L1_error)
+    __PYX_ERR(0, 257, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
-  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *) __pyx_self;
+  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *) __pyx_self;
   __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator10, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_build_path_iterator_locals_gene, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 248, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator11, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_build_path_iterator_locals_gene, __pyx_n_s_lxml__elementpath); if (unlikely(!gen)) __PYX_ERR(0, 257, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -7477,9 +7896,9 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_20_build_path_iterator_genexpr(Py
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator10(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *)__pyx_generator->closure);
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
@@ -7489,7 +7908,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator
   int __pyx_t_6;
   int __pyx_t_7;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("genexpr", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     default: /* CPython raises the right error here */
@@ -7497,11 +7916,11 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 248, __pyx_L1_error)
-  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 248, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 257, __pyx_L1_error)
+  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 257, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_r);
-  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_namespaces)) { __Pyx_RaiseClosureNameError("namespaces"); __PYX_ERR(0, 248, __pyx_L1_error) }
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_namespaces, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
+  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_namespaces)) { __Pyx_RaiseClosureNameError("namespaces"); __PYX_ERR(0, 257, __pyx_L1_error) }
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_namespaces, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -7514,10 +7933,10 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator
     }
   }
   if (__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else {
-    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -7525,9 +7944,9 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator
     __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
   } else {
-    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
+    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
+    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   for (;;) {
@@ -7535,17 +7954,17 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator
       if (likely(PyList_CheckExact(__pyx_t_2))) {
         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 248, __pyx_L1_error)
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
         #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         #endif
       } else {
         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 248, __pyx_L1_error)
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
         #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         #endif
       }
@@ -7554,8 +7973,8 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 248, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 257, __pyx_L1_error)
         }
         break;
       }
@@ -7565,13 +7984,13 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator
     __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_1);
     __Pyx_GIVEREF(__pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_6 = (__pyx_t_1 != Py_None);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_7 = (__pyx_t_6 != 0);
     if (__pyx_t_7) {
-      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_item))) __PYX_ERR(0, 248, __pyx_L1_error)
+      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_item))) __PYX_ERR(0, 257, __pyx_L1_error)
     }
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -7587,13 +8006,14 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator
   __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "lxml/_elementpath.py":237
+/* "lxml/_elementpath.py":246
  * 
  * 
  * def _build_path_iterator(path, namespaces):             # <<<<<<<<<<<<<<
@@ -7602,7 +8022,7 @@ static PyObject *__pyx_gb_4lxml_12_elementpath_20_build_path_iterator_2generator
  */
 
 static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_namespaces) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *__pyx_cur_scope;
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *__pyx_cur_scope;
   PyObject *__pyx_v_cache_key = NULL;
   PyObject *__pyx_v_stream = NULL;
   PyObject *__pyx_v__next = NULL;
@@ -7623,11 +8043,11 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
   int __pyx_t_11;
   Py_ssize_t __pyx_t_12;
   __Pyx_RefNannySetupContext("_build_path_iterator", 0);
-  __pyx_cur_scope = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *)__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator(__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator, __pyx_empty_tuple, NULL);
+  __pyx_cur_scope = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *)__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator(__pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator, __pyx_empty_tuple, NULL);
   if (unlikely(!__pyx_cur_scope)) {
-    __pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *)Py_None);
+    __pyx_cur_scope = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(0, 237, __pyx_L1_error)
+    __PYX_ERR(0, 246, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -7636,32 +8056,32 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_namespaces);
   __Pyx_INCREF(__pyx_v_path);
 
-  /* "lxml/_elementpath.py":239
+  /* "lxml/_elementpath.py":248
  * def _build_path_iterator(path, namespaces):
  *     """compile selector pattern"""
  *     if path[-1:] == "/":             # <<<<<<<<<<<<<<
  *         path += "*"  # implicit all (FIXME: keep this?)
  * 
  */
-  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, -1L, 0, NULL, NULL, &__pyx_slice__46, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_path, -1L, 0, NULL, NULL, &__pyx_slice__50, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__47, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__51, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 248, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_2) {
 
-    /* "lxml/_elementpath.py":240
+    /* "lxml/_elementpath.py":249
  *     """compile selector pattern"""
  *     if path[-1:] == "/":
  *         path += "*"  # implicit all (FIXME: keep this?)             # <<<<<<<<<<<<<<
  * 
  *     cache_key = (path,)
  */
-    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_path, __pyx_kp_s__7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
+    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_path, __pyx_kp_s__7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":239
+    /* "lxml/_elementpath.py":248
  * def _build_path_iterator(path, namespaces):
  *     """compile selector pattern"""
  *     if path[-1:] == "/":             # <<<<<<<<<<<<<<
@@ -7670,14 +8090,14 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
  */
   }
 
-  /* "lxml/_elementpath.py":242
+  /* "lxml/_elementpath.py":251
  *         path += "*"  # implicit all (FIXME: keep this?)
  * 
  *     cache_key = (path,)             # <<<<<<<<<<<<<<
  *     if namespaces:
  *         if '' in namespaces:
  */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_path);
   __Pyx_GIVEREF(__pyx_v_path);
@@ -7685,41 +8105,41 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
   __pyx_v_cache_key = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":243
+  /* "lxml/_elementpath.py":252
  * 
  *     cache_key = (path,)
  *     if namespaces:             # <<<<<<<<<<<<<<
  *         if '' in namespaces:
  *             raise ValueError("empty namespace prefix must be passed as None, not the empty string")
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_namespaces); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_namespaces); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
   if (__pyx_t_2) {
 
-    /* "lxml/_elementpath.py":244
+    /* "lxml/_elementpath.py":253
  *     cache_key = (path,)
  *     if namespaces:
  *         if '' in namespaces:             # <<<<<<<<<<<<<<
  *             raise ValueError("empty namespace prefix must be passed as None, not the empty string")
  *         if None in namespaces:
  */
-    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__18, __pyx_cur_scope->__pyx_v_namespaces, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
+    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__18, __pyx_cur_scope->__pyx_v_namespaces, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 253, __pyx_L1_error)
     __pyx_t_3 = (__pyx_t_2 != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/_elementpath.py":245
+      /* "lxml/_elementpath.py":254
  *     if namespaces:
  *         if '' in namespaces:
  *             raise ValueError("empty namespace prefix must be passed as None, not the empty string")             # <<<<<<<<<<<<<<
  *         if None in namespaces:
  *             cache_key += (namespaces[None],) + tuple(sorted(
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 245, __pyx_L1_error)
+      __PYX_ERR(0, 254, __pyx_L1_error)
 
-      /* "lxml/_elementpath.py":244
+      /* "lxml/_elementpath.py":253
  *     cache_key = (path,)
  *     if namespaces:
  *         if '' in namespaces:             # <<<<<<<<<<<<<<
@@ -7728,73 +8148,73 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
  */
     }
 
-    /* "lxml/_elementpath.py":246
+    /* "lxml/_elementpath.py":255
  *         if '' in namespaces:
  *             raise ValueError("empty namespace prefix must be passed as None, not the empty string")
  *         if None in namespaces:             # <<<<<<<<<<<<<<
  *             cache_key += (namespaces[None],) + tuple(sorted(
  *                 item for item in namespaces.items() if item[0] is not None))
  */
-    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(Py_None, __pyx_cur_scope->__pyx_v_namespaces, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 246, __pyx_L1_error)
+    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(Py_None, __pyx_cur_scope->__pyx_v_namespaces, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 255, __pyx_L1_error)
     __pyx_t_2 = (__pyx_t_3 != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/_elementpath.py":247
+      /* "lxml/_elementpath.py":256
  *             raise ValueError("empty namespace prefix must be passed as None, not the empty string")
  *         if None in namespaces:
  *             cache_key += (namespaces[None],) + tuple(sorted(             # <<<<<<<<<<<<<<
  *                 item for item in namespaces.items() if item[0] is not None))
  *         else:
  */
-      __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_namespaces, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
+      __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_namespaces, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GIVEREF(__pyx_t_1);
       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
       __pyx_t_1 = 0;
 
-      /* "lxml/_elementpath.py":248
+      /* "lxml/_elementpath.py":257
  *         if None in namespaces:
  *             cache_key += (namespaces[None],) + tuple(sorted(
  *                 item for item in namespaces.items() if item[0] is not None))             # <<<<<<<<<<<<<<
  *         else:
  *             cache_key += tuple(sorted(namespaces.items()))
  */
-      __pyx_t_5 = __pyx_pf_4lxml_12_elementpath_20_build_path_iterator_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
+      __pyx_t_5 = __pyx_pf_4lxml_12_elementpath_20_build_path_iterator_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
 
-      /* "lxml/_elementpath.py":247
+      /* "lxml/_elementpath.py":256
  *             raise ValueError("empty namespace prefix must be passed as None, not the empty string")
  *         if None in namespaces:
  *             cache_key += (namespaces[None],) + tuple(sorted(             # <<<<<<<<<<<<<<
  *                 item for item in namespaces.items() if item[0] is not None))
  *         else:
  */
-      __pyx_t_6 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __pyx_t_1 = ((PyObject*)__pyx_t_6);
       __pyx_t_6 = 0;
-      __pyx_t_7 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 247, __pyx_L1_error)
+      __pyx_t_7 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 256, __pyx_L1_error)
       if (unlikely(__pyx_t_1 == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(0, 247, __pyx_L1_error)
+        __PYX_ERR(0, 256, __pyx_L1_error)
       }
-      __pyx_t_6 = PyList_AsTuple(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error)
+      __pyx_t_6 = PyList_AsTuple(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
+      __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_cache_key, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error)
+      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_cache_key, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_DECREF_SET(__pyx_v_cache_key, ((PyObject*)__pyx_t_6));
       __pyx_t_6 = 0;
 
-      /* "lxml/_elementpath.py":246
+      /* "lxml/_elementpath.py":255
  *         if '' in namespaces:
  *             raise ValueError("empty namespace prefix must be passed as None, not the empty string")
  *         if None in namespaces:             # <<<<<<<<<<<<<<
@@ -7804,7 +8224,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
       goto __pyx_L6;
     }
 
-    /* "lxml/_elementpath.py":250
+    /* "lxml/_elementpath.py":259
  *                 item for item in namespaces.items() if item[0] is not None))
  *         else:
  *             cache_key += tuple(sorted(namespaces.items()))             # <<<<<<<<<<<<<<
@@ -7812,7 +8232,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
  *     try:
  */
     /*else*/ {
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_namespaces, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_namespaces, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_t_5 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -7825,27 +8245,27 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
         }
       }
       if (__pyx_t_5) {
-        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       } else {
-        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
+      __pyx_t_4 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_t_6 = ((PyObject*)__pyx_t_4);
       __pyx_t_4 = 0;
-      __pyx_t_7 = PyList_Sort(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 250, __pyx_L1_error)
+      __pyx_t_7 = PyList_Sort(__pyx_t_6); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 259, __pyx_L1_error)
       if (unlikely(__pyx_t_6 == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(0, 250, __pyx_L1_error)
+        __PYX_ERR(0, 259, __pyx_L1_error)
       }
-      __pyx_t_4 = PyList_AsTuple(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
+      __pyx_t_4 = PyList_AsTuple(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_cache_key, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
+      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_cache_key, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF_SET(__pyx_v_cache_key, ((PyObject*)__pyx_t_6));
@@ -7853,7 +8273,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     }
     __pyx_L6:;
 
-    /* "lxml/_elementpath.py":243
+    /* "lxml/_elementpath.py":252
  * 
  *     cache_key = (path,)
  *     if namespaces:             # <<<<<<<<<<<<<<
@@ -7862,7 +8282,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
  */
   }
 
-  /* "lxml/_elementpath.py":252
+  /* "lxml/_elementpath.py":261
  *             cache_key += tuple(sorted(namespaces.items()))
  * 
  *     try:             # <<<<<<<<<<<<<<
@@ -7878,7 +8298,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     __Pyx_XGOTREF(__pyx_t_10);
     /*try:*/ {
 
-      /* "lxml/_elementpath.py":253
+      /* "lxml/_elementpath.py":262
  * 
  *     try:
  *         return _cache[cache_key]             # <<<<<<<<<<<<<<
@@ -7886,16 +8306,16 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
  *         pass
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L7_error)
+      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L7_error)
       __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_4 = PyObject_GetItem(__pyx_t_6, __pyx_v_cache_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L7_error)
+      __pyx_t_4 = PyObject_GetItem(__pyx_t_6, __pyx_v_cache_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L7_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __pyx_r = __pyx_t_4;
       __pyx_t_4 = 0;
       goto __pyx_L11_try_return;
 
-      /* "lxml/_elementpath.py":252
+      /* "lxml/_elementpath.py":261
  *             cache_key += tuple(sorted(namespaces.items()))
  * 
  *     try:             # <<<<<<<<<<<<<<
@@ -7904,13 +8324,12 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
  */
     }
     __pyx_L7_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/_elementpath.py":254
+    /* "lxml/_elementpath.py":263
  *     try:
  *         return _cache[cache_key]
  *     except KeyError:             # <<<<<<<<<<<<<<
@@ -7925,58 +8344,55 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     goto __pyx_L9_except_error;
     __pyx_L9_except_error:;
 
-    /* "lxml/_elementpath.py":252
+    /* "lxml/_elementpath.py":261
  *             cache_key += tuple(sorted(namespaces.items()))
  * 
  *     try:             # <<<<<<<<<<<<<<
  *         return _cache[cache_key]
  *     except KeyError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_8);
     __Pyx_XGIVEREF(__pyx_t_9);
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
     goto __pyx_L1_error;
     __pyx_L11_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_8);
     __Pyx_XGIVEREF(__pyx_t_9);
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
     goto __pyx_L0;
     __pyx_L8_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_8);
     __Pyx_XGIVEREF(__pyx_t_9);
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
   }
 
-  /* "lxml/_elementpath.py":256
+  /* "lxml/_elementpath.py":265
  *     except KeyError:
  *         pass
  *     if len(_cache) > 100:             # <<<<<<<<<<<<<<
  *         _cache.clear()
  * 
  */
-  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_cache); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_cache); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 256, __pyx_L1_error)
+  __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 265, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_2 = ((__pyx_t_12 > 0x64) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/_elementpath.py":257
+    /* "lxml/_elementpath.py":266
  *         pass
  *     if len(_cache) > 100:
  *         _cache.clear()             # <<<<<<<<<<<<<<
  * 
  *     if path[:1] == "/":
  */
-    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_cache); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_t_6 = NULL;
@@ -7990,16 +8406,16 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
       }
     }
     if (__pyx_t_6) {
-      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     } else {
-      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
     }
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/_elementpath.py":256
+    /* "lxml/_elementpath.py":265
  *     except KeyError:
  *         pass
  *     if len(_cache) > 100:             # <<<<<<<<<<<<<<
@@ -8008,33 +8424,33 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
  */
   }
 
-  /* "lxml/_elementpath.py":259
+  /* "lxml/_elementpath.py":268
  *         _cache.clear()
  * 
  *     if path[:1] == "/":             # <<<<<<<<<<<<<<
  *         raise SyntaxError("cannot use absolute path on element")
  *     stream = iter(xpath_tokenizer(path, namespaces))
  */
-  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 1, NULL, NULL, &__pyx_slice__49, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 1, NULL, NULL, &__pyx_slice__53, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s__47, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 259, __pyx_L1_error)
+  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s__51, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_2) {
 
-    /* "lxml/_elementpath.py":260
+    /* "lxml/_elementpath.py":269
  * 
  *     if path[:1] == "/":
  *         raise SyntaxError("cannot use absolute path on element")             # <<<<<<<<<<<<<<
  *     stream = iter(xpath_tokenizer(path, namespaces))
  *     try:
  */
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(0, 260, __pyx_L1_error)
+    __PYX_ERR(0, 269, __pyx_L1_error)
 
-    /* "lxml/_elementpath.py":259
+    /* "lxml/_elementpath.py":268
  *         _cache.clear()
  * 
  *     if path[:1] == "/":             # <<<<<<<<<<<<<<
@@ -8043,14 +8459,14 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
  */
   }
 
-  /* "lxml/_elementpath.py":261
+  /* "lxml/_elementpath.py":270
  *     if path[:1] == "/":
  *         raise SyntaxError("cannot use absolute path on element")
  *     stream = iter(xpath_tokenizer(path, namespaces))             # <<<<<<<<<<<<<<
  *     try:
  *         _next = stream.next
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_xpath_tokenizer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_xpath_tokenizer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_6 = NULL;
   __pyx_t_11 = 0;
@@ -8067,7 +8483,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_1)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_path, __pyx_cur_scope->__pyx_v_namespaces};
-    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_4);
   } else
@@ -8075,13 +8491,13 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
     PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_path, __pyx_cur_scope->__pyx_v_namespaces};
-    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_4);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_6) {
       __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -8092,18 +8508,18 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     __Pyx_INCREF(__pyx_cur_scope->__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_11, __pyx_cur_scope->__pyx_v_namespaces);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
+  __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_v_stream = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":262
+  /* "lxml/_elementpath.py":271
  *         raise SyntaxError("cannot use absolute path on element")
  *     stream = iter(xpath_tokenizer(path, namespaces))
  *     try:             # <<<<<<<<<<<<<<
@@ -8119,19 +8535,19 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     __Pyx_XGOTREF(__pyx_t_8);
     /*try:*/ {
 
-      /* "lxml/_elementpath.py":263
+      /* "lxml/_elementpath.py":272
  *     stream = iter(xpath_tokenizer(path, namespaces))
  *     try:
  *         _next = stream.next             # <<<<<<<<<<<<<<
  *     except AttributeError:
  *         # Python 3
  */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L15_error)
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L15_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_v__next = __pyx_t_1;
       __pyx_t_1 = 0;
 
-      /* "lxml/_elementpath.py":262
+      /* "lxml/_elementpath.py":271
  *         raise SyntaxError("cannot use absolute path on element")
  *     stream = iter(xpath_tokenizer(path, namespaces))
  *     try:             # <<<<<<<<<<<<<<
@@ -8144,13 +8560,12 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     goto __pyx_L20_try_end;
     __pyx_L15_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":264
+    /* "lxml/_elementpath.py":273
  *     try:
  *         _next = stream.next
  *     except AttributeError:             # <<<<<<<<<<<<<<
@@ -8160,19 +8575,19 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
     if (__pyx_t_11) {
       __Pyx_AddTraceback("lxml._elementpath._build_path_iterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 264, __pyx_L17_except_error)
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 273, __pyx_L17_except_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_t_5);
 
-      /* "lxml/_elementpath.py":266
+      /* "lxml/_elementpath.py":275
  *     except AttributeError:
  *         # Python 3
  *         _next = stream.__next__             # <<<<<<<<<<<<<<
  *     try:
  *         token = _next()
  */
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_next_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L17_except_error)
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_next_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L17_except_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_XDECREF_SET(__pyx_v__next, __pyx_t_6);
       __pyx_t_6 = 0;
@@ -8184,21 +8599,19 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     goto __pyx_L17_except_error;
     __pyx_L17_except_error:;
 
-    /* "lxml/_elementpath.py":262
+    /* "lxml/_elementpath.py":271
  *         raise SyntaxError("cannot use absolute path on element")
  *     stream = iter(xpath_tokenizer(path, namespaces))
  *     try:             # <<<<<<<<<<<<<<
  *         _next = stream.next
  *     except AttributeError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_XGIVEREF(__pyx_t_9);
     __Pyx_XGIVEREF(__pyx_t_8);
     __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
     goto __pyx_L1_error;
     __pyx_L16_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_XGIVEREF(__pyx_t_9);
     __Pyx_XGIVEREF(__pyx_t_8);
@@ -8206,7 +8619,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     __pyx_L20_try_end:;
   }
 
-  /* "lxml/_elementpath.py":267
+  /* "lxml/_elementpath.py":276
  *         # Python 3
  *         _next = stream.__next__
  *     try:             # <<<<<<<<<<<<<<
@@ -8222,7 +8635,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     __Pyx_XGOTREF(__pyx_t_10);
     /*try:*/ {
 
-      /* "lxml/_elementpath.py":268
+      /* "lxml/_elementpath.py":277
  *         _next = stream.__next__
  *     try:
  *         token = _next()             # <<<<<<<<<<<<<<
@@ -8241,17 +8654,17 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
         }
       }
       if (__pyx_t_1) {
-        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L23_error)
+        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L23_error)
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       } else {
-        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L23_error)
+        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L23_error)
       }
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __pyx_v_token = __pyx_t_5;
       __pyx_t_5 = 0;
 
-      /* "lxml/_elementpath.py":267
+      /* "lxml/_elementpath.py":276
  *         # Python 3
  *         _next = stream.__next__
  *     try:             # <<<<<<<<<<<<<<
@@ -8264,13 +8677,12 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
     goto __pyx_L28_try_end;
     __pyx_L23_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/_elementpath.py":269
+    /* "lxml/_elementpath.py":278
  *     try:
  *         token = _next()
  *     except StopIteration:             # <<<<<<<<<<<<<<
@@ -8280,35 +8692,34 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
     if (__pyx_t_11) {
       __Pyx_AddTraceback("lxml._elementpath._build_path_iterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 269, __pyx_L25_except_error)
+      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 278, __pyx_L25_except_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_t_1);
 
-      /* "lxml/_elementpath.py":270
+      /* "lxml/_elementpath.py":279
  *         token = _next()
  *     except StopIteration:
  *         raise SyntaxError("empty path expression")             # <<<<<<<<<<<<<<
  *     selector = []
  *     while 1:
  */
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L25_except_error)
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L25_except_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __PYX_ERR(0, 270, __pyx_L25_except_error)
+      __PYX_ERR(0, 279, __pyx_L25_except_error)
     }
     goto __pyx_L25_except_error;
     __pyx_L25_except_error:;
 
-    /* "lxml/_elementpath.py":267
+    /* "lxml/_elementpath.py":276
  *         # Python 3
  *         _next = stream.__next__
  *     try:             # <<<<<<<<<<<<<<
  *         token = _next()
  *     except StopIteration:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_8);
     __Pyx_XGIVEREF(__pyx_t_9);
     __Pyx_XGIVEREF(__pyx_t_10);
@@ -8317,19 +8728,19 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
     __pyx_L28_try_end:;
   }
 
-  /* "lxml/_elementpath.py":271
+  /* "lxml/_elementpath.py":280
  *     except StopIteration:
  *         raise SyntaxError("empty path expression")
  *     selector = []             # <<<<<<<<<<<<<<
  *     while 1:
  *         try:
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_selector = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":272
+  /* "lxml/_elementpath.py":281
  *         raise SyntaxError("empty path expression")
  *     selector = []
  *     while 1:             # <<<<<<<<<<<<<<
@@ -8338,7 +8749,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
  */
   while (1) {
 
-    /* "lxml/_elementpath.py":273
+    /* "lxml/_elementpath.py":282
  *     selector = []
  *     while 1:
  *         try:             # <<<<<<<<<<<<<<
@@ -8354,18 +8765,18 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
       __Pyx_XGOTREF(__pyx_t_8);
       /*try:*/ {
 
-        /* "lxml/_elementpath.py":274
+        /* "lxml/_elementpath.py":283
  *     while 1:
  *         try:
  *             selector.append(ops[token[0]](_next, token))             # <<<<<<<<<<<<<<
  *         except StopIteration:
  *             raise SyntaxError("invalid path")
  */
-        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ops); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L33_error)
+        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ops); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L33_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L33_error)
+        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L33_error)
         __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L33_error)
+        __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L33_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -8384,7 +8795,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_6)) {
           PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v__next, __pyx_v_token};
-          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L33_error)
+          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L33_error)
           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_GOTREF(__pyx_t_1);
         } else
@@ -8392,13 +8803,13 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
           PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v__next, __pyx_v_token};
-          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L33_error)
+          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L33_error)
           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_GOTREF(__pyx_t_1);
         } else
         #endif
         {
-          __pyx_t_4 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L33_error)
+          __pyx_t_4 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L33_error)
           __Pyx_GOTREF(__pyx_t_4);
           if (__pyx_t_5) {
             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
@@ -8409,15 +8820,15 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
           __Pyx_INCREF(__pyx_v_token);
           __Pyx_GIVEREF(__pyx_v_token);
           PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_11, __pyx_v_token);
-          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L33_error)
+          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L33_error)
           __Pyx_GOTREF(__pyx_t_1);
           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         }
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_selector, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 274, __pyx_L33_error)
+        __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_selector, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 283, __pyx_L33_error)
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-        /* "lxml/_elementpath.py":273
+        /* "lxml/_elementpath.py":282
  *     selector = []
  *     while 1:
  *         try:             # <<<<<<<<<<<<<<
@@ -8430,13 +8841,12 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       goto __pyx_L40_try_end;
       __pyx_L33_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-      /* "lxml/_elementpath.py":275
+      /* "lxml/_elementpath.py":284
  *         try:
  *             selector.append(ops[token[0]](_next, token))
  *         except StopIteration:             # <<<<<<<<<<<<<<
@@ -8446,35 +8856,34 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
       __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
       if (__pyx_t_11) {
         __Pyx_AddTraceback("lxml._elementpath._build_path_iterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 275, __pyx_L35_except_error)
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 284, __pyx_L35_except_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_GOTREF(__pyx_t_4);
 
-        /* "lxml/_elementpath.py":276
+        /* "lxml/_elementpath.py":285
  *             selector.append(ops[token[0]](_next, token))
  *         except StopIteration:
  *             raise SyntaxError("invalid path")             # <<<<<<<<<<<<<<
  *         try:
  *             token = _next()
  */
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L35_except_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_SyntaxError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L35_except_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_Raise(__pyx_t_5, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __PYX_ERR(0, 276, __pyx_L35_except_error)
+        __PYX_ERR(0, 285, __pyx_L35_except_error)
       }
       goto __pyx_L35_except_error;
       __pyx_L35_except_error:;
 
-      /* "lxml/_elementpath.py":273
+      /* "lxml/_elementpath.py":282
  *     selector = []
  *     while 1:
  *         try:             # <<<<<<<<<<<<<<
  *             selector.append(ops[token[0]](_next, token))
  *         except StopIteration:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_8);
@@ -8483,7 +8892,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
       __pyx_L40_try_end:;
     }
 
-    /* "lxml/_elementpath.py":277
+    /* "lxml/_elementpath.py":286
  *         except StopIteration:
  *             raise SyntaxError("invalid path")
  *         try:             # <<<<<<<<<<<<<<
@@ -8499,7 +8908,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
       __Pyx_XGOTREF(__pyx_t_10);
       /*try:*/ {
 
-        /* "lxml/_elementpath.py":278
+        /* "lxml/_elementpath.py":287
  *             raise SyntaxError("invalid path")
  *         try:
  *             token = _next()             # <<<<<<<<<<<<<<
@@ -8518,30 +8927,30 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
           }
         }
         if (__pyx_t_1) {
-          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L43_error)
+          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L43_error)
           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         } else {
-          __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L43_error)
+          __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L43_error)
         }
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_DECREF_SET(__pyx_v_token, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "lxml/_elementpath.py":279
+        /* "lxml/_elementpath.py":288
  *         try:
  *             token = _next()
  *             if token[0] == "/":             # <<<<<<<<<<<<<<
  *                 token = _next()
  *         except StopIteration:
  */
-        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L43_error)
+        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_token, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L43_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s__47, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 279, __pyx_L43_error)
+        __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s__51, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 288, __pyx_L43_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         if (__pyx_t_2) {
 
-          /* "lxml/_elementpath.py":280
+          /* "lxml/_elementpath.py":289
  *             token = _next()
  *             if token[0] == "/":
  *                 token = _next()             # <<<<<<<<<<<<<<
@@ -8560,17 +8969,17 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
             }
           }
           if (__pyx_t_1) {
-            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L43_error)
+            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L43_error)
             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
           } else {
-            __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L43_error)
+            __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L43_error)
           }
           __Pyx_GOTREF(__pyx_t_4);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_DECREF_SET(__pyx_v_token, __pyx_t_4);
           __pyx_t_4 = 0;
 
-          /* "lxml/_elementpath.py":279
+          /* "lxml/_elementpath.py":288
  *         try:
  *             token = _next()
  *             if token[0] == "/":             # <<<<<<<<<<<<<<
@@ -8579,7 +8988,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
  */
         }
 
-        /* "lxml/_elementpath.py":277
+        /* "lxml/_elementpath.py":286
  *         except StopIteration:
  *             raise SyntaxError("invalid path")
  *         try:             # <<<<<<<<<<<<<<
@@ -8592,13 +9001,12 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
       goto __pyx_L50_try_end;
       __pyx_L43_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-      /* "lxml/_elementpath.py":281
+      /* "lxml/_elementpath.py":290
  *             if token[0] == "/":
  *                 token = _next()
  *         except StopIteration:             # <<<<<<<<<<<<<<
@@ -8608,12 +9016,12 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
       __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
       if (__pyx_t_11) {
         __Pyx_AddTraceback("lxml._elementpath._build_path_iterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(0, 281, __pyx_L45_except_error)
+        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(0, 290, __pyx_L45_except_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_GOTREF(__pyx_t_1);
 
-        /* "lxml/_elementpath.py":282
+        /* "lxml/_elementpath.py":291
  *                 token = _next()
  *         except StopIteration:
  *             break             # <<<<<<<<<<<<<<
@@ -8630,21 +9038,19 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
       goto __pyx_L45_except_error;
       __pyx_L45_except_error:;
 
-      /* "lxml/_elementpath.py":277
+      /* "lxml/_elementpath.py":286
  *         except StopIteration:
  *             raise SyntaxError("invalid path")
  *         try:             # <<<<<<<<<<<<<<
  *             token = _next()
  *             if token[0] == "/":
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_8);
       __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
       goto __pyx_L1_error;
       __pyx_L48_try_break:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_8);
       __Pyx_XGIVEREF(__pyx_t_9);
       __Pyx_XGIVEREF(__pyx_t_10);
@@ -8655,19 +9061,19 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
   }
   __pyx_L32_break:;
 
-  /* "lxml/_elementpath.py":283
+  /* "lxml/_elementpath.py":292
  *         except StopIteration:
  *             break
  *     _cache[cache_key] = selector             # <<<<<<<<<<<<<<
  *     return selector
  * 
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cache); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cache); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_cache_key, __pyx_v_selector) < 0)) __PYX_ERR(0, 283, __pyx_L1_error)
+  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_cache_key, __pyx_v_selector) < 0)) __PYX_ERR(0, 292, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":284
+  /* "lxml/_elementpath.py":293
  *             break
  *     _cache[cache_key] = selector
  *     return selector             # <<<<<<<<<<<<<<
@@ -8679,7 +9085,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
   __pyx_r = __pyx_v_selector;
   goto __pyx_L0;
 
-  /* "lxml/_elementpath.py":237
+  /* "lxml/_elementpath.py":246
  * 
  * 
  * def _build_path_iterator(path, namespaces):             # <<<<<<<<<<<<<<
@@ -8708,7 +9114,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_15_build_path_iterator(CYTHON_UNU
   return __pyx_r;
 }
 
-/* "lxml/_elementpath.py":290
+/* "lxml/_elementpath.py":299
  * # Iterate over the matching nodes
  * 
  * def iterfind(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -8752,7 +9158,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_18iterfind(PyObject *__pyx_self,
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("iterfind", 0, 2, 3, 1); __PYX_ERR(0, 290, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("iterfind", 0, 2, 3, 1); __PYX_ERR(0, 299, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -8762,7 +9168,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_18iterfind(PyObject *__pyx_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterfind") < 0)) __PYX_ERR(0, 290, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterfind") < 0)) __PYX_ERR(0, 299, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -8780,7 +9186,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_18iterfind(PyObject *__pyx_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("iterfind", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 290, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("iterfind", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 299, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml._elementpath.iterfind", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -8809,14 +9215,14 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
   PyObject *__pyx_t_8 = NULL;
   __Pyx_RefNannySetupContext("iterfind", 0);
 
-  /* "lxml/_elementpath.py":291
+  /* "lxml/_elementpath.py":300
  * 
  * def iterfind(elem, path, namespaces=None):
  *     selector = _build_path_iterator(path, namespaces)             # <<<<<<<<<<<<<<
  *     result = iter((elem,))
  *     for select in selector:
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_build_path_iterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_build_path_iterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   __pyx_t_4 = 0;
@@ -8833,7 +9239,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -8841,13 +9247,13 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_3) {
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
@@ -8858,7 +9264,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_namespaces);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -8866,25 +9272,25 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
   __pyx_v_selector = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":292
+  /* "lxml/_elementpath.py":301
  * def iterfind(elem, path, namespaces=None):
  *     selector = _build_path_iterator(path, namespaces)
  *     result = iter((elem,))             # <<<<<<<<<<<<<<
  *     for select in selector:
  *         result = select(result)
  */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_elem);
   __Pyx_GIVEREF(__pyx_v_elem);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_elem);
-  __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error)
+  __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_result = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "lxml/_elementpath.py":293
+  /* "lxml/_elementpath.py":302
  *     selector = _build_path_iterator(path, namespaces)
  *     result = iter((elem,))
  *     for select in selector:             # <<<<<<<<<<<<<<
@@ -8895,26 +9301,26 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
     __pyx_t_2 = __pyx_v_selector; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
     __pyx_t_7 = NULL;
   } else {
-    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_selector); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_selector); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_7)) {
       if (likely(PyList_CheckExact(__pyx_t_2))) {
         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 293, __pyx_L1_error)
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 302, __pyx_L1_error)
         #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         #endif
       } else {
         if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 293, __pyx_L1_error)
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 302, __pyx_L1_error)
         #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         #endif
       }
@@ -8923,8 +9329,8 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 293, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 302, __pyx_L1_error)
         }
         break;
       }
@@ -8933,7 +9339,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
     __Pyx_XDECREF_SET(__pyx_v_select, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":294
+    /* "lxml/_elementpath.py":303
  *     result = iter((elem,))
  *     for select in selector:
  *         result = select(result)             # <<<<<<<<<<<<<<
@@ -8952,13 +9358,13 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
       }
     }
     if (!__pyx_t_3) {
-      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_result};
-        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_GOTREF(__pyx_t_1);
       } else
@@ -8966,19 +9372,19 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_result};
-        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_GOTREF(__pyx_t_1);
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 303, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
         __Pyx_INCREF(__pyx_v_result);
         __Pyx_GIVEREF(__pyx_v_result);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_result);
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -8987,7 +9393,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
     __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":293
+    /* "lxml/_elementpath.py":302
  *     selector = _build_path_iterator(path, namespaces)
  *     result = iter((elem,))
  *     for select in selector:             # <<<<<<<<<<<<<<
@@ -8997,7 +9403,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/_elementpath.py":295
+  /* "lxml/_elementpath.py":304
  *     for select in selector:
  *         result = select(result)
  *     return result             # <<<<<<<<<<<<<<
@@ -9009,7 +9415,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "lxml/_elementpath.py":290
+  /* "lxml/_elementpath.py":299
  * # Iterate over the matching nodes
  * 
  * def iterfind(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -9035,7 +9441,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_17iterfind(CYTHON_UNUSED PyObject
   return __pyx_r;
 }
 
-/* "lxml/_elementpath.py":301
+/* "lxml/_elementpath.py":310
  * # Find first matching object.
  * 
  * def find(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -9079,7 +9485,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_20find(PyObject *__pyx_self, PyOb
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("find", 0, 2, 3, 1); __PYX_ERR(0, 301, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("find", 0, 2, 3, 1); __PYX_ERR(0, 310, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -9089,7 +9495,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_20find(PyObject *__pyx_self, PyOb
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find") < 0)) __PYX_ERR(0, 301, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find") < 0)) __PYX_ERR(0, 310, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -9107,7 +9513,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_20find(PyObject *__pyx_self, PyOb
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("find", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("find", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 310, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml._elementpath.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -9134,14 +9540,14 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
   PyObject *__pyx_t_8 = NULL;
   __Pyx_RefNannySetupContext("find", 0);
 
-  /* "lxml/_elementpath.py":302
+  /* "lxml/_elementpath.py":311
  * 
  * def find(elem, path, namespaces=None):
  *     it = iterfind(elem, path, namespaces)             # <<<<<<<<<<<<<<
  *     try:
  *         return next(it)
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iterfind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iterfind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   __pyx_t_4 = 0;
@@ -9158,7 +9564,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_elem, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -9166,13 +9572,13 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_elem, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_3) {
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
@@ -9186,7 +9592,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_namespaces);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -9194,7 +9600,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
   __pyx_v_it = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":303
+  /* "lxml/_elementpath.py":312
  * def find(elem, path, namespaces=None):
  *     it = iterfind(elem, path, namespaces)
  *     try:             # <<<<<<<<<<<<<<
@@ -9210,7 +9616,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
     __Pyx_XGOTREF(__pyx_t_8);
     /*try:*/ {
 
-      /* "lxml/_elementpath.py":304
+      /* "lxml/_elementpath.py":313
  *     it = iterfind(elem, path, namespaces)
  *     try:
  *         return next(it)             # <<<<<<<<<<<<<<
@@ -9218,13 +9624,13 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
  *         return None
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L3_error)
+      __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_r = __pyx_t_1;
       __pyx_t_1 = 0;
       goto __pyx_L7_try_return;
 
-      /* "lxml/_elementpath.py":303
+      /* "lxml/_elementpath.py":312
  * def find(elem, path, namespaces=None):
  *     it = iterfind(elem, path, namespaces)
  *     try:             # <<<<<<<<<<<<<<
@@ -9233,13 +9639,12 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
  */
     }
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "lxml/_elementpath.py":305
+    /* "lxml/_elementpath.py":314
  *     try:
  *         return next(it)
  *     except StopIteration:             # <<<<<<<<<<<<<<
@@ -9249,12 +9654,12 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
     if (__pyx_t_4) {
       __Pyx_AddTraceback("lxml._elementpath.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 305, __pyx_L5_except_error)
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 314, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_GOTREF(__pyx_t_5);
 
-      /* "lxml/_elementpath.py":306
+      /* "lxml/_elementpath.py":315
  *         return next(it)
  *     except StopIteration:
  *         return None             # <<<<<<<<<<<<<<
@@ -9272,28 +9677,25 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
     goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
 
-    /* "lxml/_elementpath.py":303
+    /* "lxml/_elementpath.py":312
  * def find(elem, path, namespaces=None):
  *     it = iterfind(elem, path, namespaces)
  *     try:             # <<<<<<<<<<<<<<
  *         return next(it)
  *     except StopIteration:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_XGIVEREF(__pyx_t_7);
     __Pyx_XGIVEREF(__pyx_t_8);
     __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
     goto __pyx_L1_error;
     __pyx_L7_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_XGIVEREF(__pyx_t_7);
     __Pyx_XGIVEREF(__pyx_t_8);
     __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
     goto __pyx_L0;
     __pyx_L6_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_XGIVEREF(__pyx_t_7);
     __Pyx_XGIVEREF(__pyx_t_8);
@@ -9301,7 +9703,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
     goto __pyx_L0;
   }
 
-  /* "lxml/_elementpath.py":301
+  /* "lxml/_elementpath.py":310
  * # Find first matching object.
  * 
  * def find(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -9324,7 +9726,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_19find(CYTHON_UNUSED PyObject *__
   return __pyx_r;
 }
 
-/* "lxml/_elementpath.py":312
+/* "lxml/_elementpath.py":321
  * # Find all matching objects.
  * 
  * def findall(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -9368,7 +9770,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_22findall(PyObject *__pyx_self, P
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("findall", 0, 2, 3, 1); __PYX_ERR(0, 312, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("findall", 0, 2, 3, 1); __PYX_ERR(0, 321, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -9378,7 +9780,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_22findall(PyObject *__pyx_self, P
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findall") < 0)) __PYX_ERR(0, 312, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findall") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -9396,7 +9798,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_22findall(PyObject *__pyx_self, P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("findall", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 312, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("findall", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml._elementpath.findall", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -9419,7 +9821,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_21findall(CYTHON_UNUSED PyObject
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("findall", 0);
 
-  /* "lxml/_elementpath.py":313
+  /* "lxml/_elementpath.py":322
  * 
  * def findall(elem, path, namespaces=None):
  *     return list(iterfind(elem, path, namespaces))             # <<<<<<<<<<<<<<
@@ -9427,7 +9829,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_21findall(CYTHON_UNUSED PyObject
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iterfind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_iterfind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   __pyx_t_4 = 0;
@@ -9444,7 +9846,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_21findall(CYTHON_UNUSED PyObject
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_elem, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -9452,13 +9854,13 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_21findall(CYTHON_UNUSED PyObject
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_elem, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_3) {
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
@@ -9472,19 +9874,19 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_21findall(CYTHON_UNUSED PyObject
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_namespaces);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
+  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/_elementpath.py":312
+  /* "lxml/_elementpath.py":321
  * # Find all matching objects.
  * 
  * def findall(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -9506,7 +9908,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_21findall(CYTHON_UNUSED PyObject
   return __pyx_r;
 }
 
-/* "lxml/_elementpath.py":319
+/* "lxml/_elementpath.py":328
  * # Find text for first matching object.
  * 
  * def findtext(elem, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
@@ -9554,7 +9956,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_24findtext(PyObject *__pyx_self,
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("findtext", 0, 2, 4, 1); __PYX_ERR(0, 319, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("findtext", 0, 2, 4, 1); __PYX_ERR(0, 328, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -9570,7 +9972,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_24findtext(PyObject *__pyx_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findtext") < 0)) __PYX_ERR(0, 319, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findtext") < 0)) __PYX_ERR(0, 328, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -9591,7 +9993,7 @@ static PyObject *__pyx_pw_4lxml_12_elementpath_24findtext(PyObject *__pyx_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("findtext", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 319, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("findtext", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 328, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml._elementpath.findtext", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -9617,14 +10019,14 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_23findtext(CYTHON_UNUSED PyObject
   int __pyx_t_7;
   __Pyx_RefNannySetupContext("findtext", 0);
 
-  /* "lxml/_elementpath.py":320
+  /* "lxml/_elementpath.py":329
  * 
  * def findtext(elem, path, default=None, namespaces=None):
  *     el = find(elem, path, namespaces)             # <<<<<<<<<<<<<<
  *     if el is None:
  *         return default
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_find); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_find); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   __pyx_t_4 = 0;
@@ -9641,7 +10043,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_23findtext(CYTHON_UNUSED PyObject
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_elem, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -9649,13 +10051,13 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_23findtext(CYTHON_UNUSED PyObject
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_elem, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_3) {
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
@@ -9669,7 +10071,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_23findtext(CYTHON_UNUSED PyObject
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_namespaces);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -9677,7 +10079,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_23findtext(CYTHON_UNUSED PyObject
   __pyx_v_el = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":321
+  /* "lxml/_elementpath.py":330
  * def findtext(elem, path, default=None, namespaces=None):
  *     el = find(elem, path, namespaces)
  *     if el is None:             # <<<<<<<<<<<<<<
@@ -9688,7 +10090,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_23findtext(CYTHON_UNUSED PyObject
   __pyx_t_7 = (__pyx_t_6 != 0);
   if (__pyx_t_7) {
 
-    /* "lxml/_elementpath.py":322
+    /* "lxml/_elementpath.py":331
  *     el = find(elem, path, namespaces)
  *     if el is None:
  *         return default             # <<<<<<<<<<<<<<
@@ -9700,7 +10102,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_23findtext(CYTHON_UNUSED PyObject
     __pyx_r = __pyx_v_default;
     goto __pyx_L0;
 
-    /* "lxml/_elementpath.py":321
+    /* "lxml/_elementpath.py":330
  * def findtext(elem, path, default=None, namespaces=None):
  *     el = find(elem, path, namespaces)
  *     if el is None:             # <<<<<<<<<<<<<<
@@ -9709,16 +10111,16 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_23findtext(CYTHON_UNUSED PyObject
  */
   }
 
-  /* "lxml/_elementpath.py":324
+  /* "lxml/_elementpath.py":333
  *         return default
  *     else:
  *         return el.text or ''             # <<<<<<<<<<<<<<
  */
   /*else*/ {
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
     if (!__pyx_t_7) {
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     } else {
@@ -9735,7 +10137,7 @@ static PyObject *__pyx_pf_4lxml_12_elementpath_23findtext(CYTHON_UNUSED PyObject
     goto __pyx_L0;
   }
 
-  /* "lxml/_elementpath.py":319
+  /* "lxml/_elementpath.py":328
  * # Find text for first matching object.
  * 
  * def findtext(elem, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
@@ -9835,22 +10237,6 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct__xpath_toke
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct__xpath_tokenizer(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct__xpath_tokenizer *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct__xpath_tokenizer *)o;
-  Py_CLEAR(p->__pyx_v_default_namespace);
-  Py_CLEAR(p->__pyx_v_namespaces);
-  Py_CLEAR(p->__pyx_v_pattern);
-  Py_CLEAR(p->__pyx_v_prefix);
-  Py_CLEAR(p->__pyx_v_tag);
-  Py_CLEAR(p->__pyx_v_token);
-  Py_CLEAR(p->__pyx_v_uri);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_3);
-  Py_CLEAR(p->__pyx_t_4);
-  Py_CLEAR(p->__pyx_t_5);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct__xpath_tokenizer = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml._elementpath.__pyx_scope_struct__xpath_tokenizer", /*tp_name*/
@@ -9879,7 +10265,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct__xpath_to
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct__xpath_tokenizer, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct__xpath_tokenizer, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -10067,17 +10453,6 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_2_select(Py
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_2_select(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_2_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_2_select *)o;
-  Py_CLEAR(p->__pyx_outer_scope);
-  Py_CLEAR(p->__pyx_v_e);
-  Py_CLEAR(p->__pyx_v_elem);
-  Py_CLEAR(p->__pyx_v_result);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_3);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_2_select = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml._elementpath.__pyx_scope_struct_2_select", /*tp_name*/
@@ -10106,7 +10481,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_2_select
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_2_select, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_2_select, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -10189,16 +10564,6 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_3_select(Py
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_3_select(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_3_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_3_select *)o;
-  Py_CLEAR(p->__pyx_v_e);
-  Py_CLEAR(p->__pyx_v_elem);
-  Py_CLEAR(p->__pyx_v_result);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_3);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_3_select = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml._elementpath.__pyx_scope_struct_3_select", /*tp_name*/
@@ -10227,7 +10592,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_3_select
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_3_select, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_3_select, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -10415,17 +10780,6 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_5_select(Py
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_5_select(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_5_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_5_select *)o;
-  Py_CLEAR(p->__pyx_outer_scope);
-  Py_CLEAR(p->__pyx_v_e);
-  Py_CLEAR(p->__pyx_v_elem);
-  Py_CLEAR(p->__pyx_v_result);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_3);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_5_select = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml._elementpath.__pyx_scope_struct_5_select", /*tp_name*/
@@ -10454,7 +10808,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_5_select
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_5_select, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_5_select, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -10533,15 +10887,6 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_6_select(Py
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_6_select(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_6_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_6_select *)o;
-  Py_CLEAR(p->__pyx_v_elem);
-  Py_CLEAR(p->__pyx_v_parent);
-  Py_CLEAR(p->__pyx_v_result);
-  Py_CLEAR(p->__pyx_t_0);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_6_select = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml._elementpath.__pyx_scope_struct_6_select", /*tp_name*/
@@ -10570,7 +10915,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_6_select
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_6_select, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_6_select, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -10765,15 +11110,6 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_8_select(Py
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_8_select(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_8_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_8_select *)o;
-  Py_CLEAR(p->__pyx_outer_scope);
-  Py_CLEAR(p->__pyx_v_elem);
-  Py_CLEAR(p->__pyx_v_result);
-  Py_CLEAR(p->__pyx_t_0);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_8_select = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml._elementpath.__pyx_scope_struct_8_select", /*tp_name*/
@@ -10802,7 +11138,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_8_select
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_8_select, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_8_select, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -10881,15 +11217,6 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_9_select(Py
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_9_select(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_9_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_9_select *)o;
-  Py_CLEAR(p->__pyx_outer_scope);
-  Py_CLEAR(p->__pyx_v_elem);
-  Py_CLEAR(p->__pyx_v_result);
-  Py_CLEAR(p->__pyx_t_0);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_9_select = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml._elementpath.__pyx_scope_struct_9_select", /*tp_name*/
@@ -10918,7 +11245,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_9_select
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_9_select, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_9_select, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -11005,17 +11332,6 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_10_select(P
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_10_select(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_10_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_10_select *)o;
-  Py_CLEAR(p->__pyx_outer_scope);
-  Py_CLEAR(p->__pyx_v__);
-  Py_CLEAR(p->__pyx_v_elem);
-  Py_CLEAR(p->__pyx_v_result);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_3);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_10_select = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml._elementpath.__pyx_scope_struct_10_select", /*tp_name*/
@@ -11044,7 +11360,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_10_select
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_10_select, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_10_select, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -11131,23 +11447,119 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_11_select(P
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_11_select(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_11_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_11_select *)o;
+static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_11_select = {
+  PyVarObject_HEAD_INIT(0, 0)
+  "lxml._elementpath.__pyx_scope_struct_11_select", /*tp_name*/
+  sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_11_select), /*tp_basicsize*/
+  0, /*tp_itemsize*/
+  __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_11_select, /*tp_dealloc*/
+  0, /*tp_print*/
+  0, /*tp_getattr*/
+  0, /*tp_setattr*/
+  #if PY_MAJOR_VERSION < 3
+  0, /*tp_compare*/
+  #endif
+  #if PY_MAJOR_VERSION >= 3
+  0, /*tp_as_async*/
+  #endif
+  0, /*tp_repr*/
+  0, /*tp_as_number*/
+  0, /*tp_as_sequence*/
+  0, /*tp_as_mapping*/
+  0, /*tp_hash*/
+  0, /*tp_call*/
+  0, /*tp_str*/
+  0, /*tp_getattro*/
+  0, /*tp_setattro*/
+  0, /*tp_as_buffer*/
+  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+  0, /*tp_doc*/
+  __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_11_select, /*tp_traverse*/
+  0, /*tp_clear*/
+  0, /*tp_richcompare*/
+  0, /*tp_weaklistoffset*/
+  0, /*tp_iter*/
+  0, /*tp_iternext*/
+  0, /*tp_methods*/
+  0, /*tp_members*/
+  0, /*tp_getset*/
+  0, /*tp_base*/
+  0, /*tp_dict*/
+  0, /*tp_descr_get*/
+  0, /*tp_descr_set*/
+  0, /*tp_dictoffset*/
+  0, /*tp_init*/
+  0, /*tp_alloc*/
+  __pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_11_select, /*tp_new*/
+  0, /*tp_free*/
+  0, /*tp_is_gc*/
+  0, /*tp_bases*/
+  0, /*tp_mro*/
+  0, /*tp_cache*/
+  0, /*tp_subclasses*/
+  0, /*tp_weaklist*/
+  0, /*tp_del*/
+  0, /*tp_version_tag*/
+  #if PY_VERSION_HEX >= 0x030400a1
+  0, /*tp_finalize*/
+  #endif
+};
+
+static struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_12_select[8];
+static int __pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select = 0;
+
+static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_12_select(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+  PyObject *o;
+  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select)))) {
+    o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_12_select[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select];
+    memset(o, 0, sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select));
+    (void) PyObject_INIT(o, t);
+    PyObject_GC_Track(o);
+  } else {
+    o = (*t->tp_alloc)(t, 0);
+    if (unlikely(!o)) return 0;
+  }
+  return o;
+}
+
+static void __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_12_select(PyObject *o) {
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *)o;
+  PyObject_GC_UnTrack(o);
   Py_CLEAR(p->__pyx_outer_scope);
-  Py_CLEAR(p->__pyx_v_e);
   Py_CLEAR(p->__pyx_v_elem);
   Py_CLEAR(p->__pyx_v_result);
   Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_3);
+  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select)))) {
+    __pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_12_select[__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select++] = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *)o);
+  } else {
+    (*Py_TYPE(o)->tp_free)(o);
+  }
+}
+
+static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_12_select(PyObject *o, visitproc v, void *a) {
+  int e;
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *)o;
+  if (p->__pyx_outer_scope) {
+    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
+  }
+  if (p->__pyx_v_elem) {
+    e = (*v)(p->__pyx_v_elem, a); if (e) return e;
+  }
+  if (p->__pyx_v_result) {
+    e = (*v)(p->__pyx_v_result, a); if (e) return e;
+  }
+  if (p->__pyx_t_0) {
+    e = (*v)(p->__pyx_t_0, a); if (e) return e;
+  }
   return 0;
 }
 
-static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_11_select = {
+static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_12_select = {
   PyVarObject_HEAD_INIT(0, 0)
-  "lxml._elementpath.__pyx_scope_struct_11_select", /*tp_name*/
-  sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_11_select), /*tp_basicsize*/
+  "lxml._elementpath.__pyx_scope_struct_12_select", /*tp_name*/
+  sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select), /*tp_basicsize*/
   0, /*tp_itemsize*/
-  __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_11_select, /*tp_dealloc*/
+  __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_12_select, /*tp_dealloc*/
   0, /*tp_print*/
   0, /*tp_getattr*/
   0, /*tp_setattr*/
@@ -11169,8 +11581,8 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_11_select
   0, /*tp_as_buffer*/
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
-  __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_11_select, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_11_select, /*tp_clear*/
+  __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_12_select, /*tp_traverse*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -11185,7 +11597,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_11_select
   0, /*tp_dictoffset*/
   0, /*tp_init*/
   0, /*tp_alloc*/
-  __pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_11_select, /*tp_new*/
+  __pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_12_select, /*tp_new*/
   0, /*tp_free*/
   0, /*tp_is_gc*/
   0, /*tp_bases*/
@@ -11200,14 +11612,14 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_11_select
   #endif
 };
 
-static struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_12_select[8];
-static int __pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select = 0;
+static struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_13_select[8];
+static int __pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13_select = 0;
 
-static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_12_select(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_13_select(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
   PyObject *o;
-  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select)))) {
-    o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_12_select[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select];
-    memset(o, 0, sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select));
+  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13_select > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select)))) {
+    o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_13_select[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13_select];
+    memset(o, 0, sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select));
     (void) PyObject_INIT(o, t);
     PyObject_GC_Track(o);
   } else {
@@ -11217,8 +11629,8 @@ static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_12_select(
   return o;
 }
 
-static void __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_12_select(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *)o;
+static void __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_13_select(PyObject *o) {
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *)o;
   PyObject_GC_UnTrack(o);
   Py_CLEAR(p->__pyx_outer_scope);
   Py_CLEAR(p->__pyx_v_elem);
@@ -11229,16 +11641,16 @@ static void __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_12_select(P
   Py_CLEAR(p->__pyx_t_3);
   Py_CLEAR(p->__pyx_t_4);
   Py_CLEAR(p->__pyx_t_5);
-  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select)))) {
-    __pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_12_select[__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select++] = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *)o);
+  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13_select < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select)))) {
+    __pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_13_select[__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13_select++] = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *)o);
   } else {
     (*Py_TYPE(o)->tp_free)(o);
   }
 }
 
-static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_12_select(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_13_select(PyObject *o, visitproc v, void *a) {
   int e;
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *)o;
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select *)o;
   if (p->__pyx_outer_scope) {
     e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
   }
@@ -11269,26 +11681,12 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_12_select(P
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_12_select(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select *)o;
-  Py_CLEAR(p->__pyx_outer_scope);
-  Py_CLEAR(p->__pyx_v_elem);
-  Py_CLEAR(p->__pyx_v_elems);
-  Py_CLEAR(p->__pyx_v_parent);
-  Py_CLEAR(p->__pyx_v_result);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_3);
-  Py_CLEAR(p->__pyx_t_4);
-  Py_CLEAR(p->__pyx_t_5);
-  return 0;
-}
-
-static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_12_select = {
+static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_13_select = {
   PyVarObject_HEAD_INIT(0, 0)
-  "lxml._elementpath.__pyx_scope_struct_12_select", /*tp_name*/
-  sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_12_select), /*tp_basicsize*/
+  "lxml._elementpath.__pyx_scope_struct_13_select", /*tp_name*/
+  sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13_select), /*tp_basicsize*/
   0, /*tp_itemsize*/
-  __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_12_select, /*tp_dealloc*/
+  __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_13_select, /*tp_dealloc*/
   0, /*tp_print*/
   0, /*tp_getattr*/
   0, /*tp_setattr*/
@@ -11310,8 +11708,8 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_12_select
   0, /*tp_as_buffer*/
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
-  __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_12_select, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_12_select, /*tp_clear*/
+  __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_13_select, /*tp_traverse*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -11326,7 +11724,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_12_select
   0, /*tp_dictoffset*/
   0, /*tp_init*/
   0, /*tp_alloc*/
-  __pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_12_select, /*tp_new*/
+  __pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_13_select, /*tp_new*/
   0, /*tp_free*/
   0, /*tp_is_gc*/
   0, /*tp_bases*/
@@ -11341,14 +11739,14 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_12_select
   #endif
 };
 
-static struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator[8];
-static int __pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator = 0;
+static struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator[8];
+static int __pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator = 0;
 
-static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
   PyObject *o;
-  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator)))) {
-    o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator];
-    memset(o, 0, sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator));
+  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator)))) {
+    o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator];
+    memset(o, 0, sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator));
     (void) PyObject_INIT(o, t);
     PyObject_GC_Track(o);
   } else {
@@ -11358,38 +11756,38 @@ static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_13__build_
   return o;
 }
 
-static void __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *)o;
+static void __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator(PyObject *o) {
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *)o;
   PyObject_GC_UnTrack(o);
   Py_CLEAR(p->__pyx_v_namespaces);
-  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator)))) {
-    __pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator[__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator++] = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *)o);
+  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator)))) {
+    __pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator[__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator++] = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *)o);
   } else {
     (*Py_TYPE(o)->tp_free)(o);
   }
 }
 
-static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator(PyObject *o, visitproc v, void *a) {
   int e;
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *)o;
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *)o;
   if (p->__pyx_v_namespaces) {
     e = (*v)(p->__pyx_v_namespaces, a); if (e) return e;
   }
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator *)o;
+static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator(PyObject *o) {
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator *)o;
   Py_CLEAR(p->__pyx_v_namespaces);
   return 0;
 }
 
-static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator = {
+static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator = {
   PyVarObject_HEAD_INIT(0, 0)
-  "lxml._elementpath.__pyx_scope_struct_13__build_path_iterator", /*tp_name*/
-  sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator), /*tp_basicsize*/
+  "lxml._elementpath.__pyx_scope_struct_14__build_path_iterator", /*tp_name*/
+  sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator), /*tp_basicsize*/
   0, /*tp_itemsize*/
-  __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator, /*tp_dealloc*/
+  __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator, /*tp_dealloc*/
   0, /*tp_print*/
   0, /*tp_getattr*/
   0, /*tp_setattr*/
@@ -11411,8 +11809,8 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_13__build
   0, /*tp_as_buffer*/
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
-  __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator, /*tp_clear*/
+  __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator, /*tp_traverse*/
+  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -11427,7 +11825,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_13__build
   0, /*tp_dictoffset*/
   0, /*tp_init*/
   0, /*tp_alloc*/
-  __pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator, /*tp_new*/
+  __pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator, /*tp_new*/
   0, /*tp_free*/
   0, /*tp_is_gc*/
   0, /*tp_bases*/
@@ -11442,14 +11840,14 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_13__build
   #endif
 };
 
-static struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_14_genexpr[8];
-static int __pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14_genexpr = 0;
+static struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_15_genexpr[8];
+static int __pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_15_genexpr = 0;
 
-static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_15_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
   PyObject *o;
-  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr)))) {
-    o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_14_genexpr[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14_genexpr];
-    memset(o, 0, sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr));
+  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_15_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr)))) {
+    o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_15_genexpr[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_15_genexpr];
+    memset(o, 0, sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr));
     (void) PyObject_INIT(o, t);
     PyObject_GC_Track(o);
   } else {
@@ -11459,21 +11857,21 @@ static PyObject *__pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_14_genexpr
   return o;
 }
 
-static void __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_14_genexpr(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *)o;
+static void __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_15_genexpr(PyObject *o) {
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *)o;
   PyObject_GC_UnTrack(o);
   Py_CLEAR(p->__pyx_outer_scope);
   Py_CLEAR(p->__pyx_v_item);
-  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr)))) {
-    __pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_14_genexpr[__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *)o);
+  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_15_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr)))) {
+    __pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_15_genexpr[__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_15_genexpr++] = ((struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *)o);
   } else {
     (*Py_TYPE(o)->tp_free)(o);
   }
 }
 
-static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_15_genexpr(PyObject *o, visitproc v, void *a) {
   int e;
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *)o;
+  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr *)o;
   if (p->__pyx_outer_scope) {
     e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
   }
@@ -11483,19 +11881,12 @@ static int __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_14_genexpr(
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_14_genexpr(PyObject *o) {
-  struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr *)o;
-  Py_CLEAR(p->__pyx_outer_scope);
-  Py_CLEAR(p->__pyx_v_item);
-  return 0;
-}
-
-static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_14_genexpr = {
+static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_15_genexpr = {
   PyVarObject_HEAD_INIT(0, 0)
-  "lxml._elementpath.__pyx_scope_struct_14_genexpr", /*tp_name*/
-  sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_14_genexpr), /*tp_basicsize*/
+  "lxml._elementpath.__pyx_scope_struct_15_genexpr", /*tp_name*/
+  sizeof(struct __pyx_obj_4lxml_12_elementpath___pyx_scope_struct_15_genexpr), /*tp_basicsize*/
   0, /*tp_itemsize*/
-  __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_14_genexpr, /*tp_dealloc*/
+  __pyx_tp_dealloc_4lxml_12_elementpath___pyx_scope_struct_15_genexpr, /*tp_dealloc*/
   0, /*tp_print*/
   0, /*tp_getattr*/
   0, /*tp_setattr*/
@@ -11517,8 +11908,8 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_14_genexp
   0, /*tp_as_buffer*/
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
-  __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_14_genexpr, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_12_elementpath___pyx_scope_struct_14_genexpr, /*tp_clear*/
+  __pyx_tp_traverse_4lxml_12_elementpath___pyx_scope_struct_15_genexpr, /*tp_traverse*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -11533,7 +11924,7 @@ static PyTypeObject __pyx_type_4lxml_12_elementpath___pyx_scope_struct_14_genexp
   0, /*tp_dictoffset*/
   0, /*tp_init*/
   0, /*tp_alloc*/
-  __pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_14_genexpr, /*tp_new*/
+  __pyx_tp_new_4lxml_12_elementpath___pyx_scope_struct_15_genexpr, /*tp_new*/
   0, /*tp_free*/
   0, /*tp_is_gc*/
   0, /*tp_bases*/
@@ -11553,17 +11944,31 @@ static PyMethodDef __pyx_methods[] = {
 };
 
 #if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec__elementpath(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+  {Py_mod_create, (void*)__pyx_pymod_create},
+  {Py_mod_exec, (void*)__pyx_pymod_exec__elementpath},
+  {0, NULL}
+};
+#endif
+
 static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
     PyModuleDef_HEAD_INIT,
-  #endif
     "_elementpath",
     0, /* m_doc */
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    0, /* m_size */
+  #else
     -1, /* m_size */
+  #endif
     __pyx_methods /* m_methods */,
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    __pyx_moduledef_slots, /* m_slots */
+  #else
     NULL, /* m_reload */
+  #endif
     NULL, /* m_traverse */
     NULL, /* m_clear */
     (freefunc)__pyx_module_cleanup /* m_free */
@@ -11580,23 +11985,23 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_kp_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 0},
   {&__pyx_kp_s__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 1, 0},
   {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
-  {&__pyx_kp_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 0},
   {&__pyx_kp_s__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 0},
-  {&__pyx_kp_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 0},
+  {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
   {&__pyx_kp_s__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 1, 0},
-  {&__pyx_kp_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 0},
+  {&__pyx_kp_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 0},
+  {&__pyx_kp_s__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 1, 0},
   {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
-  {&__pyx_n_s__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 0, 1, 1},
-  {&__pyx_kp_s__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 0},
-  {&__pyx_kp_s__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 1, 0},
-  {&__pyx_kp_s__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 1, 0},
-  {&__pyx_kp_s__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 0, 1, 0},
-  {&__pyx_kp_s__69, __pyx_k__69, sizeof(__pyx_k__69), 0, 0, 1, 0},
+  {&__pyx_n_s__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 1, 1},
+  {&__pyx_kp_s__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 0, 1, 0},
+  {&__pyx_kp_s__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 1, 0},
+  {&__pyx_kp_s__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 0, 1, 0},
+  {&__pyx_kp_s__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 0, 1, 0},
+  {&__pyx_kp_s__51, __pyx_k__51, sizeof(__pyx_k__51), 0, 0, 1, 0},
   {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0},
-  {&__pyx_kp_s__70, __pyx_k__70, sizeof(__pyx_k__70), 0, 0, 1, 0},
-  {&__pyx_kp_s__71, __pyx_k__71, sizeof(__pyx_k__71), 0, 0, 1, 0},
-  {&__pyx_kp_s__72, __pyx_k__72, sizeof(__pyx_k__72), 0, 0, 1, 0},
-  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
+  {&__pyx_kp_s__73, __pyx_k__73, sizeof(__pyx_k__73), 0, 0, 1, 0},
+  {&__pyx_kp_s__74, __pyx_k__74, sizeof(__pyx_k__74), 0, 0, 1, 0},
+  {&__pyx_kp_s__75, __pyx_k__75, sizeof(__pyx_k__75), 0, 0, 1, 0},
+  {&__pyx_kp_s__76, __pyx_k__76, sizeof(__pyx_k__76), 0, 0, 1, 0},
   {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
   {&__pyx_n_s_build_path_iterator, __pyx_k_build_path_iterator, sizeof(__pyx_k_build_path_iterator), 0, 0, 1, 1},
   {&__pyx_n_s_build_path_iterator_locals_gene, __pyx_k_build_path_iterator_locals_gene, sizeof(__pyx_k_build_path_iterator_locals_gene), 0, 0, 1, 1},
@@ -11691,10 +12096,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
 static int __Pyx_InitCachedBuiltins(void) {
   __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 79, __pyx_L1_error)
   __pyx_builtin_SyntaxError = __Pyx_GetBuiltinName(__pyx_n_s_SyntaxError); if (!__pyx_builtin_SyntaxError) __PYX_ERR(0, 82, __pyx_L1_error)
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 203, __pyx_L1_error)
-  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 217, __pyx_L1_error)
-  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 264, __pyx_L1_error)
-  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 269, __pyx_L1_error)
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 212, __pyx_L1_error)
+  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 226, __pyx_L1_error)
+  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 273, __pyx_L1_error)
+  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 278, __pyx_L1_error)
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -11736,7 +12141,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_result, __pyx_n_s_elem, __pyx_n_s_e); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 93, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__5);
   __Pyx_GIVEREF(__pyx_tuple__5);
-  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 93, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 93, __pyx_L1_error)
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 93, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 93, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":102
  *     def select(result):
@@ -11759,7 +12164,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_result, __pyx_n_s_elem, __pyx_n_s_e); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 100, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__9);
   __Pyx_GIVEREF(__pyx_tuple__9);
-  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 100, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":107
  * 
@@ -11771,7 +12176,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_result); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 107, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__11);
   __Pyx_GIVEREF(__pyx_tuple__11);
-  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 107, __pyx_L1_error)
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 107, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":118
  *         tag = token[1]
@@ -11794,7 +12199,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_result, __pyx_n_s_elem, __pyx_n_s_e); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 119, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__14);
   __Pyx_GIVEREF(__pyx_tuple__14);
-  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 119, __pyx_L1_error)
+  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 119, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":126
  * 
@@ -11806,210 +12211,233 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_result, __pyx_n_s_elem, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 126, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__16);
   __Pyx_GIVEREF(__pyx_tuple__16);
-  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 126, __pyx_L1_error)
+  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 126, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":143
  *         if token[0] == "]":
  *             break
+ *         if token == ('', ''):             # <<<<<<<<<<<<<<
+ *             # ignore whitespace
+ *             continue
+ */
+  __pyx_tuple__20 = PyTuple_Pack(2, __pyx_kp_s__18, __pyx_kp_s__18); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__20);
+  __Pyx_GIVEREF(__pyx_tuple__20);
+
+  /* "lxml/_elementpath.py":146
+ *             # ignore whitespace
+ *             continue
  *         if token[0] and token[0][:1] in "'\"":             # <<<<<<<<<<<<<<
  *             token = "'", token[0][1:-1]
- *         signature.append(token[0] or "-")
+ *         signature += token[0] or "-"
  */
-  __pyx_slice__20 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 143, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__20);
-  __Pyx_GIVEREF(__pyx_slice__20);
+  __pyx_slice__21 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__21);
+  __Pyx_GIVEREF(__pyx_slice__21);
 
-  /* "lxml/_elementpath.py":144
- *             break
+  /* "lxml/_elementpath.py":147
+ *             continue
  *         if token[0] and token[0][:1] in "'\"":
  *             token = "'", token[0][1:-1]             # <<<<<<<<<<<<<<
- *         signature.append(token[0] or "-")
+ *         signature += token[0] or "-"
  *         predicate.append(token[1])
  */
-  __pyx_slice__23 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(0, 144, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__23);
-  __Pyx_GIVEREF(__pyx_slice__23);
+  __pyx_slice__24 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(0, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__24);
+  __Pyx_GIVEREF(__pyx_slice__24);
 
-  /* "lxml/_elementpath.py":152
+  /* "lxml/_elementpath.py":155
  *         # [@attribute] predicate
  *         key = predicate[1]
  *         def select(result):             # <<<<<<<<<<<<<<
  *             for elem in result:
  *                 if elem.get(key) is not None:
  */
-  __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_result, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 152, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__26);
-  __Pyx_GIVEREF(__pyx_tuple__26);
-  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_result, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 155, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":161
+  /* "lxml/_elementpath.py":164
  *         key = predicate[1]
  *         value = predicate[-1]
  *         def select(result):             # <<<<<<<<<<<<<<
  *             for elem in result:
  *                 if elem.get(key) == value:
  */
-  __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_result, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 161, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__29);
-  __Pyx_GIVEREF(__pyx_tuple__29);
-  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_result, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 164, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__30);
+  __Pyx_GIVEREF(__pyx_tuple__30);
+  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 164, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":169
+  /* "lxml/_elementpath.py":172
  *         # [tag]
  *         tag = predicate[0]
  *         def select(result):             # <<<<<<<<<<<<<<
  *             for elem in result:
  *                 for _ in elem.iterchildren(tag):
  */
-  __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_result, __pyx_n_s_elem, __pyx_n_s__31); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 169, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
-  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_result, __pyx_n_s_elem, __pyx_n_s__32); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 172, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
+  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 172, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":179
- *         tag = predicate[0]
+  /* "lxml/_elementpath.py":183
  *         value = predicate[-1]
- *         def select(result):             # <<<<<<<<<<<<<<
- *             for elem in result:
- *                 for e in elem.iterchildren(tag):
+ *         if tag:
+ *             def select(result):             # <<<<<<<<<<<<<<
+ *                 for elem in result:
+ *                     for e in elem.iterchildren(tag):
+ */
+  __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_result, __pyx_n_s_elem, __pyx_n_s_e); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
+  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 183, __pyx_L1_error)
+
+  /* "lxml/_elementpath.py":190
+ *                             break
+ *         else:
+ *             def select(result):             # <<<<<<<<<<<<<<
+ *                 for elem in result:
+ *                     if "".join(elem.itertext()) == value:
  */
-  __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_result, __pyx_n_s_elem, __pyx_n_s_e); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 179, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__35);
-  __Pyx_GIVEREF(__pyx_tuple__35);
-  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_result, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__39);
+  __Pyx_GIVEREF(__pyx_tuple__39);
+  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 190, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":193
+  /* "lxml/_elementpath.py":202
  *             if index < 0:
  *                 if index == -1:
  *                     raise SyntaxError(             # <<<<<<<<<<<<<<
  *                         "indices in path predicates are 1-based, not 0-based")
  *                 else:
  */
-  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_indices_in_path_predicates_are_1); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 193, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__39);
-  __Pyx_GIVEREF(__pyx_tuple__39);
+  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_indices_in_path_predicates_are_1); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__43);
+  __Pyx_GIVEREF(__pyx_tuple__43);
 
-  /* "lxml/_elementpath.py":196
+  /* "lxml/_elementpath.py":205
  *                         "indices in path predicates are 1-based, not 0-based")
  *                 else:
  *                     raise SyntaxError("path index >= 1 expected")             # <<<<<<<<<<<<<<
  *         else:
  *             if predicate[0] != "last":
  */
-  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_path_index_1_expected); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 196, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__40);
-  __Pyx_GIVEREF(__pyx_tuple__40);
+  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_path_index_1_expected); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 205, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__44);
+  __Pyx_GIVEREF(__pyx_tuple__44);
 
-  /* "lxml/_elementpath.py":199
+  /* "lxml/_elementpath.py":208
  *         else:
  *             if predicate[0] != "last":
  *                 raise SyntaxError("unsupported function")             # <<<<<<<<<<<<<<
  *             if signature == "-()-":
  *                 try:
  */
-  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_unsupported_function); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 199, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__41);
-  __Pyx_GIVEREF(__pyx_tuple__41);
+  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_unsupported_function); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 208, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__45);
+  __Pyx_GIVEREF(__pyx_tuple__45);
 
-  /* "lxml/_elementpath.py":204
+  /* "lxml/_elementpath.py":213
  *                     index = int(predicate[2]) - 1
  *                 except ValueError:
  *                     raise SyntaxError("unsupported expression")             # <<<<<<<<<<<<<<
  *             else:
  *                 index = -1
  */
-  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_unsupported_expression); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 204, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__42);
-  __Pyx_GIVEREF(__pyx_tuple__42);
+  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_unsupported_expression); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 213, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__46);
+  __Pyx_GIVEREF(__pyx_tuple__46);
 
-  /* "lxml/_elementpath.py":207
+  /* "lxml/_elementpath.py":216
  *             else:
  *                 index = -1
  *         def select(result):             # <<<<<<<<<<<<<<
  *             for elem in result:
  *                 parent = elem.getparent()
  */
-  __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_s_result, __pyx_n_s_elem, __pyx_n_s_parent, __pyx_n_s_elems); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 207, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__43);
-  __Pyx_GIVEREF(__pyx_tuple__43);
-  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 207, __pyx_L1_error)
+  __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_result, __pyx_n_s_elem, __pyx_n_s_parent, __pyx_n_s_elems); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 216, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
+  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_select, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 216, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":220
+  /* "lxml/_elementpath.py":229
  *                     pass
  *         return select
  *     raise SyntaxError("invalid predicate")             # <<<<<<<<<<<<<<
  * 
  * ops = {
  */
-  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_invalid_predicate); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 220, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__45);
-  __Pyx_GIVEREF(__pyx_tuple__45);
+  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_invalid_predicate); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 229, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
 
-  /* "lxml/_elementpath.py":239
+  /* "lxml/_elementpath.py":248
  * def _build_path_iterator(path, namespaces):
  *     """compile selector pattern"""
  *     if path[-1:] == "/":             # <<<<<<<<<<<<<<
  *         path += "*"  # implicit all (FIXME: keep this?)
  * 
  */
-  __pyx_slice__46 = PySlice_New(__pyx_int_neg_1, Py_None, Py_None); if (unlikely(!__pyx_slice__46)) __PYX_ERR(0, 239, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__46);
-  __Pyx_GIVEREF(__pyx_slice__46);
+  __pyx_slice__50 = PySlice_New(__pyx_int_neg_1, Py_None, Py_None); if (unlikely(!__pyx_slice__50)) __PYX_ERR(0, 248, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__50);
+  __Pyx_GIVEREF(__pyx_slice__50);
 
-  /* "lxml/_elementpath.py":245
+  /* "lxml/_elementpath.py":254
  *     if namespaces:
  *         if '' in namespaces:
  *             raise ValueError("empty namespace prefix must be passed as None, not the empty string")             # <<<<<<<<<<<<<<
  *         if None in namespaces:
  *             cache_key += (namespaces[None],) + tuple(sorted(
  */
-  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_empty_namespace_prefix_must_be_p); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 245, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__48);
-  __Pyx_GIVEREF(__pyx_tuple__48);
+  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_empty_namespace_prefix_must_be_p); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 254, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__52);
+  __Pyx_GIVEREF(__pyx_tuple__52);
 
-  /* "lxml/_elementpath.py":259
+  /* "lxml/_elementpath.py":268
  *         _cache.clear()
  * 
  *     if path[:1] == "/":             # <<<<<<<<<<<<<<
  *         raise SyntaxError("cannot use absolute path on element")
  *     stream = iter(xpath_tokenizer(path, namespaces))
  */
-  __pyx_slice__49 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__49)) __PYX_ERR(0, 259, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__49);
-  __Pyx_GIVEREF(__pyx_slice__49);
+  __pyx_slice__53 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__53)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__53);
+  __Pyx_GIVEREF(__pyx_slice__53);
 
-  /* "lxml/_elementpath.py":260
+  /* "lxml/_elementpath.py":269
  * 
  *     if path[:1] == "/":
  *         raise SyntaxError("cannot use absolute path on element")             # <<<<<<<<<<<<<<
  *     stream = iter(xpath_tokenizer(path, namespaces))
  *     try:
  */
-  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_cannot_use_absolute_path_on_elem); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 260, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__50);
-  __Pyx_GIVEREF(__pyx_tuple__50);
+  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_cannot_use_absolute_path_on_elem); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 269, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__54);
+  __Pyx_GIVEREF(__pyx_tuple__54);
 
-  /* "lxml/_elementpath.py":270
+  /* "lxml/_elementpath.py":279
  *         token = _next()
  *     except StopIteration:
  *         raise SyntaxError("empty path expression")             # <<<<<<<<<<<<<<
  *     selector = []
  *     while 1:
  */
-  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_empty_path_expression); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 270, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__51);
-  __Pyx_GIVEREF(__pyx_tuple__51);
+  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_empty_path_expression); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 279, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__55);
+  __Pyx_GIVEREF(__pyx_tuple__55);
 
-  /* "lxml/_elementpath.py":276
+  /* "lxml/_elementpath.py":285
  *             selector.append(ops[token[0]](_next, token))
  *         except StopIteration:
  *             raise SyntaxError("invalid path")             # <<<<<<<<<<<<<<
  *         try:
  *             token = _next()
  */
-  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_invalid_path); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 276, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__52);
-  __Pyx_GIVEREF(__pyx_tuple__52);
+  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_invalid_path); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 285, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__56);
+  __Pyx_GIVEREF(__pyx_tuple__56);
 
   /* "lxml/_elementpath.py":58
  * import re
@@ -12018,9 +12446,9 @@ static int __Pyx_InitCachedConstants(void) {
  *     "("
  *     "'[^']*'|\"[^\"]*\"|"
  */
-  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_s_s_2); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 58, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__53);
-  __Pyx_GIVEREF(__pyx_tuple__53);
+  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_s_s_2); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__57);
+  __Pyx_GIVEREF(__pyx_tuple__57);
 
   /* "lxml/_elementpath.py":70
  *     )
@@ -12029,13 +12457,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     default_namespace = namespaces.get(None) if namespaces else None
  *     for token in xpath_tokenizer_re.findall(pattern):
  */
-  __pyx_tuple__54 = PyTuple_Pack(7, __pyx_n_s_pattern, __pyx_n_s_namespaces, __pyx_n_s_default_namespace, __pyx_n_s_token, __pyx_n_s_tag, __pyx_n_s_prefix, __pyx_n_s_uri); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 70, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__54);
-  __Pyx_GIVEREF(__pyx_tuple__54);
-  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_xpath_tokenizer, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 70, __pyx_L1_error)
-  __pyx_tuple__56 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 70, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__56);
-  __Pyx_GIVEREF(__pyx_tuple__56);
+  __pyx_tuple__58 = PyTuple_Pack(7, __pyx_n_s_pattern, __pyx_n_s_namespaces, __pyx_n_s_default_namespace, __pyx_n_s_token, __pyx_n_s_tag, __pyx_n_s_prefix, __pyx_n_s_uri); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__58);
+  __Pyx_GIVEREF(__pyx_tuple__58);
+  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_xpath_tokenizer, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __pyx_tuple__60 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__60);
+  __Pyx_GIVEREF(__pyx_tuple__60);
 
   /* "lxml/_elementpath.py":91
  * 
@@ -12044,10 +12472,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     tag = token[1]
  *     def select(result):
  */
-  __pyx_tuple__57 = PyTuple_Pack(5, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_tag, __pyx_n_s_select, __pyx_n_s_select); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 91, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__57);
-  __Pyx_GIVEREF(__pyx_tuple__57);
-  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_child, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __pyx_tuple__61 = PyTuple_Pack(5, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_tag, __pyx_n_s_select, __pyx_n_s_select); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__61);
+  __Pyx_GIVEREF(__pyx_tuple__61);
+  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_child, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 91, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":99
  *     return select
@@ -12056,10 +12484,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     def select(result):
  *         for elem in result:
  */
-  __pyx_tuple__59 = PyTuple_Pack(4, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_select, __pyx_n_s_select); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 99, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__59);
-  __Pyx_GIVEREF(__pyx_tuple__59);
-  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_star, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __pyx_tuple__63 = PyTuple_Pack(4, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_select, __pyx_n_s_select); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__63);
+  __Pyx_GIVEREF(__pyx_tuple__63);
+  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_star, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 99, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":106
  *     return select
@@ -12068,10 +12496,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     def select(result):
  *         return result
  */
-  __pyx_tuple__61 = PyTuple_Pack(4, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_select, __pyx_n_s_select); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 106, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__61);
-  __Pyx_GIVEREF(__pyx_tuple__61);
-  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_self, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __pyx_tuple__65 = PyTuple_Pack(4, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_select, __pyx_n_s_select); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__65);
+  __Pyx_GIVEREF(__pyx_tuple__65);
+  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_self, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 106, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":111
  *     return select
@@ -12080,10 +12508,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     token = next()
  *     if token[0] == "*":
  */
-  __pyx_tuple__63 = PyTuple_Pack(5, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_tag, __pyx_n_s_select, __pyx_n_s_select); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 111, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__63);
-  __Pyx_GIVEREF(__pyx_tuple__63);
-  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_descendant, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __pyx_tuple__67 = PyTuple_Pack(5, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_tag, __pyx_n_s_select, __pyx_n_s_select); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__67);
+  __Pyx_GIVEREF(__pyx_tuple__67);
+  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_descendant, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 111, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":125
  *     return select
@@ -12092,10 +12520,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     def select(result):
  *         for elem in result:
  */
-  __pyx_tuple__65 = PyTuple_Pack(4, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_select, __pyx_n_s_select); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 125, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__65);
-  __Pyx_GIVEREF(__pyx_tuple__65);
-  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_parent, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __pyx_tuple__69 = PyTuple_Pack(4, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_select, __pyx_n_s_select); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__69);
+  __Pyx_GIVEREF(__pyx_tuple__69);
+  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_parent, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 125, __pyx_L1_error)
 
   /* "lxml/_elementpath.py":133
  *     return select
@@ -12104,82 +12532,82 @@ static int __Pyx_InitCachedConstants(void) {
  *     # FIXME: replace with real parser!!! refs:
  *     # http://effbot.org/zone/simple-iterator-parser.htm
  */
-  __pyx_tuple__67 = PyTuple_Pack(14, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_signature, __pyx_n_s_predicate, __pyx_n_s_key, __pyx_n_s_select, __pyx_n_s_select, __pyx_n_s_value, __pyx_n_s_select, __pyx_n_s_tag, __pyx_n_s_select, __pyx_n_s_select, __pyx_n_s_index, __pyx_n_s_select); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 133, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__67);
-  __Pyx_GIVEREF(__pyx_tuple__67);
-  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_predicate, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __pyx_tuple__71 = PyTuple_Pack(15, __pyx_n_s_next, __pyx_n_s_token, __pyx_n_s_signature, __pyx_n_s_predicate, __pyx_n_s_key, __pyx_n_s_select, __pyx_n_s_select, __pyx_n_s_value, __pyx_n_s_select, __pyx_n_s_tag, __pyx_n_s_select, __pyx_n_s_select, __pyx_n_s_select, __pyx_n_s_index, __pyx_n_s_select); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__71);
+  __Pyx_GIVEREF(__pyx_tuple__71);
+  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_prepare_predicate, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 133, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":237
+  /* "lxml/_elementpath.py":246
  * 
  * 
  * def _build_path_iterator(path, namespaces):             # <<<<<<<<<<<<<<
  *     """compile selector pattern"""
  *     if path[-1:] == "/":
  */
-  __pyx_tuple__73 = PyTuple_Pack(9, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_cache_key, __pyx_n_s_stream, __pyx_n_s_next_3, __pyx_n_s_token, __pyx_n_s_selector, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 237, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__73);
-  __Pyx_GIVEREF(__pyx_tuple__73);
-  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_build_path_iterator, 237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 237, __pyx_L1_error)
+  __pyx_tuple__77 = PyTuple_Pack(9, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_cache_key, __pyx_n_s_stream, __pyx_n_s_next_3, __pyx_n_s_token, __pyx_n_s_selector, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 246, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__77);
+  __Pyx_GIVEREF(__pyx_tuple__77);
+  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_build_path_iterator, 246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 246, __pyx_L1_error)
 
-  /* "lxml/_elementpath.py":290
+  /* "lxml/_elementpath.py":299
  * # Iterate over the matching nodes
  * 
  * def iterfind(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
  *     selector = _build_path_iterator(path, namespaces)
  *     result = iter((elem,))
  */
-  __pyx_tuple__75 = PyTuple_Pack(6, __pyx_n_s_elem, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_selector, __pyx_n_s_result, __pyx_n_s_select); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 290, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__75);
-  __Pyx_GIVEREF(__pyx_tuple__75);
-  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_iterfind, 290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 290, __pyx_L1_error)
-  __pyx_tuple__77 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 290, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__77);
-  __Pyx_GIVEREF(__pyx_tuple__77);
+  __pyx_tuple__79 = PyTuple_Pack(6, __pyx_n_s_elem, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_selector, __pyx_n_s_result, __pyx_n_s_select); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__79);
+  __Pyx_GIVEREF(__pyx_tuple__79);
+  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_iterfind, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 299, __pyx_L1_error)
+  __pyx_tuple__81 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__81);
+  __Pyx_GIVEREF(__pyx_tuple__81);
 
-  /* "lxml/_elementpath.py":301
+  /* "lxml/_elementpath.py":310
  * # Find first matching object.
  * 
  * def find(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
  *     it = iterfind(elem, path, namespaces)
  *     try:
  */
-  __pyx_tuple__78 = PyTuple_Pack(4, __pyx_n_s_elem, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_it); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 301, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__78);
-  __Pyx_GIVEREF(__pyx_tuple__78);
-  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_find, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 301, __pyx_L1_error)
-  __pyx_tuple__80 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 301, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__80);
-  __Pyx_GIVEREF(__pyx_tuple__80);
+  __pyx_tuple__82 = PyTuple_Pack(4, __pyx_n_s_elem, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_it); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 310, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__82);
+  __Pyx_GIVEREF(__pyx_tuple__82);
+  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_find, 310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 310, __pyx_L1_error)
+  __pyx_tuple__84 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 310, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__84);
+  __Pyx_GIVEREF(__pyx_tuple__84);
 
-  /* "lxml/_elementpath.py":312
+  /* "lxml/_elementpath.py":321
  * # Find all matching objects.
  * 
  * def findall(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
  *     return list(iterfind(elem, path, namespaces))
  * 
  */
-  __pyx_tuple__81 = PyTuple_Pack(3, __pyx_n_s_elem, __pyx_n_s_path, __pyx_n_s_namespaces); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 312, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__81);
-  __Pyx_GIVEREF(__pyx_tuple__81);
-  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_findall, 312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 312, __pyx_L1_error)
-  __pyx_tuple__83 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 312, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__83);
-  __Pyx_GIVEREF(__pyx_tuple__83);
+  __pyx_tuple__85 = PyTuple_Pack(3, __pyx_n_s_elem, __pyx_n_s_path, __pyx_n_s_namespaces); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 321, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__85);
+  __Pyx_GIVEREF(__pyx_tuple__85);
+  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_findall, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 321, __pyx_L1_error)
+  __pyx_tuple__87 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 321, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__87);
+  __Pyx_GIVEREF(__pyx_tuple__87);
 
-  /* "lxml/_elementpath.py":319
+  /* "lxml/_elementpath.py":328
  * # Find text for first matching object.
  * 
  * def findtext(elem, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
  *     el = find(elem, path, namespaces)
  *     if el is None:
  */
-  __pyx_tuple__84 = PyTuple_Pack(5, __pyx_n_s_elem, __pyx_n_s_path, __pyx_n_s_default, __pyx_n_s_namespaces, __pyx_n_s_el); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 319, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__84);
-  __Pyx_GIVEREF(__pyx_tuple__84);
-  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_findtext, 319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 319, __pyx_L1_error)
-  __pyx_tuple__86 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 319, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__86);
-  __Pyx_GIVEREF(__pyx_tuple__86);
+  __pyx_tuple__88 = PyTuple_Pack(5, __pyx_n_s_elem, __pyx_n_s_path, __pyx_n_s_default, __pyx_n_s_namespaces, __pyx_n_s_el); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 328, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__88);
+  __Pyx_GIVEREF(__pyx_tuple__88);
+  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml__elementpath_py, __pyx_n_s_findtext, 328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 328, __pyx_L1_error)
+  __pyx_tuple__90 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 328, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__90);
+  __Pyx_GIVEREF(__pyx_tuple__90);
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -12203,11 +12631,55 @@ PyMODINIT_FUNC init_elementpath(void)
 #else
 PyMODINIT_FUNC PyInit__elementpath(void); /*proto*/
 PyMODINIT_FUNC PyInit__elementpath(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+  return PyModuleDef_Init(&__pyx_moduledef);
+}
+static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
+    PyObject *value = PyObject_GetAttrString(spec, from_name);
+    int result = 0;
+    if (likely(value)) {
+        result = PyDict_SetItemString(moddict, to_name, value);
+        Py_DECREF(value);
+    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+        PyErr_Clear();
+    } else {
+        result = -1;
+    }
+    return result;
+}
+static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+    PyObject *module = NULL, *moddict, *modname;
+    if (__pyx_m)
+        return __Pyx_NewRef(__pyx_m);
+    modname = PyObject_GetAttrString(spec, "name");
+    if (unlikely(!modname)) goto bad;
+    module = PyModule_NewObject(modname);
+    Py_DECREF(modname);
+    if (unlikely(!module)) goto bad;
+    moddict = PyModule_GetDict(module);
+    if (unlikely(!moddict)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
+    return module;
+bad:
+    Py_XDECREF(module);
+    return NULL;
+}
+
+
+static int __pyx_pymod_exec__elementpath(PyObject *__pyx_pyinit_module)
+#endif
 #endif
 {
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannyDeclarations
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
+  #endif
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
   if (!__Pyx_RefNanny) {
@@ -12234,6 +12706,9 @@ PyMODINIT_FUNC PyInit__elementpath(void)
   #ifdef __Pyx_Generator_USED
   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
+  #ifdef __Pyx_AsyncGen_USED
+  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   #ifdef __Pyx_StopAsyncIteration_USED
   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
@@ -12245,12 +12720,17 @@ PyMODINIT_FUNC PyInit__elementpath(void)
   #endif
   #endif
   /*--- Module creation code ---*/
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  __pyx_m = __pyx_pyinit_module;
+  Py_INCREF(__pyx_m);
+  #else
   #if PY_MAJOR_VERSION < 3
   __pyx_m = Py_InitModule4("_elementpath", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
   Py_INCREF(__pyx_d);
   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
@@ -12307,27 +12787,30 @@ PyMODINIT_FUNC PyInit__elementpath(void)
   if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_7_prepare_predicate) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
   __pyx_type_4lxml_12_elementpath___pyx_scope_struct_7_prepare_predicate.tp_print = 0;
   __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_7_prepare_predicate = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_7_prepare_predicate;
-  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_8_select) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_8_select) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
   __pyx_type_4lxml_12_elementpath___pyx_scope_struct_8_select.tp_print = 0;
   __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_8_select = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_8_select;
-  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_9_select) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_9_select) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
   __pyx_type_4lxml_12_elementpath___pyx_scope_struct_9_select.tp_print = 0;
   __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_9_select = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_9_select;
-  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_10_select) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_10_select) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
   __pyx_type_4lxml_12_elementpath___pyx_scope_struct_10_select.tp_print = 0;
   __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_10_select = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_10_select;
-  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_11_select) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_11_select) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
   __pyx_type_4lxml_12_elementpath___pyx_scope_struct_11_select.tp_print = 0;
   __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_11_select = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_11_select;
-  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_12_select) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_12_select) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
   __pyx_type_4lxml_12_elementpath___pyx_scope_struct_12_select.tp_print = 0;
   __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_12_select = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_12_select;
-  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator) < 0) __PYX_ERR(0, 237, __pyx_L1_error)
-  __pyx_type_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator.tp_print = 0;
-  __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator;
-  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
-  __pyx_type_4lxml_12_elementpath___pyx_scope_struct_14_genexpr.tp_print = 0;
-  __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_14_genexpr = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_14_genexpr;
+  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_13_select) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
+  __pyx_type_4lxml_12_elementpath___pyx_scope_struct_13_select.tp_print = 0;
+  __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_13_select = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_13_select;
+  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator) < 0) __PYX_ERR(0, 246, __pyx_L1_error)
+  __pyx_type_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator.tp_print = 0;
+  __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator;
+  if (PyType_Ready(&__pyx_type_4lxml_12_elementpath___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
+  __pyx_type_4lxml_12_elementpath___pyx_scope_struct_15_genexpr.tp_print = 0;
+  __pyx_ptype_4lxml_12_elementpath___pyx_scope_struct_15_genexpr = &__pyx_type_4lxml_12_elementpath___pyx_scope_struct_15_genexpr;
   /*--- Type import code ---*/
   /*--- Variable import code ---*/
   /*--- Function import code ---*/
@@ -12360,7 +12843,7 @@ PyMODINIT_FUNC PyInit__elementpath(void)
   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_xpath_tokenizer_re, __pyx_t_1) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
@@ -12373,9 +12856,9 @@ PyMODINIT_FUNC PyInit__elementpath(void)
  *     default_namespace = namespaces.get(None) if namespaces else None
  *     for token in xpath_tokenizer_re.findall(pattern):
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_1xpath_tokenizer, 0, __pyx_n_s_xpath_tokenizer, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_1xpath_tokenizer, 0, __pyx_n_s_xpath_tokenizer, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__56);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__60);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_xpath_tokenizer, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -12386,7 +12869,7 @@ PyMODINIT_FUNC PyInit__elementpath(void)
  *     tag = token[1]
  *     def select(result):
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_4prepare_child, 0, __pyx_n_s_prepare_child, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_4prepare_child, 0, __pyx_n_s_prepare_child, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_prepare_child, __pyx_t_1) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -12398,7 +12881,7 @@ PyMODINIT_FUNC PyInit__elementpath(void)
  *     def select(result):
  *         for elem in result:
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_6prepare_star, 0, __pyx_n_s_prepare_star, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_6prepare_star, 0, __pyx_n_s_prepare_star, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_prepare_star, __pyx_t_1) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -12410,7 +12893,7 @@ PyMODINIT_FUNC PyInit__elementpath(void)
  *     def select(result):
  *         return result
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_8prepare_self, 0, __pyx_n_s_prepare_self, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_8prepare_self, 0, __pyx_n_s_prepare_self, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_prepare_self, __pyx_t_1) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -12422,7 +12905,7 @@ PyMODINIT_FUNC PyInit__elementpath(void)
  *     token = next()
  *     if token[0] == "*":
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_10prepare_descendant, 0, __pyx_n_s_prepare_descendant, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_10prepare_descendant, 0, __pyx_n_s_prepare_descendant, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_prepare_descendant, __pyx_t_1) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -12434,7 +12917,7 @@ PyMODINIT_FUNC PyInit__elementpath(void)
  *     def select(result):
  *         for elem in result:
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_12prepare_parent, 0, __pyx_n_s_prepare_parent, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_12prepare_parent, 0, __pyx_n_s_prepare_parent, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_prepare_parent, __pyx_t_1) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -12446,161 +12929,161 @@ PyMODINIT_FUNC PyInit__elementpath(void)
  *     # FIXME: replace with real parser!!! refs:
  *     # http://effbot.org/zone/simple-iterator-parser.htm
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_14prepare_predicate, 0, __pyx_n_s_prepare_predicate, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_14prepare_predicate, 0, __pyx_n_s_prepare_predicate, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_prepare_predicate, __pyx_t_1) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":223
+  /* "lxml/_elementpath.py":232
  * 
  * ops = {
  *     "": prepare_child,             # <<<<<<<<<<<<<<
  *     "*": prepare_star,
  *     ".": prepare_self,
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_child); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_child); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__18, __pyx_t_2) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__18, __pyx_t_2) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/_elementpath.py":224
+  /* "lxml/_elementpath.py":233
  * ops = {
  *     "": prepare_child,
  *     "*": prepare_star,             # <<<<<<<<<<<<<<
  *     ".": prepare_self,
  *     "..": prepare_parent,
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_star); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_star); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__7, __pyx_t_2) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__7, __pyx_t_2) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/_elementpath.py":225
+  /* "lxml/_elementpath.py":234
  *     "": prepare_child,
  *     "*": prepare_star,
  *     ".": prepare_self,             # <<<<<<<<<<<<<<
  *     "..": prepare_parent,
  *     "//": prepare_descendant,
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__69, __pyx_t_2) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__73, __pyx_t_2) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/_elementpath.py":226
+  /* "lxml/_elementpath.py":235
  *     "*": prepare_star,
  *     ".": prepare_self,
  *     "..": prepare_parent,             # <<<<<<<<<<<<<<
  *     "//": prepare_descendant,
  *     "[": prepare_predicate,
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__70, __pyx_t_2) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__74, __pyx_t_2) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/_elementpath.py":227
+  /* "lxml/_elementpath.py":236
  *     ".": prepare_self,
  *     "..": prepare_parent,
  *     "//": prepare_descendant,             # <<<<<<<<<<<<<<
  *     "[": prepare_predicate,
  * }
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_descendant); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_descendant); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__71, __pyx_t_2) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__75, __pyx_t_2) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/_elementpath.py":228
+  /* "lxml/_elementpath.py":237
  *     "..": prepare_parent,
  *     "//": prepare_descendant,
  *     "[": prepare_predicate,             # <<<<<<<<<<<<<<
  * }
  * 
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_predicate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_prepare_predicate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__72, __pyx_t_2) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s__76, __pyx_t_2) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ops, __pyx_t_1) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ops, __pyx_t_1) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":234
+  /* "lxml/_elementpath.py":243
  * # --------------------------------------------------------------------
  * 
  * _cache = {}             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cache, __pyx_t_1) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cache, __pyx_t_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":237
+  /* "lxml/_elementpath.py":246
  * 
  * 
  * def _build_path_iterator(path, namespaces):             # <<<<<<<<<<<<<<
  *     """compile selector pattern"""
  *     if path[-1:] == "/":
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_16_build_path_iterator, 0, __pyx_n_s_build_path_iterator, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_16_build_path_iterator, 0, __pyx_n_s_build_path_iterator, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_build_path_iterator, __pyx_t_1) < 0) __PYX_ERR(0, 237, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_build_path_iterator, __pyx_t_1) < 0) __PYX_ERR(0, 246, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":290
+  /* "lxml/_elementpath.py":299
  * # Iterate over the matching nodes
  * 
  * def iterfind(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
  *     selector = _build_path_iterator(path, namespaces)
  *     result = iter((elem,))
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_18iterfind, 0, __pyx_n_s_iterfind, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_18iterfind, 0, __pyx_n_s_iterfind, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__77);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iterfind, __pyx_t_1) < 0) __PYX_ERR(0, 290, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__81);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iterfind, __pyx_t_1) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":301
+  /* "lxml/_elementpath.py":310
  * # Find first matching object.
  * 
  * def find(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
  *     it = iterfind(elem, path, namespaces)
  *     try:
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_20find, 0, __pyx_n_s_find, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_20find, 0, __pyx_n_s_find, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__80);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_find, __pyx_t_1) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__84);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_find, __pyx_t_1) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":312
+  /* "lxml/_elementpath.py":321
  * # Find all matching objects.
  * 
  * def findall(elem, path, namespaces=None):             # <<<<<<<<<<<<<<
  *     return list(iterfind(elem, path, namespaces))
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_22findall, 0, __pyx_n_s_findall, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_22findall, 0, __pyx_n_s_findall, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__83);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_findall, __pyx_t_1) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__87);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_findall, __pyx_t_1) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/_elementpath.py":319
+  /* "lxml/_elementpath.py":328
  * # Find text for first matching object.
  * 
  * def findtext(elem, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
  *     el = find(elem, path, namespaces)
  *     if el is None:
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_24findtext, 0, __pyx_n_s_findtext, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_12_elementpath_24findtext, 0, __pyx_n_s_findtext, NULL, __pyx_n_s_lxml__elementpath, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__86);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_findtext, __pyx_t_1) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__90);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_findtext, __pyx_t_1) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "lxml/_elementpath.py":1
@@ -12608,7 +13091,7 @@ PyMODINIT_FUNC PyInit__elementpath(void)
  * # ElementTree
  * # $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -12630,10 +13113,12 @@ PyMODINIT_FUNC PyInit__elementpath(void)
   }
   __pyx_L0:;
   __Pyx_RefNannyFinishContext();
-  #if PY_MAJOR_VERSION < 3
-  return;
-  #else
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  return (__pyx_m != NULL) ? 0 : -1;
+  #elif PY_MAJOR_VERSION >= 3
   return __pyx_m;
+  #else
+  return;
   #endif
 }
 
@@ -12652,37 +13137,36 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_codeobj__15);
   Py_CLEAR(__pyx_tuple__16);
   Py_CLEAR(__pyx_codeobj__17);
-  Py_CLEAR(__pyx_slice__20);
-  Py_CLEAR(__pyx_slice__23);
-  Py_CLEAR(__pyx_tuple__26);
-  Py_CLEAR(__pyx_codeobj__27);
-  Py_CLEAR(__pyx_tuple__29);
-  Py_CLEAR(__pyx_codeobj__30);
-  Py_CLEAR(__pyx_tuple__32);
-  Py_CLEAR(__pyx_codeobj__33);
-  Py_CLEAR(__pyx_tuple__35);
-  Py_CLEAR(__pyx_codeobj__36);
+  Py_CLEAR(__pyx_tuple__20);
+  Py_CLEAR(__pyx_slice__21);
+  Py_CLEAR(__pyx_slice__24);
+  Py_CLEAR(__pyx_tuple__27);
+  Py_CLEAR(__pyx_codeobj__28);
+  Py_CLEAR(__pyx_tuple__30);
+  Py_CLEAR(__pyx_codeobj__31);
+  Py_CLEAR(__pyx_tuple__33);
+  Py_CLEAR(__pyx_codeobj__34);
+  Py_CLEAR(__pyx_tuple__37);
+  Py_CLEAR(__pyx_codeobj__38);
   Py_CLEAR(__pyx_tuple__39);
-  Py_CLEAR(__pyx_tuple__40);
-  Py_CLEAR(__pyx_tuple__41);
-  Py_CLEAR(__pyx_tuple__42);
+  Py_CLEAR(__pyx_codeobj__40);
   Py_CLEAR(__pyx_tuple__43);
-  Py_CLEAR(__pyx_codeobj__44);
+  Py_CLEAR(__pyx_tuple__44);
   Py_CLEAR(__pyx_tuple__45);
-  Py_CLEAR(__pyx_slice__46);
-  Py_CLEAR(__pyx_tuple__48);
-  Py_CLEAR(__pyx_slice__49);
-  Py_CLEAR(__pyx_tuple__50);
-  Py_CLEAR(__pyx_tuple__51);
+  Py_CLEAR(__pyx_tuple__46);
+  Py_CLEAR(__pyx_tuple__47);
+  Py_CLEAR(__pyx_codeobj__48);
+  Py_CLEAR(__pyx_tuple__49);
+  Py_CLEAR(__pyx_slice__50);
   Py_CLEAR(__pyx_tuple__52);
-  Py_CLEAR(__pyx_tuple__53);
+  Py_CLEAR(__pyx_slice__53);
   Py_CLEAR(__pyx_tuple__54);
-  Py_CLEAR(__pyx_codeobj__55);
+  Py_CLEAR(__pyx_tuple__55);
   Py_CLEAR(__pyx_tuple__56);
   Py_CLEAR(__pyx_tuple__57);
-  Py_CLEAR(__pyx_codeobj__58);
-  Py_CLEAR(__pyx_tuple__59);
-  Py_CLEAR(__pyx_codeobj__60);
+  Py_CLEAR(__pyx_tuple__58);
+  Py_CLEAR(__pyx_codeobj__59);
+  Py_CLEAR(__pyx_tuple__60);
   Py_CLEAR(__pyx_tuple__61);
   Py_CLEAR(__pyx_codeobj__62);
   Py_CLEAR(__pyx_tuple__63);
@@ -12691,20 +13175,24 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_codeobj__66);
   Py_CLEAR(__pyx_tuple__67);
   Py_CLEAR(__pyx_codeobj__68);
-  Py_CLEAR(__pyx_tuple__73);
-  Py_CLEAR(__pyx_codeobj__74);
-  Py_CLEAR(__pyx_tuple__75);
-  Py_CLEAR(__pyx_codeobj__76);
+  Py_CLEAR(__pyx_tuple__69);
+  Py_CLEAR(__pyx_codeobj__70);
+  Py_CLEAR(__pyx_tuple__71);
+  Py_CLEAR(__pyx_codeobj__72);
   Py_CLEAR(__pyx_tuple__77);
-  Py_CLEAR(__pyx_tuple__78);
-  Py_CLEAR(__pyx_codeobj__79);
-  Py_CLEAR(__pyx_tuple__80);
+  Py_CLEAR(__pyx_codeobj__78);
+  Py_CLEAR(__pyx_tuple__79);
+  Py_CLEAR(__pyx_codeobj__80);
   Py_CLEAR(__pyx_tuple__81);
-  Py_CLEAR(__pyx_codeobj__82);
-  Py_CLEAR(__pyx_tuple__83);
+  Py_CLEAR(__pyx_tuple__82);
+  Py_CLEAR(__pyx_codeobj__83);
   Py_CLEAR(__pyx_tuple__84);
-  Py_CLEAR(__pyx_codeobj__85);
-  Py_CLEAR(__pyx_tuple__86);
+  Py_CLEAR(__pyx_tuple__85);
+  Py_CLEAR(__pyx_codeobj__86);
+  Py_CLEAR(__pyx_tuple__87);
+  Py_CLEAR(__pyx_tuple__88);
+  Py_CLEAR(__pyx_codeobj__89);
+  Py_CLEAR(__pyx_tuple__90);
   /* CodeObjectCache.cleanup */
   if (__pyx_code_cache.entries) {
       __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
@@ -12784,12 +13272,16 @@ static void __pyx_module_cleanup(CYTHON_UNUSED PyObject *self) {
     PyObject* o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_12_select[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_12_select];
     (*Py_TYPE(o)->tp_free)(o);
   }
-  while (__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator > 0) {
-    PyObject* o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13__build_path_iterator];
+  while (__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13_select > 0) {
+    PyObject* o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_13_select[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_13_select];
+    (*Py_TYPE(o)->tp_free)(o);
+  }
+  while (__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator > 0) {
+    PyObject* o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14__build_path_iterator];
     (*Py_TYPE(o)->tp_free)(o);
   }
-  while (__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14_genexpr > 0) {
-    PyObject* o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_14_genexpr[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_14_genexpr];
+  while (__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_15_genexpr > 0) {
+    PyObject* o = (PyObject*)__pyx_freelist_4lxml_12_elementpath___pyx_scope_struct_15_genexpr[--__pyx_freecount_4lxml_12_elementpath___pyx_scope_struct_15_genexpr];
     (*Py_TYPE(o)->tp_free)(o);
   }
   #if CYTHON_COMPILING_IN_PYPY
@@ -13039,7 +13531,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, P
 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                                PyObject *globals) {
     PyFrameObject *f;
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject **fastlocals;
     Py_ssize_t i;
     PyObject *result;
@@ -13214,7 +13706,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
 #endif
 
 /* GetItemInt */
-  static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+  static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
     PyObject *r;
     if (!j) return NULL;
     r = PyObject_GetItem(o, j);
@@ -13462,10 +13954,10 @@ return_ne:
 /* IterFinish */
   static CYTHON_INLINE int __Pyx_IterFinish(void) {
 #if CYTHON_FAST_THREAD_STATE
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject* exc_type = tstate->curexc_type;
     if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
+        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
             PyObject *exc_value, *exc_tb;
             exc_value = tstate->curexc_value;
             exc_tb = tstate->curexc_traceback;
@@ -13646,11 +14138,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             "raise: exception class must be a subclass of BaseException");
         goto bad;
     }
-#if PY_VERSION_HEX >= 0x03030000
     if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
         PyObject *fixed_cause;
         if (cause == Py_None) {
             fixed_cause = NULL;
@@ -13678,7 +14166,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         PyErr_Restore(tmp_type, tmp_value, tb);
         Py_XDECREF(tmp_tb);
 #else
-        PyThreadState *tstate = PyThreadState_GET();
+        PyThreadState *tstate = __Pyx_PyThreadState_Current;
         PyObject* tmp_tb = tstate->curexc_traceback;
         if (tb != tmp_tb) {
             Py_INCREF(tb);
@@ -13694,7 +14182,7 @@ bad:
 #endif
 
 /* SaveResetException */
-    #if CYTHON_FAST_THREAD_STATE
+  #if CYTHON_FAST_THREAD_STATE
 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
     *type = tstate->exc_type;
     *value = tstate->exc_value;
@@ -13718,17 +14206,32 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject
 #endif
 
 /* PyErrExceptionMatches */
-    #if CYTHON_FAST_THREAD_STATE
+  #if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+    Py_ssize_t i, n;
+    n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+    for (i=0; i<n; i++) {
+        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+    }
+#endif
+    for (i=0; i<n; i++) {
+        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
+    }
+    return 0;
+}
 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
     PyObject *exc_type = tstate->curexc_type;
     if (exc_type == err) return 1;
     if (unlikely(!exc_type)) return 0;
-    return PyErr_GivenExceptionMatches(exc_type, err);
+    if (unlikely(PyTuple_Check(err)))
+        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
 }
 #endif
 
 /* GetException */
-    #if CYTHON_FAST_THREAD_STATE
+  #if CYTHON_FAST_THREAD_STATE
 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
 #else
 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
@@ -13789,12 +14292,12 @@ bad:
 }
 
 /* None */
-      static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
+    static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
     PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
 }
 
 /* FetchCommonType */
-      static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+    static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
     PyObject* fake_module;
     PyTypeObject* cached_type = NULL;
     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
@@ -13833,7 +14336,7 @@ bad:
 }
 
 /* CythonFunction */
-      static PyObject *
+    static PyObject *
 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
 {
     if (unlikely(op->func_doc == NULL)) {
@@ -14193,14 +14696,18 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
     }
     return 0;
 }
-static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
 {
-    PyObject_GC_UnTrack(m);
     if (__Pyx_CyFunction_weakreflist(m) != NULL)
         PyObject_ClearWeakRefs((PyObject *) m);
     __Pyx_CyFunction_clear(m);
     PyObject_GC_Del(m);
 }
+static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+{
+    PyObject_GC_UnTrack(m);
+    __Pyx__CyFunction_dealloc(m);
+}
 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
 {
     Py_VISIT(m->func_closure);
@@ -14275,10 +14782,16 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py
         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
             size = PyTuple_GET_SIZE(arg);
             if (likely(size == 1)) {
-                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
-                if (unlikely(!arg0)) return NULL;
+                PyObject *result, *arg0;
+                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+                arg0 = PyTuple_GET_ITEM(arg, 0);
+                #else
+                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
+                #endif
                 result = (*meth)(self, arg0);
+                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                 Py_DECREF(arg0);
+                #endif
                 return result;
             }
             PyErr_Format(PyExc_TypeError,
@@ -14385,7 +14898,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
 };
 static int __pyx_CyFunction_init(void) {
     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
-    if (__pyx_CyFunctionType == NULL) {
+    if (unlikely(__pyx_CyFunctionType == NULL)) {
         return -1;
     }
     return 0;
@@ -14393,7 +14906,7 @@ static int __pyx_CyFunction_init(void) {
 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
     m->defaults = PyObject_Malloc(size);
-    if (!m->defaults)
+    if (unlikely(!m->defaults))
         return PyErr_NoMemory();
     memset(m->defaults, 0, size);
     m->defaults_pyobjects = pyobjects;
@@ -14416,7 +14929,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
 }
 
 /* PyObjectCallNoArg */
-          #if CYTHON_COMPILING_IN_CPYTHON
+        #if CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(func)) {
@@ -14424,7 +14937,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
     }
 #endif
 #ifdef __Pyx_CyFunction_USED
-    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+    if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
 #else
     if (likely(PyCFunction_Check(func))) {
 #endif
@@ -14437,14 +14950,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 #endif
 
 /* StringJoin */
-            #if !CYTHON_COMPILING_IN_CPYTHON
+          #if !CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
     return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
 }
 #endif
 
 /* SliceObject */
-            static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
+          static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
         Py_ssize_t cstart, Py_ssize_t cstop,
         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
@@ -14540,67 +15053,8 @@ bad:
     return NULL;
 }
 
-/* PyObjectCallMethod1 */
-            static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
-    PyObject *method, *result = NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto done;
-#if CYTHON_UNPACK_METHODS
-    if (likely(PyMethod_Check(method))) {
-        PyObject *self = PyMethod_GET_SELF(method);
-        if (likely(self)) {
-            PyObject *args;
-            PyObject *function = PyMethod_GET_FUNCTION(method);
-            #if CYTHON_FAST_PYCALL
-            if (PyFunction_Check(function)) {
-                PyObject *args[2] = {self, arg};
-                result = __Pyx_PyFunction_FastCall(function, args, 2);
-                goto done;
-            }
-            #endif
-            #if CYTHON_FAST_PYCCALL
-            if (__Pyx_PyFastCFunction_Check(function)) {
-                PyObject *args[2] = {self, arg};
-                result = __Pyx_PyCFunction_FastCall(function, args, 2);
-                goto done;
-            }
-            #endif
-            args = PyTuple_New(2);
-            if (unlikely(!args)) goto done;
-            Py_INCREF(self);
-            PyTuple_SET_ITEM(args, 0, self);
-            Py_INCREF(arg);
-            PyTuple_SET_ITEM(args, 1, arg);
-            Py_INCREF(function);
-            Py_DECREF(method); method = NULL;
-            result = __Pyx_PyObject_Call(function, args, NULL);
-            Py_DECREF(args);
-            Py_DECREF(function);
-            return result;
-        }
-    }
-#endif
-    result = __Pyx_PyObject_CallOneArg(method, arg);
-done:
-    Py_XDECREF(method);
-    return result;
-}
-
-/* append */
-            static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
-    if (likely(PyList_CheckExact(L))) {
-        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
-    } else {
-        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
-        if (unlikely(!retval))
-            return -1;
-        Py_DECREF(retval);
-    }
-    return 0;
-}
-
 /* PyIntBinop */
-            #if !CYTHON_COMPILING_IN_PYPY
+          #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_CheckExact(op1))) {
@@ -14716,7 +15170,7 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_U
 #endif
 
 /* PyIntBinop */
-            #if !CYTHON_COMPILING_IN_PYPY
+          #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     if (op1 == op2) {
         Py_RETURN_TRUE;
@@ -14801,51 +15255,63 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
 #endif
 
 /* IterNext */
-            static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
+          static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
+    PyObject* exc_type;
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    exc_type = __Pyx_PyErr_Occurred();
+    if (unlikely(exc_type)) {
+        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
+            return NULL;
+        if (defval) {
+            __Pyx_PyErr_Clear();
+            Py_INCREF(defval);
+        }
+        return defval;
+    }
+    if (defval) {
+        Py_INCREF(defval);
+        return defval;
+    }
+    __Pyx_PyErr_SetNone(PyExc_StopIteration);
+    return NULL;
+}
+static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
+    PyErr_Format(PyExc_TypeError,
+        "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
+}
+static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
     PyObject* next;
     iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
+    if (likely(iternext)) {
 #if CYTHON_USE_TYPE_SLOTS
-    if (unlikely(!iternext)) {
+        next = iternext(iterator);
+        if (likely(next))
+            return next;
+        #if PY_VERSION_HEX >= 0x02070000
+        if (unlikely(iternext == &_PyObject_NextNotImplemented))
+            return NULL;
+        #endif
 #else
-    if (unlikely(!iternext) || unlikely(!PyIter_Check(iterator))) {
+        next = PyIter_Next(iterator);
+        if (likely(next))
+            return next;
 #endif
-        PyErr_Format(PyExc_TypeError,
-            "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
-        return NULL;
-    }
-    next = iternext(iterator);
-    if (likely(next))
-        return next;
-#if CYTHON_USE_TYPE_SLOTS
-#if PY_VERSION_HEX >= 0x02070000
-    if (unlikely(iternext == &_PyObject_NextNotImplemented))
+    } else if (CYTHON_USE_TYPE_SLOTS || !PyIter_Check(iterator)) {
+        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
         return NULL;
-#endif
-#endif
-    if (defval) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-            if (unlikely(exc_type != PyExc_StopIteration) &&
-                    !PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))
-                return NULL;
-            PyErr_Clear();
-        }
-        Py_INCREF(defval);
-        return defval;
     }
-    if (!PyErr_Occurred())
-        PyErr_SetNone(PyExc_StopIteration);
-    return NULL;
+    return __Pyx_PyIter_Next2Default(defval);
 }
 
 /* Import */
-              static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+          static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     PyObject *empty_list = 0;
     PyObject *module = 0;
     PyObject *global_dict = 0;
     PyObject *empty_dict = 0;
     PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     PyObject *py_import;
     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
@@ -14869,17 +15335,8 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
             if (strchr(__Pyx_MODULE_NAME, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                PyObject *py_level = PyInt_FromLong(1);
-                if (!py_level)
-                    goto bad;
-                module = PyObject_CallFunctionObjArgs(py_import,
-                    name, global_dict, empty_dict, list, py_level, NULL);
-                Py_DECREF(py_level);
-                #else
                 module = PyImport_ImportModuleLevelObject(
                     name, global_dict, empty_dict, list, 1);
-                #endif
                 if (!module) {
                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
                         goto bad;
@@ -14890,7 +15347,7 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
         }
         #endif
         if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
+            #if PY_MAJOR_VERSION < 3
             PyObject *py_level = PyInt_FromLong(level);
             if (!py_level)
                 goto bad;
@@ -14904,7 +15361,7 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
         }
     }
 bad:
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     Py_XDECREF(py_import);
     #endif
     Py_XDECREF(empty_list);
@@ -14913,7 +15370,7 @@ bad:
 }
 
 /* ModuleImport */
-              #ifndef __PYX_HAVE_RT_ImportModule
+          #ifndef __PYX_HAVE_RT_ImportModule
 #define __PYX_HAVE_RT_ImportModule
 static PyObject *__Pyx_ImportModule(const char *name) {
     PyObject *py_name = 0;
@@ -14931,7 +15388,7 @@ bad:
 #endif
 
 /* RegisterModuleCleanup */
-              #if PY_MAJOR_VERSION < 3
+          #if PY_MAJOR_VERSION < 3
 static PyObject* __pyx_module_cleanup_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) {
     __pyx_module_cleanup(module);
     Py_INCREF(Py_None); return Py_None;
@@ -14998,7 +15455,7 @@ static int __Pyx_RegisterCleanup(void) {
 #endif
 
 /* CLineInTraceback */
-              static int __Pyx_CLineForTraceback(int c_line) {
+          static int __Pyx_CLineForTraceback(int c_line) {
 #ifdef CYTHON_CLINE_IN_TRACEBACK
     return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0;
 #else
@@ -15034,7 +15491,7 @@ static int __Pyx_RegisterCleanup(void) {
 }
 
 /* CodeObjectCache */
-              static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+          static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
     int start = 0, mid = 0, end = count - 1;
     if (end >= 0 && code_line > entries[end].code_line) {
         return count;
@@ -15114,7 +15571,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
 }
 
 /* AddTraceback */
-              #include "compile.h"
+          #include "compile.h"
 #include "frameobject.h"
 #include "traceback.h"
 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -15184,10 +15641,10 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
     }
     py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        __pyx_d,      /*PyObject *globals,*/
-        0                    /*PyObject *locals*/
+        __Pyx_PyThreadState_Current, /*PyThreadState *tstate,*/
+        py_code,                     /*PyCodeObject *code,*/
+        __pyx_d,              /*PyObject *globals,*/
+        0                            /*PyObject *locals*/
     );
     if (!py_frame) goto bad;
     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
@@ -15198,7 +15655,7 @@ bad:
 }
 
 /* CIntToPy */
-              static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -15229,7 +15686,7 @@ bad:
 }
 
 /* CIntFromPyVerify */
-              #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+          #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
@@ -15251,7 +15708,7 @@ bad:
     }
 
 /* CIntFromPy */
-              static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+          static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -15440,7 +15897,7 @@ raise_neg_overflow:
 }
 
 /* CIntFromPy */
-              static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+          static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
     const int neg_one = (int) -1, const_zero = (int) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -15628,8 +16085,80 @@ raise_neg_overflow:
     return (int) -1;
 }
 
+/* FastTypeChecks */
+          #if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+    while (a) {
+        a = a->tp_base;
+        if (a == b)
+            return 1;
+    }
+    return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+    PyObject *mro;
+    if (a == b) return 1;
+    mro = a->tp_mro;
+    if (likely(mro)) {
+        Py_ssize_t i, n;
+        n = PyTuple_GET_SIZE(mro);
+        for (i = 0; i < n; i++) {
+            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+                return 1;
+        }
+        return 0;
+    }
+    return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+    PyObject *exception, *value, *tb;
+    int res;
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    __Pyx_ErrFetch(&exception, &value, &tb);
+    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+    if (unlikely(res == -1)) {
+        PyErr_WriteUnraisable(err);
+        res = 0;
+    }
+    if (!res) {
+        res = PyObject_IsSubclass(err, exc_type2);
+        if (unlikely(res == -1)) {
+            PyErr_WriteUnraisable(err);
+            res = 0;
+        }
+    }
+    __Pyx_ErrRestore(exception, value, tb);
+    return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+    if (!res) {
+        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+    }
+    return res;
+}
+#endif
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+    if (likely(err == exc_type)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+    }
+    return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+    if (likely(err == exc_type1 || err == exc_type2)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+    }
+    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
 /* SwapException */
-              #if CYTHON_FAST_THREAD_STATE
+          #if CYTHON_FAST_THREAD_STATE
 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
     PyObject *tmp_type, *tmp_value, *tmp_tb;
     tmp_type = tstate->exc_type;
@@ -15653,19 +16182,65 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
 }
 #endif
 
+/* PyObjectCallMethod1 */
+          static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
+    PyObject *result = NULL;
+#if CYTHON_UNPACK_METHODS
+    if (likely(PyMethod_Check(method))) {
+        PyObject *self = PyMethod_GET_SELF(method);
+        if (likely(self)) {
+            PyObject *args;
+            PyObject *function = PyMethod_GET_FUNCTION(method);
+            #if CYTHON_FAST_PYCALL
+            if (PyFunction_Check(function)) {
+                PyObject *args[2] = {self, arg};
+                result = __Pyx_PyFunction_FastCall(function, args, 2);
+                goto done;
+            }
+            #endif
+            #if CYTHON_FAST_PYCCALL
+            if (__Pyx_PyFastCFunction_Check(function)) {
+                PyObject *args[2] = {self, arg};
+                result = __Pyx_PyCFunction_FastCall(function, args, 2);
+                goto done;
+            }
+            #endif
+            args = PyTuple_New(2);
+            if (unlikely(!args)) goto done;
+            Py_INCREF(self);
+            PyTuple_SET_ITEM(args, 0, self);
+            Py_INCREF(arg);
+            PyTuple_SET_ITEM(args, 1, arg);
+            Py_INCREF(function);
+            result = __Pyx_PyObject_Call(function, args, NULL);
+            Py_DECREF(args);
+            Py_DECREF(function);
+            return result;
+        }
+    }
+#endif
+    result = __Pyx_PyObject_CallOneArg(method, arg);
+    goto done;
+done:
+    return result;
+}
+static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
+    PyObject *method, *result = NULL;
+    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
+    if (unlikely(!method)) goto done;
+    result = __Pyx__PyObject_CallMethod1(method, arg);
+done:
+    Py_XDECREF(method);
+    return result;
+}
+
 /* CoroutineBase */
-              #include <structmember.h>
+          #include <structmember.h>
 #include <frameobject.h>
-static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
-static PyObject *__Pyx_Coroutine_Close(PyObject *self);
-static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
+static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
     PyObject *et, *ev, *tb;
     PyObject *value = NULL;
-    __Pyx_PyThreadState_declare
-    __Pyx_PyThreadState_assign
     __Pyx_ErrFetch(&et, &ev, &tb);
     if (!et) {
         Py_XDECREF(tb);
@@ -15700,7 +16275,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
             }
             Py_DECREF(ev);
         }
-        else if (!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
+        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
             value = ev;
         }
         if (likely(value)) {
@@ -15709,7 +16284,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
             *pvalue = value;
             return 0;
         }
-    } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
+    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
         __Pyx_ErrRestore(et, ev, tb);
         return -1;
     }
@@ -15742,7 +16317,6 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
     *pvalue = value;
     return 0;
 }
-#endif
 static CYTHON_INLINE
 void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
     PyObject *exc_type = self->exc_type;
@@ -15755,72 +16329,121 @@ void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
     Py_XDECREF(exc_value);
     Py_XDECREF(exc_traceback);
 }
-static CYTHON_INLINE
-int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
-    if (unlikely(gen->is_running)) {
-        PyErr_SetString(PyExc_ValueError,
-                        "generator already executing");
-        return 1;
+#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
+static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
+    const char *msg;
+    if (0) {
+    #ifdef __Pyx_Coroutine_USED
+    } else if (__Pyx_Coroutine_CheckExact((PyObject*)gen)) {
+        msg = "coroutine already executing";
+    #endif
+    #ifdef __Pyx_AsyncGen_USED
+    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
+        msg = "async generator already executing";
+    #endif
+    } else {
+        msg = "generator already executing";
     }
-    return 0;
+    PyErr_SetString(PyExc_ValueError, msg);
 }
-static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
-    PyObject *retval;
+#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
+static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
+    const char *msg;
+    if (0) {
+    #ifdef __Pyx_Coroutine_USED
+    } else if (__Pyx_Coroutine_CheckExact(gen)) {
+        msg = "can't send non-None value to a just-started coroutine";
+    #endif
+    #ifdef __Pyx_AsyncGen_USED
+    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
+        msg = "can't send non-None value to a just-started async generator";
+    #endif
+    } else {
+        msg = "can't send non-None value to a just-started generator";
+    }
+    PyErr_SetString(PyExc_TypeError, msg);
+}
+#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
+static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
+    #ifdef __Pyx_Coroutine_USED
+    if (!closing && __Pyx_Coroutine_CheckExact(gen)) {
+        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
+    } else
+    #endif
+    if (value) {
+        #ifdef __Pyx_AsyncGen_USED
+        if (__Pyx_AsyncGen_CheckExact(gen))
+            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
+        else
+        #endif
+        PyErr_SetNone(PyExc_StopIteration);
+    }
+}
+static
+PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
     __Pyx_PyThreadState_declare
+    PyThreadState *tstate;
+    PyObject *retval;
     assert(!self->is_running);
     if (unlikely(self->resume_label == 0)) {
         if (unlikely(value && value != Py_None)) {
-            PyErr_SetString(PyExc_TypeError,
-                            "can't send non-None value to a "
-                            "just-started generator");
-            return NULL;
+            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
         }
     }
     if (unlikely(self->resume_label == -1)) {
-        PyErr_SetNone(PyExc_StopIteration);
-        return NULL;
+        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
     }
+#if CYTHON_FAST_THREAD_STATE
     __Pyx_PyThreadState_assign
-    if (value) {
+    tstate = __pyx_tstate;
+#else
+    tstate = __Pyx_PyThreadState_Current;
+#endif
+    if (self->exc_type) {
 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
 #else
         if (self->exc_traceback) {
             PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
             PyFrameObject *f = tb->tb_frame;
-            Py_XINCREF(__pyx_tstate->frame);
+            Py_XINCREF(tstate->frame);
             assert(f->f_back == NULL);
-            f->f_back = __pyx_tstate->frame;
+            f->f_back = tstate->frame;
         }
 #endif
         __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                             &self->exc_traceback);
     } else {
         __Pyx_Coroutine_ExceptionClear(self);
+        __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
     }
     self->is_running = 1;
-    retval = self->body((PyObject *) self, value);
+    retval = self->body((PyObject *) self, tstate, value);
     self->is_running = 0;
-    if (retval) {
-        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
-                            &self->exc_traceback);
+    return retval;
+}
+static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *self) {
+    if (likely(self->exc_traceback)) {
 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
 #else
-        if (self->exc_traceback) {
-            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
-            PyFrameObject *f = tb->tb_frame;
-            Py_CLEAR(f->f_back);
-        }
+        PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
+        PyFrameObject *f = tb->tb_frame;
+        Py_CLEAR(f->f_back);
 #endif
-    } else {
-        __Pyx_Coroutine_ExceptionClear(self);
     }
-    return retval;
 }
 static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
-    if (unlikely(!retval && !PyErr_Occurred())) {
-        PyErr_SetNone(PyExc_StopIteration);
+PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
+    if (unlikely(!retval)) {
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        if (!__Pyx_PyErr_Occurred()) {
+            PyObject *exc = PyExc_StopIteration;
+            #ifdef __Pyx_AsyncGen_USED
+            if (__Pyx_AsyncGen_CheckExact(gen))
+                exc = __Pyx_PyExc_StopAsyncIteration;
+            #endif
+            __Pyx_PyErr_SetNone(exc);
+        }
     }
     return retval;
 }
@@ -15829,8 +16452,8 @@ PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
     PyObject *ret;
     PyObject *val = NULL;
     __Pyx_Coroutine_Undelegate(gen);
-    __Pyx_PyGen_FetchStopIterationValue(&val);
-    ret = __Pyx_Coroutine_SendEx(gen, val);
+    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
+    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
     Py_XDECREF(val);
     return ret;
 }
@@ -15838,8 +16461,8 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
     PyObject *retval;
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
     PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         PyObject *ret;
         gen->is_running = 1;
@@ -15853,6 +16476,21 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
             ret = __Pyx_Coroutine_Send(yf, value);
         } else
         #endif
+        #ifdef __Pyx_AsyncGen_USED
+        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
+            ret = __Pyx_async_gen_asend_send(yf, value);
+        } else
+        #endif
+        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000)
+        if (PyGen_CheckExact(yf)) {
+            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
+        } else
+        #endif
+        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000)
+        if (PyCoro_CheckExact(yf)) {
+            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
+        } else
+        #endif
         {
             if (value == Py_None)
                 ret = Py_TYPE(yf)->tp_iternext(yf);
@@ -15865,9 +16503,9 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
         }
         retval = __Pyx_Coroutine_FinishDelegation(gen);
     } else {
-        retval = __Pyx_Coroutine_SendEx(gen, value);
+        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
     }
-    return __Pyx_Coroutine_MethodReturn(retval);
+    return __Pyx_Coroutine_MethodReturn(self, retval);
 }
 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
     PyObject *retval = NULL;
@@ -15885,6 +16523,19 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
         if (!retval)
             return -1;
     } else
+    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
+        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
+        if (!retval)
+            return -1;
+    } else
+    #endif
+    #ifdef __Pyx_AsyncGen_USED
+    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
+        retval = __Pyx_async_gen_asend_close(yf, NULL);
+    } else
+    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
+        retval = __Pyx_async_gen_athrow_close(yf, NULL);
+    } else
     #endif
     {
         PyObject *meth;
@@ -15909,8 +16560,8 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
 static PyObject *__Pyx_Generator_Next(PyObject *self) {
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
     PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         PyObject *ret;
         gen->is_running = 1;
@@ -15918,6 +16569,11 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
         if (__Pyx_Generator_CheckExact(yf)) {
             ret = __Pyx_Generator_Next(yf);
         } else
+        #endif
+        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000)
+        if (PyGen_CheckExact(yf)) {
+            ret = _PyGen_Send((PyGenObject*)yf, NULL);
+        } else
         #endif
             ret = Py_TYPE(yf)->tp_iternext(yf);
         gen->is_running = 0;
@@ -15926,15 +16582,15 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
         }
         return __Pyx_Coroutine_FinishDelegation(gen);
     }
-    return __Pyx_Coroutine_SendEx(gen, Py_None);
+    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
 }
 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
     PyObject *retval, *raised_exception;
     PyObject *yf = gen->yieldfrom;
     int err = 0;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         Py_INCREF(yf);
         err = __Pyx_Coroutine_CloseIter(gen, yf);
@@ -15943,59 +16599,69 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
     }
     if (err == 0)
         PyErr_SetNone(PyExc_GeneratorExit);
-    retval = __Pyx_Coroutine_SendEx(gen, NULL);
-    if (retval) {
+    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
+    if (unlikely(retval)) {
+        const char *msg;
         Py_DECREF(retval);
-        PyErr_SetString(PyExc_RuntimeError,
-                        "generator ignored GeneratorExit");
+        if ((0)) {
+        #ifdef __Pyx_Coroutine_USED
+        } else if (__Pyx_Coroutine_CheckExact(self)) {
+            msg = "coroutine ignored GeneratorExit";
+        #endif
+        #ifdef __Pyx_AsyncGen_USED
+        } else if (__Pyx_AsyncGen_CheckExact(self)) {
+#if PY_VERSION_HEX < 0x03060000
+            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
+#else
+            msg = "async generator ignored GeneratorExit";
+#endif
+        #endif
+        } else {
+            msg = "generator ignored GeneratorExit";
+        }
+        PyErr_SetString(PyExc_RuntimeError, msg);
         return NULL;
     }
     raised_exception = PyErr_Occurred();
-    if (!raised_exception
-        || raised_exception == PyExc_StopIteration
-        || raised_exception == PyExc_GeneratorExit
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
-    {
+    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
         if (raised_exception) PyErr_Clear();
         Py_INCREF(Py_None);
         return Py_None;
     }
     return NULL;
 }
-static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
+static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
+                                        PyObject *args, int close_on_genexit) {
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
-    PyObject *typ;
-    PyObject *tb = NULL;
-    PyObject *val = NULL;
     PyObject *yf = gen->yieldfrom;
-    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
-        return NULL;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         PyObject *ret;
         Py_INCREF(yf);
-        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
+        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
             int err = __Pyx_Coroutine_CloseIter(gen, yf);
             Py_DECREF(yf);
             __Pyx_Coroutine_Undelegate(gen);
             if (err < 0)
-                return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
+                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
             goto throw_here;
         }
         gen->is_running = 1;
+        if (0
         #ifdef __Pyx_Generator_USED
-        if (__Pyx_Generator_CheckExact(yf)) {
-            ret = __Pyx_Coroutine_Throw(yf, args);
-        } else
+            || __Pyx_Generator_CheckExact(yf)
         #endif
         #ifdef __Pyx_Coroutine_USED
-        if (__Pyx_Coroutine_CheckExact(yf)) {
-            ret = __Pyx_Coroutine_Throw(yf, args);
-        } else
+            || __Pyx_Coroutine_CheckExact(yf)
         #endif
-        {
+            ) {
+            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
+        #ifdef __Pyx_Coroutine_USED
+        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
+            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
+        #endif
+        } else {
             PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
             if (unlikely(!meth)) {
                 Py_DECREF(yf);
@@ -16008,7 +16674,11 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
                 gen->is_running = 0;
                 goto throw_here;
             }
-            ret = PyObject_CallObject(meth, args);
+            if (likely(args)) {
+                ret = PyObject_CallObject(meth, args);
+            } else {
+                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
+            }
             Py_DECREF(meth);
         }
         gen->is_running = 0;
@@ -16016,14 +16686,21 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
         if (!ret) {
             ret = __Pyx_Coroutine_FinishDelegation(gen);
         }
-        return __Pyx_Coroutine_MethodReturn(ret);
+        return __Pyx_Coroutine_MethodReturn(self, ret);
     }
 throw_here:
     __Pyx_Raise(typ, val, tb, NULL);
-    return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
+    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
 }
-static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
-    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
+static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
+    PyObject *typ;
+    PyObject *val = NULL;
+    PyObject *tb = NULL;
+    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
+        return NULL;
+    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
+}
+static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
     Py_VISIT(gen->closure);
     Py_VISIT(gen->classobj);
     Py_VISIT(gen->yieldfrom);
@@ -16040,6 +16717,11 @@ static int __Pyx_Coroutine_clear(PyObject *self) {
     Py_CLEAR(gen->exc_type);
     Py_CLEAR(gen->exc_value);
     Py_CLEAR(gen->exc_traceback);
+#ifdef __Pyx_AsyncGen_USED
+    if (__Pyx_AsyncGen_CheckExact(self)) {
+        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
+    }
+#endif
     Py_CLEAR(gen->gi_name);
     Py_CLEAR(gen->gi_qualname);
     return 0;
@@ -16049,9 +16731,9 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) {
     PyObject_GC_UnTrack(gen);
     if (gen->gi_weakreflist != NULL)
         PyObject_ClearWeakRefs(self);
-    if (gen->resume_label > 0) {
+    if (gen->resume_label >= 0) {
         PyObject_GC_Track(self);
-#if PY_VERSION_HEX >= 0x030400a1
+#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
         if (PyObject_CallFinalizerFromDealloc(self))
 #else
         Py_TYPE(gen)->tp_del(self);
@@ -16062,29 +16744,93 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) {
         }
         PyObject_GC_UnTrack(self);
     }
+#ifdef __Pyx_AsyncGen_USED
+    if (__Pyx_AsyncGen_CheckExact(self)) {
+        /* We have to handle this case for asynchronous generators
+           right here, because this code has to be between UNTRACK
+           and GC_Del. */
+        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
+    }
+#endif
     __Pyx_Coroutine_clear(self);
     PyObject_GC_Del(gen);
 }
 static void __Pyx_Coroutine_del(PyObject *self) {
-    PyObject *res;
     PyObject *error_type, *error_value, *error_traceback;
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
     __Pyx_PyThreadState_declare
-    if (gen->resume_label <= 0)
-        return ;
-#if PY_VERSION_HEX < 0x030400a1
+    if (gen->resume_label < 0) {
+        return;
+    }
+#if !CYTHON_USE_TP_FINALIZE
     assert(self->ob_refcnt == 0);
     self->ob_refcnt = 1;
 #endif
     __Pyx_PyThreadState_assign
     __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
-    res = __Pyx_Coroutine_Close(self);
-    if (res == NULL)
-        PyErr_WriteUnraisable(self);
-    else
-        Py_DECREF(res);
+#ifdef __Pyx_AsyncGen_USED
+    if (__Pyx_AsyncGen_CheckExact(self)) {
+        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
+        PyObject *finalizer = agen->ag_finalizer;
+        if (finalizer && !agen->ag_closed) {
+            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
+            if (unlikely(!res)) {
+                PyErr_WriteUnraisable(self);
+            } else {
+                Py_DECREF(res);
+            }
+            __Pyx_ErrRestore(error_type, error_value, error_traceback);
+            return;
+        }
+    }
+#endif
+    if (unlikely(gen->resume_label == 0 && !error_value)) {
+#ifdef __Pyx_Coroutine_USED
+#ifdef __Pyx_Generator_USED
+    if (!__Pyx_Generator_CheckExact(self))
+#endif
+        {
+        PyObject_GC_UnTrack(self);
+#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
+        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
+            PyErr_WriteUnraisable(self);
+#else
+        {PyObject *msg;
+        char *cmsg;
+        #if CYTHON_COMPILING_IN_PYPY
+        msg = NULL;
+        cmsg = (char*) "coroutine was never awaited";
+        #else
+        char *cname;
+        PyObject *qualname;
+        qualname = gen->gi_qualname;
+        cname = PyString_AS_STRING(qualname);
+        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
+        if (unlikely(!msg)) {
+            PyErr_Clear();
+            cmsg = (char*) "coroutine was never awaited";
+        } else {
+            cmsg = PyString_AS_STRING(msg);
+        }
+        #endif
+        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
+            PyErr_WriteUnraisable(self);
+        Py_XDECREF(msg);}
+#endif
+        PyObject_GC_Track(self);
+        }
+#endif
+    } else {
+        PyObject *res = __Pyx_Coroutine_Close(self);
+        if (unlikely(!res)) {
+            if (PyErr_Occurred())
+                PyErr_WriteUnraisable(self);
+        } else {
+            Py_DECREF(res);
+        }
+    }
     __Pyx_ErrRestore(error_type, error_value, error_traceback);
-#if PY_VERSION_HEX < 0x030400a1
+#if !CYTHON_USE_TP_FINALIZE
     assert(self->ob_refcnt > 0);
     if (--self->ob_refcnt == 0) {
         return;
@@ -16163,8 +16909,13 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_New(
             PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure,
             PyObject *name, PyObject *qualname, PyObject *module_name) {
     __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
-    if (gen == NULL)
+    if (unlikely(!gen))
         return NULL;
+    return __Pyx__Coroutine_NewInit(gen, body, closure, name, qualname, module_name);
+}
+static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
+            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
+            PyObject *name, PyObject *qualname, PyObject *module_name) {
     gen->body = body;
     gen->closure = closure;
     Py_XINCREF(closure);
@@ -16187,7 +16938,7 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_New(
 }
 
 /* PatchModuleWithCoroutine */
-                  static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
+              static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
     int result;
     PyObject *globals, *result_obj;
@@ -16227,7 +16978,7 @@ ignore:
 }
 
 /* PatchGeneratorABC */
-                  #ifndef CYTHON_REGISTER_ABCS
+              #ifndef CYTHON_REGISTER_ABCS
 #define CYTHON_REGISTER_ABCS 1
 #endif
 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
@@ -16252,11 +17003,11 @@ static int __Pyx_patch_abc(void) {
     static int abc_patched = 0;
     if (CYTHON_REGISTER_ABCS && !abc_patched) {
         PyObject *module;
-        module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
+        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
         if (!module) {
             PyErr_WriteUnraisable(NULL);
             if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
-                    ((PY_VERSION_HEX >= 0x03030000) ?
+                    ((PY_MAJOR_VERSION >= 3) ?
                         "Cython module failed to register with collections.abc module" :
                         "Cython module failed to register with collections module"), 1) < 0)) {
                 return -1;
@@ -16284,7 +17035,7 @@ static int __Pyx_patch_abc(void) {
 }
 
 /* Generator */
-                  static PyMethodDef __pyx_Generator_methods[] = {
+              static PyMethodDef __pyx_Generator_methods[] = {
     {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
      (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
     {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
@@ -16352,14 +17103,16 @@ static PyTypeObject __pyx_GeneratorType_type = {
     0,
     0,
     0,
-#if PY_VERSION_HEX >= 0x030400a1
+#if CYTHON_USE_TP_FINALIZE
     0,
 #else
     __Pyx_Coroutine_del,
 #endif
     0,
-#if PY_VERSION_HEX >= 0x030400a1
+#if CYTHON_USE_TP_FINALIZE
     __Pyx_Coroutine_del,
+#elif PY_VERSION_HEX >= 0x030400a1
+    0,
 #endif
 };
 static int __pyx_Generator_init(void) {
@@ -16373,7 +17126,7 @@ static int __pyx_Generator_init(void) {
 }
 
 /* CheckBinaryVersion */
-                  static int __Pyx_check_binary_version(void) {
+              static int __Pyx_check_binary_version(void) {
     char ctversion[4], rtversion[4];
     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -16389,7 +17142,7 @@ static int __pyx_Generator_init(void) {
 }
 
 /* InitStrings */
-                  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+              static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
         if (t->is_unicode) {
@@ -16428,46 +17181,53 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
     Py_ssize_t ignore;
     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
 }
-static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    char* defenc_c;
+    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+    if (!defenc) return NULL;
+    defenc_c = PyBytes_AS_STRING(defenc);
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
+    {
+        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+        char* c;
+        for (c = defenc_c; c < end; c++) {
+            if ((unsigned char) (*c) >= 128) {
+                PyUnicode_AsASCIIString(o);
+                return NULL;
             }
         }
+    }
 #endif
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
+    *length = PyBytes_GET_SIZE(defenc);
+    return defenc_c;
+}
 #else
-        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_LENGTH(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
+    if (likely(PyUnicode_IS_ASCII(o))) {
+        *length = PyUnicode_GET_LENGTH(o);
+        return PyUnicode_AsUTF8(o);
+    } else {
+        PyUnicode_AsASCIIString(o);
+        return NULL;
+    }
 #else
-        return PyUnicode_AsUTF8AndSize(o, length);
+    return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+}
+#endif
 #endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+    if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+            __Pyx_sys_getdefaultencoding_not_ascii &&
 #endif
+            PyUnicode_Check(o)) {
+        return __Pyx_PyUnicode_AsStringAndSize(o, length);
     } else
 #endif
 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
@@ -16491,6 +17251,26 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
    else return PyObject_IsTrue(x);
 }
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+    if (PyLong_Check(result)) {
+        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+                "__int__ returned non-int (type %.200s).  "
+                "The ability to return an instance of a strict subclass of int "
+                "is deprecated, and may be removed in a future version of Python.",
+                Py_TYPE(result)->tp_name)) {
+            Py_DECREF(result);
+            return NULL;
+        }
+        return result;
+    }
+#endif
+    PyErr_Format(PyExc_TypeError,
+                 "__%.4s__ returned non-%.4s (type %.200s)",
+                 type_name, type_name, Py_TYPE(result)->tp_name);
+    Py_DECREF(result);
+    return NULL;
+}
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
 #if CYTHON_USE_TYPE_SLOTS
   PyNumberMethods *m;
@@ -16498,9 +17278,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   const char *name = NULL;
   PyObject *res = NULL;
 #if PY_MAJOR_VERSION < 3
-  if (PyInt_Check(x) || PyLong_Check(x))
+  if (likely(PyInt_Check(x) || PyLong_Check(x)))
 #else
-  if (PyLong_Check(x))
+  if (likely(PyLong_Check(x)))
 #endif
     return __Pyx_NewRef(x);
 #if CYTHON_USE_TYPE_SLOTS
@@ -16508,32 +17288,30 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   #if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
-    res = PyNumber_Int(x);
+    res = m->nb_int(x);
   }
   else if (m && m->nb_long) {
     name = "long";
-    res = PyNumber_Long(x);
+    res = m->nb_long(x);
   }
   #else
-  if (m && m->nb_int) {
+  if (likely(m && m->nb_int)) {
     name = "int";
-    res = PyNumber_Long(x);
+    res = m->nb_int(x);
   }
   #endif
 #else
-  res = PyNumber_Int(x);
+  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+    res = PyNumber_Int(x);
+  }
 #endif
-  if (res) {
+  if (likely(res)) {
 #if PY_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
+    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
 #else
-    if (!PyLong_Check(res)) {
+    if (unlikely(!PyLong_CheckExact(res))) {
 #endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (type %.200s)",
-                   name, name, Py_TYPE(res)->tp_name);
-      Py_DECREF(res);
-      return NULL;
+        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
     }
   }
   else if (!PyErr_Occurred()) {
index d338cc9c4d0367363b4ec4727cda0c4f1fea410e..9360fabfd510aa7f6455e406b1ab5efef27287e0 100644 (file)
@@ -134,17 +134,20 @@ def prepare_predicate(next, token):
     # FIXME: replace with real parser!!! refs:
     # http://effbot.org/zone/simple-iterator-parser.htm
     # http://javascript.crockford.com/tdop/tdop.html
-    signature = []
+    signature = ''
     predicate = []
     while 1:
         token = next()
         if token[0] == "]":
             break
+        if token == ('', ''):
+            # ignore whitespace
+            continue
         if token[0] and token[0][:1] in "'\"":
             token = "'", token[0][1:-1]
-        signature.append(token[0] or "-")
+        signature += token[0] or "-"
         predicate.append(token[1])
-    signature = "".join(signature)
+
     # use signature to determine predicate type
     if signature == "@-":
         # [@attribute] predicate
@@ -172,16 +175,22 @@ def prepare_predicate(next, token):
                     yield elem
                     break
         return select
-    if signature == "-='" and not re.match(r"-?\d+$", predicate[0]):
-        # [tag='value']
+    if signature == ".='" or (signature == "-='" and not re.match(r"-?\d+$", predicate[0])):
+        # [.='value'] or [tag='value']
         tag = predicate[0]
         value = predicate[-1]
-        def select(result):
-            for elem in result:
-                for e in elem.iterchildren(tag):
-                    if "".join(e.itertext()) == value:
+        if tag:
+            def select(result):
+                for elem in result:
+                    for e in elem.iterchildren(tag):
+                        if "".join(e.itertext()) == value:
+                            yield elem
+                            break
+        else:
+            def select(result):
+                for elem in result:
+                    if "".join(elem.itertext()) == value:
                         yield elem
-                        break
         return select
     if signature == "-" or signature == "-()" or signature == "-()-":
         # [index] or [last()] or [last()-index]
index a00b750cfbce49cf7ba05d87b90fc7f7700c0655..d858fb738c6d5226e7590be0e227aae017d212c7 100644 (file)
@@ -1,8 +1,14 @@
-/* Generated by Cython 0.26.1 */
+/* Generated by Cython 0.27.1 */
 
 /* BEGIN: Cython Metadata
 {
     "distutils": {
+        "define_macros": [
+            [
+                "CYTHON_CLINE_IN_TRACEBACK", 
+                "1"
+            ]
+        ], 
         "extra_compile_args": [
             "-w"
         ], 
@@ -32,10 +38,11 @@ END: Cython Metadata */
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
-    #error Cython requires Python 2.6+ or Python 3.2+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+    #error Cython requires Python 2.6+ or Python 3.3+.
 #else
-#define CYTHON_ABI "0_26_1"
+#define CYTHON_ABI "0_27_1"
+#define CYTHON_FUTURE_DIVISION 0
 #include <stddef.h>
 #ifndef offsetof
   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
@@ -59,7 +66,7 @@ END: Cython Metadata */
 #endif
 #define __PYX_COMMA ,
 #ifndef HAVE_LONG_LONG
-  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+  #if PY_VERSION_HEX >= 0x02070000
     #define HAVE_LONG_LONG
   #endif
 #endif
@@ -77,8 +84,12 @@ END: Cython Metadata */
   #define CYTHON_USE_TYPE_SLOTS 0
   #undef CYTHON_USE_PYTYPE_LOOKUP
   #define CYTHON_USE_PYTYPE_LOOKUP 0
-  #undef CYTHON_USE_ASYNC_SLOTS
-  #define CYTHON_USE_ASYNC_SLOTS 0
+  #if PY_VERSION_HEX < 0x03050000
+    #undef CYTHON_USE_ASYNC_SLOTS
+    #define CYTHON_USE_ASYNC_SLOTS 0
+  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+    #define CYTHON_USE_ASYNC_SLOTS 1
+  #endif
   #undef CYTHON_USE_PYLIST_INTERNALS
   #define CYTHON_USE_PYLIST_INTERNALS 0
   #undef CYTHON_USE_UNICODE_INTERNALS
@@ -97,6 +108,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #elif defined(PYSTON_VERSION)
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 1
@@ -130,6 +145,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #else
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 0
@@ -182,6 +201,12 @@ END: Cython Metadata */
   #ifndef CYTHON_FAST_PYCALL
     #define CYTHON_FAST_PYCALL 1
   #endif
+  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+    #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
+  #endif
+  #ifndef CYTHON_USE_TP_FINALIZE
+    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+  #endif
 #endif
 #if !defined(CYTHON_FAST_PYCCALL)
 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
@@ -237,6 +262,27 @@ END: Cython Metadata */
 #else
 #define __Pyx_PyFastCFunction_Check(func) 0
 #endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+  #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
+#else
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
@@ -320,7 +366,6 @@ END: Cython Metadata */
 #ifndef PySet_CheckExact
   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
 #endif
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
 #if PY_MAJOR_VERSION >= 3
   #define PyIntObject                  PyLongObject
@@ -371,15 +416,17 @@ END: Cython Metadata */
     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
   #else
+    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+  #endif
+#else
+  #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
     typedef struct {
         unaryfunc am_await;
         unaryfunc am_aiter;
         unaryfunc am_anext;
     } __Pyx_PyAsyncMethodsStruct;
-    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
-  #endif
-#else
-  #define __Pyx_PyType_AsAsync(obj) NULL
 #endif
 #ifndef CYTHON_RESTRICT
   #if defined(__GNUC__)
@@ -489,14 +536,6 @@ static CYTHON_INLINE float __PYX_NAN() {
   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
 }
 
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
-#else
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
-#endif
-
 #ifndef __PYX_EXTERN_C
   #ifdef __cplusplus
     #define __PYX_EXTERN_C extern "C"
@@ -511,7 +550,7 @@ static CYTHON_INLINE float __PYX_NAN() {
 #include <omp.h>
 #endif /* _OPENMP */
 
-#ifdef PYREX_WITHOUT_ASSERTIONS
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
@@ -542,8 +581,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc
     #define __Pyx_sst_abs(value) abs(value)
 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
     #define __Pyx_sst_abs(value) labs(value)
-#elif defined (_MSC_VER) && defined (_M_X64)
-    #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (_MSC_VER)
+    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
     #define __Pyx_sst_abs(value) llabs(value)
 #elif defined (__GNUC__)
@@ -565,6 +604,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
 #endif
+#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
@@ -575,16 +620,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
     const Py_UNICODE *u_end = u;
     while (*u_end++) ;
     return (size_t)(u_end - u - 1);
 }
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
@@ -593,6 +633,8 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 #if CYTHON_ASSUME_SAFE_MACROS
@@ -693,7 +735,7 @@ bad:
 #endif /* __GNUC__ */
 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
 
-static PyObject *__pyx_m;
+static PyObject *__pyx_m = NULL;
 static PyObject *__pyx_d;
 static PyObject *__pyx_b;
 static PyObject *__pyx_cython_runtime;
@@ -857,7 +899,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                               int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                      int is_list, int wraparound, int boundscheck);
 
@@ -882,10 +924,12 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr
 /* PyThreadStateGet.proto */
 #if CYTHON_FAST_THREAD_STATE
 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
+#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
 #else
 #define __Pyx_PyThreadState_declare
 #define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
 #endif
 
 /* SaveResetException.proto */
@@ -924,13 +968,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
 
 /* PyErrFetchRestore.proto */
 #if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
 #else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
@@ -1120,6 +1172,7 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
 
 /* PyObjectCallMethod1.proto */
 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
+static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
 
 /* append.proto */
 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
@@ -1189,6 +1242,18 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 /* CIntFromPy.proto */
 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+
 /* CheckBinaryVersion.proto */
 static int __Pyx_check_binary_version(void);
 
@@ -1661,7 +1726,6 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_8__init___add_text(CYTHO
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -1722,14 +1786,12 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_8__init___add_text(CYTHO
  *                 elem[-1].tail = (elem[-1].tail or "") + item
  *             except IndexError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L4_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -2082,7 +2144,7 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_8__init___4add_dict(PyOb
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 189, __pyx_L1_error)
         }
         break;
@@ -2153,7 +2215,7 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_8__init___4add_dict(PyOb
  */
     __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = PyObject_IsInstance(__pyx_v_v, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 190, __pyx_L1_error)
+    __pyx_t_9 = PyObject_IsInstance(__pyx_v_v, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 190, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_10 = (__pyx_t_9 != 0);
     if (__pyx_t_10) {
@@ -2440,7 +2502,7 @@ static int __pyx_pf_4lxml_7builder_12ElementMaker___init__(struct __pyx_obj_4lxm
  */
     #ifndef CYTHON_WITHOUT_ASSERTIONS
     if (unlikely(!Py_OptimizeFlag)) {
-      __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_makeelement); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 157, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_makeelement); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 157, __pyx_L1_error)
       if (unlikely(!(__pyx_t_1 != 0))) {
         PyErr_SetNone(PyExc_AssertionError);
         __PYX_ERR(0, 157, __pyx_L1_error)
@@ -2537,7 +2599,7 @@ static int __pyx_pf_4lxml_7builder_12ElementMaker___init__(struct __pyx_obj_4lxm
  *         def add_text(elem, item):
  */
   /*else*/ {
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_typemap);
     __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_typemap, __pyx_t_4);
@@ -2921,7 +2983,7 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_2__call__(struct __pyx_o
   __Pyx_INCREF(__pyx_v_tag);
   __Pyx_GIVEREF(__pyx_v_tag);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tag);
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_nsmap, __pyx_v_self->_nsmap) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
   __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_self->_makeelement, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error)
@@ -3036,7 +3098,7 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_2__call__(struct __pyx_o
  *                 item = item()
  *             t = typemap.get(type(item))
  */
-    __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_item); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 209, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_item); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 209, __pyx_L1_error)
     __pyx_t_4 = (__pyx_t_2 != 0);
     if (__pyx_t_4) {
 
@@ -3086,7 +3148,7 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_2__call__(struct __pyx_o
  *                 if ET.iselement(item):
  */
     if (unlikely(__pyx_v_typemap == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
       __PYX_ERR(0, 211, __pyx_L1_error)
     }
     __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_typemap, ((PyObject *)Py_TYPE(__pyx_v_item)), Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
@@ -3168,7 +3230,7 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_2__call__(struct __pyx_o
  *                     continue
  *                 for basetype in type(item).__mro__:
  */
-        __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_elem, __pyx_v_item); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 214, __pyx_L1_error)
+        __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_elem, __pyx_v_item); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 214, __pyx_L1_error)
 
         /* "lxml/builder.py":215
  *                 if ET.iselement(item):
@@ -3230,7 +3292,7 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_2__call__(struct __pyx_o
           if (unlikely(!__pyx_t_5)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(0, 216, __pyx_L1_error)
             }
             break;
@@ -3248,7 +3310,7 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_2__call__(struct __pyx_o
  *                         break
  */
         if (unlikely(__pyx_v_typemap == Py_None)) {
-          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
           __PYX_ERR(0, 218, __pyx_L1_error)
         }
         __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_typemap, __pyx_v_basetype, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error)
@@ -3429,7 +3491,7 @@ static PyObject *__pyx_pf_4lxml_7builder_12ElementMaker_2__call__(struct __pyx_o
  *         return elem
  */
       if (unlikely(__pyx_v_typemap == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
         __PYX_ERR(0, 226, __pyx_L1_error)
       }
       __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_typemap, ((PyObject *)Py_TYPE(__pyx_v_v)), Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error)
@@ -4525,14 +4587,14 @@ static PyObject *__pyx_f_4lxml_7builder___pyx_unpickle_ElementMaker__set_state(s
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(1, 11, __pyx_L1_error)
   }
-  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 11, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
   __pyx_t_4 = ((__pyx_t_3 > 4) != 0);
   if (__pyx_t_4) {
   } else {
     __pyx_t_2 = __pyx_t_4;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 11, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
   __pyx_t_5 = (__pyx_t_4 != 0);
   __pyx_t_2 = __pyx_t_5;
   __pyx_L4_bool_binop_done:;
@@ -4654,7 +4716,7 @@ static PyObject *__pyx_tp_new_4lxml_7builder_ElementMaker(PyTypeObject *t, CYTHO
 
 static void __pyx_tp_dealloc_4lxml_7builder_ElementMaker(PyObject *o) {
   struct __pyx_obj_4lxml_7builder_ElementMaker *p = (struct __pyx_obj_4lxml_7builder_ElementMaker *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -4898,17 +4960,31 @@ static PyMethodDef __pyx_methods[] = {
 };
 
 #if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec_builder(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+  {Py_mod_create, (void*)__pyx_pymod_create},
+  {Py_mod_exec, (void*)__pyx_pymod_exec_builder},
+  {0, NULL}
+};
+#endif
+
 static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
     PyModuleDef_HEAD_INIT,
-  #endif
     "builder",
     __pyx_k_The_E_Element_factory_for_gener, /* m_doc */
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    0, /* m_size */
+  #else
     -1, /* m_size */
+  #endif
     __pyx_methods /* m_methods */,
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    __pyx_moduledef_slots, /* m_slots */
+  #else
     NULL, /* m_reload */
+  #endif
     NULL, /* m_traverse */
     NULL, /* m_clear */
     (freefunc)__pyx_module_cleanup /* m_free */
@@ -5018,7 +5094,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_elem, __pyx_n_s_item); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 169, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__4);
   __Pyx_GIVEREF(__pyx_tuple__4);
-  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_builder_py, __pyx_n_s_add_text, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_builder_py, __pyx_n_s_add_text, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 169, __pyx_L1_error)
 
   /* "lxml/builder.py":175
  *                 elem.text = (elem.text or "") + item
@@ -5030,7 +5106,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_elem, __pyx_n_s_cdata); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 175, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__6);
   __Pyx_GIVEREF(__pyx_tuple__6);
-  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_builder_py, __pyx_n_s_add_cdata, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_builder_py, __pyx_n_s_add_cdata, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 175, __pyx_L1_error)
 
   /* "lxml/builder.py":187
  *             typemap[ET.CDATA] = add_cdata
@@ -5042,7 +5118,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__8 = PyTuple_Pack(5, __pyx_n_s_elem, __pyx_n_s_item, __pyx_n_s_attrib, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 187, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__8);
   __Pyx_GIVEREF(__pyx_tuple__8);
-  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_builder_py, __pyx_n_s_add_dict, 187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 187, __pyx_L1_error)
+  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_builder_py, __pyx_n_s_add_dict, 187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 187, __pyx_L1_error)
 
   /* "(tree fragment)":1
  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
@@ -5052,7 +5128,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_use_setstate, __pyx_n_s_state, __pyx_n_s_dict_2); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__11);
   __Pyx_GIVEREF(__pyx_tuple__11);
-  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 1, __pyx_L1_error)
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 1, __pyx_L1_error)
 
   /* "(tree fragment)":14
  *     else:
@@ -5063,7 +5139,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 14, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__13);
   __Pyx_GIVEREF(__pyx_tuple__13);
-  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 14, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 14, __pyx_L1_error)
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 14, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 14, __pyx_L1_error)
 
   /* "(tree fragment)":1
  * def __pyx_unpickle_ElementMaker(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
@@ -5073,7 +5149,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 1, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__15);
   __Pyx_GIVEREF(__pyx_tuple__15);
-  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ElementMaker, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 1, __pyx_L1_error)
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ElementMaker, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 1, __pyx_L1_error)
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -5095,6 +5171,47 @@ PyMODINIT_FUNC initbuilder(void)
 #else
 PyMODINIT_FUNC PyInit_builder(void); /*proto*/
 PyMODINIT_FUNC PyInit_builder(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+  return PyModuleDef_Init(&__pyx_moduledef);
+}
+static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
+    PyObject *value = PyObject_GetAttrString(spec, from_name);
+    int result = 0;
+    if (likely(value)) {
+        result = PyDict_SetItemString(moddict, to_name, value);
+        Py_DECREF(value);
+    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+        PyErr_Clear();
+    } else {
+        result = -1;
+    }
+    return result;
+}
+static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+    PyObject *module = NULL, *moddict, *modname;
+    if (__pyx_m)
+        return __Pyx_NewRef(__pyx_m);
+    modname = PyObject_GetAttrString(spec, "name");
+    if (unlikely(!modname)) goto bad;
+    module = PyModule_NewObject(modname);
+    Py_DECREF(modname);
+    if (unlikely(!module)) goto bad;
+    moddict = PyModule_GetDict(module);
+    if (unlikely(!moddict)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
+    return module;
+bad:
+    Py_XDECREF(module);
+    return NULL;
+}
+
+
+static int __pyx_pymod_exec_builder(PyObject *__pyx_pyinit_module)
+#endif
 #endif
 {
   PyObject *__pyx_t_1 = NULL;
@@ -5105,6 +5222,9 @@ PyMODINIT_FUNC PyInit_builder(void)
   int __pyx_t_6;
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannyDeclarations
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
+  #endif
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
   if (!__Pyx_RefNanny) {
@@ -5131,6 +5251,9 @@ PyMODINIT_FUNC PyInit_builder(void)
   #ifdef __Pyx_Generator_USED
   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
+  #ifdef __Pyx_AsyncGen_USED
+  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   #ifdef __Pyx_StopAsyncIteration_USED
   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
@@ -5142,12 +5265,17 @@ PyMODINIT_FUNC PyInit_builder(void)
   #endif
   #endif
   /*--- Module creation code ---*/
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  __pyx_m = __pyx_pyinit_module;
+  Py_INCREF(__pyx_m);
+  #else
   #if PY_MAJOR_VERSION < 3
   __pyx_m = Py_InitModule4("builder", __pyx_methods, __pyx_k_The_E_Element_factory_for_gener, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
   Py_INCREF(__pyx_d);
   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
@@ -5284,7 +5412,6 @@ PyMODINIT_FUNC PyInit_builder(void)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L7_try_end;
     __pyx_L2_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -5326,14 +5453,12 @@ PyMODINIT_FUNC PyInit_builder(void)
  *     basestring
  * except NameError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
     goto __pyx_L1_error;
     __pyx_L3_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
@@ -5381,7 +5506,6 @@ PyMODINIT_FUNC PyInit_builder(void)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L15_try_end;
     __pyx_L10_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -5424,14 +5548,12 @@ PyMODINIT_FUNC PyInit_builder(void)
  *     unicode
  * except NameError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L11_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -5485,7 +5607,7 @@ PyMODINIT_FUNC PyInit_builder(void)
  * # Element generator factory by Fredrik Lundh.
  * #
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -5508,10 +5630,12 @@ PyMODINIT_FUNC PyInit_builder(void)
   }
   __pyx_L0:;
   __Pyx_RefNannyFinishContext();
-  #if PY_MAJOR_VERSION < 3
-  return;
-  #else
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  return (__pyx_m != NULL) ? 0 : -1;
+  #elif PY_MAJOR_VERSION >= 3
   return __pyx_m;
+  #else
+  return;
   #endif
 }
 
@@ -5740,7 +5864,7 @@ static void __Pyx_RaiseArgtupleInvalid(
 }
 
 /* GetItemInt */
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
     PyObject *r;
     if (!j) return NULL;
     r = PyObject_GetItem(o, j);
@@ -5852,11 +5976,26 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject
 
 /* PyErrExceptionMatches */
 #if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+    Py_ssize_t i, n;
+    n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+    for (i=0; i<n; i++) {
+        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+    }
+#endif
+    for (i=0; i<n; i++) {
+        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
+    }
+    return 0;
+}
 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
     PyObject *exc_type = tstate->curexc_type;
     if (exc_type == err) return 1;
     if (unlikely(!exc_type)) return 0;
-    return PyErr_GivenExceptionMatches(exc_type, err);
+    if (unlikely(PyTuple_Check(err)))
+        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
 }
 #endif
 
@@ -6081,11 +6220,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             "raise: exception class must be a subclass of BaseException");
         goto bad;
     }
-#if PY_VERSION_HEX >= 0x03030000
     if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
         PyObject *fixed_cause;
         if (cause == Py_None) {
             fixed_cause = NULL;
@@ -6113,7 +6248,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         PyErr_Restore(tmp_type, tmp_value, tb);
         Py_XDECREF(tmp_tb);
 #else
-        PyThreadState *tstate = PyThreadState_GET();
+        PyThreadState *tstate = __Pyx_PyThreadState_Current;
         PyObject* tmp_tb = tstate->curexc_traceback;
         if (tb != tmp_tb) {
             Py_INCREF(tb);
@@ -6129,7 +6264,7 @@ bad:
 #endif
 
 /* PyCFunctionFastCall */
-    #if CYTHON_FAST_PYCCALL
+  #if CYTHON_FAST_PYCCALL
 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
@@ -6152,12 +6287,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, P
 #endif
 
 /* PyFunctionFastCall */
-    #if CYTHON_FAST_PYCALL
+  #if CYTHON_FAST_PYCALL
 #include "frameobject.h"
 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                                PyObject *globals) {
     PyFrameObject *f;
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject **fastlocals;
     Py_ssize_t i;
     PyObject *result;
@@ -6272,7 +6407,7 @@ done:
 #endif
 
 /* PyObjectCallMethO */
-    #if CYTHON_COMPILING_IN_CPYTHON
+  #if CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
     PyObject *self, *result;
     PyCFunction cfunc;
@@ -6292,7 +6427,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
 #endif
 
 /* PyObjectCallOneArg */
-    #if CYTHON_COMPILING_IN_CPYTHON
+  #if CYTHON_COMPILING_IN_CPYTHON
 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
     PyObject *result;
     PyObject *args = PyTuple_New(1);
@@ -6332,7 +6467,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
 #endif
 
 /* PyObjectCallNoArg */
-    #if CYTHON_COMPILING_IN_CPYTHON
+  #if CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(func)) {
@@ -6340,7 +6475,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
     }
 #endif
 #ifdef __Pyx_CyFunction_USED
-    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+    if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
 #else
     if (likely(PyCFunction_Check(func))) {
 #endif
@@ -6353,25 +6488,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 #endif
 
 /* RaiseTooManyValuesToUnpack */
-      static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+    static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
     PyErr_Format(PyExc_ValueError,
                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
 }
 
 /* RaiseNeedMoreValuesToUnpack */
-      static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+    static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                  index, (index == 1) ? "" : "s");
 }
 
 /* IterFinish */
-      static CYTHON_INLINE int __Pyx_IterFinish(void) {
+    static CYTHON_INLINE int __Pyx_IterFinish(void) {
 #if CYTHON_FAST_THREAD_STATE
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject* exc_type = tstate->curexc_type;
     if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
+        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
             PyObject *exc_value, *exc_tb;
             exc_value = tstate->curexc_value;
             exc_tb = tstate->curexc_traceback;
@@ -6401,7 +6536,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 }
 
 /* UnpackItemEndCheck */
-      static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+    static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
     if (unlikely(retval)) {
         Py_DECREF(retval);
         __Pyx_RaiseTooManyValuesError(expected);
@@ -6413,7 +6548,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 }
 
 /* GetModuleGlobalName */
-      static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+    static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
     PyObject *result;
 #if !CYTHON_AVOID_BORROWED_REFS
     result = PyDict_GetItem(__pyx_d, name);
@@ -6431,12 +6566,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 }
 
 /* None */
-        static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
+      static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
     PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
 }
 
 /* FetchCommonType */
-        static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+      static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
     PyObject* fake_module;
     PyTypeObject* cached_type = NULL;
     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
@@ -6475,7 +6610,7 @@ bad:
 }
 
 /* CythonFunction */
-        static PyObject *
+      static PyObject *
 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
 {
     if (unlikely(op->func_doc == NULL)) {
@@ -6835,14 +6970,18 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
     }
     return 0;
 }
-static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
 {
-    PyObject_GC_UnTrack(m);
     if (__Pyx_CyFunction_weakreflist(m) != NULL)
         PyObject_ClearWeakRefs((PyObject *) m);
     __Pyx_CyFunction_clear(m);
     PyObject_GC_Del(m);
 }
+static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+{
+    PyObject_GC_UnTrack(m);
+    __Pyx__CyFunction_dealloc(m);
+}
 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
 {
     Py_VISIT(m->func_closure);
@@ -6917,10 +7056,16 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py
         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
             size = PyTuple_GET_SIZE(arg);
             if (likely(size == 1)) {
-                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
-                if (unlikely(!arg0)) return NULL;
+                PyObject *result, *arg0;
+                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+                arg0 = PyTuple_GET_ITEM(arg, 0);
+                #else
+                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
+                #endif
                 result = (*meth)(self, arg0);
+                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                 Py_DECREF(arg0);
+                #endif
                 return result;
             }
             PyErr_Format(PyExc_TypeError,
@@ -7027,7 +7172,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
 };
 static int __pyx_CyFunction_init(void) {
     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
-    if (__pyx_CyFunctionType == NULL) {
+    if (unlikely(__pyx_CyFunctionType == NULL)) {
         return -1;
     }
     return 0;
@@ -7035,7 +7180,7 @@ static int __pyx_CyFunction_init(void) {
 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
     m->defaults = PyObject_Malloc(size);
-    if (!m->defaults)
+    if (unlikely(!m->defaults))
         return PyErr_NoMemory();
     memset(m->defaults, 0, size);
     m->defaults_pyobjects = pyobjects;
@@ -7058,7 +7203,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
 }
 
 /* BytesEquals */
-            static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+          static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
 #if CYTHON_COMPILING_IN_PYPY
     return PyObject_RichCompareBool(s1, s2, equals);
 #else
@@ -7105,7 +7250,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
 }
 
 /* UnicodeEquals */
-            static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+          static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
 #if CYTHON_COMPILING_IN_PYPY
     return PyObject_RichCompareBool(s1, s2, equals);
 #else
@@ -7204,7 +7349,7 @@ return_ne:
 }
 
 /* dict_getitem_default */
-            static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
+          static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
     PyObject* value;
 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
     value = PyDict_GetItemWithError(d, key);
@@ -7232,10 +7377,8 @@ return_ne:
 }
 
 /* PyObjectCallMethod1 */
-            static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
-    PyObject *method, *result = NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto done;
+          static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
+    PyObject *result = NULL;
 #if CYTHON_UNPACK_METHODS
     if (likely(PyMethod_Check(method))) {
         PyObject *self = PyMethod_GET_SELF(method);
@@ -7263,7 +7406,6 @@ return_ne:
             Py_INCREF(arg);
             PyTuple_SET_ITEM(args, 1, arg);
             Py_INCREF(function);
-            Py_DECREF(method); method = NULL;
             result = __Pyx_PyObject_Call(function, args, NULL);
             Py_DECREF(args);
             Py_DECREF(function);
@@ -7272,13 +7414,22 @@ return_ne:
     }
 #endif
     result = __Pyx_PyObject_CallOneArg(method, arg);
+    goto done;
+done:
+    return result;
+}
+static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
+    PyObject *method, *result = NULL;
+    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
+    if (unlikely(!method)) goto done;
+    result = __Pyx__PyObject_CallMethod1(method, arg);
 done:
     Py_XDECREF(method);
     return result;
 }
 
 /* append */
-            static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
+          static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
     if (likely(PyList_CheckExact(L))) {
         if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
     } else {
@@ -7291,8 +7442,8 @@ done:
 }
 
 /* GetAttr */
-            static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
-#if CYTHON_COMPILING_IN_CPYTHON
+          static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_USE_TYPE_SLOTS
 #if PY_MAJOR_VERSION >= 3
     if (likely(PyUnicode_Check(n)))
 #else
@@ -7304,28 +7455,28 @@ done:
 }
 
 /* GetAttr3 */
-            static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
+          static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
+        return NULL;
+    __Pyx_PyErr_Clear();
+    Py_INCREF(d);
+    return d;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
     PyObject *r = __Pyx_GetAttr(o, n);
-    if (unlikely(!r)) {
-        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
-            goto bad;
-        PyErr_Clear();
-        r = d;
-        Py_INCREF(d);
-    }
-    return r;
-bad:
-    return NULL;
+    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
 }
 
 /* Import */
-            static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+          static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     PyObject *empty_list = 0;
     PyObject *module = 0;
     PyObject *global_dict = 0;
     PyObject *empty_dict = 0;
     PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     PyObject *py_import;
     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
@@ -7349,17 +7500,8 @@ bad:
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
             if (strchr(__Pyx_MODULE_NAME, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                PyObject *py_level = PyInt_FromLong(1);
-                if (!py_level)
-                    goto bad;
-                module = PyObject_CallFunctionObjArgs(py_import,
-                    name, global_dict, empty_dict, list, py_level, NULL);
-                Py_DECREF(py_level);
-                #else
                 module = PyImport_ImportModuleLevelObject(
                     name, global_dict, empty_dict, list, 1);
-                #endif
                 if (!module) {
                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
                         goto bad;
@@ -7370,7 +7512,7 @@ bad:
         }
         #endif
         if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
+            #if PY_MAJOR_VERSION < 3
             PyObject *py_level = PyInt_FromLong(level);
             if (!py_level)
                 goto bad;
@@ -7384,7 +7526,7 @@ bad:
         }
     }
 bad:
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     Py_XDECREF(py_import);
     #endif
     Py_XDECREF(empty_list);
@@ -7393,7 +7535,7 @@ bad:
 }
 
 /* ImportFrom */
-            static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+          static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
         PyErr_Format(PyExc_ImportError,
@@ -7407,7 +7549,7 @@ bad:
 }
 
 /* HasAttr */
-            static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
+          static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
     PyObject *r;
     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
         PyErr_SetString(PyExc_TypeError,
@@ -7425,7 +7567,7 @@ bad:
 }
 
 /* SetupReduce */
-            static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
+          static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
   int ret;
   PyObject *name_attr;
   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
@@ -7488,7 +7630,7 @@ BAD:
         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
     ret = -1;
 GOOD:
-#if !CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_USE_PYTYPE_LOOKUP
     Py_XDECREF(object_reduce);
     Py_XDECREF(object_reduce_ex);
 #endif
@@ -7501,7 +7643,7 @@ GOOD:
 }
 
 /* ModuleImport */
-            #ifndef __PYX_HAVE_RT_ImportModule
+          #ifndef __PYX_HAVE_RT_ImportModule
 #define __PYX_HAVE_RT_ImportModule
 static PyObject *__Pyx_ImportModule(const char *name) {
     PyObject *py_name = 0;
@@ -7519,7 +7661,7 @@ bad:
 #endif
 
 /* RegisterModuleCleanup */
-            #if PY_MAJOR_VERSION < 3
+          #if PY_MAJOR_VERSION < 3
 static PyObject* __pyx_module_cleanup_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) {
     __pyx_module_cleanup(module);
     Py_INCREF(Py_None); return Py_None;
@@ -7586,7 +7728,7 @@ static int __Pyx_RegisterCleanup(void) {
 #endif
 
 /* CLineInTraceback */
-            static int __Pyx_CLineForTraceback(int c_line) {
+          static int __Pyx_CLineForTraceback(int c_line) {
 #ifdef CYTHON_CLINE_IN_TRACEBACK
     return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0;
 #else
@@ -7622,7 +7764,7 @@ static int __Pyx_RegisterCleanup(void) {
 }
 
 /* CodeObjectCache */
-            static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+          static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
     int start = 0, mid = 0, end = count - 1;
     if (end >= 0 && code_line > entries[end].code_line) {
         return count;
@@ -7702,7 +7844,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
 }
 
 /* AddTraceback */
-            #include "compile.h"
+          #include "compile.h"
 #include "frameobject.h"
 #include "traceback.h"
 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -7772,10 +7914,10 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
     }
     py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        __pyx_d,      /*PyObject *globals,*/
-        0                    /*PyObject *locals*/
+        __Pyx_PyThreadState_Current, /*PyThreadState *tstate,*/
+        py_code,                     /*PyCodeObject *code,*/
+        __pyx_d,              /*PyObject *globals,*/
+        0                            /*PyObject *locals*/
     );
     if (!py_frame) goto bad;
     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
@@ -7786,7 +7928,7 @@ bad:
 }
 
 /* CIntFromPyVerify */
-            #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+          #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
@@ -7808,7 +7950,7 @@ bad:
     }
 
 /* CIntToPy */
-            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -7839,7 +7981,7 @@ bad:
 }
 
 /* CIntFromPy */
-            static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+          static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -8028,7 +8170,7 @@ raise_neg_overflow:
 }
 
 /* CIntFromPy */
-            static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+          static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
     const int neg_one = (int) -1, const_zero = (int) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -8216,8 +8358,80 @@ raise_neg_overflow:
     return (int) -1;
 }
 
+/* FastTypeChecks */
+          #if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+    while (a) {
+        a = a->tp_base;
+        if (a == b)
+            return 1;
+    }
+    return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+    PyObject *mro;
+    if (a == b) return 1;
+    mro = a->tp_mro;
+    if (likely(mro)) {
+        Py_ssize_t i, n;
+        n = PyTuple_GET_SIZE(mro);
+        for (i = 0; i < n; i++) {
+            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+                return 1;
+        }
+        return 0;
+    }
+    return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+    PyObject *exception, *value, *tb;
+    int res;
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    __Pyx_ErrFetch(&exception, &value, &tb);
+    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+    if (unlikely(res == -1)) {
+        PyErr_WriteUnraisable(err);
+        res = 0;
+    }
+    if (!res) {
+        res = PyObject_IsSubclass(err, exc_type2);
+        if (unlikely(res == -1)) {
+            PyErr_WriteUnraisable(err);
+            res = 0;
+        }
+    }
+    __Pyx_ErrRestore(exception, value, tb);
+    return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+    if (!res) {
+        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+    }
+    return res;
+}
+#endif
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+    if (likely(err == exc_type)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+    }
+    return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+    if (likely(err == exc_type1 || err == exc_type2)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+    }
+    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
 /* CheckBinaryVersion */
-            static int __Pyx_check_binary_version(void) {
+          static int __Pyx_check_binary_version(void) {
     char ctversion[4], rtversion[4];
     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -8233,7 +8447,7 @@ raise_neg_overflow:
 }
 
 /* VoidPtrExport */
-            static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
+          static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
     PyObject *d;
     PyObject *cobj = 0;
     d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi);
@@ -8264,7 +8478,7 @@ bad:
 }
 
 /* InitStrings */
-            static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+          static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
         if (t->is_unicode) {
@@ -8303,46 +8517,53 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
     Py_ssize_t ignore;
     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
 }
-static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    char* defenc_c;
+    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+    if (!defenc) return NULL;
+    defenc_c = PyBytes_AS_STRING(defenc);
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
+    {
+        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+        char* c;
+        for (c = defenc_c; c < end; c++) {
+            if ((unsigned char) (*c) >= 128) {
+                PyUnicode_AsASCIIString(o);
+                return NULL;
             }
         }
+    }
 #endif
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
+    *length = PyBytes_GET_SIZE(defenc);
+    return defenc_c;
+}
 #else
-        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_LENGTH(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
+    if (likely(PyUnicode_IS_ASCII(o))) {
+        *length = PyUnicode_GET_LENGTH(o);
+        return PyUnicode_AsUTF8(o);
+    } else {
+        PyUnicode_AsASCIIString(o);
+        return NULL;
+    }
 #else
-        return PyUnicode_AsUTF8AndSize(o, length);
+    return PyUnicode_AsUTF8AndSize(o, length);
 #endif
+}
 #endif
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+    if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+            __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+            PyUnicode_Check(o)) {
+        return __Pyx_PyUnicode_AsStringAndSize(o, length);
     } else
 #endif
 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
@@ -8366,6 +8587,26 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
    else return PyObject_IsTrue(x);
 }
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+    if (PyLong_Check(result)) {
+        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+                "__int__ returned non-int (type %.200s).  "
+                "The ability to return an instance of a strict subclass of int "
+                "is deprecated, and may be removed in a future version of Python.",
+                Py_TYPE(result)->tp_name)) {
+            Py_DECREF(result);
+            return NULL;
+        }
+        return result;
+    }
+#endif
+    PyErr_Format(PyExc_TypeError,
+                 "__%.4s__ returned non-%.4s (type %.200s)",
+                 type_name, type_name, Py_TYPE(result)->tp_name);
+    Py_DECREF(result);
+    return NULL;
+}
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
 #if CYTHON_USE_TYPE_SLOTS
   PyNumberMethods *m;
@@ -8373,9 +8614,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   const char *name = NULL;
   PyObject *res = NULL;
 #if PY_MAJOR_VERSION < 3
-  if (PyInt_Check(x) || PyLong_Check(x))
+  if (likely(PyInt_Check(x) || PyLong_Check(x)))
 #else
-  if (PyLong_Check(x))
+  if (likely(PyLong_Check(x)))
 #endif
     return __Pyx_NewRef(x);
 #if CYTHON_USE_TYPE_SLOTS
@@ -8383,32 +8624,30 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   #if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
-    res = PyNumber_Int(x);
+    res = m->nb_int(x);
   }
   else if (m && m->nb_long) {
     name = "long";
-    res = PyNumber_Long(x);
+    res = m->nb_long(x);
   }
   #else
-  if (m && m->nb_int) {
+  if (likely(m && m->nb_int)) {
     name = "int";
-    res = PyNumber_Long(x);
+    res = m->nb_int(x);
   }
   #endif
 #else
-  res = PyNumber_Int(x);
+  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+    res = PyNumber_Int(x);
+  }
 #endif
-  if (res) {
+  if (likely(res)) {
 #if PY_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
+    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
 #else
-    if (!PyLong_Check(res)) {
+    if (unlikely(!PyLong_CheckExact(res))) {
 #endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (type %.200s)",
-                   name, name, Py_TYPE(res)->tp_name);
-      Py_DECREF(res);
-      return NULL;
+        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
     }
   }
   else if (!PyErr_Occurred()) {
index 82740a511f7682689d8d37de1dabed12ff55ff6b..da3f4d83f8b1e29b0eb87010840826c56cd0ca31 100644 (file)
@@ -217,8 +217,7 @@ cdef public class ElementClassLookup [ type LxmlElementClassLookupType,
     Superclass of Element class lookups.
     """
     cdef _element_class_lookup_function _lookup_function
-    def __cinit__(self):
-        self._lookup_function = NULL # use default lookup
+
 
 cdef public class FallbackElementClassLookup(ElementClassLookup) \
          [ type LxmlFallbackElementClassLookupType,
@@ -520,7 +519,7 @@ cdef class PythonElementClassLookup(FallbackElementClassLookup):
 
 cdef object _python_class_lookup(state, _Document doc, tree.xmlNode* c_node):
     cdef PythonElementClassLookup lookup
-    cdef _ReadOnlyElementProxy proxy
+    cdef _ReadOnlyProxy proxy
     lookup = <PythonElementClassLookup>state
 
     proxy = _newReadOnlyProxy(None, c_node)
index 8e3711f191d6bad75f63ad2eb7a438cfb784bc1a..e05b96daeefe5e528e82e23eee50171ec1b88789 100644 (file)
@@ -1,8 +1,14 @@
-/* Generated by Cython 0.26.1 */
+/* Generated by Cython 0.27.1 */
 
 /* BEGIN: Cython Metadata
 {
     "distutils": {
+        "define_macros": [
+            [
+                "CYTHON_CLINE_IN_TRACEBACK", 
+                "1"
+            ]
+        ], 
         "depends": [
             "/usr/include/libxml2/libxml/HTMLtree.h", 
             "/usr/include/libxml2/libxml/chvalid.h", 
@@ -91,10 +97,11 @@ END: Cython Metadata */
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
-    #error Cython requires Python 2.6+ or Python 3.2+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+    #error Cython requires Python 2.6+ or Python 3.3+.
 #else
-#define CYTHON_ABI "0_26_1"
+#define CYTHON_ABI "0_27_1"
+#define CYTHON_FUTURE_DIVISION 0
 #include <stddef.h>
 #ifndef offsetof
   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
@@ -118,7 +125,7 @@ END: Cython Metadata */
 #endif
 #define __PYX_COMMA ,
 #ifndef HAVE_LONG_LONG
-  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+  #if PY_VERSION_HEX >= 0x02070000
     #define HAVE_LONG_LONG
   #endif
 #endif
@@ -136,8 +143,12 @@ END: Cython Metadata */
   #define CYTHON_USE_TYPE_SLOTS 0
   #undef CYTHON_USE_PYTYPE_LOOKUP
   #define CYTHON_USE_PYTYPE_LOOKUP 0
-  #undef CYTHON_USE_ASYNC_SLOTS
-  #define CYTHON_USE_ASYNC_SLOTS 0
+  #if PY_VERSION_HEX < 0x03050000
+    #undef CYTHON_USE_ASYNC_SLOTS
+    #define CYTHON_USE_ASYNC_SLOTS 0
+  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+    #define CYTHON_USE_ASYNC_SLOTS 1
+  #endif
   #undef CYTHON_USE_PYLIST_INTERNALS
   #define CYTHON_USE_PYLIST_INTERNALS 0
   #undef CYTHON_USE_UNICODE_INTERNALS
@@ -156,6 +167,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #elif defined(PYSTON_VERSION)
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 1
@@ -189,6 +204,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #else
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 0
@@ -241,6 +260,12 @@ END: Cython Metadata */
   #ifndef CYTHON_FAST_PYCALL
     #define CYTHON_FAST_PYCALL 1
   #endif
+  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+    #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
+  #endif
+  #ifndef CYTHON_USE_TP_FINALIZE
+    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+  #endif
 #endif
 #if !defined(CYTHON_FAST_PYCCALL)
 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
@@ -296,6 +321,27 @@ END: Cython Metadata */
 #else
 #define __Pyx_PyFastCFunction_Check(func) 0
 #endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+  #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
+#else
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
@@ -379,7 +425,6 @@ END: Cython Metadata */
 #ifndef PySet_CheckExact
   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
 #endif
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
 #if PY_MAJOR_VERSION >= 3
   #define PyIntObject                  PyLongObject
@@ -430,15 +475,17 @@ END: Cython Metadata */
     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
   #else
+    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+  #endif
+#else
+  #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
     typedef struct {
         unaryfunc am_await;
         unaryfunc am_aiter;
         unaryfunc am_anext;
     } __Pyx_PyAsyncMethodsStruct;
-    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
-  #endif
-#else
-  #define __Pyx_PyType_AsAsync(obj) NULL
 #endif
 #ifndef CYTHON_RESTRICT
   #if defined(__GNUC__)
@@ -548,14 +595,6 @@ static CYTHON_INLINE float __PYX_NAN() {
   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
 }
 
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
-#else
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
-#endif
-
 #ifndef __PYX_EXTERN_C
   #ifdef __cplusplus
     #define __PYX_EXTERN_C extern "C"
@@ -617,7 +656,7 @@ static CYTHON_INLINE float __PYX_NAN() {
 #include <omp.h>
 #endif /* _OPENMP */
 
-#ifdef PYREX_WITHOUT_ASSERTIONS
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
@@ -648,8 +687,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc
     #define __Pyx_sst_abs(value) abs(value)
 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
     #define __Pyx_sst_abs(value) labs(value)
-#elif defined (_MSC_VER) && defined (_M_X64)
-    #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (_MSC_VER)
+    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
     #define __Pyx_sst_abs(value) llabs(value)
 #elif defined (__GNUC__)
@@ -671,6 +710,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
 #endif
+#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
@@ -681,16 +726,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
     const Py_UNICODE *u_end = u;
     while (*u_end++) ;
     return (size_t)(u_end - u - 1);
 }
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
@@ -699,6 +739,8 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 #if CYTHON_ASSUME_SAFE_MACROS
@@ -799,7 +841,7 @@ bad:
 #endif /* __GNUC__ */
 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
 
-static PyObject *__pyx_m;
+static PyObject *__pyx_m = NULL;
 static PyObject *__pyx_d;
 static PyObject *__pyx_b;
 static PyObject *__pyx_cython_runtime;
@@ -841,6 +883,18 @@ static const char *__pyx_f[] = {
   "src/lxml/debug.pxi",
   "type.pxd",
 };
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+  #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+/* NoFastGil.proto */
+#define __Pyx_PyGILState_Ensure PyGILState_Ensure
+#define __Pyx_PyGILState_Release PyGILState_Release
+#define __Pyx_FastGIL_Remember()
+#define __Pyx_FastGIL_Forget()
+#define __Pyx_FastGilFuncInit()
+
 
 /*--- Type declarations ---*/
 struct __pyx_obj_4lxml_5etree_Error;
@@ -1108,7 +1162,7 @@ enum __pyx_t_4lxml_5etree__IterwalkSkipStates {
   __pyx_e_4lxml_5etree_IWSKIP_CANNOT_SKIP
 };
 
-/* "lxml/etree.pyx":156
+/* "lxml/etree.pyx":159
  * # PyPy requires us to store a Python reference for the
  * # namespace in order to keep the byte buffer alive.
  * cdef struct qname:             # <<<<<<<<<<<<<<
@@ -1120,7 +1174,7 @@ struct __pyx_t_4lxml_5etree_qname {
   PyObject *href;
 };
 
-/* "lxml/etree.pyx":327
+/* "lxml/etree.pyx":330
  * 
  * # type of a function that steps from node to node
  * ctypedef public xmlNode* (*_node_to_node_function)(xmlNode*)             # <<<<<<<<<<<<<<
@@ -1191,7 +1245,7 @@ struct __pyx_opt_args_4lxml_5etree__connectGenericErrorLog {
   int c_domain;
 };
 
-/* "lxml/etree.pyx":2741
+/* "lxml/etree.pyx":2744
  *                 self._storeTags(item, seen)
  * 
  *     cdef inline int cacheTags(self, _Document doc, bint force_into_dict=False) except -1:             # <<<<<<<<<<<<<<
@@ -1221,7 +1275,7 @@ typedef PyObject *(*_element_class_lookup_function)(PyObject *, struct LxmlDocum
  */
 typedef int (*__pyx_t_4lxml_5etree__register_function)(void *, PyObject *, PyObject *);
 
-/* "lxml/etree.pyx":209
+/* "lxml/etree.pyx":212
  * 
  * # Error superclass for ElementTree compatibility
  * cdef class Error(Exception):             # <<<<<<<<<<<<<<
@@ -1233,7 +1287,7 @@ struct __pyx_obj_4lxml_5etree_Error {
 };
 
 
-/* "lxml/etree.pyx":213
+/* "lxml/etree.pyx":216
  * 
  * # module level superclass for all exceptions
  * cdef class LxmlError(Error):             # <<<<<<<<<<<<<<
@@ -1245,7 +1299,7 @@ struct __pyx_obj_4lxml_5etree_LxmlError {
 };
 
 
-/* "lxml/etree.pyx":232
+/* "lxml/etree.pyx":235
  *     """
  * 
  * cdef class C14NError(LxmlError):             # <<<<<<<<<<<<<<
@@ -1257,7 +1311,7 @@ struct __pyx_obj_4lxml_5etree_C14NError {
 };
 
 
-/* "lxml/etree.pyx":286
+/* "lxml/etree.pyx":289
  * @cython.final
  * @cython.internal
  * cdef class _TempStore:             # <<<<<<<<<<<<<<
@@ -1271,7 +1325,7 @@ struct __pyx_obj_4lxml_5etree__TempStore {
 };
 
 
-/* "lxml/etree.pyx":301
+/* "lxml/etree.pyx":304
  * # class for temporarily storing exceptions raised in extensions
  * @cython.internal
  * cdef class _ExceptionContext:             # <<<<<<<<<<<<<<
@@ -1404,7 +1458,7 @@ struct __pyx_obj_4lxml_5etree_PyErrorLog {
 };
 
 
-/* "lxml/etree.pyx":343
+/* "lxml/etree.pyx":346
  * @cython.final
  * @cython.freelist(8)
  * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]:             # <<<<<<<<<<<<<<
@@ -1422,7 +1476,7 @@ struct LxmlDocument {
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlDocumentType;
 
-/* "lxml/etree.pyx":517
+/* "lxml/etree.pyx":520
  * 
  * 
  * cdef class DocInfo:             # <<<<<<<<<<<<<<
@@ -1436,7 +1490,7 @@ struct __pyx_obj_4lxml_5etree_DocInfo {
 };
 
 
-/* "lxml/etree.pyx":695
+/* "lxml/etree.pyx":698
  * 
  * @cython.no_gc_clear
  * cdef public class _Element [ type LxmlElementType, object LxmlElement ]:             # <<<<<<<<<<<<<<
@@ -1452,7 +1506,7 @@ struct LxmlElement {
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementType;
 
-/* "lxml/etree.pyx":1634
+/* "lxml/etree.pyx":1637
  * 
  * @cython.internal
  * cdef class __ContentOnlyElement(_Element):             # <<<<<<<<<<<<<<
@@ -1465,7 +1519,7 @@ struct __pyx_obj_4lxml_5etree___ContentOnlyElement {
 };
 
 
-/* "lxml/etree.pyx":1701
+/* "lxml/etree.pyx":1704
  *         return []
  * 
  * cdef class _Comment(__ContentOnlyElement):             # <<<<<<<<<<<<<<
@@ -1477,7 +1531,7 @@ struct __pyx_obj_4lxml_5etree__Comment {
 };
 
 
-/* "lxml/etree.pyx":1709
+/* "lxml/etree.pyx":1712
  *         return "<!--%s-->" % strrepr(self.text)
  * 
  * cdef class _ProcessingInstruction(__ContentOnlyElement):             # <<<<<<<<<<<<<<
@@ -1489,7 +1543,7 @@ struct __pyx_obj_4lxml_5etree__ProcessingInstruction {
 };
 
 
-/* "lxml/etree.pyx":1760
+/* "lxml/etree.pyx":1763
  * cdef object _FIND_PI_ATTRIBUTES = re.compile(ur'\s+(\w+)\s*=\s*(?:\'([^\']*)\'|"([^"]*)")', re.U).findall
  * 
  * cdef class _Entity(__ContentOnlyElement):             # <<<<<<<<<<<<<<
@@ -1501,7 +1555,7 @@ struct __pyx_obj_4lxml_5etree__Entity {
 };
 
 
-/* "lxml/etree.pyx":1789
+/* "lxml/etree.pyx":1792
  * 
  * 
  * cdef class QName:             # <<<<<<<<<<<<<<
@@ -1516,7 +1570,7 @@ struct __pyx_obj_4lxml_5etree_QName {
 };
 
 
-/* "lxml/etree.pyx":1857
+/* "lxml/etree.pyx":1860
  * 
  * 
  * cdef public class _ElementTree [ type LxmlElementTreeType,             # <<<<<<<<<<<<<<
@@ -1532,7 +1586,7 @@ struct LxmlElementTree {
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementTreeType;
 
-/* "lxml/etree.pyx":2405
+/* "lxml/etree.pyx":2408
  * @cython.final
  * @cython.freelist(16)
  * cdef class _Attrib:             # <<<<<<<<<<<<<<
@@ -1545,7 +1599,7 @@ struct __pyx_obj_4lxml_5etree__Attrib {
 };
 
 
-/* "lxml/etree.pyx":2545
+/* "lxml/etree.pyx":2548
  * @cython.final
  * @cython.internal
  * cdef class _AttribIterator:             # <<<<<<<<<<<<<<
@@ -1560,7 +1614,7 @@ struct __pyx_obj_4lxml_5etree__AttribIterator {
 };
 
 
-/* "lxml/etree.pyx":2586
+/* "lxml/etree.pyx":2589
  * 
  * 
  * cdef public class _ElementTagMatcher [ object LxmlElementTagMatcher,             # <<<<<<<<<<<<<<
@@ -1578,7 +1632,7 @@ struct LxmlElementTagMatcher {
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementTagMatcherType;
 
-/* "lxml/etree.pyx":2617
+/* "lxml/etree.pyx":2620
  *                 self._name = NULL
  * 
  * cdef public class _ElementIterator(_ElementTagMatcher) [             # <<<<<<<<<<<<<<
@@ -1593,7 +1647,7 @@ struct LxmlElementIterator {
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementIteratorType;
 
-/* "lxml/etree.pyx":2654
+/* "lxml/etree.pyx":2657
  * @cython.final
  * @cython.internal
  * cdef class _MultiTagMatcher:             # <<<<<<<<<<<<<<
@@ -1612,7 +1666,7 @@ struct __pyx_obj_4lxml_5etree__MultiTagMatcher {
 };
 
 
-/* "lxml/etree.pyx":2795
+/* "lxml/etree.pyx":2798
  *         return False
  * 
  * cdef class _ElementMatchIterator:             # <<<<<<<<<<<<<<
@@ -1628,7 +1682,7 @@ struct __pyx_obj_4lxml_5etree__ElementMatchIterator {
 };
 
 
-/* "lxml/etree.pyx":2824
+/* "lxml/etree.pyx":2827
  *         return current_node
  * 
  * cdef class ElementChildIterator(_ElementMatchIterator):             # <<<<<<<<<<<<<<
@@ -1640,7 +1694,7 @@ struct __pyx_obj_4lxml_5etree_ElementChildIterator {
 };
 
 
-/* "lxml/etree.pyx":2844
+/* "lxml/etree.pyx":2847
  *         self._node = _elementFactory(node._doc, c_node) if c_node is not NULL else None
  * 
  * cdef class SiblingsIterator(_ElementMatchIterator):             # <<<<<<<<<<<<<<
@@ -1652,7 +1706,7 @@ struct __pyx_obj_4lxml_5etree_SiblingsIterator {
 };
 
 
-/* "lxml/etree.pyx":2859
+/* "lxml/etree.pyx":2862
  *         self._storeNext(node)
  * 
  * cdef class AncestorsIterator(_ElementMatchIterator):             # <<<<<<<<<<<<<<
@@ -1664,7 +1718,7 @@ struct __pyx_obj_4lxml_5etree_AncestorsIterator {
 };
 
 
-/* "lxml/etree.pyx":2869
+/* "lxml/etree.pyx":2872
  *         self._storeNext(node)
  * 
  * cdef class ElementDepthFirstIterator:             # <<<<<<<<<<<<<<
@@ -1680,7 +1734,7 @@ struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator {
 };
 
 
-/* "lxml/etree.pyx":2945
+/* "lxml/etree.pyx":2948
  *         return NULL
  * 
  * cdef class ElementTextIterator:             # <<<<<<<<<<<<<<
@@ -1694,7 +1748,7 @@ struct __pyx_obj_4lxml_5etree_ElementTextIterator {
 };
 
 
-/* "lxml/etree.pyx":3071
+/* "lxml/etree.pyx":3074
  * 
  * 
  * cdef class CDATA:             # <<<<<<<<<<<<<<
@@ -1897,8 +1951,8 @@ struct LxmlElementClassLookup {
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementClassLookupType;
 
-/* "src/lxml/classlookup.pxi":223
- *         self._lookup_function = NULL # use default lookup
+/* "src/lxml/classlookup.pxi":222
+ * 
  * 
  * cdef public class FallbackElementClassLookup(ElementClassLookup) \             # <<<<<<<<<<<<<<
  *          [ type LxmlFallbackElementClassLookupType,
@@ -1913,7 +1967,7 @@ struct LxmlFallbackElementClassLookup {
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlFallbackElementClassLookupType;
 
-/* "src/lxml/classlookup.pxi":265
+/* "src/lxml/classlookup.pxi":264
  * # default lookup scheme
  * 
  * cdef class ElementDefaultClassLookup(ElementClassLookup):             # <<<<<<<<<<<<<<
@@ -1929,7 +1983,7 @@ struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup {
 };
 
 
-/* "src/lxml/classlookup.pxi":344
+/* "src/lxml/classlookup.pxi":343
  * # attribute based lookup scheme
  * 
  * cdef class AttributeBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
@@ -1945,7 +1999,7 @@ struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup {
 };
 
 
-/* "src/lxml/classlookup.pxi":396
+/* "src/lxml/classlookup.pxi":395
  * #  per-parser lookup scheme
  * 
  * cdef class ParserBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
@@ -1957,7 +2011,7 @@ struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup {
 };
 
 
-/* "src/lxml/classlookup.pxi":413
+/* "src/lxml/classlookup.pxi":412
  * #  custom class lookup based on node type, namespace, name
  * 
  * cdef class CustomElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
@@ -1969,7 +2023,7 @@ struct __pyx_obj_4lxml_5etree_CustomElementClassLookup {
 };
 
 
-/* "src/lxml/classlookup.pxi":468
+/* "src/lxml/classlookup.pxi":467
  * # read-only tree based class lookup
  * 
  * cdef class PythonElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
@@ -2022,7 +2076,7 @@ struct __pyx_obj_4lxml_5etree__NamespaceRegistry {
 };
 
 
-/* "src/lxml/nsclasses.pxi":85
+/* "src/lxml/nsclasses.pxi":106
  * @cython.final
  * @cython.internal
  * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<<
@@ -2034,7 +2088,7 @@ struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry {
 };
 
 
-/* "src/lxml/nsclasses.pxi":99
+/* "src/lxml/nsclasses.pxi":120
  * 
  * 
  * cdef class ElementNamespaceClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
@@ -2047,7 +2101,7 @@ struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup {
 };
 
 
-/* "src/lxml/nsclasses.pxi":190
+/* "src/lxml/nsclasses.pxi":237
  * 
  * @cython.internal
  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<<
@@ -2059,7 +2113,7 @@ struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry {
 };
 
 
-/* "src/lxml/nsclasses.pxi":205
+/* "src/lxml/nsclasses.pxi":252
  * @cython.final
  * @cython.internal
  * cdef class _XPathFunctionNamespaceRegistry(_FunctionNamespaceRegistry):             # <<<<<<<<<<<<<<
@@ -3002,7 +3056,7 @@ struct __pyx_obj_4lxml_5etree_XSLTExtension {
 };
 
 
-/* "lxml/etree.pyx":3518
+/* "lxml/etree.pyx":3521
  * # Validation
  * 
  * cdef class DocumentInvalid(LxmlError):             # <<<<<<<<<<<<<<
@@ -3539,7 +3593,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_14_iterentities {
 
 
 
-/* "lxml/etree.pyx":286
+/* "lxml/etree.pyx":289
  * @cython.final
  * @cython.internal
  * cdef class _TempStore:             # <<<<<<<<<<<<<<
@@ -3556,7 +3610,7 @@ static int __pyx_f_4lxml_5etree_10_TempStore_add(struct __pyx_obj_4lxml_5etree__
 static int __pyx_f_4lxml_5etree_10_TempStore_clear(struct __pyx_obj_4lxml_5etree__TempStore *);
 
 
-/* "lxml/etree.pyx":301
+/* "lxml/etree.pyx":304
  * # class for temporarily storing exceptions raised in extensions
  * @cython.internal
  * cdef class _ExceptionContext:             # <<<<<<<<<<<<<<
@@ -3692,7 +3746,7 @@ static struct __pyx_vtabstruct_4lxml_5etree_PyErrorLog *__pyx_vtabptr_4lxml_5etr
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlDocumentType;
 
-/* "lxml/etree.pyx":343
+/* "lxml/etree.pyx":346
  * @cython.final
  * @cython.freelist(8)
  * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]:             # <<<<<<<<<<<<<<
@@ -3721,7 +3775,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
 static int __pyx_f_4lxml_5etree_9_Document__setNodeNs(struct LxmlDocument *, xmlNode *, const xmlChar *);
 
 
-/* "lxml/etree.pyx":517
+/* "lxml/etree.pyx":520
  * 
  * 
  * cdef class DocInfo:             # <<<<<<<<<<<<<<
@@ -3736,7 +3790,7 @@ static struct __pyx_vtabstruct_4lxml_5etree_DocInfo *__pyx_vtabptr_4lxml_5etree_
 static xmlDtd *__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(struct __pyx_obj_4lxml_5etree_DocInfo *);
 
 
-/* "lxml/etree.pyx":1634
+/* "lxml/etree.pyx":1637
  * 
  * @cython.internal
  * cdef class __ContentOnlyElement(_Element):             # <<<<<<<<<<<<<<
@@ -3750,7 +3804,7 @@ struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement {
 static struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
 
 
-/* "lxml/etree.pyx":1701
+/* "lxml/etree.pyx":1704
  *         return []
  * 
  * cdef class _Comment(__ContentOnlyElement):             # <<<<<<<<<<<<<<
@@ -3764,7 +3818,7 @@ struct __pyx_vtabstruct_4lxml_5etree__Comment {
 static struct __pyx_vtabstruct_4lxml_5etree__Comment *__pyx_vtabptr_4lxml_5etree__Comment;
 
 
-/* "lxml/etree.pyx":1709
+/* "lxml/etree.pyx":1712
  *         return "<!--%s-->" % strrepr(self.text)
  * 
  * cdef class _ProcessingInstruction(__ContentOnlyElement):             # <<<<<<<<<<<<<<
@@ -3778,7 +3832,7 @@ struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction {
 static struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction *__pyx_vtabptr_4lxml_5etree__ProcessingInstruction;
 
 
-/* "lxml/etree.pyx":1760
+/* "lxml/etree.pyx":1763
  * cdef object _FIND_PI_ATTRIBUTES = re.compile(ur'\s+(\w+)\s*=\s*(?:\'([^\']*)\'|"([^"]*)")', re.U).findall
  * 
  * cdef class _Entity(__ContentOnlyElement):             # <<<<<<<<<<<<<<
@@ -3793,7 +3847,7 @@ static struct __pyx_vtabstruct_4lxml_5etree__Entity *__pyx_vtabptr_4lxml_5etree_
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementTreeType;
 
-/* "lxml/etree.pyx":1857
+/* "lxml/etree.pyx":1860
  * 
  * 
  * cdef public class _ElementTree [ type LxmlElementTreeType,             # <<<<<<<<<<<<<<
@@ -3809,7 +3863,7 @@ static int __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(struct LxmlElement
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementTagMatcherType;
 
-/* "lxml/etree.pyx":2586
+/* "lxml/etree.pyx":2589
  * 
  * 
  * cdef public class _ElementTagMatcher [ object LxmlElementTagMatcher,             # <<<<<<<<<<<<<<
@@ -3824,7 +3878,7 @@ static struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher *__pyx_vtabptr_4l
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementIteratorType;
 
-/* "lxml/etree.pyx":2617
+/* "lxml/etree.pyx":2620
  *                 self._name = NULL
  * 
  * cdef public class _ElementIterator(_ElementTagMatcher) [             # <<<<<<<<<<<<<<
@@ -3839,7 +3893,7 @@ struct __pyx_vtabstruct_4lxml_5etree__ElementIterator {
 static struct __pyx_vtabstruct_4lxml_5etree__ElementIterator *__pyx_vtabptr_4lxml_5etree__ElementIterator;
 
 
-/* "lxml/etree.pyx":2654
+/* "lxml/etree.pyx":2657
  * @cython.final
  * @cython.internal
  * cdef class _MultiTagMatcher:             # <<<<<<<<<<<<<<
@@ -3872,7 +3926,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
 static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesAttribute(struct __pyx_obj_4lxml_5etree__MultiTagMatcher *, xmlAttr *);
 
 
-/* "lxml/etree.pyx":2795
+/* "lxml/etree.pyx":2798
  *         return False
  * 
  * cdef class _ElementMatchIterator:             # <<<<<<<<<<<<<<
@@ -3889,7 +3943,7 @@ static PyObject *__pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher(st
 static int __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(struct __pyx_obj_4lxml_5etree__ElementMatchIterator *, struct LxmlElement *);
 
 
-/* "lxml/etree.pyx":2824
+/* "lxml/etree.pyx":2827
  *         return current_node
  * 
  * cdef class ElementChildIterator(_ElementMatchIterator):             # <<<<<<<<<<<<<<
@@ -3903,7 +3957,7 @@ struct __pyx_vtabstruct_4lxml_5etree_ElementChildIterator {
 static struct __pyx_vtabstruct_4lxml_5etree_ElementChildIterator *__pyx_vtabptr_4lxml_5etree_ElementChildIterator;
 
 
-/* "lxml/etree.pyx":2844
+/* "lxml/etree.pyx":2847
  *         self._node = _elementFactory(node._doc, c_node) if c_node is not NULL else None
  * 
  * cdef class SiblingsIterator(_ElementMatchIterator):             # <<<<<<<<<<<<<<
@@ -3917,7 +3971,7 @@ struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator {
 static struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator *__pyx_vtabptr_4lxml_5etree_SiblingsIterator;
 
 
-/* "lxml/etree.pyx":2859
+/* "lxml/etree.pyx":2862
  *         self._storeNext(node)
  * 
  * cdef class AncestorsIterator(_ElementMatchIterator):             # <<<<<<<<<<<<<<
@@ -3931,7 +3985,7 @@ struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator {
 static struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator *__pyx_vtabptr_4lxml_5etree_AncestorsIterator;
 
 
-/* "lxml/etree.pyx":2869
+/* "lxml/etree.pyx":2872
  *         self._storeNext(node)
  * 
  * cdef class ElementDepthFirstIterator:             # <<<<<<<<<<<<<<
@@ -4126,8 +4180,8 @@ static struct __pyx_vtabstruct_4lxml_5etree_EntityBase *__pyx_vtabptr_4lxml_5etr
 
 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlFallbackElementClassLookupType;
 
-/* "src/lxml/classlookup.pxi":223
- *         self._lookup_function = NULL # use default lookup
+/* "src/lxml/classlookup.pxi":222
+ * 
  * 
  * cdef public class FallbackElementClassLookup(ElementClassLookup) \             # <<<<<<<<<<<<<<
  *          [ type LxmlFallbackElementClassLookupType,
@@ -4140,7 +4194,7 @@ struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup {
 static struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
 
 
-/* "src/lxml/classlookup.pxi":344
+/* "src/lxml/classlookup.pxi":343
  * # attribute based lookup scheme
  * 
  * cdef class AttributeBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
@@ -4154,7 +4208,7 @@ struct __pyx_vtabstruct_4lxml_5etree_AttributeBasedElementClassLookup {
 static struct __pyx_vtabstruct_4lxml_5etree_AttributeBasedElementClassLookup *__pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup;
 
 
-/* "src/lxml/classlookup.pxi":396
+/* "src/lxml/classlookup.pxi":395
  * #  per-parser lookup scheme
  * 
  * cdef class ParserBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
@@ -4168,7 +4222,7 @@ struct __pyx_vtabstruct_4lxml_5etree_ParserBasedElementClassLookup {
 static struct __pyx_vtabstruct_4lxml_5etree_ParserBasedElementClassLookup *__pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup;
 
 
-/* "src/lxml/classlookup.pxi":413
+/* "src/lxml/classlookup.pxi":412
  * #  custom class lookup based on node type, namespace, name
  * 
  * cdef class CustomElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
@@ -4182,7 +4236,7 @@ struct __pyx_vtabstruct_4lxml_5etree_CustomElementClassLookup {
 static struct __pyx_vtabstruct_4lxml_5etree_CustomElementClassLookup *__pyx_vtabptr_4lxml_5etree_CustomElementClassLookup;
 
 
-/* "src/lxml/classlookup.pxi":468
+/* "src/lxml/classlookup.pxi":467
  * # read-only tree based class lookup
  * 
  * cdef class PythonElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
@@ -4211,7 +4265,7 @@ struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry {
 static struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry *__pyx_vtabptr_4lxml_5etree__NamespaceRegistry;
 
 
-/* "src/lxml/nsclasses.pxi":85
+/* "src/lxml/nsclasses.pxi":106
  * @cython.final
  * @cython.internal
  * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<<
@@ -4225,7 +4279,7 @@ struct __pyx_vtabstruct_4lxml_5etree__ClassNamespaceRegistry {
 static struct __pyx_vtabstruct_4lxml_5etree__ClassNamespaceRegistry *__pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry;
 
 
-/* "src/lxml/nsclasses.pxi":99
+/* "src/lxml/nsclasses.pxi":120
  * 
  * 
  * cdef class ElementNamespaceClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
@@ -4239,7 +4293,7 @@ struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup {
 static struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup *__pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup;
 
 
-/* "src/lxml/nsclasses.pxi":190
+/* "src/lxml/nsclasses.pxi":237
  * 
  * @cython.internal
  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<<
@@ -4253,7 +4307,7 @@ struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry {
 static struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry *__pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry;
 
 
-/* "src/lxml/nsclasses.pxi":205
+/* "src/lxml/nsclasses.pxi":252
  * @cython.final
  * @cython.internal
  * cdef class _XPathFunctionNamespaceRegistry(_FunctionNamespaceRegistry):             # <<<<<<<<<<<<<<
@@ -4380,7 +4434,7 @@ static void __pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_disconnect(str
 static int __pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_isvalid(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *);
 
 
-/* "lxml/etree.pyx":3526
+/* "lxml/etree.pyx":3529
  * 
  * 
  * cdef class _Validator:             # <<<<<<<<<<<<<<
@@ -5183,21 +5237,31 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
 /* PyThreadStateGet.proto */
 #if CYTHON_FAST_THREAD_STATE
 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
+#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
 #else
 #define __Pyx_PyThreadState_declare
 #define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
 #endif
 
 /* PyErrFetchRestore.proto */
 #if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
+#else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
 #else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
@@ -5372,7 +5436,7 @@ static CYTHON_INLINE long __Pyx_mod_long(long, long);
 static CYTHON_INLINE long __Pyx_div_long(long, long);
 
 /* KeywordStringCheck.proto */
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
+static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
 
 /* SliceObject.proto */
 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
@@ -5464,7 +5528,7 @@ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
     __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
     (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
                __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
+static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                                int is_list, int wraparound, int boundscheck);
 
@@ -5491,8 +5555,10 @@ static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
 
 /* ArgTypeTest.proto */
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact);
+#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
+    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
+        __Pyx__ArgTypeTest(obj, type, name, exact))
+static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
 
 /* GetItemInt.proto */
 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
@@ -5512,7 +5578,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                               int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                      int is_list, int wraparound, int boundscheck);
 
@@ -5542,18 +5608,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t
 /* Import.proto */
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
 
-/* ForceInitThreads.proto */
-#ifndef __PYX_FORCE_INIT_THREADS
-  #define __PYX_FORCE_INIT_THREADS 0
-#endif
-
-/* NoFastGil.proto */
-#define __Pyx_PyGILState_Ensure PyGILState_Ensure
-#define __Pyx_PyGILState_Release PyGILState_Release
-#define __Pyx_FastGIL_Remember()
-#define __Pyx_FastGIL_Forget()
-#define __Pyx_FastGilFuncInit()
-
 /* None.proto */
 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
 
@@ -5641,8 +5695,16 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
 
 /* UnpackTuple2.proto */
-static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
-                                             int is_tuple, int has_known_size, int decref_tuple);
+#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
+    (likely(is_tuple || PyTuple_Check(tuple)) ?\
+        (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
+            __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
+            (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
+        __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
+static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
+    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
+static int __Pyx_unpack_tuple2_generic(
+    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
 
 /* dict_iter.proto */
 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
@@ -5694,9 +5756,10 @@ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
 
 /* PyObjectCallMethod1.proto */
 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
+static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
 
 /* CoroutineBase.proto */
-typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *);
+typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
 typedef struct {
     PyObject_HEAD
     __pyx_coroutine_body_t body;
@@ -5716,12 +5779,30 @@ typedef struct {
 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
     PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure,
     PyObject *name, PyObject *qualname, PyObject *module_name);
+static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
+            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
+            PyObject *name, PyObject *qualname, PyObject *module_name);
 static int __Pyx_Coroutine_clear(PyObject *self);
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
+static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
+static PyObject *__Pyx_Coroutine_Close(PyObject *self);
+static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
+#define __Pyx_Coroutine_SwapException(self) {\
+    __Pyx_ExceptionSwap(&(self)->exc_type, &(self)->exc_value, &(self)->exc_traceback);\
+    __Pyx_Coroutine_ResetFrameBackpointer(self);\
+    }
+#define __Pyx_Coroutine_ResetAndClearException(self) {\
+    __Pyx_ExceptionReset((self)->exc_type, (self)->exc_value, (self)->exc_traceback);\
+    (self)->exc_type = (self)->exc_value = (self)->exc_traceback = NULL;\
+    }
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
+    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
 #else
-#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
+#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
+    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
 #endif
+static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
+static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *self);
 
 /* PatchModuleWithCoroutine.proto */
 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
@@ -5734,18 +5815,24 @@ static int __Pyx_patch_abc(void);
 static PyTypeObject *__pyx_CoroutineType = 0;
 static PyTypeObject *__pyx_CoroutineAwaitType = 0;
 #define __Pyx_Coroutine_CheckExact(obj) (Py_TYPE(obj) == __pyx_CoroutineType)
+#define __Pyx_CoroutineAwait_CheckExact(obj) (Py_TYPE(obj) == __pyx_CoroutineAwaitType)
 #define __Pyx_Coroutine_New(body, closure, name, qualname, module_name)\
     __Pyx__Coroutine_New(__pyx_CoroutineType, body, closure, name, qualname, module_name)
 static int __pyx_Coroutine_init(void);
 static PyObject *__Pyx__Coroutine_await(PyObject *coroutine);
+typedef struct {
+    PyObject_HEAD
+    PyObject *coroutine;
+} __pyx_CoroutineAwaitObject;
+static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self);
+static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args);
 
 /* GetAwaitIter.proto */
 static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o);
 static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o);
 
 /* CoroutineYieldFrom.proto */
-#define __Pyx_Coroutine_Yield_From(gen, source) __Pyx__Coroutine_Yield_From(gen, source, 0)
-static CYTHON_INLINE PyObject* __Pyx__Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source, int warn);
+static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source);
 
 /* py_dict_values.proto */
 static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
@@ -5922,6 +6009,18 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 /* BytesContains.proto */
 static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character);
 
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+
 /* Generator.proto */
 #define __Pyx_Generator_USED
 static PyTypeObject *__pyx_GeneratorType = 0;
@@ -6393,6 +6492,7 @@ static PyObject *__pyx_v_4lxml_5etree_OrderedDict = 0;
 static PyObject *__pyx_v_4lxml_5etree__elementpath = 0;
 static PyObject *__pyx_v_4lxml_5etree_sys = 0;
 static PyObject *__pyx_v_4lxml_5etree_re = 0;
+static PyObject *__pyx_v_4lxml_5etree_partial = 0;
 static PyObject *__pyx_v_4lxml_5etree_islice = 0;
 static PyObject *__pyx_v_4lxml_5etree_ITER_EMPTY = 0;
 static PyObject *__pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING = 0;
@@ -6831,15 +6931,15 @@ static const char __pyx_k__24[] = ":";
 static const char __pyx_k__25[] = "\n";
 static const char __pyx_k__29[] = "'";
 static const char __pyx_k__30[] = "\"";
-static const char __pyx_k__32[] = "&";
-static const char __pyx_k__33[] = ";";
-static const char __pyx_k__37[] = "/";
-static const char __pyx_k__42[] = "*";
-static const char __pyx_k__43[] = "{*}*";
-static const char __pyx_k__46[] = "--";
-static const char __pyx_k__49[] = "?>";
-static const char __pyx_k__51[] = "]]>";
-static const char __pyx_k__62[] = "_";
+static const char __pyx_k__33[] = "&";
+static const char __pyx_k__34[] = ";";
+static const char __pyx_k__39[] = "/";
+static const char __pyx_k__44[] = "*";
+static const char __pyx_k__45[] = "{*}*";
+static const char __pyx_k__48[] = "--";
+static const char __pyx_k__51[] = "?>";
+static const char __pyx_k__53[] = "]]>";
+static const char __pyx_k__64[] = "_";
 static const char __pyx_k_add[] = "add";
 static const char __pyx_k_all[] = "__all__";
 static const char __pyx_k_any[] = "any";
@@ -6853,6 +6953,7 @@ static const char __pyx_k_key[] = "key";
 static const char __pyx_k_len[] = "__len__";
 static const char __pyx_k_log[] = "log";
 static const char __pyx_k_new[] = "new";
+static const char __pyx_k_obj[] = "obj";
 static const char __pyx_k_old[] = "old";
 static const char __pyx_k_opt[] = "opt";
 static const char __pyx_k_pop[] = "pop";
@@ -6881,10 +6982,10 @@ static const char __pyx_k_xsl[] = "xsl";
 static const char __pyx_k_HTML[] = "HTML";
 static const char __pyx_k_UTF8[] = "UTF8";
 static const char __pyx_k_XSLT[] = "XSLT";
-static const char __pyx_k__102[] = ", ";
-static const char __pyx_k__107[] = ">";
-static const char __pyx_k__618[] = "(\"[^\"]*\")|('[^']*')";
-static const char __pyx_k__620[] = "({[^}]+})";
+static const char __pyx_k__104[] = ", ";
+static const char __pyx_k__109[] = ">";
+static const char __pyx_k__626[] = "(\"[^\"]*\")|('[^']*')";
+static const char __pyx_k__628[] = "({[^}]+})";
 static const char __pyx_k_args[] = "args";
 static const char __pyx_k_beta[] = "beta";
 static const char __pyx_k_c14n[] = "c14n";
@@ -6892,6 +6993,7 @@ static const char __pyx_k_code[] = "code";
 static const char __pyx_k_copy[] = "copy";
 static const char __pyx_k_ctxt[] = "ctxt";
 static const char __pyx_k_data[] = "data";
+static const char __pyx_k_deco[] = "__deco";
 static const char __pyx_k_dict[] = "__dict__";
 static const char __pyx_k_dump[] = "dump";
 static const char __pyx_k_elem[] = "elem";
@@ -7141,6 +7243,7 @@ static const char __pyx_k_options[] = "options";
 static const char __pyx_k_os_path[] = "os.path";
 static const char __pyx_k_outfile[] = "outfile";
 static const char __pyx_k_parseid[] = "parseid";
+static const char __pyx_k_partial[] = "partial";
 static const char __pyx_k_prepare[] = "__prepare__";
 static const char __pyx_k_receive[] = "receive";
 static const char __pyx_k_recover[] = "recover";
@@ -7246,6 +7349,7 @@ static const char __pyx_k_evaluator[] = "evaluator";
 static const char __pyx_k_exclusive[] = "exclusive";
 static const char __pyx_k_file_path[] = "file_path";
 static const char __pyx_k_functions[] = "functions";
+static const char __pyx_k_functools[] = "functools";
 static const char __pyx_k_getLogger[] = "getLogger";
 static const char __pyx_k_getparent[] = "getparent";
 static const char __pyx_k_huge_tree[] = "huge_tree";
@@ -7437,7 +7541,7 @@ static const char __pyx_k_MemDebug_show[] = "_MemDebug.show";
 static const char __pyx_k_StopIteration[] = "StopIteration";
 static const char __pyx_k_Unknown_error[] = "\077\077 Unknown error \077\077\n";
 static const char __pyx_k_XIncludeError[] = "XIncludeError";
-static const char __pyx_k_XML_line_3181[] = "XML (line 3181)";
+static const char __pyx_k_XML_line_3184[] = "XML (line 3184)";
 static const char __pyx_k_XSLTExtension[] = "XSLTExtension";
 static const char __pyx_k_XSLTSaveError[] = "XSLTSaveError";
 static const char __pyx_k_XSLT_strparam[] = "XSLT.strparam";
@@ -7815,6 +7919,7 @@ static const char __pyx_k_FileWriterElement___exit[] = "_FileWriterElement.__exi
 static const char __pyx_k_Invalid_attribute_name_r[] = "Invalid attribute name %r";
 static const char __pyx_k_Invalid_context_position[] = "Invalid context position";
 static const char __pyx_k_LIBXSLT_COMPILED_VERSION[] = "LIBXSLT_COMPILED_VERSION";
+static const char __pyx_k_NamespaceRegistry___deco[] = "_NamespaceRegistry.__deco";
 static const char __pyx_k_NamespaceRegistry_update[] = "_NamespaceRegistry.update";
 static const char __pyx_k_No_document_to_serialise[] = "No document to serialise";
 static const char __pyx_k_PI_text_must_not_contain[] = "PI text must not contain '?>'";
@@ -7854,6 +7959,7 @@ static const char __pyx_k_src_lxml_readonlytree_pxi[] = "src/lxml/readonlytree.p
 static const char __pyx_k_undecodable_error_message[] = "<undecodable error message>";
 static const char __pyx_k_ElementTree_getelementpath[] = "_ElementTree.getelementpath";
 static const char __pyx_k_FallbackElementClassLookup[] = "FallbackElementClassLookup";
+static const char __pyx_k_FunctionNamespace_line_207[] = "FunctionNamespace (line 207)";
 static const char __pyx_k_HTMLPullParser_read_events[] = "HTMLPullParser.read_events";
 static const char __pyx_k_ImmutableMapping___delitem[] = "_ImmutableMapping.__delitem__";
 static const char __pyx_k_ImmutableMapping___getitem[] = "_ImmutableMapping.__getitem__";
@@ -8000,6 +8106,7 @@ static const char __pyx_k_Error_during_serialisation_out_o[] = "Error during ser
 static const char __pyx_k_Error_serialising_an_XSLT_result[] = "Error serialising an XSLT result.\n    ";
 static const char __pyx_k_Failed_to_create_validation_cont[] = "Failed to create validation context";
 static const char __pyx_k_FallbackElementClassLookup_set_f[] = "FallbackElementClassLookup.set_fallback";
+static const char __pyx_k_FunctionNamespace_ns_uri_Retriev[] = "FunctionNamespace(ns_uri)\n\n    Retrieve the function namespace object associated with the given\n    URI.\n\n    Creates a new one if it does not yet exist. A function namespace\n    can only be used to register extension functions.\n\n    Usage:\n\n    >>> ns_functions = FunctionNamespace(\"http://schema.org/Movie\")\n\n    >>> @ns_functions  # uses function name\n    ... def add2(x):\n    ...     return x + 2\n\n    >>> @ns_functions(\"add3\")  # uses explicit name\n    ... def add_three(x):\n    ...     return x + 3\n    ";
 static const char __pyx_k_I18N_NO_OUTPUT_6004_BUF_OVERFLOW[] = "I18N_NO_OUTPUT=6004\nBUF_OVERFLOW=7000\n";
 static const char __pyx_k_Illegal_document_provided_expect[] = "Illegal document provided: expected XML or HTML, found %s";
 static const char __pyx_k_Inconsistent_enter_action_in_con[] = "Inconsistent enter action in context manager";
@@ -8300,6 +8407,8 @@ static PyObject *__pyx_kp_u_File_is_already_closed;
 static PyObject *__pyx_kp_u_File_or_filename_expected_got_s;
 static PyObject *__pyx_kp_b_Forbidden_variable;
 static PyObject *__pyx_n_s_FunctionNamespace;
+static PyObject *__pyx_kp_u_FunctionNamespace_line_207;
+static PyObject *__pyx_kp_u_FunctionNamespace_ns_uri_Retriev;
 static PyObject *__pyx_kp_u_FunctionNamespace_r;
 static PyObject *__pyx_n_s_FutureWarning;
 static PyObject *__pyx_n_u_GlobalErrorLog;
@@ -8412,6 +8521,7 @@ static PyObject *__pyx_kp_u_NONE_0_PARSER_1_TREE_2_NAMESPACE;
 static PyObject *__pyx_kp_u_NONE_0_WARNING_1_ERROR_2_FATAL_3;
 static PyObject *__pyx_kp_u_Name_not_registered;
 static PyObject *__pyx_n_s_NamespaceRegistryError;
+static PyObject *__pyx_n_s_NamespaceRegistry___deco;
 static PyObject *__pyx_n_s_NamespaceRegistry_clear;
 static PyObject *__pyx_n_s_NamespaceRegistry_items;
 static PyObject *__pyx_n_s_NamespaceRegistry_iteritems;
@@ -8590,7 +8700,7 @@ static PyObject *__pyx_n_s_XMLSchemaValidateError;
 static PyObject *__pyx_n_s_XMLSyntaxError;
 static PyObject *__pyx_n_s_XMLTreeBuilder;
 static PyObject *__pyx_kp_s_XML_declaration_already_written;
-static PyObject *__pyx_kp_u_XML_line_3181;
+static PyObject *__pyx_kp_u_XML_line_3184;
 static PyObject *__pyx_kp_u_XML_text_parser_None_base_url_No;
 static PyObject *__pyx_n_u_XPATH_LOCATIONSET;
 static PyObject *__pyx_n_u_XPATH_POINT;
@@ -8635,8 +8745,8 @@ static PyObject *__pyx_n_s_XSLT_set_global_max_depth;
 static PyObject *__pyx_n_s_XSLT_strparam;
 static PyObject *__pyx_kp_s_XSLT_stylesheet_not_initialised;
 static PyObject *__pyx_n_s_XSLT_tostring;
-static PyObject *__pyx_kp_u__102;
-static PyObject *__pyx_kp_u__107;
+static PyObject *__pyx_kp_u__104;
+static PyObject *__pyx_kp_u__109;
 static PyObject *__pyx_kp_u__15;
 static PyObject *__pyx_kp_b__16;
 static PyObject *__pyx_kp_s__16;
@@ -8650,24 +8760,24 @@ static PyObject *__pyx_kp_u__3;
 static PyObject *__pyx_kp_b__30;
 static PyObject *__pyx_kp_s__30;
 static PyObject *__pyx_kp_u__30;
-static PyObject *__pyx_kp_b__32;
-static PyObject *__pyx_kp_u__32;
 static PyObject *__pyx_kp_b__33;
 static PyObject *__pyx_kp_u__33;
-static PyObject *__pyx_kp_s__37;
+static PyObject *__pyx_kp_b__34;
+static PyObject *__pyx_kp_u__34;
+static PyObject *__pyx_kp_s__39;
 static PyObject *__pyx_kp_b__4;
 static PyObject *__pyx_kp_s__4;
 static PyObject *__pyx_kp_u__4;
-static PyObject *__pyx_kp_b__42;
-static PyObject *__pyx_kp_s__42;
-static PyObject *__pyx_kp_s__43;
-static PyObject *__pyx_kp_b__46;
-static PyObject *__pyx_kp_b__49;
+static PyObject *__pyx_kp_b__44;
+static PyObject *__pyx_kp_s__44;
+static PyObject *__pyx_kp_s__45;
+static PyObject *__pyx_kp_b__48;
 static PyObject *__pyx_kp_b__51;
-static PyObject *__pyx_kp_b__618;
-static PyObject *__pyx_n_s__62;
-static PyObject *__pyx_n_u__62;
-static PyObject *__pyx_kp_b__620;
+static PyObject *__pyx_kp_b__53;
+static PyObject *__pyx_kp_b__626;
+static PyObject *__pyx_kp_b__628;
+static PyObject *__pyx_n_s__64;
+static PyObject *__pyx_n_u__64;
 static PyObject *__pyx_n_s_abspath;
 static PyObject *__pyx_n_s_accepted_domains;
 static PyObject *__pyx_n_s_access_control;
@@ -8797,6 +8907,7 @@ static PyObject *__pyx_n_s_cssselect;
 static PyObject *__pyx_n_s_ctxt;
 static PyObject *__pyx_n_s_data;
 static PyObject *__pyx_n_b_dc;
+static PyObject *__pyx_n_s_deco;
 static PyObject *__pyx_n_s_decode;
 static PyObject *__pyx_n_s_deepcopy;
 static PyObject *__pyx_n_s_default;
@@ -8916,6 +9027,7 @@ static PyObject *__pyx_n_s_fromstringlist;
 static PyObject *__pyx_n_s_function_mapping;
 static PyObject *__pyx_n_s_function_name;
 static PyObject *__pyx_n_s_functions;
+static PyObject *__pyx_n_s_functools;
 static PyObject *__pyx_n_u_g;
 static PyObject *__pyx_kp_u_g_1_g_2;
 static PyObject *__pyx_n_s_get;
@@ -9115,6 +9227,7 @@ static PyObject *__pyx_kp_b_ns_d_2;
 static PyObject *__pyx_n_s_ns_uri;
 static PyObject *__pyx_n_s_ns_utf;
 static PyObject *__pyx_n_s_nsmap;
+static PyObject *__pyx_n_s_obj;
 static PyObject *__pyx_n_s_object;
 static PyObject *__pyx_n_s_occur;
 static PyObject *__pyx_n_s_offset;
@@ -9140,6 +9253,7 @@ static PyObject *__pyx_n_s_parse_options;
 static PyObject *__pyx_n_s_parseid;
 static PyObject *__pyx_n_s_parser;
 static PyObject *__pyx_kp_u_parser_locking_failed;
+static PyObject *__pyx_n_s_partial;
 static PyObject *__pyx_kp_s_passing_a_single_string_into_fro;
 static PyObject *__pyx_n_s_path;
 static PyObject *__pyx_n_s_path_2;
@@ -9704,7 +9818,6 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
 static int __pyx_pf_4lxml_5etree_11CommentBase___init__(struct __pyx_obj_4lxml_5etree_CommentBase *__pyx_v_self, PyObject *__pyx_v_text); /* proto */
 static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_PIBase *__pyx_v_self, PyObject *__pyx_v_target, PyObject *__pyx_v_text); /* proto */
 static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5etree_EntityBase *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static int __pyx_pf_4lxml_5etree_18ElementClassLookup___cinit__(struct LxmlElementClassLookup *__pyx_v_self); /* proto */
 static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___cinit__(struct LxmlFallbackElementClassLookup *__pyx_v_self); /* proto */
 static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_2__init__(struct LxmlFallbackElementClassLookup *__pyx_v_self, struct LxmlElementClassLookup *__pyx_v_fallback); /* proto */
 static PyObject *__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_4set_fallback(struct LxmlFallbackElementClassLookup *__pyx_v_self, struct LxmlElementClassLookup *__pyx_v_lookup); /* proto */
@@ -9731,6 +9844,8 @@ static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_8__iter__(struct __p
 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_10items(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self); /* proto */
 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_12iteritems(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self); /* proto */
 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_14clear(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_16__call__(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
+static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_18__deco(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_obj); /* proto */
 static int __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item); /* proto */
 static PyObject *__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry_2__repr__(struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *__pyx_v_self); /* proto */
 static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup___cinit__(struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *__pyx_v_self); /* proto */
@@ -10189,17 +10304,17 @@ static PyObject *__pyx_tuple__6;
 static PyObject *__pyx_tuple__8;
 static PyObject *__pyx_slice__11;
 static PyObject *__pyx_slice__13;
-static PyObject *__pyx_slice__38;
-static PyObject *__pyx_slice__39;
 static PyObject *__pyx_slice__40;
 static PyObject *__pyx_slice__41;
-static PyObject *__pyx_slice__59;
+static PyObject *__pyx_slice__42;
+static PyObject *__pyx_slice__43;
 static PyObject *__pyx_slice__61;
-static PyObject *__pyx_slice__76;
-static PyObject *__pyx_slice__77;
+static PyObject *__pyx_slice__63;
+static PyObject *__pyx_slice__78;
 static PyObject *__pyx_slice__79;
-static PyObject *__pyx_slice__95;
-static PyObject *__pyx_slice__96;
+static PyObject *__pyx_slice__81;
+static PyObject *__pyx_slice__97;
+static PyObject *__pyx_slice__98;
 static PyObject *__pyx_tuple__10;
 static PyObject *__pyx_tuple__12;
 static PyObject *__pyx_tuple__14;
@@ -10214,24 +10329,24 @@ static PyObject *__pyx_tuple__26;
 static PyObject *__pyx_tuple__27;
 static PyObject *__pyx_tuple__28;
 static PyObject *__pyx_tuple__31;
-static PyObject *__pyx_tuple__34;
+static PyObject *__pyx_tuple__32;
 static PyObject *__pyx_tuple__35;
 static PyObject *__pyx_tuple__36;
-static PyObject *__pyx_tuple__44;
-static PyObject *__pyx_tuple__45;
+static PyObject *__pyx_tuple__37;
+static PyObject *__pyx_tuple__38;
+static PyObject *__pyx_tuple__46;
 static PyObject *__pyx_tuple__47;
-static PyObject *__pyx_tuple__48;
+static PyObject *__pyx_tuple__49;
 static PyObject *__pyx_tuple__50;
 static PyObject *__pyx_tuple__52;
-static PyObject *__pyx_tuple__53;
 static PyObject *__pyx_tuple__54;
 static PyObject *__pyx_tuple__55;
 static PyObject *__pyx_tuple__56;
 static PyObject *__pyx_tuple__57;
 static PyObject *__pyx_tuple__58;
+static PyObject *__pyx_tuple__59;
 static PyObject *__pyx_tuple__60;
-static PyObject *__pyx_tuple__63;
-static PyObject *__pyx_tuple__64;
+static PyObject *__pyx_tuple__62;
 static PyObject *__pyx_tuple__65;
 static PyObject *__pyx_tuple__66;
 static PyObject *__pyx_tuple__67;
@@ -10243,9 +10358,9 @@ static PyObject *__pyx_tuple__72;
 static PyObject *__pyx_tuple__73;
 static PyObject *__pyx_tuple__74;
 static PyObject *__pyx_tuple__75;
-static PyObject *__pyx_tuple__78;
+static PyObject *__pyx_tuple__76;
+static PyObject *__pyx_tuple__77;
 static PyObject *__pyx_tuple__80;
-static PyObject *__pyx_tuple__81;
 static PyObject *__pyx_tuple__82;
 static PyObject *__pyx_tuple__83;
 static PyObject *__pyx_tuple__84;
@@ -10259,36 +10374,37 @@ static PyObject *__pyx_tuple__91;
 static PyObject *__pyx_tuple__92;
 static PyObject *__pyx_tuple__93;
 static PyObject *__pyx_tuple__94;
-static PyObject *__pyx_tuple__97;
-static PyObject *__pyx_tuple__98;
+static PyObject *__pyx_tuple__95;
+static PyObject *__pyx_tuple__96;
 static PyObject *__pyx_tuple__99;
-static PyObject *__pyx_slice__100;
-static PyObject *__pyx_slice__115;
+static PyObject *__pyx_slice__102;
 static PyObject *__pyx_slice__117;
+static PyObject *__pyx_slice__119;
+static PyObject *__pyx_tuple__100;
 static PyObject *__pyx_tuple__101;
 static PyObject *__pyx_tuple__103;
-static PyObject *__pyx_tuple__104;
 static PyObject *__pyx_tuple__105;
 static PyObject *__pyx_tuple__106;
+static PyObject *__pyx_tuple__107;
 static PyObject *__pyx_tuple__108;
-static PyObject *__pyx_tuple__109;
 static PyObject *__pyx_tuple__110;
 static PyObject *__pyx_tuple__111;
 static PyObject *__pyx_tuple__112;
 static PyObject *__pyx_tuple__113;
 static PyObject *__pyx_tuple__114;
+static PyObject *__pyx_tuple__115;
 static PyObject *__pyx_tuple__116;
 static PyObject *__pyx_tuple__118;
-static PyObject *__pyx_tuple__119;
 static PyObject *__pyx_tuple__120;
+static PyObject *__pyx_tuple__121;
 static PyObject *__pyx_tuple__122;
 static PyObject *__pyx_tuple__124;
 static PyObject *__pyx_tuple__126;
 static PyObject *__pyx_tuple__128;
 static PyObject *__pyx_tuple__130;
 static PyObject *__pyx_tuple__132;
-static PyObject *__pyx_tuple__133;
 static PyObject *__pyx_tuple__134;
+static PyObject *__pyx_tuple__135;
 static PyObject *__pyx_tuple__136;
 static PyObject *__pyx_tuple__138;
 static PyObject *__pyx_tuple__140;
@@ -10310,15 +10426,17 @@ static PyObject *__pyx_tuple__170;
 static PyObject *__pyx_tuple__172;
 static PyObject *__pyx_tuple__174;
 static PyObject *__pyx_tuple__176;
-static PyObject *__pyx_tuple__177;
+static PyObject *__pyx_tuple__178;
 static PyObject *__pyx_tuple__179;
-static PyObject *__pyx_tuple__180;
 static PyObject *__pyx_tuple__181;
 static PyObject *__pyx_tuple__182;
 static PyObject *__pyx_tuple__183;
 static PyObject *__pyx_tuple__184;
+static PyObject *__pyx_tuple__185;
 static PyObject *__pyx_tuple__186;
+static PyObject *__pyx_tuple__187;
 static PyObject *__pyx_tuple__188;
+static PyObject *__pyx_tuple__189;
 static PyObject *__pyx_tuple__190;
 static PyObject *__pyx_tuple__192;
 static PyObject *__pyx_tuple__194;
@@ -10397,15 +10515,14 @@ static PyObject *__pyx_tuple__338;
 static PyObject *__pyx_tuple__340;
 static PyObject *__pyx_tuple__342;
 static PyObject *__pyx_tuple__344;
-static PyObject *__pyx_tuple__345;
-static PyObject *__pyx_tuple__347;
+static PyObject *__pyx_tuple__346;
 static PyObject *__pyx_tuple__348;
 static PyObject *__pyx_tuple__350;
 static PyObject *__pyx_tuple__351;
 static PyObject *__pyx_tuple__353;
-static PyObject *__pyx_tuple__355;
+static PyObject *__pyx_tuple__354;
 static PyObject *__pyx_tuple__356;
-static PyObject *__pyx_tuple__358;
+static PyObject *__pyx_tuple__357;
 static PyObject *__pyx_tuple__359;
 static PyObject *__pyx_tuple__361;
 static PyObject *__pyx_tuple__362;
@@ -10416,16 +10533,17 @@ static PyObject *__pyx_tuple__368;
 static PyObject *__pyx_tuple__370;
 static PyObject *__pyx_tuple__371;
 static PyObject *__pyx_tuple__373;
-static PyObject *__pyx_tuple__375;
+static PyObject *__pyx_tuple__374;
+static PyObject *__pyx_tuple__376;
 static PyObject *__pyx_tuple__377;
 static PyObject *__pyx_tuple__379;
 static PyObject *__pyx_tuple__381;
 static PyObject *__pyx_tuple__383;
-static PyObject *__pyx_tuple__384;
-static PyObject *__pyx_tuple__386;
+static PyObject *__pyx_tuple__385;
 static PyObject *__pyx_tuple__387;
 static PyObject *__pyx_tuple__389;
-static PyObject *__pyx_tuple__391;
+static PyObject *__pyx_tuple__390;
+static PyObject *__pyx_tuple__392;
 static PyObject *__pyx_tuple__393;
 static PyObject *__pyx_tuple__395;
 static PyObject *__pyx_tuple__397;
@@ -10443,9 +10561,9 @@ static PyObject *__pyx_tuple__419;
 static PyObject *__pyx_tuple__421;
 static PyObject *__pyx_tuple__423;
 static PyObject *__pyx_tuple__425;
-static PyObject *__pyx_tuple__426;
-static PyObject *__pyx_tuple__428;
-static PyObject *__pyx_tuple__430;
+static PyObject *__pyx_tuple__427;
+static PyObject *__pyx_tuple__429;
+static PyObject *__pyx_tuple__431;
 static PyObject *__pyx_tuple__432;
 static PyObject *__pyx_tuple__434;
 static PyObject *__pyx_tuple__436;
@@ -10460,10 +10578,10 @@ static PyObject *__pyx_tuple__452;
 static PyObject *__pyx_tuple__454;
 static PyObject *__pyx_tuple__456;
 static PyObject *__pyx_tuple__458;
-static PyObject *__pyx_tuple__459;
-static PyObject *__pyx_tuple__461;
-static PyObject *__pyx_tuple__463;
-static PyObject *__pyx_tuple__465;
+static PyObject *__pyx_tuple__460;
+static PyObject *__pyx_tuple__462;
+static PyObject *__pyx_tuple__464;
+static PyObject *__pyx_tuple__466;
 static PyObject *__pyx_tuple__467;
 static PyObject *__pyx_tuple__469;
 static PyObject *__pyx_tuple__471;
@@ -10473,10 +10591,10 @@ static PyObject *__pyx_tuple__477;
 static PyObject *__pyx_tuple__479;
 static PyObject *__pyx_tuple__481;
 static PyObject *__pyx_tuple__483;
-static PyObject *__pyx_tuple__484;
-static PyObject *__pyx_tuple__486;
-static PyObject *__pyx_tuple__488;
-static PyObject *__pyx_tuple__490;
+static PyObject *__pyx_tuple__485;
+static PyObject *__pyx_tuple__487;
+static PyObject *__pyx_tuple__489;
+static PyObject *__pyx_tuple__491;
 static PyObject *__pyx_tuple__492;
 static PyObject *__pyx_tuple__494;
 static PyObject *__pyx_tuple__496;
@@ -10512,14 +10630,14 @@ static PyObject *__pyx_tuple__554;
 static PyObject *__pyx_tuple__556;
 static PyObject *__pyx_tuple__558;
 static PyObject *__pyx_tuple__560;
-static PyObject *__pyx_tuple__561;
-static PyObject *__pyx_tuple__563;
+static PyObject *__pyx_tuple__562;
 static PyObject *__pyx_tuple__564;
 static PyObject *__pyx_tuple__566;
-static PyObject *__pyx_tuple__567;
+static PyObject *__pyx_tuple__568;
 static PyObject *__pyx_tuple__569;
 static PyObject *__pyx_tuple__571;
-static PyObject *__pyx_tuple__573;
+static PyObject *__pyx_tuple__572;
+static PyObject *__pyx_tuple__574;
 static PyObject *__pyx_tuple__575;
 static PyObject *__pyx_tuple__577;
 static PyObject *__pyx_tuple__579;
@@ -10527,37 +10645,37 @@ static PyObject *__pyx_tuple__581;
 static PyObject *__pyx_tuple__583;
 static PyObject *__pyx_tuple__585;
 static PyObject *__pyx_tuple__587;
-static PyObject *__pyx_tuple__588;
-static PyObject *__pyx_tuple__590;
-static PyObject *__pyx_tuple__592;
-static PyObject *__pyx_tuple__594;
+static PyObject *__pyx_tuple__589;
+static PyObject *__pyx_tuple__591;
+static PyObject *__pyx_tuple__593;
 static PyObject *__pyx_tuple__595;
-static PyObject *__pyx_tuple__597;
+static PyObject *__pyx_tuple__596;
 static PyObject *__pyx_tuple__598;
 static PyObject *__pyx_tuple__600;
 static PyObject *__pyx_tuple__602;
-static PyObject *__pyx_tuple__604;
+static PyObject *__pyx_tuple__603;
+static PyObject *__pyx_tuple__605;
 static PyObject *__pyx_tuple__606;
 static PyObject *__pyx_tuple__608;
 static PyObject *__pyx_tuple__610;
 static PyObject *__pyx_tuple__612;
 static PyObject *__pyx_tuple__614;
 static PyObject *__pyx_tuple__616;
-static PyObject *__pyx_tuple__619;
-static PyObject *__pyx_tuple__621;
+static PyObject *__pyx_tuple__618;
+static PyObject *__pyx_tuple__620;
 static PyObject *__pyx_tuple__622;
 static PyObject *__pyx_tuple__624;
-static PyObject *__pyx_tuple__626;
-static PyObject *__pyx_tuple__628;
+static PyObject *__pyx_tuple__627;
+static PyObject *__pyx_tuple__629;
 static PyObject *__pyx_tuple__630;
 static PyObject *__pyx_tuple__632;
 static PyObject *__pyx_tuple__634;
 static PyObject *__pyx_tuple__636;
 static PyObject *__pyx_tuple__638;
-static PyObject *__pyx_tuple__639;
-static PyObject *__pyx_tuple__641;
-static PyObject *__pyx_tuple__643;
-static PyObject *__pyx_tuple__645;
+static PyObject *__pyx_tuple__640;
+static PyObject *__pyx_tuple__642;
+static PyObject *__pyx_tuple__644;
+static PyObject *__pyx_tuple__646;
 static PyObject *__pyx_tuple__647;
 static PyObject *__pyx_tuple__649;
 static PyObject *__pyx_tuple__651;
@@ -10574,18 +10692,21 @@ static PyObject *__pyx_tuple__671;
 static PyObject *__pyx_tuple__673;
 static PyObject *__pyx_tuple__675;
 static PyObject *__pyx_tuple__677;
-static PyObject *__pyx_tuple__678;
-static PyObject *__pyx_tuple__680;
-static PyObject *__pyx_tuple__682;
-static PyObject *__pyx_tuple__684;
+static PyObject *__pyx_tuple__679;
+static PyObject *__pyx_tuple__681;
+static PyObject *__pyx_tuple__683;
+static PyObject *__pyx_tuple__685;
 static PyObject *__pyx_tuple__686;
-static PyObject *__pyx_codeobj__121;
+static PyObject *__pyx_tuple__688;
+static PyObject *__pyx_tuple__690;
+static PyObject *__pyx_tuple__692;
+static PyObject *__pyx_tuple__694;
 static PyObject *__pyx_codeobj__123;
 static PyObject *__pyx_codeobj__125;
 static PyObject *__pyx_codeobj__127;
 static PyObject *__pyx_codeobj__129;
 static PyObject *__pyx_codeobj__131;
-static PyObject *__pyx_codeobj__135;
+static PyObject *__pyx_codeobj__133;
 static PyObject *__pyx_codeobj__137;
 static PyObject *__pyx_codeobj__139;
 static PyObject *__pyx_codeobj__141;
@@ -10606,10 +10727,8 @@ static PyObject *__pyx_codeobj__169;
 static PyObject *__pyx_codeobj__171;
 static PyObject *__pyx_codeobj__173;
 static PyObject *__pyx_codeobj__175;
-static PyObject *__pyx_codeobj__178;
-static PyObject *__pyx_codeobj__185;
-static PyObject *__pyx_codeobj__187;
-static PyObject *__pyx_codeobj__189;
+static PyObject *__pyx_codeobj__177;
+static PyObject *__pyx_codeobj__180;
 static PyObject *__pyx_codeobj__191;
 static PyObject *__pyx_codeobj__193;
 static PyObject *__pyx_codeobj__195;
@@ -10687,25 +10806,25 @@ static PyObject *__pyx_codeobj__337;
 static PyObject *__pyx_codeobj__339;
 static PyObject *__pyx_codeobj__341;
 static PyObject *__pyx_codeobj__343;
-static PyObject *__pyx_codeobj__346;
+static PyObject *__pyx_codeobj__345;
+static PyObject *__pyx_codeobj__347;
 static PyObject *__pyx_codeobj__349;
 static PyObject *__pyx_codeobj__352;
-static PyObject *__pyx_codeobj__354;
-static PyObject *__pyx_codeobj__357;
+static PyObject *__pyx_codeobj__355;
+static PyObject *__pyx_codeobj__358;
 static PyObject *__pyx_codeobj__360;
 static PyObject *__pyx_codeobj__363;
 static PyObject *__pyx_codeobj__366;
 static PyObject *__pyx_codeobj__369;
 static PyObject *__pyx_codeobj__372;
-static PyObject *__pyx_codeobj__374;
-static PyObject *__pyx_codeobj__376;
+static PyObject *__pyx_codeobj__375;
 static PyObject *__pyx_codeobj__378;
 static PyObject *__pyx_codeobj__380;
 static PyObject *__pyx_codeobj__382;
-static PyObject *__pyx_codeobj__385;
+static PyObject *__pyx_codeobj__384;
+static PyObject *__pyx_codeobj__386;
 static PyObject *__pyx_codeobj__388;
-static PyObject *__pyx_codeobj__390;
-static PyObject *__pyx_codeobj__392;
+static PyObject *__pyx_codeobj__391;
 static PyObject *__pyx_codeobj__394;
 static PyObject *__pyx_codeobj__396;
 static PyObject *__pyx_codeobj__398;
@@ -10722,9 +10841,9 @@ static PyObject *__pyx_codeobj__418;
 static PyObject *__pyx_codeobj__420;
 static PyObject *__pyx_codeobj__422;
 static PyObject *__pyx_codeobj__424;
-static PyObject *__pyx_codeobj__427;
-static PyObject *__pyx_codeobj__429;
-static PyObject *__pyx_codeobj__431;
+static PyObject *__pyx_codeobj__426;
+static PyObject *__pyx_codeobj__428;
+static PyObject *__pyx_codeobj__430;
 static PyObject *__pyx_codeobj__433;
 static PyObject *__pyx_codeobj__435;
 static PyObject *__pyx_codeobj__437;
@@ -10738,10 +10857,10 @@ static PyObject *__pyx_codeobj__451;
 static PyObject *__pyx_codeobj__453;
 static PyObject *__pyx_codeobj__455;
 static PyObject *__pyx_codeobj__457;
-static PyObject *__pyx_codeobj__460;
-static PyObject *__pyx_codeobj__462;
-static PyObject *__pyx_codeobj__464;
-static PyObject *__pyx_codeobj__466;
+static PyObject *__pyx_codeobj__459;
+static PyObject *__pyx_codeobj__461;
+static PyObject *__pyx_codeobj__463;
+static PyObject *__pyx_codeobj__465;
 static PyObject *__pyx_codeobj__468;
 static PyObject *__pyx_codeobj__470;
 static PyObject *__pyx_codeobj__472;
@@ -10750,10 +10869,10 @@ static PyObject *__pyx_codeobj__476;
 static PyObject *__pyx_codeobj__478;
 static PyObject *__pyx_codeobj__480;
 static PyObject *__pyx_codeobj__482;
-static PyObject *__pyx_codeobj__485;
-static PyObject *__pyx_codeobj__487;
-static PyObject *__pyx_codeobj__489;
-static PyObject *__pyx_codeobj__491;
+static PyObject *__pyx_codeobj__484;
+static PyObject *__pyx_codeobj__486;
+static PyObject *__pyx_codeobj__488;
+static PyObject *__pyx_codeobj__490;
 static PyObject *__pyx_codeobj__493;
 static PyObject *__pyx_codeobj__495;
 static PyObject *__pyx_codeobj__497;
@@ -10788,44 +10907,44 @@ static PyObject *__pyx_codeobj__553;
 static PyObject *__pyx_codeobj__555;
 static PyObject *__pyx_codeobj__557;
 static PyObject *__pyx_codeobj__559;
-static PyObject *__pyx_codeobj__562;
+static PyObject *__pyx_codeobj__561;
+static PyObject *__pyx_codeobj__563;
 static PyObject *__pyx_codeobj__565;
-static PyObject *__pyx_codeobj__568;
+static PyObject *__pyx_codeobj__567;
 static PyObject *__pyx_codeobj__570;
-static PyObject *__pyx_codeobj__572;
-static PyObject *__pyx_codeobj__574;
+static PyObject *__pyx_codeobj__573;
 static PyObject *__pyx_codeobj__576;
 static PyObject *__pyx_codeobj__578;
 static PyObject *__pyx_codeobj__580;
 static PyObject *__pyx_codeobj__582;
 static PyObject *__pyx_codeobj__584;
 static PyObject *__pyx_codeobj__586;
-static PyObject *__pyx_codeobj__589;
-static PyObject *__pyx_codeobj__591;
-static PyObject *__pyx_codeobj__593;
-static PyObject *__pyx_codeobj__596;
+static PyObject *__pyx_codeobj__588;
+static PyObject *__pyx_codeobj__590;
+static PyObject *__pyx_codeobj__592;
+static PyObject *__pyx_codeobj__594;
+static PyObject *__pyx_codeobj__597;
 static PyObject *__pyx_codeobj__599;
 static PyObject *__pyx_codeobj__601;
-static PyObject *__pyx_codeobj__603;
-static PyObject *__pyx_codeobj__605;
+static PyObject *__pyx_codeobj__604;
 static PyObject *__pyx_codeobj__607;
 static PyObject *__pyx_codeobj__609;
 static PyObject *__pyx_codeobj__611;
 static PyObject *__pyx_codeobj__613;
 static PyObject *__pyx_codeobj__615;
 static PyObject *__pyx_codeobj__617;
+static PyObject *__pyx_codeobj__619;
+static PyObject *__pyx_codeobj__621;
 static PyObject *__pyx_codeobj__623;
 static PyObject *__pyx_codeobj__625;
-static PyObject *__pyx_codeobj__627;
-static PyObject *__pyx_codeobj__629;
 static PyObject *__pyx_codeobj__631;
 static PyObject *__pyx_codeobj__633;
 static PyObject *__pyx_codeobj__635;
 static PyObject *__pyx_codeobj__637;
-static PyObject *__pyx_codeobj__640;
-static PyObject *__pyx_codeobj__642;
-static PyObject *__pyx_codeobj__644;
-static PyObject *__pyx_codeobj__646;
+static PyObject *__pyx_codeobj__639;
+static PyObject *__pyx_codeobj__641;
+static PyObject *__pyx_codeobj__643;
+static PyObject *__pyx_codeobj__645;
 static PyObject *__pyx_codeobj__648;
 static PyObject *__pyx_codeobj__650;
 static PyObject *__pyx_codeobj__652;
@@ -10841,13 +10960,17 @@ static PyObject *__pyx_codeobj__670;
 static PyObject *__pyx_codeobj__672;
 static PyObject *__pyx_codeobj__674;
 static PyObject *__pyx_codeobj__676;
-static PyObject *__pyx_codeobj__679;
-static PyObject *__pyx_codeobj__681;
-static PyObject *__pyx_codeobj__683;
-static PyObject *__pyx_codeobj__685;
+static PyObject *__pyx_codeobj__678;
+static PyObject *__pyx_codeobj__680;
+static PyObject *__pyx_codeobj__682;
+static PyObject *__pyx_codeobj__684;
 static PyObject *__pyx_codeobj__687;
+static PyObject *__pyx_codeobj__689;
+static PyObject *__pyx_codeobj__691;
+static PyObject *__pyx_codeobj__693;
+static PyObject *__pyx_codeobj__695;
 
-/* "lxml/etree.pyx":112
+/* "lxml/etree.pyx":115
  * 
  * class _ImmutableMapping(MutableMapping):
  *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
@@ -10887,11 +11010,11 @@ static PyObject *__pyx_pw_4lxml_5etree_17_ImmutableMapping_1__getitem__(PyObject
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 112, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 112, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -10904,7 +11027,7 @@ static PyObject *__pyx_pw_4lxml_5etree_17_ImmutableMapping_1__getitem__(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 112, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ImmutableMapping.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -10922,7 +11045,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping___getitem__(CYTHON_UN
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__getitem__", 0);
 
-  /* "lxml/etree.pyx":113
+  /* "lxml/etree.pyx":116
  * class _ImmutableMapping(MutableMapping):
  *     def __getitem__(self, key):
  *         raise KeyError, key             # <<<<<<<<<<<<<<
@@ -10930,9 +11053,9 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping___getitem__(CYTHON_UN
  *     def __setitem__(self, key, value):
  */
   __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0, 0);
-  __PYX_ERR(0, 113, __pyx_L1_error)
+  __PYX_ERR(0, 116, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":112
+  /* "lxml/etree.pyx":115
  * 
  * class _ImmutableMapping(MutableMapping):
  *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
@@ -10949,7 +11072,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping___getitem__(CYTHON_UN
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":115
+/* "lxml/etree.pyx":118
  *         raise KeyError, key
  * 
  *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
@@ -10992,17 +11115,17 @@ static PyObject *__pyx_pw_4lxml_5etree_17_ImmutableMapping_3__setitem__(PyObject
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 115, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 118, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 115, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 118, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setitem__") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setitem__") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -11017,7 +11140,7 @@ static PyObject *__pyx_pw_4lxml_5etree_17_ImmutableMapping_3__setitem__(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ImmutableMapping.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -11035,7 +11158,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_2__setitem__(CYTHON_U
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__setitem__", 0);
 
-  /* "lxml/etree.pyx":116
+  /* "lxml/etree.pyx":119
  * 
  *     def __setitem__(self, key, value):
  *         raise KeyError, key             # <<<<<<<<<<<<<<
@@ -11043,9 +11166,9 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_2__setitem__(CYTHON_U
  *     def __delitem__(self, key):
  */
   __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0, 0);
-  __PYX_ERR(0, 116, __pyx_L1_error)
+  __PYX_ERR(0, 119, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":115
+  /* "lxml/etree.pyx":118
  *         raise KeyError, key
  * 
  *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
@@ -11062,7 +11185,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_2__setitem__(CYTHON_U
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":118
+/* "lxml/etree.pyx":121
  *         raise KeyError, key
  * 
  *     def __delitem__(self, key):             # <<<<<<<<<<<<<<
@@ -11102,11 +11225,11 @@ static PyObject *__pyx_pw_4lxml_5etree_17_ImmutableMapping_5__delitem__(PyObject
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__delitem__", 1, 2, 2, 1); __PYX_ERR(0, 118, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__delitem__", 1, 2, 2, 1); __PYX_ERR(0, 121, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__delitem__") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__delitem__") < 0)) __PYX_ERR(0, 121, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -11119,7 +11242,7 @@ static PyObject *__pyx_pw_4lxml_5etree_17_ImmutableMapping_5__delitem__(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__delitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__delitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 121, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ImmutableMapping.__delitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -11137,7 +11260,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_4__delitem__(CYTHON_U
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__delitem__", 0);
 
-  /* "lxml/etree.pyx":119
+  /* "lxml/etree.pyx":122
  * 
  *     def __delitem__(self, key):
  *         raise KeyError, key             # <<<<<<<<<<<<<<
@@ -11145,9 +11268,9 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_4__delitem__(CYTHON_U
  *     def __contains__(self, key):
  */
   __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0, 0);
-  __PYX_ERR(0, 119, __pyx_L1_error)
+  __PYX_ERR(0, 122, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":118
+  /* "lxml/etree.pyx":121
  *         raise KeyError, key
  * 
  *     def __delitem__(self, key):             # <<<<<<<<<<<<<<
@@ -11164,7 +11287,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_4__delitem__(CYTHON_U
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":121
+/* "lxml/etree.pyx":124
  *         raise KeyError, key
  * 
  *     def __contains__(self, key):             # <<<<<<<<<<<<<<
@@ -11204,11 +11327,11 @@ static PyObject *__pyx_pw_4lxml_5etree_17_ImmutableMapping_7__contains__(PyObjec
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, 1); __PYX_ERR(0, 121, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, 1); __PYX_ERR(0, 124, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__contains__") < 0)) __PYX_ERR(0, 121, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__contains__") < 0)) __PYX_ERR(0, 124, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -11221,7 +11344,7 @@ static PyObject *__pyx_pw_4lxml_5etree_17_ImmutableMapping_7__contains__(PyObjec
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 121, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 124, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ImmutableMapping.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -11239,7 +11362,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_6__contains__(CYTHON_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__contains__", 0);
 
-  /* "lxml/etree.pyx":122
+  /* "lxml/etree.pyx":125
  * 
  *     def __contains__(self, key):
  *         return False             # <<<<<<<<<<<<<<
@@ -11251,7 +11374,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_6__contains__(CYTHON_
   __pyx_r = Py_False;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":121
+  /* "lxml/etree.pyx":124
  *         raise KeyError, key
  * 
  *     def __contains__(self, key):             # <<<<<<<<<<<<<<
@@ -11266,7 +11389,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_6__contains__(CYTHON_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":124
+/* "lxml/etree.pyx":127
  *         return False
  * 
  *     def __len__(self):             # <<<<<<<<<<<<<<
@@ -11293,7 +11416,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_8__len__(CYTHON_UNUSE
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__len__", 0);
 
-  /* "lxml/etree.pyx":125
+  /* "lxml/etree.pyx":128
  * 
  *     def __len__(self):
  *         return 0             # <<<<<<<<<<<<<<
@@ -11305,7 +11428,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_8__len__(CYTHON_UNUSE
   __pyx_r = __pyx_int_0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":124
+  /* "lxml/etree.pyx":127
  *         return False
  * 
  *     def __len__(self):             # <<<<<<<<<<<<<<
@@ -11320,7 +11443,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_8__len__(CYTHON_UNUSE
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":127
+/* "lxml/etree.pyx":130
  *         return 0
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -11347,7 +11470,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_10__iter__(CYTHON_UNU
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "lxml/etree.pyx":128
+  /* "lxml/etree.pyx":131
  * 
  *     def __iter__(self):
  *         return ITER_EMPTY             # <<<<<<<<<<<<<<
@@ -11359,7 +11482,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_10__iter__(CYTHON_UNU
   __pyx_r = __pyx_v_4lxml_5etree_ITER_EMPTY;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":127
+  /* "lxml/etree.pyx":130
  *         return 0
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -11374,7 +11497,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ImmutableMapping_10__iter__(CYTHON_UNU
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":191
+/* "lxml/etree.pyx":194
  * cdef object _check_internal_prefix = re.compile(b"ns\d+$").match
  * 
  * def register_namespace(prefix, uri):             # <<<<<<<<<<<<<<
@@ -11415,11 +11538,11 @@ static PyObject *__pyx_pw_4lxml_5etree_1register_namespace(PyObject *__pyx_self,
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_uri)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("register_namespace", 1, 2, 2, 1); __PYX_ERR(0, 191, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("register_namespace", 1, 2, 2, 1); __PYX_ERR(0, 194, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_namespace") < 0)) __PYX_ERR(0, 191, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register_namespace") < 0)) __PYX_ERR(0, 194, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -11432,7 +11555,7 @@ static PyObject *__pyx_pw_4lxml_5etree_1register_namespace(PyObject *__pyx_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("register_namespace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 191, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("register_namespace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 194, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.register_namespace", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -11464,23 +11587,23 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
   int __pyx_t_10;
   __Pyx_RefNannySetupContext("register_namespace", 0);
 
-  /* "lxml/etree.pyx":197
+  /* "lxml/etree.pyx":200
  *     removed.
  *     """
  *     prefix_utf, uri_utf = _utf8(prefix), _utf8(uri)             # <<<<<<<<<<<<<<
  *     if _check_internal_prefix(prefix_utf):
  *         raise ValueError("Prefix format reserved for internal use")
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_uri); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_uri); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_v_prefix_utf = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
   __pyx_v_uri_utf = ((PyObject*)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":198
+  /* "lxml/etree.pyx":201
  *     """
  *     prefix_utf, uri_utf = _utf8(prefix), _utf8(uri)
  *     if _check_internal_prefix(prefix_utf):             # <<<<<<<<<<<<<<
@@ -11499,13 +11622,13 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_prefix_utf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_prefix_utf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_1)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_prefix_utf};
-      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_2);
     } else
@@ -11513,42 +11636,42 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_prefix_utf};
-      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_2);
     } else
     #endif
     {
-      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_INCREF(__pyx_v_prefix_utf);
       __Pyx_GIVEREF(__pyx_v_prefix_utf);
       PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_prefix_utf);
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     }
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 198, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":199
+    /* "lxml/etree.pyx":202
  *     prefix_utf, uri_utf = _utf8(prefix), _utf8(uri)
  *     if _check_internal_prefix(prefix_utf):
  *         raise ValueError("Prefix format reserved for internal use")             # <<<<<<<<<<<<<<
  *     _tagValidOrRaise(prefix_utf)
  *     _uriValidOrRaise(uri_utf)
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 199, __pyx_L1_error)
+    __PYX_ERR(0, 202, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":198
+    /* "lxml/etree.pyx":201
  *     """
  *     prefix_utf, uri_utf = _utf8(prefix), _utf8(uri)
  *     if _check_internal_prefix(prefix_utf):             # <<<<<<<<<<<<<<
@@ -11557,25 +11680,25 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
  */
   }
 
-  /* "lxml/etree.pyx":200
+  /* "lxml/etree.pyx":203
  *     if _check_internal_prefix(prefix_utf):
  *         raise ValueError("Prefix format reserved for internal use")
  *     _tagValidOrRaise(prefix_utf)             # <<<<<<<<<<<<<<
  *     _uriValidOrRaise(uri_utf)
  *     for k, v in list(_DEFAULT_NAMESPACE_PREFIXES.items()):
  */
-  __pyx_t_6 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_prefix_utf); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_prefix_utf); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 203, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":201
+  /* "lxml/etree.pyx":204
  *         raise ValueError("Prefix format reserved for internal use")
  *     _tagValidOrRaise(prefix_utf)
  *     _uriValidOrRaise(uri_utf)             # <<<<<<<<<<<<<<
  *     for k, v in list(_DEFAULT_NAMESPACE_PREFIXES.items()):
  *         if k == uri_utf or v == prefix_utf:
  */
-  __pyx_t_6 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_uri_utf); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_uri_utf); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":202
+  /* "lxml/etree.pyx":205
  *     _tagValidOrRaise(prefix_utf)
  *     _uriValidOrRaise(uri_utf)
  *     for k, v in list(_DEFAULT_NAMESPACE_PREFIXES.items()):             # <<<<<<<<<<<<<<
@@ -11583,12 +11706,12 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
  *             del _DEFAULT_NAMESPACE_PREFIXES[k]
  */
   if (unlikely(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
-    __PYX_ERR(0, 202, __pyx_L1_error)
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
+    __PYX_ERR(0, 205, __pyx_L1_error)
   }
-  __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
@@ -11596,9 +11719,9 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
   for (;;) {
     if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 202, __pyx_L1_error)
+    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 205, __pyx_L1_error)
     #else
-    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     #endif
     if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
@@ -11611,7 +11734,7 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        __PYX_ERR(0, 202, __pyx_L1_error)
+        __PYX_ERR(0, 205, __pyx_L1_error)
       }
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
       if (likely(PyTuple_CheckExact(sequence))) {
@@ -11624,15 +11747,15 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
       __Pyx_INCREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_t_3);
       #else
-      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error)
+      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
+      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       #endif
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     } else {
       Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error)
+      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 205, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
@@ -11640,7 +11763,7 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
       __Pyx_GOTREF(__pyx_t_4);
       index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
       __pyx_t_9 = NULL;
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       goto __pyx_L7_unpacking_done;
@@ -11648,7 +11771,7 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       __pyx_t_9 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      __PYX_ERR(0, 202, __pyx_L1_error)
+      __PYX_ERR(0, 205, __pyx_L1_error)
       __pyx_L7_unpacking_done:;
     }
     __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4);
@@ -11656,25 +11779,25 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
     __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":203
+    /* "lxml/etree.pyx":206
  *     _uriValidOrRaise(uri_utf)
  *     for k, v in list(_DEFAULT_NAMESPACE_PREFIXES.items()):
  *         if k == uri_utf or v == prefix_utf:             # <<<<<<<<<<<<<<
  *             del _DEFAULT_NAMESPACE_PREFIXES[k]
  *     _DEFAULT_NAMESPACE_PREFIXES[uri_utf] = prefix_utf
  */
-    __pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_k, __pyx_v_uri_utf, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
+    __pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_k, __pyx_v_uri_utf, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 206, __pyx_L1_error)
     if (!__pyx_t_10) {
     } else {
       __pyx_t_5 = __pyx_t_10;
       goto __pyx_L9_bool_binop_done;
     }
-    __pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_v, __pyx_v_prefix_utf, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
+    __pyx_t_10 = (__Pyx_PyBytes_Equals(__pyx_v_v, __pyx_v_prefix_utf, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 206, __pyx_L1_error)
     __pyx_t_5 = __pyx_t_10;
     __pyx_L9_bool_binop_done:;
     if (__pyx_t_5) {
 
-      /* "lxml/etree.pyx":204
+      /* "lxml/etree.pyx":207
  *     for k, v in list(_DEFAULT_NAMESPACE_PREFIXES.items()):
  *         if k == uri_utf or v == prefix_utf:
  *             del _DEFAULT_NAMESPACE_PREFIXES[k]             # <<<<<<<<<<<<<<
@@ -11683,11 +11806,11 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
  */
       if (unlikely(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(0, 204, __pyx_L1_error)
+        __PYX_ERR(0, 207, __pyx_L1_error)
       }
-      if (unlikely(PyDict_DelItem(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES, __pyx_v_k) < 0)) __PYX_ERR(0, 204, __pyx_L1_error)
+      if (unlikely(PyDict_DelItem(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES, __pyx_v_k) < 0)) __PYX_ERR(0, 207, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":203
+      /* "lxml/etree.pyx":206
  *     _uriValidOrRaise(uri_utf)
  *     for k, v in list(_DEFAULT_NAMESPACE_PREFIXES.items()):
  *         if k == uri_utf or v == prefix_utf:             # <<<<<<<<<<<<<<
@@ -11696,7 +11819,7 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/etree.pyx":202
+    /* "lxml/etree.pyx":205
  *     _tagValidOrRaise(prefix_utf)
  *     _uriValidOrRaise(uri_utf)
  *     for k, v in list(_DEFAULT_NAMESPACE_PREFIXES.items()):             # <<<<<<<<<<<<<<
@@ -11706,7 +11829,7 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":205
+  /* "lxml/etree.pyx":208
  *         if k == uri_utf or v == prefix_utf:
  *             del _DEFAULT_NAMESPACE_PREFIXES[k]
  *     _DEFAULT_NAMESPACE_PREFIXES[uri_utf] = prefix_utf             # <<<<<<<<<<<<<<
@@ -11715,11 +11838,11 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
  */
   if (unlikely(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(0, 205, __pyx_L1_error)
+    __PYX_ERR(0, 208, __pyx_L1_error)
   }
-  if (unlikely(PyDict_SetItem(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES, __pyx_v_uri_utf, __pyx_v_prefix_utf) < 0)) __PYX_ERR(0, 205, __pyx_L1_error)
+  if (unlikely(PyDict_SetItem(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES, __pyx_v_uri_utf, __pyx_v_prefix_utf) < 0)) __PYX_ERR(0, 208, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":191
+  /* "lxml/etree.pyx":194
  * cdef object _check_internal_prefix = re.compile(b"ns\d+$").match
  * 
  * def register_namespace(prefix, uri):             # <<<<<<<<<<<<<<
@@ -11748,7 +11871,7 @@ static PyObject *__pyx_pf_4lxml_5etree_register_namespace(CYTHON_UNUSED PyObject
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":217
+/* "lxml/etree.pyx":220
  *     this one.
  *     """
  *     def __init__(self, message, error_log=None):             # <<<<<<<<<<<<<<
@@ -11792,7 +11915,7 @@ static int __pyx_pw_4lxml_5etree_9LxmlError_1__init__(PyObject *__pyx_v_self, Py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 220, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -11808,7 +11931,7 @@ static int __pyx_pw_4lxml_5etree_9LxmlError_1__init__(PyObject *__pyx_v_self, Py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 220, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.LxmlError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -11832,14 +11955,14 @@ static int __pyx_pf_4lxml_5etree_9LxmlError___init__(struct __pyx_obj_4lxml_5etr
   int __pyx_t_6;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "lxml/etree.pyx":218
+  /* "lxml/etree.pyx":221
  *     """
  *     def __init__(self, message, error_log=None):
  *         super(_Error, self).__init__(message)             # <<<<<<<<<<<<<<
  *         if error_log is None:
  *             self.error_log = __copyGlobalErrorLog()
  */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_4lxml_5etree__Error);
   __Pyx_GIVEREF(__pyx_v_4lxml_5etree__Error);
@@ -11847,10 +11970,10 @@ static int __pyx_pf_4lxml_5etree_9LxmlError___init__(struct __pyx_obj_4lxml_5etr
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = NULL;
@@ -11864,13 +11987,13 @@ static int __pyx_pf_4lxml_5etree_9LxmlError___init__(struct __pyx_obj_4lxml_5etr
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_message};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else
@@ -11878,19 +12001,19 @@ static int __pyx_pf_4lxml_5etree_9LxmlError___init__(struct __pyx_obj_4lxml_5etr
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_message};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else
     #endif
     {
-      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_INCREF(__pyx_v_message);
       __Pyx_GIVEREF(__pyx_v_message);
       PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_message);
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     }
@@ -11898,7 +12021,7 @@ static int __pyx_pf_4lxml_5etree_9LxmlError___init__(struct __pyx_obj_4lxml_5etr
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":219
+  /* "lxml/etree.pyx":222
  *     def __init__(self, message, error_log=None):
  *         super(_Error, self).__init__(message)
  *         if error_log is None:             # <<<<<<<<<<<<<<
@@ -11909,19 +12032,19 @@ static int __pyx_pf_4lxml_5etree_9LxmlError___init__(struct __pyx_obj_4lxml_5etr
   __pyx_t_6 = (__pyx_t_5 != 0);
   if (__pyx_t_6) {
 
-    /* "lxml/etree.pyx":220
+    /* "lxml/etree.pyx":223
  *         super(_Error, self).__init__(message)
  *         if error_log is None:
  *             self.error_log = __copyGlobalErrorLog()             # <<<<<<<<<<<<<<
  *         else:
  *             self.error_log = error_log.copy()
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree___copyGlobalErrorLog(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree___copyGlobalErrorLog(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error_log, __pyx_t_1) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error_log, __pyx_t_1) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "lxml/etree.pyx":219
+    /* "lxml/etree.pyx":222
  *     def __init__(self, message, error_log=None):
  *         super(_Error, self).__init__(message)
  *         if error_log is None:             # <<<<<<<<<<<<<<
@@ -11931,7 +12054,7 @@ static int __pyx_pf_4lxml_5etree_9LxmlError___init__(struct __pyx_obj_4lxml_5etr
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":222
+  /* "lxml/etree.pyx":225
  *             self.error_log = __copyGlobalErrorLog()
  *         else:
  *             self.error_log = error_log.copy()             # <<<<<<<<<<<<<<
@@ -11939,7 +12062,7 @@ static int __pyx_pf_4lxml_5etree_9LxmlError___init__(struct __pyx_obj_4lxml_5etr
  * cdef object _Error = Error
  */
   /*else*/ {
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_error_log, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_error_log, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -11952,19 +12075,19 @@ static int __pyx_pf_4lxml_5etree_9LxmlError___init__(struct __pyx_obj_4lxml_5etr
       }
     }
     if (__pyx_t_4) {
-      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     } else {
-      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
     }
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error_log, __pyx_t_1) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error_log, __pyx_t_1) < 0) __PYX_ERR(0, 225, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":217
+  /* "lxml/etree.pyx":220
  *     this one.
  *     """
  *     def __init__(self, message, error_log=None):             # <<<<<<<<<<<<<<
@@ -11987,7 +12110,7 @@ static int __pyx_pf_4lxml_5etree_9LxmlError___init__(struct __pyx_obj_4lxml_5etr
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":237
+/* "lxml/etree.pyx":240
  * 
  * # version information
  * cdef __unpackDottedVersion(version):             # <<<<<<<<<<<<<<
@@ -12018,43 +12141,43 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
   int __pyx_t_14;
   __Pyx_RefNannySetupContext("__unpackDottedVersion", 0);
 
-  /* "lxml/etree.pyx":238
+  /* "lxml/etree.pyx":241
  * # version information
  * cdef __unpackDottedVersion(version):
  *     version_list = []             # <<<<<<<<<<<<<<
  *     l = (version.decode("ascii").replace(u'-', u'.').split(u'.') + [0]*4)[:4]
  *     for item in l:
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_version_list = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":239
+  /* "lxml/etree.pyx":242
  * cdef __unpackDottedVersion(version):
  *     version_list = []
  *     l = (version.decode("ascii").replace(u'-', u'.').split(u'.') + [0]*4)[:4]             # <<<<<<<<<<<<<<
  *     for item in l:
  *         try:
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_version, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_version, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyList_New(1 * 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(1 * 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   { Py_ssize_t __pyx_temp;
     for (__pyx_temp=0; __pyx_temp < 4; __pyx_temp++) {
@@ -12063,17 +12186,17 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
       PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_int_0);
     }
   }
-  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 4, NULL, NULL, &__pyx_slice__7, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 4, NULL, NULL, &__pyx_slice__7, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_l = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":240
+  /* "lxml/etree.pyx":243
  *     version_list = []
  *     l = (version.decode("ascii").replace(u'-', u'.').split(u'.') + [0]*4)[:4]
  *     for item in l:             # <<<<<<<<<<<<<<
@@ -12084,26 +12207,26 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
     __pyx_t_1 = __pyx_v_l; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
   } else {
-    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
+    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error)
+    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_5)) {
       if (likely(PyList_CheckExact(__pyx_t_1))) {
         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
+        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
         #else
-        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error)
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         #endif
       } else {
         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
+        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
         #else
-        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error)
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         #endif
       }
@@ -12112,8 +12235,8 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
       if (unlikely(!__pyx_t_3)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 240, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 243, __pyx_L1_error)
         }
         break;
       }
@@ -12122,7 +12245,7 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":241
+    /* "lxml/etree.pyx":244
  *     l = (version.decode("ascii").replace(u'-', u'.').split(u'.') + [0]*4)[:4]
  *     for item in l:
  *         try:             # <<<<<<<<<<<<<<
@@ -12138,19 +12261,19 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
       __Pyx_XGOTREF(__pyx_t_8);
       /*try:*/ {
 
-        /* "lxml/etree.pyx":242
+        /* "lxml/etree.pyx":245
  *     for item in l:
  *         try:
  *             item = int(item)             # <<<<<<<<<<<<<<
  *         except ValueError:
  *             if item.startswith(u'dev'):
  */
-        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L5_error)
+        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L5_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_3);
         __pyx_t_3 = 0;
 
-        /* "lxml/etree.pyx":241
+        /* "lxml/etree.pyx":244
  *     l = (version.decode("ascii").replace(u'-', u'.').split(u'.') + [0]*4)[:4]
  *     for item in l:
  *         try:             # <<<<<<<<<<<<<<
@@ -12163,11 +12286,10 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       goto __pyx_L12_try_end;
       __pyx_L5_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":243
+      /* "lxml/etree.pyx":246
  *         try:
  *             item = int(item)
  *         except ValueError:             # <<<<<<<<<<<<<<
@@ -12177,40 +12299,40 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
       if (__pyx_t_9) {
         __Pyx_AddTraceback("lxml.etree.__unpackDottedVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(0, 243, __pyx_L7_except_error)
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(0, 246, __pyx_L7_except_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_GOTREF(__pyx_t_10);
 
-        /* "lxml/etree.pyx":244
+        /* "lxml/etree.pyx":247
  *             item = int(item)
  *         except ValueError:
  *             if item.startswith(u'dev'):             # <<<<<<<<<<<<<<
  *                 count = item[3:]
  *                 item = -300
  */
-        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_startswith); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 244, __pyx_L7_except_error)
+        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_startswith); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 247, __pyx_L7_except_error)
         __Pyx_GOTREF(__pyx_t_11);
-        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 244, __pyx_L7_except_error)
+        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 247, __pyx_L7_except_error)
         __Pyx_GOTREF(__pyx_t_12);
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 244, __pyx_L7_except_error)
+        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 247, __pyx_L7_except_error)
         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
         if (__pyx_t_13) {
 
-          /* "lxml/etree.pyx":245
+          /* "lxml/etree.pyx":248
  *         except ValueError:
  *             if item.startswith(u'dev'):
  *                 count = item[3:]             # <<<<<<<<<<<<<<
  *                 item = -300
  *             elif item.startswith(u'alpha'):
  */
-          __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_item, 3, 0, NULL, NULL, &__pyx_slice__9, 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 245, __pyx_L7_except_error)
+          __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_item, 3, 0, NULL, NULL, &__pyx_slice__9, 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 248, __pyx_L7_except_error)
           __Pyx_GOTREF(__pyx_t_12);
           __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_12);
           __pyx_t_12 = 0;
 
-          /* "lxml/etree.pyx":246
+          /* "lxml/etree.pyx":249
  *             if item.startswith(u'dev'):
  *                 count = item[3:]
  *                 item = -300             # <<<<<<<<<<<<<<
@@ -12220,7 +12342,7 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
           __Pyx_INCREF(__pyx_int_neg_300);
           __Pyx_DECREF_SET(__pyx_v_item, __pyx_int_neg_300);
 
-          /* "lxml/etree.pyx":244
+          /* "lxml/etree.pyx":247
  *             item = int(item)
  *         except ValueError:
  *             if item.startswith(u'dev'):             # <<<<<<<<<<<<<<
@@ -12230,35 +12352,35 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
           goto __pyx_L15;
         }
 
-        /* "lxml/etree.pyx":247
+        /* "lxml/etree.pyx":250
  *                 count = item[3:]
  *                 item = -300
  *             elif item.startswith(u'alpha'):             # <<<<<<<<<<<<<<
  *                 count = item[5:]
  *                 item = -200
  */
-        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_startswith); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 247, __pyx_L7_except_error)
+        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_startswith); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 250, __pyx_L7_except_error)
         __Pyx_GOTREF(__pyx_t_12);
-        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 247, __pyx_L7_except_error)
+        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 250, __pyx_L7_except_error)
         __Pyx_GOTREF(__pyx_t_11);
         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 247, __pyx_L7_except_error)
+        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 250, __pyx_L7_except_error)
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
         if (__pyx_t_13) {
 
-          /* "lxml/etree.pyx":248
+          /* "lxml/etree.pyx":251
  *                 item = -300
  *             elif item.startswith(u'alpha'):
  *                 count = item[5:]             # <<<<<<<<<<<<<<
  *                 item = -200
  *             elif item.startswith(u'beta'):
  */
-          __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_item, 5, 0, NULL, NULL, &__pyx_slice__11, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 248, __pyx_L7_except_error)
+          __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_item, 5, 0, NULL, NULL, &__pyx_slice__11, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 251, __pyx_L7_except_error)
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_11);
           __pyx_t_11 = 0;
 
-          /* "lxml/etree.pyx":249
+          /* "lxml/etree.pyx":252
  *             elif item.startswith(u'alpha'):
  *                 count = item[5:]
  *                 item = -200             # <<<<<<<<<<<<<<
@@ -12268,7 +12390,7 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
           __Pyx_INCREF(__pyx_int_neg_200);
           __Pyx_DECREF_SET(__pyx_v_item, __pyx_int_neg_200);
 
-          /* "lxml/etree.pyx":247
+          /* "lxml/etree.pyx":250
  *                 count = item[3:]
  *                 item = -300
  *             elif item.startswith(u'alpha'):             # <<<<<<<<<<<<<<
@@ -12278,35 +12400,35 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
           goto __pyx_L15;
         }
 
-        /* "lxml/etree.pyx":250
+        /* "lxml/etree.pyx":253
  *                 count = item[5:]
  *                 item = -200
  *             elif item.startswith(u'beta'):             # <<<<<<<<<<<<<<
  *                 count = item[4:]
  *                 item = -100
  */
-        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_startswith); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 250, __pyx_L7_except_error)
+        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_startswith); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 253, __pyx_L7_except_error)
         __Pyx_GOTREF(__pyx_t_11);
-        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 250, __pyx_L7_except_error)
+        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 253, __pyx_L7_except_error)
         __Pyx_GOTREF(__pyx_t_12);
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 250, __pyx_L7_except_error)
+        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 253, __pyx_L7_except_error)
         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
         if (__pyx_t_13) {
 
-          /* "lxml/etree.pyx":251
+          /* "lxml/etree.pyx":254
  *                 item = -200
  *             elif item.startswith(u'beta'):
  *                 count = item[4:]             # <<<<<<<<<<<<<<
  *                 item = -100
  *             else:
  */
-          __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_item, 4, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 251, __pyx_L7_except_error)
+          __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_item, 4, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 254, __pyx_L7_except_error)
           __Pyx_GOTREF(__pyx_t_12);
           __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_12);
           __pyx_t_12 = 0;
 
-          /* "lxml/etree.pyx":252
+          /* "lxml/etree.pyx":255
  *             elif item.startswith(u'beta'):
  *                 count = item[4:]
  *                 item = -100             # <<<<<<<<<<<<<<
@@ -12316,7 +12438,7 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
           __Pyx_INCREF(__pyx_int_neg_100);
           __Pyx_DECREF_SET(__pyx_v_item, __pyx_int_neg_100);
 
-          /* "lxml/etree.pyx":250
+          /* "lxml/etree.pyx":253
  *                 count = item[5:]
  *                 item = -200
  *             elif item.startswith(u'beta'):             # <<<<<<<<<<<<<<
@@ -12326,7 +12448,7 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
           goto __pyx_L15;
         }
 
-        /* "lxml/etree.pyx":254
+        /* "lxml/etree.pyx":257
  *                 item = -100
  *             else:
  *                 count = 0             # <<<<<<<<<<<<<<
@@ -12339,32 +12461,32 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
         }
         __pyx_L15:;
 
-        /* "lxml/etree.pyx":255
+        /* "lxml/etree.pyx":258
  *             else:
  *                 count = 0
  *             if count:             # <<<<<<<<<<<<<<
  *                 item += int(count)
  *         version_list.append(item)
  */
-        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_count); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 255, __pyx_L7_except_error)
+        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_count); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 258, __pyx_L7_except_error)
         if (__pyx_t_13) {
 
-          /* "lxml/etree.pyx":256
+          /* "lxml/etree.pyx":259
  *                 count = 0
  *             if count:
  *                 item += int(count)             # <<<<<<<<<<<<<<
  *         version_list.append(item)
  *     return tuple(version_list)
  */
-          __pyx_t_12 = __Pyx_PyNumber_Int(__pyx_v_count); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 256, __pyx_L7_except_error)
+          __pyx_t_12 = __Pyx_PyNumber_Int(__pyx_v_count); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 259, __pyx_L7_except_error)
           __Pyx_GOTREF(__pyx_t_12);
-          __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_item, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L7_except_error)
+          __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_item, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 259, __pyx_L7_except_error)
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
           __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_11);
           __pyx_t_11 = 0;
 
-          /* "lxml/etree.pyx":255
+          /* "lxml/etree.pyx":258
  *             else:
  *                 count = 0
  *             if count:             # <<<<<<<<<<<<<<
@@ -12380,21 +12502,19 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
       goto __pyx_L7_except_error;
       __pyx_L7_except_error:;
 
-      /* "lxml/etree.pyx":241
+      /* "lxml/etree.pyx":244
  *     l = (version.decode("ascii").replace(u'-', u'.').split(u'.') + [0]*4)[:4]
  *     for item in l:
  *         try:             # <<<<<<<<<<<<<<
  *             item = int(item)
  *         except ValueError:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_XGIVEREF(__pyx_t_7);
       __Pyx_XGIVEREF(__pyx_t_8);
       __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
       goto __pyx_L1_error;
       __pyx_L6_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_XGIVEREF(__pyx_t_7);
       __Pyx_XGIVEREF(__pyx_t_8);
@@ -12402,16 +12522,16 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
       __pyx_L12_try_end:;
     }
 
-    /* "lxml/etree.pyx":257
+    /* "lxml/etree.pyx":260
  *             if count:
  *                 item += int(count)
  *         version_list.append(item)             # <<<<<<<<<<<<<<
  *     return tuple(version_list)
  * 
  */
-    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_version_list, __pyx_v_item); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 257, __pyx_L1_error)
+    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_version_list, __pyx_v_item); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 260, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":240
+    /* "lxml/etree.pyx":243
  *     version_list = []
  *     l = (version.decode("ascii").replace(u'-', u'.').split(u'.') + [0]*4)[:4]
  *     for item in l:             # <<<<<<<<<<<<<<
@@ -12421,7 +12541,7 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":258
+  /* "lxml/etree.pyx":261
  *                 item += int(count)
  *         version_list.append(item)
  *     return tuple(version_list)             # <<<<<<<<<<<<<<
@@ -12429,13 +12549,13 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
  * cdef __unpackIntVersion(int c_version):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyList_AsTuple(__pyx_v_version_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
+  __pyx_t_1 = PyList_AsTuple(__pyx_v_version_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":237
+  /* "lxml/etree.pyx":240
  * 
  * # version information
  * cdef __unpackDottedVersion(version):             # <<<<<<<<<<<<<<
@@ -12463,7 +12583,7 @@ static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_ve
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":260
+/* "lxml/etree.pyx":263
  *     return tuple(version_list)
  * 
  * cdef __unpackIntVersion(int c_version):             # <<<<<<<<<<<<<<
@@ -12480,7 +12600,7 @@ static PyObject *__pyx_f_4lxml_5etree___unpackIntVersion(int __pyx_v_c_version)
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("__unpackIntVersion", 0);
 
-  /* "lxml/etree.pyx":261
+  /* "lxml/etree.pyx":264
  * 
  * cdef __unpackIntVersion(int c_version):
  *     return (             # <<<<<<<<<<<<<<
@@ -12489,44 +12609,44 @@ static PyObject *__pyx_f_4lxml_5etree___unpackIntVersion(int __pyx_v_c_version)
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "lxml/etree.pyx":262
+  /* "lxml/etree.pyx":265
  * cdef __unpackIntVersion(int c_version):
  *     return (
  *         ((c_version / (100*100)) % 100),             # <<<<<<<<<<<<<<
  *         ((c_version / 100)       % 100),
  *         (c_version               % 100)
  */
-  __pyx_t_1 = __Pyx_PyInt_From_long(__Pyx_mod_long(__Pyx_div_long(__pyx_v_c_version, 0x2710), 0x64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_long(__Pyx_mod_long(__Pyx_div_long(__pyx_v_c_version, 0x2710), 0x64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
 
-  /* "lxml/etree.pyx":263
+  /* "lxml/etree.pyx":266
  *     return (
  *         ((c_version / (100*100)) % 100),
  *         ((c_version / 100)       % 100),             # <<<<<<<<<<<<<<
  *         (c_version               % 100)
  *         )
  */
-  __pyx_t_2 = __Pyx_PyInt_From_long(__Pyx_mod_long(__Pyx_div_long(__pyx_v_c_version, 0x64), 0x64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_long(__Pyx_mod_long(__Pyx_div_long(__pyx_v_c_version, 0x64), 0x64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
 
-  /* "lxml/etree.pyx":264
+  /* "lxml/etree.pyx":267
  *         ((c_version / (100*100)) % 100),
  *         ((c_version / 100)       % 100),
  *         (c_version               % 100)             # <<<<<<<<<<<<<<
  *         )
  * 
  */
-  __pyx_t_3 = __Pyx_PyInt_From_long(__Pyx_mod_long(__pyx_v_c_version, 0x64)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyInt_From_long(__Pyx_mod_long(__pyx_v_c_version, 0x64)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
 
-  /* "lxml/etree.pyx":262
+  /* "lxml/etree.pyx":265
  * cdef __unpackIntVersion(int c_version):
  *     return (
  *         ((c_version / (100*100)) % 100),             # <<<<<<<<<<<<<<
  *         ((c_version / 100)       % 100),
  *         (c_version               % 100)
  */
-  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
@@ -12541,7 +12661,7 @@ static PyObject *__pyx_f_4lxml_5etree___unpackIntVersion(int __pyx_v_c_version)
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":260
+  /* "lxml/etree.pyx":263
  *     return tuple(version_list)
  * 
  * cdef __unpackIntVersion(int c_version):             # <<<<<<<<<<<<<<
@@ -12563,7 +12683,7 @@ static PyObject *__pyx_f_4lxml_5etree___unpackIntVersion(int __pyx_v_c_version)
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":288
+/* "lxml/etree.pyx":291
  * cdef class _TempStore:
  *     cdef list _storage
  *     def __init__(self):             # <<<<<<<<<<<<<<
@@ -12593,14 +12713,14 @@ static int __pyx_pf_4lxml_5etree_10_TempStore___init__(struct __pyx_obj_4lxml_5e
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "lxml/etree.pyx":289
+  /* "lxml/etree.pyx":292
  *     cdef list _storage
  *     def __init__(self):
  *         self._storage = []             # <<<<<<<<<<<<<<
  * 
  *     cdef int add(self, obj) except -1:
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_storage);
@@ -12608,7 +12728,7 @@ static int __pyx_pf_4lxml_5etree_10_TempStore___init__(struct __pyx_obj_4lxml_5e
   __pyx_v_self->_storage = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":288
+  /* "lxml/etree.pyx":291
  * cdef class _TempStore:
  *     cdef list _storage
  *     def __init__(self):             # <<<<<<<<<<<<<<
@@ -12628,7 +12748,7 @@ static int __pyx_pf_4lxml_5etree_10_TempStore___init__(struct __pyx_obj_4lxml_5e
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":291
+/* "lxml/etree.pyx":294
  *         self._storage = []
  * 
  *     cdef int add(self, obj) except -1:             # <<<<<<<<<<<<<<
@@ -12642,7 +12762,7 @@ static int __pyx_f_4lxml_5etree_10_TempStore_add(struct __pyx_obj_4lxml_5etree__
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("add", 0);
 
-  /* "lxml/etree.pyx":292
+  /* "lxml/etree.pyx":295
  * 
  *     cdef int add(self, obj) except -1:
  *         self._storage.append(obj)             # <<<<<<<<<<<<<<
@@ -12650,12 +12770,12 @@ static int __pyx_f_4lxml_5etree_10_TempStore_add(struct __pyx_obj_4lxml_5etree__
  * 
  */
   if (unlikely(__pyx_v_self->_storage == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
-    __PYX_ERR(0, 292, __pyx_L1_error)
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
+    __PYX_ERR(0, 295, __pyx_L1_error)
   }
-  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_storage, __pyx_v_obj); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 292, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_storage, __pyx_v_obj); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 295, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":293
+  /* "lxml/etree.pyx":296
  *     cdef int add(self, obj) except -1:
  *         self._storage.append(obj)
  *         return 0             # <<<<<<<<<<<<<<
@@ -12665,7 +12785,7 @@ static int __pyx_f_4lxml_5etree_10_TempStore_add(struct __pyx_obj_4lxml_5etree__
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":291
+  /* "lxml/etree.pyx":294
  *         self._storage = []
  * 
  *     cdef int add(self, obj) except -1:             # <<<<<<<<<<<<<<
@@ -12682,7 +12802,7 @@ static int __pyx_f_4lxml_5etree_10_TempStore_add(struct __pyx_obj_4lxml_5etree__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":295
+/* "lxml/etree.pyx":298
  *         return 0
  * 
  *     cdef int clear(self) except -1:             # <<<<<<<<<<<<<<
@@ -12695,7 +12815,7 @@ static int __pyx_f_4lxml_5etree_10_TempStore_clear(struct __pyx_obj_4lxml_5etree
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("clear", 0);
 
-  /* "lxml/etree.pyx":296
+  /* "lxml/etree.pyx":299
  * 
  *     cdef int clear(self) except -1:
  *         del self._storage[:]             # <<<<<<<<<<<<<<
@@ -12704,11 +12824,11 @@ static int __pyx_f_4lxml_5etree_10_TempStore_clear(struct __pyx_obj_4lxml_5etree
  */
   if (unlikely(__pyx_v_self->_storage == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(0, 296, __pyx_L1_error)
+    __PYX_ERR(0, 299, __pyx_L1_error)
   }
-  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_storage, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 296, __pyx_L1_error)
+  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_storage, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":297
+  /* "lxml/etree.pyx":300
  *     cdef int clear(self) except -1:
  *         del self._storage[:]
  *         return 0             # <<<<<<<<<<<<<<
@@ -12718,7 +12838,7 @@ static int __pyx_f_4lxml_5etree_10_TempStore_clear(struct __pyx_obj_4lxml_5etree
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":295
+  /* "lxml/etree.pyx":298
  *         return 0
  * 
  *     cdef int clear(self) except -1:             # <<<<<<<<<<<<<<
@@ -12735,7 +12855,7 @@ static int __pyx_f_4lxml_5etree_10_TempStore_clear(struct __pyx_obj_4lxml_5etree
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":303
+/* "lxml/etree.pyx":306
  * cdef class _ExceptionContext:
  *     cdef object _exc_info
  *     cdef void clear(self):             # <<<<<<<<<<<<<<
@@ -12747,7 +12867,7 @@ static void __pyx_f_4lxml_5etree_17_ExceptionContext_clear(struct __pyx_obj_4lxm
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("clear", 0);
 
-  /* "lxml/etree.pyx":304
+  /* "lxml/etree.pyx":307
  *     cdef object _exc_info
  *     cdef void clear(self):
  *         self._exc_info = None             # <<<<<<<<<<<<<<
@@ -12760,7 +12880,7 @@ static void __pyx_f_4lxml_5etree_17_ExceptionContext_clear(struct __pyx_obj_4lxm
   __Pyx_DECREF(__pyx_v_self->_exc_info);
   __pyx_v_self->_exc_info = Py_None;
 
-  /* "lxml/etree.pyx":303
+  /* "lxml/etree.pyx":306
  * cdef class _ExceptionContext:
  *     cdef object _exc_info
  *     cdef void clear(self):             # <<<<<<<<<<<<<<
@@ -12772,7 +12892,7 @@ static void __pyx_f_4lxml_5etree_17_ExceptionContext_clear(struct __pyx_obj_4lxm
   __Pyx_RefNannyFinishContext();
 }
 
-/* "lxml/etree.pyx":306
+/* "lxml/etree.pyx":309
  *         self._exc_info = None
  * 
  *     cdef void _store_raised(self):             # <<<<<<<<<<<<<<
@@ -12787,14 +12907,14 @@ static void __pyx_f_4lxml_5etree_17_ExceptionContext__store_raised(struct __pyx_
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("_store_raised", 0);
 
-  /* "lxml/etree.pyx":307
+  /* "lxml/etree.pyx":310
  * 
  *     cdef void _store_raised(self):
  *         self._exc_info = sys.exc_info()             # <<<<<<<<<<<<<<
  * 
  *     cdef void _store_exception(self, exception):
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -12807,10 +12927,10 @@ static void __pyx_f_4lxml_5etree_17_ExceptionContext__store_raised(struct __pyx_
     }
   }
   if (__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else {
-    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -12820,7 +12940,7 @@ static void __pyx_f_4lxml_5etree_17_ExceptionContext__store_raised(struct __pyx_
   __pyx_v_self->_exc_info = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":306
+  /* "lxml/etree.pyx":309
  *         self._exc_info = None
  * 
  *     cdef void _store_raised(self):             # <<<<<<<<<<<<<<
@@ -12839,7 +12959,7 @@ static void __pyx_f_4lxml_5etree_17_ExceptionContext__store_raised(struct __pyx_
   __Pyx_RefNannyFinishContext();
 }
 
-/* "lxml/etree.pyx":309
+/* "lxml/etree.pyx":312
  *         self._exc_info = sys.exc_info()
  * 
  *     cdef void _store_exception(self, exception):             # <<<<<<<<<<<<<<
@@ -12852,14 +12972,14 @@ static void __pyx_f_4lxml_5etree_17_ExceptionContext__store_exception(struct __p
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("_store_exception", 0);
 
-  /* "lxml/etree.pyx":310
+  /* "lxml/etree.pyx":313
  * 
  *     cdef void _store_exception(self, exception):
  *         self._exc_info = (exception, None, None)             # <<<<<<<<<<<<<<
  * 
  *     cdef bint _has_raised(self):
  */
-  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_exception);
   __Pyx_GIVEREF(__pyx_v_exception);
@@ -12876,7 +12996,7 @@ static void __pyx_f_4lxml_5etree_17_ExceptionContext__store_exception(struct __p
   __pyx_v_self->_exc_info = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":309
+  /* "lxml/etree.pyx":312
  *         self._exc_info = sys.exc_info()
  * 
  *     cdef void _store_exception(self, exception):             # <<<<<<<<<<<<<<
@@ -12893,7 +13013,7 @@ static void __pyx_f_4lxml_5etree_17_ExceptionContext__store_exception(struct __p
   __Pyx_RefNannyFinishContext();
 }
 
-/* "lxml/etree.pyx":312
+/* "lxml/etree.pyx":315
  *         self._exc_info = (exception, None, None)
  * 
  *     cdef bint _has_raised(self):             # <<<<<<<<<<<<<<
@@ -12907,7 +13027,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__has_raised(struct __pyx_obj
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("_has_raised", 0);
 
-  /* "lxml/etree.pyx":313
+  /* "lxml/etree.pyx":316
  * 
  *     cdef bint _has_raised(self):
  *         return self._exc_info is not None             # <<<<<<<<<<<<<<
@@ -12918,7 +13038,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__has_raised(struct __pyx_obj
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":312
+  /* "lxml/etree.pyx":315
  *         self._exc_info = (exception, None, None)
  * 
  *     cdef bint _has_raised(self):             # <<<<<<<<<<<<<<
@@ -12932,7 +13052,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__has_raised(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":315
+/* "lxml/etree.pyx":318
  *         return self._exc_info is not None
  * 
  *     cdef int _raise_if_stored(self) except -1:             # <<<<<<<<<<<<<<
@@ -12957,7 +13077,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
   int __pyx_t_9;
   __Pyx_RefNannySetupContext("_raise_if_stored", 0);
 
-  /* "lxml/etree.pyx":316
+  /* "lxml/etree.pyx":319
  * 
  *     cdef int _raise_if_stored(self) except -1:
  *         if self._exc_info is None:             # <<<<<<<<<<<<<<
@@ -12968,7 +13088,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":317
+    /* "lxml/etree.pyx":320
  *     cdef int _raise_if_stored(self) except -1:
  *         if self._exc_info is None:
  *             return 0             # <<<<<<<<<<<<<<
@@ -12978,7 +13098,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
     __pyx_r = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":316
+    /* "lxml/etree.pyx":319
  * 
  *     cdef int _raise_if_stored(self) except -1:
  *         if self._exc_info is None:             # <<<<<<<<<<<<<<
@@ -12987,7 +13107,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
  */
   }
 
-  /* "lxml/etree.pyx":318
+  /* "lxml/etree.pyx":321
  *         if self._exc_info is None:
  *             return 0
  *         type, value, traceback = self._exc_info             # <<<<<<<<<<<<<<
@@ -13006,7 +13126,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
     if (unlikely(size != 3)) {
       if (size > 3) __Pyx_RaiseTooManyValuesError(3);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 318, __pyx_L1_error)
+      __PYX_ERR(0, 321, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -13022,17 +13142,17 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
     __Pyx_INCREF(__pyx_t_5);
     __Pyx_INCREF(__pyx_t_6);
     #else
-    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
+    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
+    __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     #endif
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error)
+    __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
@@ -13042,7 +13162,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
     __Pyx_GOTREF(__pyx_t_5);
     index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_6);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
     __pyx_t_8 = NULL;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     goto __pyx_L5_unpacking_done;
@@ -13050,7 +13170,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     __pyx_t_8 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 318, __pyx_L1_error)
+    __PYX_ERR(0, 321, __pyx_L1_error)
     __pyx_L5_unpacking_done:;
   }
   __pyx_v_type = __pyx_t_4;
@@ -13060,7 +13180,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
   __pyx_v_traceback = __pyx_t_6;
   __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":319
+  /* "lxml/etree.pyx":322
  *             return 0
  *         type, value, traceback = self._exc_info
  *         self._exc_info = None             # <<<<<<<<<<<<<<
@@ -13073,7 +13193,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
   __Pyx_DECREF(__pyx_v_self->_exc_info);
   __pyx_v_self->_exc_info = Py_None;
 
-  /* "lxml/etree.pyx":320
+  /* "lxml/etree.pyx":323
  *         type, value, traceback = self._exc_info
  *         self._exc_info = None
  *         if value is None and traceback is None:             # <<<<<<<<<<<<<<
@@ -13093,7 +13213,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
   __pyx_L7_bool_binop_done:;
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":321
+    /* "lxml/etree.pyx":324
  *         self._exc_info = None
  *         if value is None and traceback is None:
  *             raise type             # <<<<<<<<<<<<<<
@@ -13101,9 +13221,9 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
  *             raise type, value, traceback
  */
     __Pyx_Raise(__pyx_v_type, 0, 0, 0);
-    __PYX_ERR(0, 321, __pyx_L1_error)
+    __PYX_ERR(0, 324, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":320
+    /* "lxml/etree.pyx":323
  *         type, value, traceback = self._exc_info
  *         self._exc_info = None
  *         if value is None and traceback is None:             # <<<<<<<<<<<<<<
@@ -13112,7 +13232,7 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
  */
   }
 
-  /* "lxml/etree.pyx":323
+  /* "lxml/etree.pyx":326
  *             raise type
  *         else:
  *             raise type, value, traceback             # <<<<<<<<<<<<<<
@@ -13121,10 +13241,10 @@ static int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __py
  */
   /*else*/ {
     __Pyx_Raise(__pyx_v_type, __pyx_v_value, __pyx_v_traceback, 0);
-    __PYX_ERR(0, 323, __pyx_L1_error)
+    __PYX_ERR(0, 326, __pyx_L1_error)
   }
 
-  /* "lxml/etree.pyx":315
+  /* "lxml/etree.pyx":318
  *         return self._exc_info is not None
  * 
  *     cdef int _raise_if_stored(self) except -1:             # <<<<<<<<<<<<<<
@@ -13484,7 +13604,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__fakeRootDoc(xmlDoc *__pyx_v_c_base_doc, xml
  * 
  * cdef xmlDoc* _plainFakeRootDoc(xmlDoc* c_base_doc, xmlNode* c_node,
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__plainFakeRootDoc(__pyx_v_c_base_doc, __pyx_v_c_node, 1); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(4, 52, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__plainFakeRootDoc(__pyx_v_c_base_doc, __pyx_v_c_node, 1); if (unlikely(__pyx_t_1 == ((xmlDoc *)NULL))) __PYX_ERR(4, 52, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -13604,7 +13724,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__plainFakeRootDoc(xmlDoc *__pyx_v_c_base_doc
  *     c_new_root = tree.xmlDocCopyNode(c_node, c_doc, 2) # non recursive!
  *     tree.xmlDocSetRootElement(c_doc, c_new_root)
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_base_doc, 0); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(4, 69, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_base_doc, 0); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(4, 69, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_3;
 
   /* "src/lxml/proxy.pxi":70
@@ -14889,7 +15009,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree__appendToNsCache(__pyx_t_4lxml_5et
  *     c_ns_cache.ns_map[c_ns_cache.last] = _ns_update_map(old=c_old_ns, new=c_new_ns)
  *     c_ns_cache.last += 1
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree__growNsCache(__pyx_v_c_ns_cache); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(4, 242, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__growNsCache(__pyx_v_c_ns_cache); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 242, __pyx_L1_error)
 
     /* "src/lxml/proxy.pxi":241
  * cdef inline int _appendToNsCache(_nscache* c_ns_cache,
@@ -15004,7 +15124,7 @@ static int __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(xmlNode *__
  *             c_nsdef = &c_nsdef[0].next
  *         else:
  */
-      __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, (__pyx_v_c_nsdef[0]), (__pyx_v_c_nsdef[0])); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(4, 263, __pyx_L1_error)
+      __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, (__pyx_v_c_nsdef[0]), (__pyx_v_c_nsdef[0])); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 263, __pyx_L1_error)
 
       /* "src/lxml/proxy.pxi":264
  *             # new namespace href => keep and cache the ns declaration
@@ -15033,7 +15153,7 @@ static int __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(xmlNode *__
  *             c_ns_next = c_nsdef[0].next
  */
     /*else*/ {
-      __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, (__pyx_v_c_nsdef[0]), __pyx_v_c_ns); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(4, 267, __pyx_L1_error)
+      __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, (__pyx_v_c_nsdef[0]), __pyx_v_c_ns); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 267, __pyx_L1_error)
 
       /* "src/lxml/proxy.pxi":269
  *             _appendToNsCache(c_ns_cache, c_nsdef[0], c_ns)
@@ -15433,7 +15553,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *             except:
  *                 _cleanUpFromNamespaceAdaptation(c_start_node, &c_ns_cache, c_del_ns_list)
  */
-          __pyx_t_6 = __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(__pyx_v_c_element, (&__pyx_v_c_ns_cache), (&__pyx_v_c_del_ns_list)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(4, 350, __pyx_L7_error)
+          __pyx_t_6 = __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(__pyx_v_c_element, (&__pyx_v_c_ns_cache), (&__pyx_v_c_del_ns_list)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 350, __pyx_L7_error)
 
           /* "src/lxml/proxy.pxi":349
  *         #    the ancestors
@@ -15448,7 +15568,6 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         goto __pyx_L12_try_end;
         __pyx_L7_error:;
-        __Pyx_PyThreadState_assign
 
         /* "src/lxml/proxy.pxi":351
  *             try:
@@ -15496,7 +15615,6 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *                 _stripRedundantNamespaceDeclarations(c_element, &c_ns_cache, &c_del_ns_list)
  *             except:
  */
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_3);
         __Pyx_XGIVEREF(__pyx_t_4);
         __Pyx_XGIVEREF(__pyx_t_5);
@@ -15712,7 +15830,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *                             c_start_node, c_node.ns.href, c_node.ns.prefix,
  *                             c_node.type == tree.XML_ATTRIBUTE_NODE)
  */
-              __pyx_t_13 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_start_node, __pyx_v_c_node->ns->href, __pyx_v_c_node->ns->prefix, (__pyx_v_c_node->type == XML_ATTRIBUTE_NODE)); if (unlikely(__pyx_t_13 == NULL)) __PYX_ERR(4, 376, __pyx_L27_error)
+              __pyx_t_13 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_start_node, __pyx_v_c_node->ns->href, __pyx_v_c_node->ns->prefix, (__pyx_v_c_node->type == XML_ATTRIBUTE_NODE)); if (unlikely(__pyx_t_13 == ((xmlNs *)NULL))) __PYX_ERR(4, 376, __pyx_L27_error)
               __pyx_v_c_ns = __pyx_t_13;
 
               /* "src/lxml/proxy.pxi":379
@@ -15731,7 +15849,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *                     except:
  *                         _cleanUpFromNamespaceAdaptation(c_start_node, &c_ns_cache, c_del_ns_list)
  */
-              __pyx_t_6 = __pyx_f_4lxml_5etree__appendToNsCache((&__pyx_v_c_ns_cache), __pyx_v_c_node->ns, __pyx_v_c_ns); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(4, 380, __pyx_L27_error)
+              __pyx_t_6 = __pyx_f_4lxml_5etree__appendToNsCache((&__pyx_v_c_ns_cache), __pyx_v_c_node->ns, __pyx_v_c_ns); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 380, __pyx_L27_error)
 
               /* "src/lxml/proxy.pxi":375
  *                     # not in cache or not acceptable
@@ -15746,7 +15864,6 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
             __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
             goto __pyx_L34_try_end;
             __pyx_L27_error:;
-            __Pyx_PyThreadState_assign
             __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
             __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
             __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
@@ -15797,7 +15914,6 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *                         c_ns = doc._findOrBuildNodeNs(
  *                             c_start_node, c_node.ns.href, c_node.ns.prefix,
  */
-            __Pyx_PyThreadState_assign
             __Pyx_XGIVEREF(__pyx_t_5);
             __Pyx_XGIVEREF(__pyx_t_4);
             __Pyx_XGIVEREF(__pyx_t_3);
@@ -17744,7 +17860,6 @@ static void __pyx_f_4lxml_5etree_displayNode(xmlNode *__pyx_v_c_node, PyObject *
         goto __pyx_L8_return;
       }
       __pyx_L8_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_10);
@@ -18141,7 +18256,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentOrRaise(PyObject *__py
  *     return doc
  * 
  */
-  __pyx_t_6 = __pyx_f_4lxml_5etree__assertValidDoc(__pyx_v_doc); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(5, 46, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__assertValidDoc(__pyx_v_doc); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 46, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":47
  *             python._fqtypename(input).decode('utf8')
@@ -18415,7 +18530,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOrRaise(PyObject *__pyx
  *     return node
  * 
  */
-  __pyx_t_7 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(5, 69, __pyx_L1_error)
+  __pyx_t_7 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 69, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":70
  *             python._fqtypename(input).decode('utf8')
@@ -18666,7 +18781,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         if c_doc is NULL:
  *             c_doc = _newHTMLDoc()
  */
-    __pyx_t_8 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(5, 101, __pyx_L1_error)
+    __pyx_t_8 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 101, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":102
  *     if parser is not None and parser._for_html:
@@ -18685,7 +18800,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *     else:
  *         _tagValidOrRaise(name_utf)
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree__newHTMLDoc(); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(5, 103, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree__newHTMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(5, 103, __pyx_L1_error)
       __pyx_v_c_doc = __pyx_t_3;
 
       /* "src/lxml/apihelpers.pxi":102
@@ -18715,7 +18830,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *             c_doc = _newXMLDoc()
  */
   /*else*/ {
-    __pyx_t_8 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(5, 105, __pyx_L1_error)
+    __pyx_t_8 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 105, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":106
  *     else:
@@ -18734,7 +18849,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *     c_node = _createElement(c_doc, name_utf)
  *     if c_node is NULL:
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(5, 107, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(5, 107, __pyx_L1_error)
       __pyx_v_c_doc = __pyx_t_3;
 
       /* "src/lxml/apihelpers.pxi":106
@@ -18755,7 +18870,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *     if c_node is NULL:
  *         if doc is None and c_doc is not NULL:
  */
-  __pyx_t_9 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(5, 108, __pyx_L1_error)
+  __pyx_t_9 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_9 == ((xmlNode *)NULL))) __PYX_ERR(5, 108, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_9;
 
   /* "src/lxml/apihelpers.pxi":109
@@ -18898,7 +19013,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         if tail is not None:
  *             _setTailText(c_node, tail)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(5, 118, __pyx_L13_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 118, __pyx_L13_error)
 
         /* "src/lxml/apihelpers.pxi":117
  *             tree.xmlDocSetRootElement(c_doc, c_node)
@@ -18927,7 +19042,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         # add namespaces to node if necessary
  *         _setNodeNamespaces(c_node, doc, ns_utf, nsmap)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_tail); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(5, 120, __pyx_L13_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_tail); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 120, __pyx_L13_error)
 
         /* "src/lxml/apihelpers.pxi":119
  *         if text is not None:
@@ -18945,7 +19060,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
  *         return _elementFactory(doc, c_node)
  */
-      __pyx_t_8 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, __pyx_v_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(5, 122, __pyx_L13_error)
+      __pyx_t_8 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, __pyx_v_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 122, __pyx_L13_error)
 
       /* "src/lxml/apihelpers.pxi":123
  *         # add namespaces to node if necessary
@@ -18981,7 +19096,6 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  */
     }
     __pyx_L13_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -19109,14 +19223,12 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         if doc is None:
  *             tree.xmlDocSetRootElement(c_doc, c_node)
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_XGIVEREF(__pyx_t_11);
     __Pyx_XGIVEREF(__pyx_t_12);
     __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
     goto __pyx_L1_error;
     __pyx_L17_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_XGIVEREF(__pyx_t_11);
     __Pyx_XGIVEREF(__pyx_t_12);
@@ -19188,7 +19300,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *         c_doc = _newHTMLDoc()
  *     else:
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(5, 148, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 148, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":149
  *     if is_html:
@@ -19197,7 +19309,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     else:
  *         _tagValidOrRaise(name_utf)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__newHTMLDoc(); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(5, 149, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__newHTMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(5, 149, __pyx_L1_error)
     __pyx_v_c_doc = __pyx_t_3;
 
     /* "src/lxml/apihelpers.pxi":147
@@ -19218,7 +19330,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     c_node = _createElement(c_doc, name_utf)
  */
   /*else*/ {
-    __pyx_t_2 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(5, 151, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 151, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":152
  *     else:
@@ -19227,7 +19339,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     c_node = _createElement(c_doc, name_utf)
  *     if c_node is NULL:
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(5, 152, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(5, 152, __pyx_L1_error)
     __pyx_v_c_doc = __pyx_t_3;
   }
   __pyx_L3:;
@@ -19239,7 +19351,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     if c_node is NULL:
  *         if c_doc is not NULL:
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(5, 153, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_4 == ((xmlNode *)NULL))) __PYX_ERR(5, 153, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_4;
 
   /* "src/lxml/apihelpers.pxi":154
@@ -19326,7 +19438,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     _initNodeAttributes(c_node, doc, attrib, extra_attrs)
  *     _registerProxy(element, doc, c_node)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, __pyx_v_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(5, 161, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, __pyx_v_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 161, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":162
  *     # add namespaces to node if necessary
@@ -19346,7 +19458,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     element._init()
  *     return 0
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__registerProxy(__pyx_v_element, __pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(5, 163, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__registerProxy(__pyx_v_element, __pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 163, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":164
  *     _initNodeAttributes(c_node, doc, attrib, extra_attrs)
@@ -19486,7 +19598,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *     ns_utf, name_utf = _getNsTag(tag)
  *     c_doc = parent._doc._c_doc
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_parent); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 176, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_parent); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 176, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":177
  *         return None
@@ -19565,7 +19677,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *     else:
  *         _tagValidOrRaise(name_utf)
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 181, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 181, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":180
  *     c_doc = parent._doc._c_doc
@@ -19585,7 +19697,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *     c_node = _createElement(c_doc, name_utf)
  */
   /*else*/ {
-    __pyx_t_4 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 183, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 183, __pyx_L1_error)
   }
   __pyx_L6:;
 
@@ -19596,7 +19708,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *     if c_node is NULL:
  *         raise MemoryError()
  */
-  __pyx_t_9 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(5, 185, __pyx_L1_error)
+  __pyx_t_9 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_9 == ((xmlNode *)NULL))) __PYX_ERR(5, 185, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_9;
 
   /* "src/lxml/apihelpers.pxi":186
@@ -19670,7 +19782,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *         if tail is not None:
  *             _setTailText(c_node, tail)
  */
-        __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 192, __pyx_L10_error)
+        __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 192, __pyx_L10_error)
 
         /* "src/lxml/apihelpers.pxi":191
  * 
@@ -19699,7 +19811,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  * 
  *         # add namespaces to node if necessary
  */
-        __pyx_t_4 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_tail); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 194, __pyx_L10_error)
+        __pyx_t_4 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_tail); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 194, __pyx_L10_error)
 
         /* "src/lxml/apihelpers.pxi":193
  *         if text is not None:
@@ -19719,7 +19831,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  */
       __pyx_t_5 = ((PyObject *)__pyx_v_parent->_doc);
       __Pyx_INCREF(__pyx_t_5);
-      __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, ((struct LxmlDocument *)__pyx_t_5), __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 197, __pyx_L10_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, ((struct LxmlDocument *)__pyx_t_5), __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 197, __pyx_L10_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
       /* "src/lxml/apihelpers.pxi":198
@@ -19762,7 +19874,6 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  */
     }
     __pyx_L10_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -19790,7 +19901,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  */
       __pyx_t_13 = ((PyObject *)__pyx_v_parent->_doc);
       __Pyx_INCREF(__pyx_t_13);
-      __pyx_t_4 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_13), __pyx_v_c_node); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 202, __pyx_L12_except_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_13), __pyx_v_c_node); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 202, __pyx_L12_except_error)
       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
       /* "src/lxml/apihelpers.pxi":203
@@ -19816,14 +19927,12 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *         if text is not None:
  *             _setNodeText(c_node, text)
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_XGIVEREF(__pyx_t_11);
     __Pyx_XGIVEREF(__pyx_t_12);
     __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
     goto __pyx_L1_error;
     __pyx_L14_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_XGIVEREF(__pyx_t_11);
     __Pyx_XGIVEREF(__pyx_t_12);
@@ -19939,7 +20048,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
         if (unlikely(!__pyx_t_2)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(5, 217, __pyx_L1_error)
           }
           break;
@@ -20020,7 +20129,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *             c_href = _xcstr(href_utf)
  *             if prefix is not None:
  */
-      __pyx_t_10 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_href_utf); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(5, 219, __pyx_L1_error)
+      __pyx_t_10 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_href_utf); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 219, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":220
  *             href_utf = _utf8(href)
@@ -20061,7 +20170,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *                 c_prefix = _xcstr(prefix_utf)
  *             else:
  */
-        __pyx_t_10 = __pyx_f_4lxml_5etree__prefixValidOrRaise(__pyx_v_prefix_utf); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(5, 223, __pyx_L1_error)
+        __pyx_t_10 = __pyx_f_4lxml_5etree__prefixValidOrRaise(__pyx_v_prefix_utf); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 223, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":224
  *                 prefix_utf = _utf8(prefix)
@@ -20244,7 +20353,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *         doc._setNodeNs(c_node, _xcstr(node_ns_utf))
  *     return 0
  */
-    __pyx_t_10 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_node_ns_utf); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(5, 238, __pyx_L1_error)
+    __pyx_t_10 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_node_ns_utf); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 238, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":239
  *     if node_ns_utf is not None:
@@ -20253,7 +20362,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *     return 0
  * 
  */
-    __pyx_t_10 = __pyx_f_4lxml_5etree_9_Document__setNodeNs(__pyx_v_doc, __pyx_v_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_node_ns_utf)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(5, 239, __pyx_L1_error)
+    __pyx_t_10 = __pyx_f_4lxml_5etree_9_Document__setNodeNs(__pyx_v_doc, __pyx_v_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_node_ns_utf)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 239, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":237
  *                 node_ns_utf = None
@@ -20338,7 +20447,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *         return nsmap.items()
  *     # nsmap will usually be a plain unordered dict => avoid type checking overhead
  */
-  __pyx_t_1 = PyObject_Length(__pyx_v_nsmap); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(5, 251, __pyx_L1_error)
+  __pyx_t_1 = PyObject_Length(__pyx_v_nsmap); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(5, 251, __pyx_L1_error)
   __pyx_t_2 = ((__pyx_t_1 <= 1) != 0);
   if (__pyx_t_2) {
 
@@ -20406,7 +20515,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
   }
   __pyx_t_3 = __pyx_v_4lxml_5etree_OrderedDict;
   __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_6 = PyObject_IsInstance(__pyx_v_nsmap, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(5, 254, __pyx_L1_error)
+  __pyx_t_6 = PyObject_IsInstance(__pyx_v_nsmap, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 254, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_7 = (__pyx_t_6 != 0);
   __pyx_t_2 = __pyx_t_7;
@@ -20498,7 +20607,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_3 = ((PyObject*)__pyx_t_5);
     __pyx_t_5 = 0;
-    __pyx_t_9 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 257, __pyx_L1_error)
+    __pyx_t_9 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 257, __pyx_L1_error)
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
@@ -20586,7 +20695,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(5, 266, __pyx_L1_error)
         }
         break;
@@ -20673,7 +20782,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *     nsdefs.append((None, default_ns))
  *     return nsdefs
  */
-  __pyx_t_9 = PyList_Sort(__pyx_v_nsdefs); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 267, __pyx_L1_error)
+  __pyx_t_9 = PyList_Sort(__pyx_v_nsdefs); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 267, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":268
  *     nsdefs = [(k, v) for k, v in nsmap.items() if k is not None]
@@ -20690,7 +20799,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
   __Pyx_INCREF(__pyx_v_default_ns);
   __Pyx_GIVEREF(__pyx_v_default_ns);
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_default_ns);
-  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_nsdefs, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 268, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_nsdefs, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 268, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
   /* "src/lxml/apihelpers.pxi":269
@@ -20798,7 +20907,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_attrib(PyObject *__pyx_v_attrib) {
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_3 = ((PyObject*)__pyx_t_5);
     __pyx_t_5 = 0;
-    __pyx_t_7 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(5, 279, __pyx_L1_error)
+    __pyx_t_7 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 279, __pyx_L1_error)
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
@@ -20843,7 +20952,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_attrib(PyObject *__pyx_v_attrib) {
   }
   __pyx_t_3 = __pyx_v_4lxml_5etree_OrderedDict;
   __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_1 = PyObject_IsInstance(__pyx_v_attrib, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(5, 281, __pyx_L1_error)
+  __pyx_t_1 = PyObject_IsInstance(__pyx_v_attrib, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 281, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_8 = (__pyx_t_1 != 0);
   __pyx_t_2 = __pyx_t_8;
@@ -20933,7 +21042,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_attrib(PyObject *__pyx_v_attrib) {
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_3 = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
-    __pyx_t_7 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(5, 285, __pyx_L1_error)
+    __pyx_t_7 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 285, __pyx_L1_error)
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
@@ -21006,7 +21115,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
     __pyx_t_1 = __pyx_t_3;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_attrib, __pyx_n_u_items); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(5, 293, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_attrib, __pyx_n_u_items); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 293, __pyx_L1_error)
   __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
   __pyx_t_1 = __pyx_t_2;
   __pyx_L4_bool_binop_done:;
@@ -21126,7 +21235,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  *     if attrib:
  */
     if (unlikely(__pyx_v_extra == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
       __PYX_ERR(5, 301, __pyx_L1_error)
     }
     __pyx_t_5 = __Pyx_PyDict_Items(__pyx_v_extra); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 301, __pyx_L1_error)
@@ -21136,7 +21245,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_6 = ((PyObject*)__pyx_t_7);
     __pyx_t_7 = 0;
-    __pyx_t_8 = PyList_Sort(__pyx_t_6); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(5, 301, __pyx_L1_error)
+    __pyx_t_8 = PyList_Sort(__pyx_t_6); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 301, __pyx_L1_error)
     if (unlikely(__pyx_t_6 == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
       __PYX_ERR(5, 301, __pyx_L1_error)
@@ -21213,7 +21322,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  *     if attrib:
  *         for name, value in _iter_attrib(attrib):
  */
-      __pyx_t_13 = __pyx_f_4lxml_5etree__addAttributeToNode(__pyx_v_c_node, __pyx_v_doc, __pyx_v_is_html, __pyx_v_name, __pyx_v_value, __pyx_v_seen); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(5, 302, __pyx_L1_error)
+      __pyx_t_13 = __pyx_f_4lxml_5etree__addAttributeToNode(__pyx_v_c_node, __pyx_v_doc, __pyx_v_is_html, __pyx_v_name, __pyx_v_value, __pyx_v_seen); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(5, 302, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":301
  *     seen = set()
@@ -21286,7 +21395,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
         if (unlikely(!__pyx_t_7)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(5, 304, __pyx_L1_error)
           }
           break;
@@ -21355,7 +21464,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  * 
  * 
  */
-      __pyx_t_13 = __pyx_f_4lxml_5etree__addAttributeToNode(__pyx_v_c_node, __pyx_v_doc, __pyx_v_is_html, __pyx_v_name, __pyx_v_value, __pyx_v_seen); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(5, 305, __pyx_L1_error)
+      __pyx_t_13 = __pyx_f_4lxml_5etree__addAttributeToNode(__pyx_v_c_node, __pyx_v_doc, __pyx_v_is_html, __pyx_v_name, __pyx_v_value, __pyx_v_seen); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(5, 305, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":304
  *             _addAttributeToNode(c_node, doc, is_html, name, value, seen)
@@ -21511,10 +21620,10 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  *         _attributeValidOrRaise(name_utf)
  */
   if (unlikely(__pyx_v_seen_tags == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
     __PYX_ERR(5, 313, __pyx_L1_error)
   }
-  __pyx_t_6 = PySet_Add(__pyx_v_seen_tags, __pyx_v_tag); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(5, 313, __pyx_L1_error)
+  __pyx_t_6 = PySet_Add(__pyx_v_seen_tags, __pyx_v_tag); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 313, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":314
  *         return 0
@@ -21533,7 +21642,7 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  *     value_utf = _utf8(value)
  *     if ns_utf is None:
  */
-    __pyx_t_7 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(5, 315, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 315, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":314
  *         return 0
@@ -21594,7 +21703,7 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  *         tree.xmlNewNsProp(c_node, c_ns,
  */
   /*else*/ {
-    __pyx_t_7 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_ns_utf); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(5, 320, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_ns_utf); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 320, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":321
  *     else:
@@ -21603,7 +21712,7 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  *         tree.xmlNewNsProp(c_node, c_ns,
  *                           _xcstr(name_utf), _xcstr(value_utf))
  */
-    __pyx_t_8 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns_utf), NULL, 1); if (unlikely(__pyx_t_8 == NULL)) __PYX_ERR(5, 321, __pyx_L1_error)
+    __pyx_t_8 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns_utf), NULL, 1); if (unlikely(__pyx_t_8 == ((xmlNs *)NULL))) __PYX_ERR(5, 321, __pyx_L1_error)
     __pyx_v_c_ns = __pyx_t_8;
 
     /* "src/lxml/apihelpers.pxi":322
@@ -22020,7 +22129,7 @@ static int __pyx_f_4lxml_5etree__removeUnusedNamespaceDeclarations(xmlNode *__py
  * 
  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_element, c_element, 1)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__collectNsDefs(__pyx_v_c_element->parent, (&__pyx_v_c_ns_list), (&__pyx_v_c_ns_list_len), (&__pyx_v_c_ns_list_size)); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(5, 378, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__collectNsDefs(__pyx_v_c_element->parent, (&__pyx_v_c_ns_list), (&__pyx_v_c_ns_list_len), (&__pyx_v_c_ns_list_size)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 378, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":376
  *     cdef size_t i
@@ -22057,7 +22166,7 @@ static int __pyx_f_4lxml_5etree__removeUnusedNamespaceDeclarations(xmlNode *__py
  * 
  *     # remove all namespace declarations from the list that are referenced
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__collectNsDefs(__pyx_v_c_element, (&__pyx_v_c_ns_list), (&__pyx_v_c_ns_list_len), (&__pyx_v_c_ns_list_size)); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(5, 383, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__collectNsDefs(__pyx_v_c_element, (&__pyx_v_c_ns_list), (&__pyx_v_c_ns_list_len), (&__pyx_v_c_ns_list_size)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 383, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":382
  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_element, c_element, 1)
@@ -23242,7 +23351,7 @@ static int __pyx_f_4lxml_5etree__replaceNodeByChildren(struct LxmlDocument *__py
  *             c_child = c_child.next
  * 
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_doc->_c_doc, __pyx_v_c_child); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(5, 505, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_doc->_c_doc, __pyx_v_c_child); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 505, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":506
  *         while c_child is not NULL:
@@ -23514,7 +23623,6 @@ static PyObject *__pyx_f_4lxml_5etree__attributeValue(xmlNode *__pyx_v_c_element
       {
         xmlFree(__pyx_v_value);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
@@ -23682,7 +23790,6 @@ static PyObject *__pyx_f_4lxml_5etree__attributeValueFromNsName(xmlNode *__pyx_v
       {
         xmlFree(__pyx_v_c_result);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_10);
@@ -23914,7 +24021,6 @@ static PyObject *__pyx_f_4lxml_5etree__getNodeAttributeValue(xmlNode *__pyx_v_c_
       {
         xmlFree(__pyx_v_c_result);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_13);
@@ -24111,7 +24217,7 @@ static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_e
  *     c_tag = _xcstr(tag)
  *     if value is None and is_html:
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_tag); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(5, 567, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_tag); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 567, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":566
  *     ns, tag = _getNsTag(key)
@@ -24267,7 +24373,7 @@ static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_e
  *     return 0
  */
   /*else*/ {
-    __pyx_t_8 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_element->_doc, __pyx_v_element->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns), NULL, 1); if (unlikely(__pyx_t_8 == NULL)) __PYX_ERR(5, 580, __pyx_L1_error)
+    __pyx_t_8 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_element->_doc, __pyx_v_element->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns), NULL, 1); if (unlikely(__pyx_t_8 == ((xmlNs *)NULL))) __PYX_ERR(5, 580, __pyx_L1_error)
     __pyx_v_c_ns = __pyx_t_8;
   }
   __pyx_L8:;
@@ -25421,7 +25527,11 @@ static PyObject *__pyx_f_4lxml_5etree__collectText(xmlNode *__pyx_v_c_node) {
  * cdef void _removeText(xmlNode* c_node):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = __Pyx_PyObject_AsWritableUString(__pyx_v_result); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(5, 682, __pyx_L1_error)
+  if (unlikely(__pyx_v_result == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+    __PYX_ERR(5, 682, __pyx_L1_error)
+  }
+  __pyx_t_6 = __Pyx_PyBytes_AsWritableUString(__pyx_v_result); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(5, 682, __pyx_L1_error)
   __pyx_t_5 = __pyx_f_4lxml_5etree_funicode(((const xmlChar *)((unsigned char *)__pyx_t_6))); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 682, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_r = __pyx_t_5;
@@ -25748,7 +25858,7 @@ static int __pyx_f_4lxml_5etree__setNodeText(xmlNode *__pyx_v_c_node, PyObject *
  *     if c_node.children is NULL:
  *         tree.xmlAddChild(c_node, c_text_node)
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__createTextNode(__pyx_v_c_node->doc, __pyx_v_value); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(5, 716, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__createTextNode(__pyx_v_c_node->doc, __pyx_v_value); if (unlikely(__pyx_t_3 == ((xmlNode *)NULL))) __PYX_ERR(5, 716, __pyx_L1_error)
   __pyx_v_c_text_node = __pyx_t_3;
 
   /* "src/lxml/apihelpers.pxi":717
@@ -25882,7 +25992,7 @@ static int __pyx_f_4lxml_5etree__setTailText(xmlNode *__pyx_v_c_node, PyObject *
  *     tree.xmlAddNextSibling(c_node, c_text_node)
  *     return 0
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__createTextNode(__pyx_v_c_node->doc, __pyx_v_value); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(5, 729, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__createTextNode(__pyx_v_c_node->doc, __pyx_v_value); if (unlikely(__pyx_t_3 == ((xmlNode *)NULL))) __PYX_ERR(5, 729, __pyx_L1_error)
   __pyx_v_c_text_node = __pyx_t_3;
 
   /* "src/lxml/apihelpers.pxi":730
@@ -26033,7 +26143,7 @@ static PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *__py
  *         return python.PyBytes_FromFormat('%s:%s', c_ns.prefix, _cstr(tag))
  * 
  */
-    __pyx_t_6 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_element->_doc, __pyx_v_element->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns), NULL, 0); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(5, 739, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_element->_doc, __pyx_v_element->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns), NULL, 0); if (unlikely(__pyx_t_6 == ((xmlNs *)NULL))) __PYX_ERR(5, 739, __pyx_L1_error)
     __pyx_v_c_ns = __pyx_t_6;
 
     /* "src/lxml/apihelpers.pxi":741
@@ -26328,7 +26438,7 @@ static int __pyx_f_4lxml_5etree__findChildSlice(PyObject *__pyx_v_sliceobject, x
     /*else*/ {
       __pyx_t_3 = ((PySliceObject*)__pyx_v_sliceobject)->step;
       __Pyx_INCREF(__pyx_t_3);
-      __pyx_t_4 = _PyEval_SliceIndex(__pyx_t_3, __pyx_v_c_step); if (unlikely(__pyx_t_4 == 0)) __PYX_ERR(5, 772, __pyx_L1_error)
+      __pyx_t_4 = _PyEval_SliceIndex(__pyx_t_3, __pyx_v_c_step); if (unlikely(__pyx_t_4 == ((int)0))) __PYX_ERR(5, 772, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     }
     __pyx_L4:;
@@ -26359,7 +26469,7 @@ static int __pyx_f_4lxml_5etree__findChildSlice(PyObject *__pyx_v_sliceobject, x
  *         sliceobject, childcount, &start, &stop, c_step, c_length)
  *     if start > childcount / 2:
  */
-  __pyx_t_4 = _lx_PySlice_GetIndicesEx(__pyx_v_sliceobject, __pyx_v_childcount, (&__pyx_v_start), (&__pyx_v_stop), __pyx_v_c_step, __pyx_v_c_length); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(5, 774, __pyx_L1_error)
+  __pyx_t_4 = _lx_PySlice_GetIndicesEx(__pyx_v_sliceobject, __pyx_v_childcount, (&__pyx_v_start), (&__pyx_v_stop), __pyx_v_c_step, __pyx_v_c_length); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 774, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":776
  *     python.PySlice_GetIndicesEx(
@@ -26563,7 +26673,7 @@ static int __pyx_f_4lxml_5etree__isFullSlice(PyObject *__pyx_v_sliceobject) {
  */
     __pyx_t_4 = ((PySliceObject*)__pyx_v_sliceobject)->step;
     __Pyx_INCREF(__pyx_t_4);
-    __pyx_t_5 = _PyEval_SliceIndex(__pyx_t_4, (&__pyx_v_step)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(5, 792, __pyx_L1_error)
+    __pyx_t_5 = _PyEval_SliceIndex(__pyx_t_4, (&__pyx_v_step)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(5, 792, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "src/lxml/apihelpers.pxi":793
@@ -26745,7 +26855,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectChildren(struct LxmlElement *__pyx
       __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_1), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 806, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(5, 806, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 806, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
       /* "src/lxml/apihelpers.pxi":807
@@ -28405,7 +28515,7 @@ static Py_ssize_t __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(xmlDoc *__pyx_v
         PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
         __PYX_ERR(5, 1007, __pyx_L1_error)
       }
-      __pyx_t_10 = PyBytes_GET_SIZE(__pyx_v_tag); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(5, 1007, __pyx_L1_error)
+      __pyx_t_10 = PyBytes_GET_SIZE(__pyx_v_tag); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1007, __pyx_L1_error)
       __pyx_v_c_tag = xmlDictLookup(__pyx_v_c_doc->dict, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_tag), __pyx_t_10);
 
       /* "src/lxml/apihelpers.pxi":1008
@@ -28479,7 +28589,7 @@ static Py_ssize_t __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(xmlDoc *__pyx_v
         PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
         __PYX_ERR(5, 1014, __pyx_L1_error)
       }
-      __pyx_t_10 = PyBytes_GET_SIZE(__pyx_v_tag); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(5, 1014, __pyx_L1_error)
+      __pyx_t_10 = PyBytes_GET_SIZE(__pyx_v_tag); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1014, __pyx_L1_error)
       __pyx_v_c_tag = xmlDictExists(__pyx_v_c_doc->dict, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_tag), __pyx_t_10);
 
       /* "src/lxml/apihelpers.pxi":1015
@@ -28688,7 +28798,7 @@ static int __pyx_f_4lxml_5etree__removeNode(struct LxmlDocument *__pyx_v_doc, xm
  *     return 0
  * 
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(5, 1037, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1037, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1035
  *     tree.xmlUnlinkNode(c_node)
@@ -29328,7 +29438,7 @@ static int __pyx_f_4lxml_5etree__copyNonElementSiblings(xmlNode *__pyx_v_c_node,
  *             if c_sibling == <xmlNode*>c_node.doc.intSubset:
  *                 c_target.doc.intSubset = <tree.xmlDtd*>c_copy
  */
-      __pyx_t_4 = __pyx_f_4lxml_5etree__copyDtd(((xmlDtd *)__pyx_v_c_sibling)); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(5, 1099, __pyx_L1_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__copyDtd(((xmlDtd *)__pyx_v_c_sibling)); if (unlikely(__pyx_t_4 == ((xmlDtd *)NULL))) __PYX_ERR(5, 1099, __pyx_L1_error)
       __pyx_v_c_copy = ((xmlNode *)__pyx_t_4);
 
       /* "src/lxml/apihelpers.pxi":1100
@@ -29735,7 +29845,7 @@ static int __pyx_f_4lxml_5etree__deleteSlice(struct LxmlDocument *__pyx_v_doc, x
  *         c += 1
  *         c_node = c_next
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(5, 1140, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 1140, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1141
  *             c_next = next_element(c_next)
@@ -29934,7 +30044,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *         if seqlength != slicelength:
  *             raise ValueError, u"attempt to assign sequence of size %d " \
  */
-    __pyx_t_5 = PyObject_Length(__pyx_v_elements); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(5, 1171, __pyx_L1_error)
+    __pyx_t_5 = PyObject_Length(__pyx_v_elements); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1171, __pyx_L1_error)
     __pyx_v_seqlength = __pyx_t_5;
 
     /* "src/lxml/apihelpers.pxi":1172
@@ -30050,7 +30160,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
           if (unlikely(!__pyx_t_7)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(5, 1179, __pyx_L1_error)
             }
             break;
@@ -30085,7 +30195,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *         else:
  *             for element in elements:
  */
-        __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 1181, __pyx_L1_error)
+        __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1181, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":1179
  *         # no children yet => add all elements straight away
@@ -30147,7 +30257,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
           if (unlikely(!__pyx_t_7)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(5, 1183, __pyx_L1_error)
             }
             break;
@@ -30182,7 +30292,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *         return 0
  * 
  */
-        __pyx_t_9 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 1185, __pyx_L1_error)
+        __pyx_t_9 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1185, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":1183
  *                 _appendChild(parent, element)
@@ -30323,7 +30433,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  */
     __pyx_t_6 = ((PyObject *)__pyx_v_parent->_doc);
     __Pyx_INCREF(__pyx_t_6);
-    __pyx_t_9 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_6), __pyx_v_c_node); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 1205, __pyx_L1_error)
+    __pyx_t_9 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_6), __pyx_v_c_node); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1205, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
     /* "src/lxml/apihelpers.pxi":1206
@@ -30467,7 +30577,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
         if (unlikely(!__pyx_t_7)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(5, 1222, __pyx_L1_error)
           }
           break;
@@ -30502,7 +30612,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *             c_node = element._c_node
  *             if slicelength > 0:
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 1224, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1224, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1225
  *             assert element is not None, u"Node must not be None"
@@ -30670,7 +30780,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
         if (unlikely(!__pyx_t_7)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(5, 1239, __pyx_L1_error)
           }
           break;
@@ -30705,7 +30815,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *             # move element and tail over
  *             c_source_doc = element._c_node.doc
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 1241, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1241, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1243
  *             _assertValidNode(element)
@@ -30754,7 +30864,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  */
       __pyx_t_7 = ((PyObject *)__pyx_v_parent->_doc);
       __Pyx_INCREF(__pyx_t_7);
-      __pyx_t_9 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_7), __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 1249, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_7), __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1249, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
       /* "src/lxml/apihelpers.pxi":1252
@@ -30924,7 +31034,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
         if (unlikely(!__pyx_t_7)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(5, 1264, __pyx_L1_error)
           }
           break;
@@ -30959,7 +31069,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *             _appendChild(parent, element)
  *     else:
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 1266, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1266, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1267
  *             assert element is not None, u"Node must not be None"
@@ -30968,7 +31078,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *     else:
  *         for element in elements:
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 1267, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1267, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1264
  *     # append the remaining elements at the respective end
@@ -31030,7 +31140,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
         if (unlikely(!__pyx_t_7)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(5, 1269, __pyx_L1_error)
           }
           break;
@@ -31065,7 +31175,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *             _prependChild(parent, element)
  * 
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 1271, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1271, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1272
  *             assert element is not None, u"Node must not be None"
@@ -31074,7 +31184,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  * 
  *     return 0
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(5, 1272, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1272, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1269
  *             _appendChild(parent, element)
@@ -31239,7 +31349,7 @@ static int __pyx_f_4lxml_5etree__appendChild(struct LxmlElement *__pyx_v_parent,
  */
   __pyx_t_4 = ((PyObject *)__pyx_v_parent->_doc);
   __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(5, 1292, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 1292, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
   /* "src/lxml/apihelpers.pxi":1293
@@ -31431,7 +31541,7 @@ static int __pyx_f_4lxml_5etree__prependChild(struct LxmlElement *__pyx_v_parent
  */
   __pyx_t_4 = ((PyObject *)__pyx_v_parent->_doc);
   __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(5, 1315, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 1315, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
   /* "src/lxml/apihelpers.pxi":1316
@@ -31483,7 +31593,7 @@ static int __pyx_f_4lxml_5etree__appendSibling(struct LxmlElement *__pyx_v_eleme
  * 
  * cdef int _prependSibling(_Element element, _Element sibling) except -1:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__addSibling(__pyx_v_element, __pyx_v_sibling, 1); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(5, 1321, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__addSibling(__pyx_v_element, __pyx_v_sibling, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1321, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -31525,7 +31635,7 @@ static int __pyx_f_4lxml_5etree__prependSibling(struct LxmlElement *__pyx_v_elem
  * 
  * cdef int _addSibling(_Element element, _Element sibling, bint as_next) except -1:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__addSibling(__pyx_v_element, __pyx_v_sibling, 0); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(5, 1326, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__addSibling(__pyx_v_element, __pyx_v_sibling, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1326, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -31717,7 +31827,7 @@ static int __pyx_f_4lxml_5etree__addSibling(struct LxmlElement *__pyx_v_element,
  */
   __pyx_t_4 = ((PyObject *)__pyx_v_element->_doc);
   __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(5, 1346, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 1346, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
   /* "src/lxml/apihelpers.pxi":1347
@@ -31993,7 +32103,7 @@ static int __pyx_f_4lxml_5etree__is_valid_xml_utf8(PyObject *__pyx_v_pystring) {
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(5, 1371, __pyx_L1_error)
   }
-  __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_pystring); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(5, 1371, __pyx_L1_error)
+  __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_pystring); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1371, __pyx_L1_error)
   __pyx_v_c_end = (__pyx_v_s + __pyx_t_1);
 
   /* "src/lxml/apihelpers.pxi":1372
@@ -32696,7 +32806,7 @@ static PyObject *__pyx_f_4lxml_5etree__utf8(PyObject *__pyx_v_s) {
  *     elif isinstance(s, (bytes, bytearray)):
  */
     if (unlikely(__pyx_v_s == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
       __PYX_ERR(5, 1436, __pyx_L1_error)
     }
     __pyx_t_4 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_s)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1436, __pyx_L1_error)
@@ -33337,7 +33447,7 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *__pyx_v_filename
  *             try:
  */
     if (unlikely(__pyx_v_filename == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
       __PYX_ERR(5, 1490, __pyx_L1_error)
     }
     __pyx_t_3 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_filename)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1490, __pyx_L1_error)
@@ -33403,7 +33513,6 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *__pyx_v_filename
  */
         }
         __pyx_L5_error:;
-        __Pyx_PyThreadState_assign
         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
         /* "src/lxml/apihelpers.pxi":1495
@@ -33428,21 +33537,18 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *__pyx_v_filename
  *                 return python.PyUnicode_AsEncodedString(
  *                     filename, _C_FILENAME_ENCODING, NULL)
  */
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_5);
         __Pyx_XGIVEREF(__pyx_t_6);
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
         goto __pyx_L1_error;
         __pyx_L9_try_return:;
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_5);
         __Pyx_XGIVEREF(__pyx_t_6);
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
         goto __pyx_L0;
         __pyx_L6_exception_handled:;
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_5);
         __Pyx_XGIVEREF(__pyx_t_6);
         __Pyx_XGIVEREF(__pyx_t_7);
@@ -33640,7 +33746,6 @@ static PyObject *__pyx_f_4lxml_5etree__decodeFilenameWithLength(const xmlChar *_
  */
       }
       __pyx_L4_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
       /* "src/lxml/apihelpers.pxi":1513
@@ -33665,21 +33770,18 @@ static PyObject *__pyx_f_4lxml_5etree__decodeFilenameWithLength(const xmlChar *_
  *             return python.PyUnicode_Decode(
  *                 <const_char*>c_path, c_len, _C_FILENAME_ENCODING, NULL)
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
       goto __pyx_L1_error;
       __pyx_L8_try_return:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
       goto __pyx_L0;
       __pyx_L5_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
@@ -33734,7 +33836,6 @@ static PyObject *__pyx_f_4lxml_5etree__decodeFilenameWithLength(const xmlChar *_
  */
     }
     __pyx_L10_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "src/lxml/apihelpers.pxi":1517
@@ -33779,21 +33880,18 @@ static PyObject *__pyx_f_4lxml_5etree__decodeFilenameWithLength(const xmlChar *_
  *         return (<unsigned char*>c_path)[:c_len].decode('UTF-8')
  *     except UnicodeDecodeError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
     goto __pyx_L1_error;
     __pyx_L14_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
     goto __pyx_L0;
     __pyx_L13_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
@@ -33906,7 +34004,11 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  *             # plain ASCII!
  *             return filename
  */
-    __pyx_t_3 = __Pyx_PyObject_AsUString(__pyx_v_filename); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(5, 1529, __pyx_L1_error)
+    if (unlikely(__pyx_v_filename == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+      __PYX_ERR(5, 1529, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_PyBytes_AsUString(__pyx_v_filename); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(5, 1529, __pyx_L1_error)
     __pyx_t_1 = ((!(__pyx_f_4lxml_5etree_isutf8(__pyx_t_3) != 0)) != 0);
     if (__pyx_t_1) {
 
@@ -33967,7 +34069,7 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
           PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
           __PYX_ERR(5, 1536, __pyx_L5_error)
         }
-        __pyx_t_7 = PyBytes_GET_SIZE(((PyObject*)__pyx_v_filename)); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(5, 1536, __pyx_L5_error)
+        __pyx_t_7 = PyBytes_GET_SIZE(((PyObject*)__pyx_v_filename)); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1536, __pyx_L5_error)
 
         /* "src/lxml/apihelpers.pxi":1535
  *         try:
@@ -33994,7 +34096,6 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L10_try_end;
       __pyx_L5_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
 
       /* "src/lxml/apihelpers.pxi":1538
@@ -34038,7 +34139,7 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  *             except UnicodeDecodeError:
  */
             if (unlikely(__pyx_v_filename == Py_None)) {
-              PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+              PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
               __PYX_ERR(5, 1541, __pyx_L13_error)
             }
             __pyx_t_15 = __Pyx_decode_bytes(((PyObject*)__pyx_v_filename), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 1541, __pyx_L13_error)
@@ -34069,7 +34170,6 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  */
           }
           __pyx_L13_error:;
-          __Pyx_PyThreadState_assign
           __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
 
           /* "src/lxml/apihelpers.pxi":1543
@@ -34107,14 +34207,12 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  *                 # try if it's proper UTF-8
  *                 (<bytes>filename).decode('utf8')
  */
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_12);
           __Pyx_XGIVEREF(__pyx_t_13);
           __Pyx_XGIVEREF(__pyx_t_14);
           __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
           goto __pyx_L7_except_error;
           __pyx_L17_try_return:;
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_12);
           __Pyx_XGIVEREF(__pyx_t_13);
           __Pyx_XGIVEREF(__pyx_t_14);
@@ -34132,14 +34230,12 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  *             # try to decode with default encoding
  *             filename = python.PyUnicode_Decode(
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L1_error;
       __pyx_L8_except_return:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -34177,7 +34273,7 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  */
     __Pyx_XDECREF(__pyx_r);
     if (unlikely(__pyx_v_filename == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
       __PYX_ERR(5, 1546, __pyx_L1_error)
     }
     __pyx_t_11 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_filename)); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 1546, __pyx_L1_error)
@@ -35242,7 +35338,7 @@ static int __pyx_f_4lxml_5etree__tagValidOrRaise(PyObject *__pyx_v_tag_utf) {
  * 
  */
     if (unlikely(__pyx_v_tag_utf == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
       __PYX_ERR(5, 1632, __pyx_L1_error)
     }
     __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1632, __pyx_L1_error)
@@ -35342,7 +35438,7 @@ static int __pyx_f_4lxml_5etree__htmlTagValidOrRaise(PyObject *__pyx_v_tag_utf)
  * 
  */
     if (unlikely(__pyx_v_tag_utf == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
       __PYX_ERR(5, 1638, __pyx_L1_error)
     }
     __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1638, __pyx_L1_error)
@@ -35442,7 +35538,7 @@ static int __pyx_f_4lxml_5etree__attributeValidOrRaise(PyObject *__pyx_v_name_ut
  * 
  */
     if (unlikely(__pyx_v_name_utf == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
       __PYX_ERR(5, 1644, __pyx_L1_error)
     }
     __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_name_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1644, __pyx_L1_error)
@@ -35542,7 +35638,7 @@ static int __pyx_f_4lxml_5etree__prefixValidOrRaise(PyObject *__pyx_v_tag_utf) {
  * 
  */
     if (unlikely(__pyx_v_tag_utf == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
       __PYX_ERR(5, 1650, __pyx_L1_error)
     }
     __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1650, __pyx_L1_error)
@@ -35652,7 +35748,7 @@ static int __pyx_f_4lxml_5etree__uriValidOrRaise(PyObject *__pyx_v_uri_utf) {
  *     return 0
  */
     if (unlikely(__pyx_v_uri_utf == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
       __PYX_ERR(5, 1657, __pyx_L1_error)
     }
     __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_uri_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1657, __pyx_L1_error)
@@ -35923,7 +36019,7 @@ static PyObject *__pyx_f_4lxml_5etree__namespacedNameFromNsName(const xmlChar *_
  */
       __Pyx_XDECREF(__pyx_r);
       if (unlikely(__pyx_v_s == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
         __PYX_ERR(5, 1672, __pyx_L1_error)
       }
       __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_s), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1672, __pyx_L1_error)
@@ -36055,7 +36151,6 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
  */
     }
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -36080,14 +36175,12 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
  *         return source.geturl()
  *     except:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L0;
     __pyx_L4_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -36210,7 +36303,6 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     goto __pyx_L14_try_end;
     __pyx_L9_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -36236,14 +36328,12 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
  *         filename = source.name
  *         if _isString(filename):
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
     goto __pyx_L0;
     __pyx_L10_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_1);
@@ -36367,7 +36457,6 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L21_try_end;
     __pyx_L16_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -36393,14 +36482,12 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
  *         filename = source.filename
  *         if _isString(filename):
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L0;
     __pyx_L17_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -37899,7 +37986,6 @@ static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_7message___get__(struct __pyx_
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L13_try_end;
     __pyx_L8_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
     /* "src/lxml/xmlerror.pxi":150
@@ -37962,7 +38048,6 @@ static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_7message___get__(struct __pyx_
         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
         goto __pyx_L23_try_end;
         __pyx_L16_error:;
-        __Pyx_PyThreadState_assign
         __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
 
         /* "src/lxml/xmlerror.pxi":154
@@ -38007,14 +38092,12 @@ static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_7message___get__(struct __pyx_
  *                     self._message = self._c_message[:size].decode(
  *                         'ascii', 'backslashreplace')
  */
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
         goto __pyx_L10_except_error;
         __pyx_L17_exception_handled:;
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
         __Pyx_XGIVEREF(__pyx_t_12);
@@ -38036,14 +38119,12 @@ static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_7message___get__(struct __pyx_
  *                 self._message = self._c_message[:size].decode('utf8')
  *             except UnicodeDecodeError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
     goto __pyx_L1_error;
     __pyx_L9_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
@@ -40825,7 +40906,7 @@ static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_6__repr__(struct __pyx_ob
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(1, 299, __pyx_L1_error)
         }
         break;
@@ -41013,7 +41094,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_13_ListErrorLog_10__len__(struct __pyx_o
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(1, 307, __pyx_L1_error)
   }
-  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 307, __pyx_L1_error)
+  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 307, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = (__pyx_t_2 - __pyx_v_self->_offset);
   goto __pyx_L0;
@@ -41238,7 +41319,7 @@ static int __pyx_pf_4lxml_5etree_13_ListErrorLog_14__nonzero__(struct __pyx_obj_
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(1, 319, __pyx_L1_error)
   }
-  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 319, __pyx_L1_error)
+  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 319, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = (__pyx_t_2 > __pyx_v_self->_offset);
   goto __pyx_L0;
@@ -41386,7 +41467,7 @@ static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_16filter_domains(struct _
       if (unlikely(!__pyx_t_8)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(1, 328, __pyx_L1_error)
         }
         break;
@@ -41584,7 +41665,7 @@ static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_18filter_types(struct __p
       if (unlikely(!__pyx_t_8)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(1, 340, __pyx_L1_error)
         }
         break;
@@ -41782,7 +41863,7 @@ static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_20filter_levels(struct __
       if (unlikely(!__pyx_t_8)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(1, 352, __pyx_L1_error)
         }
         break;
@@ -41933,7 +42014,7 @@ static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_22filter_from_level(struc
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(1, 361, __pyx_L1_error)
         }
         break;
@@ -42581,7 +42662,7 @@ static int __pyx_f_4lxml_5etree_9_ErrorLog___enter__(struct __pyx_obj_4lxml_5etr
  * 
  *     def __exit__(self, *args):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_ErrorLog_connect(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 406, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_ErrorLog_connect(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 406, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -42642,7 +42723,7 @@ static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_4__exit__(struct __pyx_obj_4lx
  * 
  *     @cython.final
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_ErrorLog_disconnect(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 410, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_ErrorLog_disconnect(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 410, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":408
  *         return self.connect()
@@ -42745,10 +42826,10 @@ static int __pyx_f_4lxml_5etree_9_ErrorLog_connect(struct __pyx_obj_4lxml_5etree
  *             <void*>self, <xmlerror.xmlStructuredErrorFunc>_receiveError)
  */
   if (unlikely(__pyx_v_self->_logContexts == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(1, 420, __pyx_L1_error)
   }
-  __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_self->_logContexts, ((PyObject *)__pyx_v_context)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 420, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_self->_logContexts, ((PyObject *)__pyx_v_context)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 420, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":421
  *         context.old_error_context = xmlerror.xmlStructuredErrorContext
@@ -42811,7 +42892,7 @@ static int __pyx_f_4lxml_5etree_9_ErrorLog_disconnect(struct __pyx_obj_4lxml_5et
  *             context.old_error_context, context.old_error_func)
  */
   if (unlikely(__pyx_v_self->_logContexts == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "pop");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
     __PYX_ERR(1, 427, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_self->_logContexts); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
@@ -43379,10 +43460,10 @@ static PyObject *__pyx_f_4lxml_5etree_9_ErrorLog_receive(struct __pyx_obj_4lxml_
  * cdef class _DomainErrorLog(_ErrorLog):
  */
   if (unlikely(__pyx_v_self->__pyx_base._entries == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(1, 451, __pyx_L1_error)
   }
-  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_self->__pyx_base._entries, ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 451, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_self->__pyx_base._entries, ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":448
  *         return iter(self._entries[self._offset:])
@@ -43579,7 +43660,7 @@ static int __pyx_pf_4lxml_5etree_15_DomainErrorLog___init__(struct __pyx_obj_4lx
  * 
  *     cpdef receive(self, _LogEntry entry):
  */
-  __pyx_t_1 = PySequence_Tuple(__pyx_v_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 456, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 456, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_accepted_domains, __pyx_t_1) < 0) __PYX_ERR(1, 456, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -44080,10 +44161,10 @@ static PyObject *__pyx_f_4lxml_5etree_17_RotatingErrorLog_receive(struct __pyx_o
  *         if len(self._entries) > self._max_len:
  */
   if (unlikely(__pyx_v_self->__pyx_base.__pyx_base._entries == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(1, 471, __pyx_L1_error)
   }
-  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_self->__pyx_base.__pyx_base._entries, ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 471, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_self->__pyx_base.__pyx_base._entries, ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 471, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":473
  *         self._entries.append(entry)
@@ -44098,7 +44179,7 @@ static PyObject *__pyx_f_4lxml_5etree_17_RotatingErrorLog_receive(struct __pyx_o
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(1, 473, __pyx_L1_error)
   }
-  __pyx_t_10 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 473, __pyx_L1_error)
+  __pyx_t_10 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(1, 473, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_6 = ((__pyx_t_10 > __pyx_v_self->_max_len) != 0);
   if (__pyx_t_6) {
@@ -44408,7 +44489,7 @@ static int __pyx_pf_4lxml_5etree_10PyErrorLog___init__(struct __pyx_obj_4lxml_5e
  *             ErrorLevels.ERROR   : logging.ERROR,
  *             ErrorLevels.FATAL   : logging.CRITICAL
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 507, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 507, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ErrorLevels); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 507, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
@@ -44963,12 +45044,12 @@ static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_4log(struct __pyx_obj_4lxml_
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_message);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/xmlerror.pxi":539
+  /* "src/lxml/xmlerror.pxi":538
+ *         self._log(
  *             self._map_level(log_entry.level, 0),
- *             message, *args
- *             )             # <<<<<<<<<<<<<<
+ *             message, *args             # <<<<<<<<<<<<<<
+ *             )
  * 
- *     cpdef receive(self, _LogEntry log_entry):
  */
   __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 536, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
@@ -45359,7 +45440,6 @@ static struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_f_4lxml_5etree__getGlo
  */
     }
     __pyx_L4_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "src/lxml/xmlerror.pxi":568
@@ -45424,21 +45504,18 @@ static struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_f_4lxml_5etree__getGlo
  *         return (<object>thread_dict)[u"_GlobalErrorLog"]
  *     except KeyError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L1_error;
     __pyx_L8_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L0;
     __pyx_L7_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -47156,7 +47233,7 @@ static PyObject *__pyx_f_4lxml_5etree___initErrorConstants(void) {
  *         cls._names   = reverse_dict
  *         cls._getName = reverse_dict.get
  */
-    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 758, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 758, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_XDECREF_SET(__pyx_v_reverse_dict, ((PyObject*)__pyx_t_5));
     __pyx_t_5 = 0;
@@ -47221,7 +47298,7 @@ static PyObject *__pyx_f_4lxml_5etree___initErrorConstants(void) {
         if (unlikely(!__pyx_t_3)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(1, 761, __pyx_L1_error)
           }
           break;
@@ -47315,7 +47392,7 @@ static PyObject *__pyx_f_4lxml_5etree___initErrorConstants(void) {
           if (unlikely(!__pyx_t_3)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(1, 763, __pyx_L1_error)
             }
             break;
@@ -47396,7 +47473,7 @@ static PyObject *__pyx_f_4lxml_5etree___initErrorConstants(void) {
  *                 reverse_dict[value] = name
  * 
  */
-        __pyx_t_14 = PyObject_SetAttr(__pyx_v_cls, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(1, 765, __pyx_L1_error)
+        __pyx_t_14 = PyObject_SetAttr(__pyx_v_cls, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(1, 765, __pyx_L1_error)
 
         /* "src/lxml/xmlerror.pxi":766
  *                 value = int(value)
@@ -47496,7 +47573,7 @@ static PyObject *__pyx_f_4lxml_5etree___initErrorConstants(void) {
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":354
+/* "lxml/etree.pyx":357
  *     cdef _BaseParser _parser
  * 
  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
@@ -47519,7 +47596,7 @@ static void __pyx_pf_4lxml_5etree_9_Document___dealloc__(struct LxmlDocument *__
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__dealloc__", 0);
 
-  /* "lxml/etree.pyx":358
+  /* "lxml/etree.pyx":361
  *         # to clean the whole thing up, as all nodes have a reference to
  *         # the document
  *         tree.xmlFreeDoc(self._c_doc)             # <<<<<<<<<<<<<<
@@ -47528,7 +47605,7 @@ static void __pyx_pf_4lxml_5etree_9_Document___dealloc__(struct LxmlDocument *__
  */
   xmlFreeDoc(__pyx_v_self->_c_doc);
 
-  /* "lxml/etree.pyx":354
+  /* "lxml/etree.pyx":357
  *     cdef _BaseParser _parser
  * 
  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
@@ -47540,7 +47617,7 @@ static void __pyx_pf_4lxml_5etree_9_Document___dealloc__(struct LxmlDocument *__
   __Pyx_RefNannyFinishContext();
 }
 
-/* "lxml/etree.pyx":361
+/* "lxml/etree.pyx":364
  * 
  *     @cython.final
  *     cdef getroot(self):             # <<<<<<<<<<<<<<
@@ -47556,7 +47633,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getroot(struct LxmlDocument *__
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("getroot", 0);
 
-  /* "lxml/etree.pyx":364
+  /* "lxml/etree.pyx":367
  *         # return an element proxy for the document root
  *         cdef xmlNode* c_node
  *         c_node = tree.xmlDocGetRootElement(self._c_doc)             # <<<<<<<<<<<<<<
@@ -47565,7 +47642,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getroot(struct LxmlDocument *__
  */
   __pyx_v_c_node = xmlDocGetRootElement(__pyx_v_self->_c_doc);
 
-  /* "lxml/etree.pyx":365
+  /* "lxml/etree.pyx":368
  *         cdef xmlNode* c_node
  *         c_node = tree.xmlDocGetRootElement(self._c_doc)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -47575,7 +47652,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getroot(struct LxmlDocument *__
   __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":366
+    /* "lxml/etree.pyx":369
  *         c_node = tree.xmlDocGetRootElement(self._c_doc)
  *         if c_node is NULL:
  *             return None             # <<<<<<<<<<<<<<
@@ -47587,7 +47664,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getroot(struct LxmlDocument *__
     __pyx_r = Py_None;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":365
+    /* "lxml/etree.pyx":368
  *         cdef xmlNode* c_node
  *         c_node = tree.xmlDocGetRootElement(self._c_doc)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -47596,7 +47673,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getroot(struct LxmlDocument *__
  */
   }
 
-  /* "lxml/etree.pyx":367
+  /* "lxml/etree.pyx":370
  *         if c_node is NULL:
  *             return None
  *         return _elementFactory(self, c_node)             # <<<<<<<<<<<<<<
@@ -47604,13 +47681,13 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getroot(struct LxmlDocument *__
  *     @cython.final
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_self, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_self, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":361
+  /* "lxml/etree.pyx":364
  * 
  *     @cython.final
  *     cdef getroot(self):             # <<<<<<<<<<<<<<
@@ -47629,7 +47706,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getroot(struct LxmlDocument *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":370
+/* "lxml/etree.pyx":373
  * 
  *     @cython.final
  *     cdef bint hasdoctype(self):             # <<<<<<<<<<<<<<
@@ -47644,7 +47721,7 @@ static int __pyx_f_4lxml_5etree_9_Document_hasdoctype(struct LxmlDocument *__pyx
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("hasdoctype", 0);
 
-  /* "lxml/etree.pyx":372
+  /* "lxml/etree.pyx":375
  *     cdef bint hasdoctype(self):
  *         # DOCTYPE gets parsed into internal subset (xmlDTD*)
  *         return self._c_doc is not NULL and self._c_doc.intSubset is not NULL             # <<<<<<<<<<<<<<
@@ -47663,7 +47740,7 @@ static int __pyx_f_4lxml_5etree_9_Document_hasdoctype(struct LxmlDocument *__pyx
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":370
+  /* "lxml/etree.pyx":373
  * 
  *     @cython.final
  *     cdef bint hasdoctype(self):             # <<<<<<<<<<<<<<
@@ -47677,7 +47754,7 @@ static int __pyx_f_4lxml_5etree_9_Document_hasdoctype(struct LxmlDocument *__pyx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":375
+/* "lxml/etree.pyx":378
  * 
  *     @cython.final
  *     cdef getdoctype(self):             # <<<<<<<<<<<<<<
@@ -47700,7 +47777,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
   int __pyx_t_5;
   __Pyx_RefNannySetupContext("getdoctype", 0);
 
-  /* "lxml/etree.pyx":379
+  /* "lxml/etree.pyx":382
  *         cdef tree.xmlDtd* c_dtd
  *         cdef xmlNode* c_root_node
  *         public_id = None             # <<<<<<<<<<<<<<
@@ -47710,7 +47787,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
   __Pyx_INCREF(Py_None);
   __pyx_v_public_id = Py_None;
 
-  /* "lxml/etree.pyx":380
+  /* "lxml/etree.pyx":383
  *         cdef xmlNode* c_root_node
  *         public_id = None
  *         sys_url   = None             # <<<<<<<<<<<<<<
@@ -47720,7 +47797,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
   __Pyx_INCREF(Py_None);
   __pyx_v_sys_url = Py_None;
 
-  /* "lxml/etree.pyx":381
+  /* "lxml/etree.pyx":384
  *         public_id = None
  *         sys_url   = None
  *         c_dtd = self._c_doc.intSubset             # <<<<<<<<<<<<<<
@@ -47730,7 +47807,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
   __pyx_t_1 = __pyx_v_self->_c_doc->intSubset;
   __pyx_v_c_dtd = __pyx_t_1;
 
-  /* "lxml/etree.pyx":382
+  /* "lxml/etree.pyx":385
  *         sys_url   = None
  *         c_dtd = self._c_doc.intSubset
  *         if c_dtd is not NULL:             # <<<<<<<<<<<<<<
@@ -47740,7 +47817,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
   __pyx_t_2 = ((__pyx_v_c_dtd != NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":383
+    /* "lxml/etree.pyx":386
  *         c_dtd = self._c_doc.intSubset
  *         if c_dtd is not NULL:
  *             if c_dtd.ExternalID is not NULL:             # <<<<<<<<<<<<<<
@@ -47750,19 +47827,19 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
     __pyx_t_2 = ((__pyx_v_c_dtd->ExternalID != NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":384
+      /* "lxml/etree.pyx":387
  *         if c_dtd is not NULL:
  *             if c_dtd.ExternalID is not NULL:
  *                 public_id = funicode(c_dtd.ExternalID)             # <<<<<<<<<<<<<<
  *             if c_dtd.SystemID is not NULL:
  *                 sys_url = funicode(c_dtd.SystemID)
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->ExternalID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->ExternalID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF_SET(__pyx_v_public_id, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":383
+      /* "lxml/etree.pyx":386
  *         c_dtd = self._c_doc.intSubset
  *         if c_dtd is not NULL:
  *             if c_dtd.ExternalID is not NULL:             # <<<<<<<<<<<<<<
@@ -47771,7 +47848,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
  */
     }
 
-    /* "lxml/etree.pyx":385
+    /* "lxml/etree.pyx":388
  *             if c_dtd.ExternalID is not NULL:
  *                 public_id = funicode(c_dtd.ExternalID)
  *             if c_dtd.SystemID is not NULL:             # <<<<<<<<<<<<<<
@@ -47781,19 +47858,19 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
     __pyx_t_2 = ((__pyx_v_c_dtd->SystemID != NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":386
+      /* "lxml/etree.pyx":389
  *                 public_id = funicode(c_dtd.ExternalID)
  *             if c_dtd.SystemID is not NULL:
  *                 sys_url = funicode(c_dtd.SystemID)             # <<<<<<<<<<<<<<
  *         c_dtd = self._c_doc.extSubset
  *         if c_dtd is not NULL:
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->SystemID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->SystemID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF_SET(__pyx_v_sys_url, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":385
+      /* "lxml/etree.pyx":388
  *             if c_dtd.ExternalID is not NULL:
  *                 public_id = funicode(c_dtd.ExternalID)
  *             if c_dtd.SystemID is not NULL:             # <<<<<<<<<<<<<<
@@ -47802,7 +47879,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
  */
     }
 
-    /* "lxml/etree.pyx":382
+    /* "lxml/etree.pyx":385
  *         sys_url   = None
  *         c_dtd = self._c_doc.intSubset
  *         if c_dtd is not NULL:             # <<<<<<<<<<<<<<
@@ -47811,7 +47888,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
  */
   }
 
-  /* "lxml/etree.pyx":387
+  /* "lxml/etree.pyx":390
  *             if c_dtd.SystemID is not NULL:
  *                 sys_url = funicode(c_dtd.SystemID)
  *         c_dtd = self._c_doc.extSubset             # <<<<<<<<<<<<<<
@@ -47821,7 +47898,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
   __pyx_t_1 = __pyx_v_self->_c_doc->extSubset;
   __pyx_v_c_dtd = __pyx_t_1;
 
-  /* "lxml/etree.pyx":388
+  /* "lxml/etree.pyx":391
  *                 sys_url = funicode(c_dtd.SystemID)
  *         c_dtd = self._c_doc.extSubset
  *         if c_dtd is not NULL:             # <<<<<<<<<<<<<<
@@ -47831,14 +47908,14 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
   __pyx_t_2 = ((__pyx_v_c_dtd != NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":389
+    /* "lxml/etree.pyx":392
  *         c_dtd = self._c_doc.extSubset
  *         if c_dtd is not NULL:
  *             if not public_id and c_dtd.ExternalID is not NULL:             # <<<<<<<<<<<<<<
  *                 public_id = funicode(c_dtd.ExternalID)
  *             if not sys_url and c_dtd.SystemID is not NULL:
  */
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 389, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
     __pyx_t_5 = ((!__pyx_t_4) != 0);
     if (__pyx_t_5) {
     } else {
@@ -47850,19 +47927,19 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
     __pyx_L8_bool_binop_done:;
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":390
+      /* "lxml/etree.pyx":393
  *         if c_dtd is not NULL:
  *             if not public_id and c_dtd.ExternalID is not NULL:
  *                 public_id = funicode(c_dtd.ExternalID)             # <<<<<<<<<<<<<<
  *             if not sys_url and c_dtd.SystemID is not NULL:
  *                 sys_url = funicode(c_dtd.SystemID)
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->ExternalID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->ExternalID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF_SET(__pyx_v_public_id, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":389
+      /* "lxml/etree.pyx":392
  *         c_dtd = self._c_doc.extSubset
  *         if c_dtd is not NULL:
  *             if not public_id and c_dtd.ExternalID is not NULL:             # <<<<<<<<<<<<<<
@@ -47871,14 +47948,14 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
  */
     }
 
-    /* "lxml/etree.pyx":391
+    /* "lxml/etree.pyx":394
  *             if not public_id and c_dtd.ExternalID is not NULL:
  *                 public_id = funicode(c_dtd.ExternalID)
  *             if not sys_url and c_dtd.SystemID is not NULL:             # <<<<<<<<<<<<<<
  *                 sys_url = funicode(c_dtd.SystemID)
  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
  */
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_sys_url); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 391, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_sys_url); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 394, __pyx_L1_error)
     __pyx_t_4 = ((!__pyx_t_5) != 0);
     if (__pyx_t_4) {
     } else {
@@ -47890,19 +47967,19 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
     __pyx_L11_bool_binop_done:;
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":392
+      /* "lxml/etree.pyx":395
  *                 public_id = funicode(c_dtd.ExternalID)
  *             if not sys_url and c_dtd.SystemID is not NULL:
  *                 sys_url = funicode(c_dtd.SystemID)             # <<<<<<<<<<<<<<
  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
  *         if c_root_node is NULL:
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->SystemID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->SystemID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF_SET(__pyx_v_sys_url, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":391
+      /* "lxml/etree.pyx":394
  *             if not public_id and c_dtd.ExternalID is not NULL:
  *                 public_id = funicode(c_dtd.ExternalID)
  *             if not sys_url and c_dtd.SystemID is not NULL:             # <<<<<<<<<<<<<<
@@ -47911,7 +47988,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
  */
     }
 
-    /* "lxml/etree.pyx":388
+    /* "lxml/etree.pyx":391
  *                 sys_url = funicode(c_dtd.SystemID)
  *         c_dtd = self._c_doc.extSubset
  *         if c_dtd is not NULL:             # <<<<<<<<<<<<<<
@@ -47920,7 +47997,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
  */
   }
 
-  /* "lxml/etree.pyx":393
+  /* "lxml/etree.pyx":396
  *             if not sys_url and c_dtd.SystemID is not NULL:
  *                 sys_url = funicode(c_dtd.SystemID)
  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)             # <<<<<<<<<<<<<<
@@ -47929,7 +48006,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
  */
   __pyx_v_c_root_node = xmlDocGetRootElement(__pyx_v_self->_c_doc);
 
-  /* "lxml/etree.pyx":394
+  /* "lxml/etree.pyx":397
  *                 sys_url = funicode(c_dtd.SystemID)
  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
  *         if c_root_node is NULL:             # <<<<<<<<<<<<<<
@@ -47939,7 +48016,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
   __pyx_t_2 = ((__pyx_v_c_root_node == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":395
+    /* "lxml/etree.pyx":398
  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
  *         if c_root_node is NULL:
  *             root_name = None             # <<<<<<<<<<<<<<
@@ -47949,7 +48026,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
     __Pyx_INCREF(Py_None);
     __pyx_v_root_name = Py_None;
 
-    /* "lxml/etree.pyx":394
+    /* "lxml/etree.pyx":397
  *                 sys_url = funicode(c_dtd.SystemID)
  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
  *         if c_root_node is NULL:             # <<<<<<<<<<<<<<
@@ -47959,7 +48036,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
     goto __pyx_L13;
   }
 
-  /* "lxml/etree.pyx":397
+  /* "lxml/etree.pyx":400
  *             root_name = None
  *         else:
  *             root_name = funicode(c_root_node.name)             # <<<<<<<<<<<<<<
@@ -47967,14 +48044,14 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
  * 
  */
   /*else*/ {
-    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_root_node->name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_root_node->name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_v_root_name = __pyx_t_3;
     __pyx_t_3 = 0;
   }
   __pyx_L13:;
 
-  /* "lxml/etree.pyx":398
+  /* "lxml/etree.pyx":401
  *         else:
  *             root_name = funicode(c_root_node.name)
  *         return (root_name, public_id, sys_url)             # <<<<<<<<<<<<<<
@@ -47982,7 +48059,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
  *     @cython.final
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(__pyx_v_root_name);
   __Pyx_GIVEREF(__pyx_v_root_name);
@@ -47997,7 +48074,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":375
+  /* "lxml/etree.pyx":378
  * 
  *     @cython.final
  *     cdef getdoctype(self):             # <<<<<<<<<<<<<<
@@ -48019,7 +48096,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":401
+/* "lxml/etree.pyx":404
  * 
  *     @cython.final
  *     cdef getxmlinfo(self):             # <<<<<<<<<<<<<<
@@ -48038,7 +48115,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("getxmlinfo", 0);
 
-  /* "lxml/etree.pyx":403
+  /* "lxml/etree.pyx":406
  *     cdef getxmlinfo(self):
  *         # return XML version and encoding (or None if not known)
  *         cdef xmlDoc* c_doc = self._c_doc             # <<<<<<<<<<<<<<
@@ -48048,7 +48125,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
   __pyx_t_1 = __pyx_v_self->_c_doc;
   __pyx_v_c_doc = __pyx_t_1;
 
-  /* "lxml/etree.pyx":404
+  /* "lxml/etree.pyx":407
  *         # return XML version and encoding (or None if not known)
  *         cdef xmlDoc* c_doc = self._c_doc
  *         if c_doc.version is NULL:             # <<<<<<<<<<<<<<
@@ -48058,7 +48135,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
   __pyx_t_2 = ((__pyx_v_c_doc->version == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":405
+    /* "lxml/etree.pyx":408
  *         cdef xmlDoc* c_doc = self._c_doc
  *         if c_doc.version is NULL:
  *             version = None             # <<<<<<<<<<<<<<
@@ -48068,7 +48145,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
     __Pyx_INCREF(Py_None);
     __pyx_v_version = Py_None;
 
-    /* "lxml/etree.pyx":404
+    /* "lxml/etree.pyx":407
  *         # return XML version and encoding (or None if not known)
  *         cdef xmlDoc* c_doc = self._c_doc
  *         if c_doc.version is NULL:             # <<<<<<<<<<<<<<
@@ -48078,7 +48155,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":407
+  /* "lxml/etree.pyx":410
  *             version = None
  *         else:
  *             version = funicode(c_doc.version)             # <<<<<<<<<<<<<<
@@ -48086,14 +48163,14 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
  *             encoding = None
  */
   /*else*/ {
-    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_doc->version); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_doc->version); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_v_version = __pyx_t_3;
     __pyx_t_3 = 0;
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":408
+  /* "lxml/etree.pyx":411
  *         else:
  *             version = funicode(c_doc.version)
  *         if c_doc.encoding is NULL:             # <<<<<<<<<<<<<<
@@ -48103,7 +48180,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
   __pyx_t_2 = ((__pyx_v_c_doc->encoding == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":409
+    /* "lxml/etree.pyx":412
  *             version = funicode(c_doc.version)
  *         if c_doc.encoding is NULL:
  *             encoding = None             # <<<<<<<<<<<<<<
@@ -48113,7 +48190,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
     __Pyx_INCREF(Py_None);
     __pyx_v_encoding = Py_None;
 
-    /* "lxml/etree.pyx":408
+    /* "lxml/etree.pyx":411
  *         else:
  *             version = funicode(c_doc.version)
  *         if c_doc.encoding is NULL:             # <<<<<<<<<<<<<<
@@ -48123,7 +48200,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
     goto __pyx_L4;
   }
 
-  /* "lxml/etree.pyx":411
+  /* "lxml/etree.pyx":414
  *             encoding = None
  *         else:
  *             encoding = funicode(c_doc.encoding)             # <<<<<<<<<<<<<<
@@ -48131,14 +48208,14 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
  * 
  */
   /*else*/ {
-    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_doc->encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_doc->encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_v_encoding = __pyx_t_3;
     __pyx_t_3 = 0;
   }
   __pyx_L4:;
 
-  /* "lxml/etree.pyx":412
+  /* "lxml/etree.pyx":415
  *         else:
  *             encoding = funicode(c_doc.encoding)
  *         return (version, encoding)             # <<<<<<<<<<<<<<
@@ -48146,7 +48223,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
  *     @cython.final
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(__pyx_v_version);
   __Pyx_GIVEREF(__pyx_v_version);
@@ -48158,7 +48235,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":401
+  /* "lxml/etree.pyx":404
  * 
  *     @cython.final
  *     cdef getxmlinfo(self):             # <<<<<<<<<<<<<<
@@ -48179,7 +48256,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":415
+/* "lxml/etree.pyx":418
  * 
  *     @cython.final
  *     cdef isstandalone(self):             # <<<<<<<<<<<<<<
@@ -48194,7 +48271,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_isstandalone(struct LxmlDocumen
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("isstandalone", 0);
 
-  /* "lxml/etree.pyx":418
+  /* "lxml/etree.pyx":421
  *         # returns True for "standalone=true",
  *         # False for "standalone=false", None if not provided
  *         if self._c_doc.standalone == -1:             # <<<<<<<<<<<<<<
@@ -48204,7 +48281,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_isstandalone(struct LxmlDocumen
   __pyx_t_1 = ((__pyx_v_self->_c_doc->standalone == -1L) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":419
+    /* "lxml/etree.pyx":422
  *         # False for "standalone=false", None if not provided
  *         if self._c_doc.standalone == -1:
  *             return None             # <<<<<<<<<<<<<<
@@ -48216,7 +48293,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_isstandalone(struct LxmlDocumen
     __pyx_r = Py_None;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":418
+    /* "lxml/etree.pyx":421
  *         # returns True for "standalone=true",
  *         # False for "standalone=false", None if not provided
  *         if self._c_doc.standalone == -1:             # <<<<<<<<<<<<<<
@@ -48225,7 +48302,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_isstandalone(struct LxmlDocumen
  */
   }
 
-  /* "lxml/etree.pyx":421
+  /* "lxml/etree.pyx":424
  *             return None
  *         else:
  *             return <bint>(self._c_doc.standalone == 1)             # <<<<<<<<<<<<<<
@@ -48234,14 +48311,14 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_isstandalone(struct LxmlDocumen
  */
   /*else*/ {
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_self->_c_doc->standalone == 1) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyBool_FromLong(((__pyx_v_self->_c_doc->standalone == 1) != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = __pyx_t_2;
     __pyx_t_2 = 0;
     goto __pyx_L0;
   }
 
-  /* "lxml/etree.pyx":415
+  /* "lxml/etree.pyx":418
  * 
  *     @cython.final
  *     cdef isstandalone(self):             # <<<<<<<<<<<<<<
@@ -48260,7 +48337,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_isstandalone(struct LxmlDocumen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":424
+/* "lxml/etree.pyx":427
  * 
  *     @cython.final
  *     cdef bytes buildNewPrefix(self):             # <<<<<<<<<<<<<<
@@ -48278,7 +48355,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
   int __pyx_t_4;
   __Pyx_RefNannySetupContext("buildNewPrefix", 0);
 
-  /* "lxml/etree.pyx":427
+  /* "lxml/etree.pyx":430
  *         # get a new unique prefix ("nsX") for this document
  *         cdef bytes ns
  *         if self._ns_counter < len(_PREFIX_CACHE):             # <<<<<<<<<<<<<<
@@ -48289,14 +48366,14 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
   __Pyx_INCREF(__pyx_t_1);
   if (unlikely(__pyx_t_1 == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-    __PYX_ERR(0, 427, __pyx_L1_error)
+    __PYX_ERR(0, 430, __pyx_L1_error)
   }
-  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 427, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 430, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = ((__pyx_v_self->_ns_counter < __pyx_t_2) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":428
+    /* "lxml/etree.pyx":431
  *         cdef bytes ns
  *         if self._ns_counter < len(_PREFIX_CACHE):
  *             ns = _PREFIX_CACHE[self._ns_counter]             # <<<<<<<<<<<<<<
@@ -48305,15 +48382,15 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
  */
     if (unlikely(__pyx_v_4lxml_5etree__PREFIX_CACHE == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(0, 428, __pyx_L1_error)
+      __PYX_ERR(0, 431, __pyx_L1_error)
     }
-    __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_4lxml_5etree__PREFIX_CACHE, __pyx_v_self->_ns_counter, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_4lxml_5etree__PREFIX_CACHE, __pyx_v_self->_ns_counter, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 428, __pyx_L1_error)
+    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 431, __pyx_L1_error)
     __pyx_v_ns = ((PyObject*)__pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/etree.pyx":427
+    /* "lxml/etree.pyx":430
  *         # get a new unique prefix ("nsX") for this document
  *         cdef bytes ns
  *         if self._ns_counter < len(_PREFIX_CACHE):             # <<<<<<<<<<<<<<
@@ -48323,7 +48400,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":430
+  /* "lxml/etree.pyx":433
  *             ns = _PREFIX_CACHE[self._ns_counter]
  *         else:
  *             ns = python.PyBytes_FromFormat("ns%d", self._ns_counter)             # <<<<<<<<<<<<<<
@@ -48331,14 +48408,14 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
  *             ns += self._prefix_tail
  */
   /*else*/ {
-    __pyx_t_1 = PyBytes_FromFormat(((char *)"ns%d"), __pyx_v_self->_ns_counter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
+    __pyx_t_1 = PyBytes_FromFormat(((char *)"ns%d"), __pyx_v_self->_ns_counter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_ns = ((PyObject*)__pyx_t_1);
     __pyx_t_1 = 0;
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":431
+  /* "lxml/etree.pyx":434
  *         else:
  *             ns = python.PyBytes_FromFormat("ns%d", self._ns_counter)
  *         if self._prefix_tail is not None:             # <<<<<<<<<<<<<<
@@ -48349,19 +48426,19 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
   __pyx_t_4 = (__pyx_t_3 != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":432
+    /* "lxml/etree.pyx":435
  *             ns = python.PyBytes_FromFormat("ns%d", self._ns_counter)
  *         if self._prefix_tail is not None:
  *             ns += self._prefix_tail             # <<<<<<<<<<<<<<
  *         self._ns_counter += 1
  *         if self._ns_counter < 0:
  */
-    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ns, __pyx_v_self->_prefix_tail); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
+    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_ns, __pyx_v_self->_prefix_tail); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF_SET(__pyx_v_ns, ((PyObject*)__pyx_t_1));
     __pyx_t_1 = 0;
 
-    /* "lxml/etree.pyx":431
+    /* "lxml/etree.pyx":434
  *         else:
  *             ns = python.PyBytes_FromFormat("ns%d", self._ns_counter)
  *         if self._prefix_tail is not None:             # <<<<<<<<<<<<<<
@@ -48370,7 +48447,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
  */
   }
 
-  /* "lxml/etree.pyx":433
+  /* "lxml/etree.pyx":436
  *         if self._prefix_tail is not None:
  *             ns += self._prefix_tail
  *         self._ns_counter += 1             # <<<<<<<<<<<<<<
@@ -48379,7 +48456,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
  */
   __pyx_v_self->_ns_counter = (__pyx_v_self->_ns_counter + 1);
 
-  /* "lxml/etree.pyx":434
+  /* "lxml/etree.pyx":437
  *             ns += self._prefix_tail
  *         self._ns_counter += 1
  *         if self._ns_counter < 0:             # <<<<<<<<<<<<<<
@@ -48389,7 +48466,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
   __pyx_t_4 = ((__pyx_v_self->_ns_counter < 0) != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":436
+    /* "lxml/etree.pyx":439
  *         if self._ns_counter < 0:
  *             # overflow!
  *             self._ns_counter = 0             # <<<<<<<<<<<<<<
@@ -48398,7 +48475,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
  */
     __pyx_v_self->_ns_counter = 0;
 
-    /* "lxml/etree.pyx":437
+    /* "lxml/etree.pyx":440
  *             # overflow!
  *             self._ns_counter = 0
  *             if self._prefix_tail is None:             # <<<<<<<<<<<<<<
@@ -48409,7 +48486,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
     __pyx_t_3 = (__pyx_t_4 != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":438
+      /* "lxml/etree.pyx":441
  *             self._ns_counter = 0
  *             if self._prefix_tail is None:
  *                 self._prefix_tail = b"A"             # <<<<<<<<<<<<<<
@@ -48422,7 +48499,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
       __Pyx_DECREF(__pyx_v_self->_prefix_tail);
       __pyx_v_self->_prefix_tail = __pyx_n_b_A;
 
-      /* "lxml/etree.pyx":437
+      /* "lxml/etree.pyx":440
  *             # overflow!
  *             self._ns_counter = 0
  *             if self._prefix_tail is None:             # <<<<<<<<<<<<<<
@@ -48432,7 +48509,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
       goto __pyx_L6;
     }
 
-    /* "lxml/etree.pyx":440
+    /* "lxml/etree.pyx":443
  *                 self._prefix_tail = b"A"
  *             else:
  *                 self._prefix_tail += b"A"             # <<<<<<<<<<<<<<
@@ -48440,7 +48517,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
  * 
  */
     /*else*/ {
-      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_self->_prefix_tail, __pyx_n_b_A); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
+      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_self->_prefix_tail, __pyx_n_b_A); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GIVEREF(__pyx_t_1);
       __Pyx_GOTREF(__pyx_v_self->_prefix_tail);
@@ -48450,7 +48527,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
     }
     __pyx_L6:;
 
-    /* "lxml/etree.pyx":434
+    /* "lxml/etree.pyx":437
  *             ns += self._prefix_tail
  *         self._ns_counter += 1
  *         if self._ns_counter < 0:             # <<<<<<<<<<<<<<
@@ -48459,7 +48536,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
  */
   }
 
-  /* "lxml/etree.pyx":441
+  /* "lxml/etree.pyx":444
  *             else:
  *                 self._prefix_tail += b"A"
  *         return ns             # <<<<<<<<<<<<<<
@@ -48471,7 +48548,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
   __pyx_r = __pyx_v_ns;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":424
+  /* "lxml/etree.pyx":427
  * 
  *     @cython.final
  *     cdef bytes buildNewPrefix(self):             # <<<<<<<<<<<<<<
@@ -48491,7 +48568,7 @@ static PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocum
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":444
+/* "lxml/etree.pyx":447
  * 
  *     @cython.final
  *     cdef xmlNs* _findOrBuildNodeNs(self, xmlNode* c_node,             # <<<<<<<<<<<<<<
@@ -48512,7 +48589,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
   int __pyx_t_5;
   __Pyx_RefNannySetupContext("_findOrBuildNodeNs", 0);
 
-  /* "lxml/etree.pyx":453
+  /* "lxml/etree.pyx":456
  *         cdef xmlNs* c_doc_ns
  *         cdef python.PyObject* dict_result
  *         if c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -48522,7 +48599,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
   __pyx_t_1 = ((__pyx_v_c_node->type != XML_ELEMENT_NODE) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":454
+    /* "lxml/etree.pyx":457
  *         cdef python.PyObject* dict_result
  *         if c_node.type != tree.XML_ELEMENT_NODE:
  *             assert c_node.type == tree.XML_ELEMENT_NODE, \             # <<<<<<<<<<<<<<
@@ -48533,18 +48610,18 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
     if (unlikely(!Py_OptimizeFlag)) {
       if (unlikely(!((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0))) {
 
-        /* "lxml/etree.pyx":456
+        /* "lxml/etree.pyx":459
  *             assert c_node.type == tree.XML_ELEMENT_NODE, \
  *                 u"invalid node type %d, expected %d" % (
  *                 c_node.type, tree.XML_ELEMENT_NODE)             # <<<<<<<<<<<<<<
  *         # look for existing ns declaration
  *         c_ns = _searchNsByHref(c_node, c_href, is_attribute)
  */
-        __pyx_t_2 = __Pyx_PyInt_From_xmlElementType(__pyx_v_c_node->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyInt_From_xmlElementType(__pyx_v_c_node->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_3 = __Pyx_PyInt_From_xmlElementType(XML_ELEMENT_NODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyInt_From_xmlElementType(XML_ELEMENT_NODE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
-        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error)
+        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 459, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_GIVEREF(__pyx_t_2);
         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
@@ -48553,24 +48630,24 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
         __pyx_t_2 = 0;
         __pyx_t_3 = 0;
 
-        /* "lxml/etree.pyx":455
+        /* "lxml/etree.pyx":458
  *         if c_node.type != tree.XML_ELEMENT_NODE:
  *             assert c_node.type == tree.XML_ELEMENT_NODE, \
  *                 u"invalid node type %d, expected %d" % (             # <<<<<<<<<<<<<<
  *                 c_node.type, tree.XML_ELEMENT_NODE)
  *         # look for existing ns declaration
  */
-        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_invalid_node_type_d_expected_d, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
+        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_invalid_node_type_d_expected_d, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         PyErr_SetObject(PyExc_AssertionError, __pyx_t_3);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __PYX_ERR(0, 454, __pyx_L1_error)
+        __PYX_ERR(0, 457, __pyx_L1_error)
       }
     }
     #endif
 
-    /* "lxml/etree.pyx":453
+    /* "lxml/etree.pyx":456
  *         cdef xmlNs* c_doc_ns
  *         cdef python.PyObject* dict_result
  *         if c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -48579,7 +48656,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
  */
   }
 
-  /* "lxml/etree.pyx":458
+  /* "lxml/etree.pyx":461
  *                 c_node.type, tree.XML_ELEMENT_NODE)
  *         # look for existing ns declaration
  *         c_ns = _searchNsByHref(c_node, c_href, is_attribute)             # <<<<<<<<<<<<<<
@@ -48588,7 +48665,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
  */
   __pyx_v_c_ns = __pyx_f_4lxml_5etree__searchNsByHref(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_is_attribute);
 
-  /* "lxml/etree.pyx":459
+  /* "lxml/etree.pyx":462
  *         # look for existing ns declaration
  *         c_ns = _searchNsByHref(c_node, c_href, is_attribute)
  *         if c_ns is not NULL:             # <<<<<<<<<<<<<<
@@ -48598,7 +48675,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
   __pyx_t_1 = ((__pyx_v_c_ns != NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":460
+    /* "lxml/etree.pyx":463
  *         c_ns = _searchNsByHref(c_node, c_href, is_attribute)
  *         if c_ns is not NULL:
  *             if is_attribute and c_ns.prefix is NULL:             # <<<<<<<<<<<<<<
@@ -48618,7 +48695,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
       goto __pyx_L5;
     }
 
-    /* "lxml/etree.pyx":465
+    /* "lxml/etree.pyx":468
  *                 pass
  *             else:
  *                 return c_ns             # <<<<<<<<<<<<<<
@@ -48631,7 +48708,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
     }
     __pyx_L5:;
 
-    /* "lxml/etree.pyx":459
+    /* "lxml/etree.pyx":462
  *         # look for existing ns declaration
  *         c_ns = _searchNsByHref(c_node, c_href, is_attribute)
  *         if c_ns is not NULL:             # <<<<<<<<<<<<<<
@@ -48640,7 +48717,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
  */
   }
 
-  /* "lxml/etree.pyx":468
+  /* "lxml/etree.pyx":471
  * 
  *         # none found => determine a suitable new prefix
  *         if c_prefix is NULL:             # <<<<<<<<<<<<<<
@@ -48650,7 +48727,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
   __pyx_t_1 = ((__pyx_v_c_prefix == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":470
+    /* "lxml/etree.pyx":473
  *         if c_prefix is NULL:
  *             dict_result = python.PyDict_GetItem(
  *                 _DEFAULT_NAMESPACE_PREFIXES, <unsigned char*>c_href)             # <<<<<<<<<<<<<<
@@ -48659,10 +48736,10 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
  */
     __pyx_t_3 = __pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES;
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_href)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_href)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
 
-    /* "lxml/etree.pyx":469
+    /* "lxml/etree.pyx":472
  *         # none found => determine a suitable new prefix
  *         if c_prefix is NULL:
  *             dict_result = python.PyDict_GetItem(             # <<<<<<<<<<<<<<
@@ -48673,7 +48750,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":471
+    /* "lxml/etree.pyx":474
  *             dict_result = python.PyDict_GetItem(
  *                 _DEFAULT_NAMESPACE_PREFIXES, <unsigned char*>c_href)
  *             if dict_result is not NULL:             # <<<<<<<<<<<<<<
@@ -48683,7 +48760,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
     __pyx_t_1 = ((__pyx_v_dict_result != NULL) != 0);
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":472
+      /* "lxml/etree.pyx":475
  *                 _DEFAULT_NAMESPACE_PREFIXES, <unsigned char*>c_href)
  *             if dict_result is not NULL:
  *                 prefix = <object>dict_result             # <<<<<<<<<<<<<<
@@ -48695,7 +48772,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
       __pyx_v_prefix = __pyx_t_4;
       __pyx_t_4 = 0;
 
-      /* "lxml/etree.pyx":471
+      /* "lxml/etree.pyx":474
  *             dict_result = python.PyDict_GetItem(
  *                 _DEFAULT_NAMESPACE_PREFIXES, <unsigned char*>c_href)
  *             if dict_result is not NULL:             # <<<<<<<<<<<<<<
@@ -48705,7 +48782,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
       goto __pyx_L9;
     }
 
-    /* "lxml/etree.pyx":474
+    /* "lxml/etree.pyx":477
  *                 prefix = <object>dict_result
  *             else:
  *                 prefix = self.buildNewPrefix()             # <<<<<<<<<<<<<<
@@ -48713,14 +48790,14 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
  * 
  */
     /*else*/ {
-      __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_buildNewPrefix(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_buildNewPrefix(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_v_prefix = __pyx_t_4;
       __pyx_t_4 = 0;
     }
     __pyx_L9:;
 
-    /* "lxml/etree.pyx":475
+    /* "lxml/etree.pyx":478
  *             else:
  *                 prefix = self.buildNewPrefix()
  *             c_prefix = _xcstr(prefix)             # <<<<<<<<<<<<<<
@@ -48729,7 +48806,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
  */
     __pyx_v_c_prefix = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_prefix);
 
-    /* "lxml/etree.pyx":468
+    /* "lxml/etree.pyx":471
  * 
  *         # none found => determine a suitable new prefix
  *         if c_prefix is NULL:             # <<<<<<<<<<<<<<
@@ -48738,7 +48815,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
  */
   }
 
-  /* "lxml/etree.pyx":478
+  /* "lxml/etree.pyx":481
  * 
  *         # make sure the prefix is not in use already
  *         while tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is not NULL:             # <<<<<<<<<<<<<<
@@ -48749,19 +48826,19 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
     __pyx_t_1 = ((xmlSearchNs(__pyx_v_self->_c_doc, __pyx_v_c_node, __pyx_v_c_prefix) != NULL) != 0);
     if (!__pyx_t_1) break;
 
-    /* "lxml/etree.pyx":479
+    /* "lxml/etree.pyx":482
  *         # make sure the prefix is not in use already
  *         while tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is not NULL:
  *             prefix = self.buildNewPrefix()             # <<<<<<<<<<<<<<
  *             c_prefix = _xcstr(prefix)
  * 
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_buildNewPrefix(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_buildNewPrefix(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 482, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":480
+    /* "lxml/etree.pyx":483
  *         while tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is not NULL:
  *             prefix = self.buildNewPrefix()
  *             c_prefix = _xcstr(prefix)             # <<<<<<<<<<<<<<
@@ -48771,7 +48848,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
     __pyx_v_c_prefix = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_prefix);
   }
 
-  /* "lxml/etree.pyx":483
+  /* "lxml/etree.pyx":486
  * 
  *         # declare the namespace and return it
  *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)             # <<<<<<<<<<<<<<
@@ -48780,7 +48857,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
  */
   __pyx_v_c_ns = xmlNewNs(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_prefix);
 
-  /* "lxml/etree.pyx":484
+  /* "lxml/etree.pyx":487
  *         # declare the namespace and return it
  *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
  *         if c_ns is NULL:             # <<<<<<<<<<<<<<
@@ -48790,16 +48867,16 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
   __pyx_t_1 = ((__pyx_v_c_ns == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":485
+    /* "lxml/etree.pyx":488
  *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
  *         if c_ns is NULL:
  *             raise MemoryError()             # <<<<<<<<<<<<<<
  *         return c_ns
  * 
  */
-    PyErr_NoMemory(); __PYX_ERR(0, 485, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(0, 488, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":484
+    /* "lxml/etree.pyx":487
  *         # declare the namespace and return it
  *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
  *         if c_ns is NULL:             # <<<<<<<<<<<<<<
@@ -48808,7 +48885,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
  */
   }
 
-  /* "lxml/etree.pyx":486
+  /* "lxml/etree.pyx":489
  *         if c_ns is NULL:
  *             raise MemoryError()
  *         return c_ns             # <<<<<<<<<<<<<<
@@ -48818,7 +48895,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
   __pyx_r = __pyx_v_c_ns;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":444
+  /* "lxml/etree.pyx":447
  * 
  *     @cython.final
  *     cdef xmlNs* _findOrBuildNodeNs(self, xmlNode* c_node,             # <<<<<<<<<<<<<<
@@ -48839,7 +48916,7 @@ static xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocu
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":489
+/* "lxml/etree.pyx":492
  * 
  *     @cython.final
  *     cdef int _setNodeNs(self, xmlNode* c_node, const_xmlChar* c_href) except -1:             # <<<<<<<<<<<<<<
@@ -48854,17 +48931,17 @@ static int __pyx_f_4lxml_5etree_9_Document__setNodeNs(struct LxmlDocument *__pyx
   xmlNs *__pyx_t_1;
   __Pyx_RefNannySetupContext("_setNodeNs", 0);
 
-  /* "lxml/etree.pyx":491
+  /* "lxml/etree.pyx":494
  *     cdef int _setNodeNs(self, xmlNode* c_node, const_xmlChar* c_href) except -1:
  *         u"Lookup namespace structure and set it for the node."
  *         c_ns = self._findOrBuildNodeNs(c_node, c_href, NULL, 0)             # <<<<<<<<<<<<<<
  *         tree.xmlSetNs(c_node, c_ns)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_self, __pyx_v_c_node, __pyx_v_c_href, NULL, 0); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 491, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_self, __pyx_v_c_node, __pyx_v_c_href, NULL, 0); if (unlikely(__pyx_t_1 == ((xmlNs *)NULL))) __PYX_ERR(0, 494, __pyx_L1_error)
   __pyx_v_c_ns = __pyx_t_1;
 
-  /* "lxml/etree.pyx":492
+  /* "lxml/etree.pyx":495
  *         u"Lookup namespace structure and set it for the node."
  *         c_ns = self._findOrBuildNodeNs(c_node, c_href, NULL, 0)
  *         tree.xmlSetNs(c_node, c_ns)             # <<<<<<<<<<<<<<
@@ -48873,7 +48950,7 @@ static int __pyx_f_4lxml_5etree_9_Document__setNodeNs(struct LxmlDocument *__pyx
  */
   xmlSetNs(__pyx_v_c_node, __pyx_v_c_ns);
 
-  /* "lxml/etree.pyx":489
+  /* "lxml/etree.pyx":492
  * 
  *     @cython.final
  *     cdef int _setNodeNs(self, xmlNode* c_node, const_xmlChar* c_href) except -1:             # <<<<<<<<<<<<<<
@@ -48892,7 +48969,7 @@ static int __pyx_f_4lxml_5etree_9_Document__setNodeNs(struct LxmlDocument *__pyx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":494
+/* "lxml/etree.pyx":497
  *         tree.xmlSetNs(c_node, c_ns)
  * 
  * cdef tuple __initPrefixCache():             # <<<<<<<<<<<<<<
@@ -48909,7 +48986,7 @@ static PyObject *__pyx_f_4lxml_5etree___initPrefixCache(void) {
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__initPrefixCache", 0);
 
-  /* "lxml/etree.pyx":496
+  /* "lxml/etree.pyx":499
  * cdef tuple __initPrefixCache():
  *     cdef int i
  *     return tuple([ python.PyBytes_FromFormat("ns%d", i)             # <<<<<<<<<<<<<<
@@ -48917,10 +48994,10 @@ static PyObject *__pyx_f_4lxml_5etree___initPrefixCache(void) {
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
 
-  /* "lxml/etree.pyx":497
+  /* "lxml/etree.pyx":500
  *     cdef int i
  *     return tuple([ python.PyBytes_FromFormat("ns%d", i)
  *                    for i in range(30) ])             # <<<<<<<<<<<<<<
@@ -48930,26 +49007,26 @@ static PyObject *__pyx_f_4lxml_5etree___initPrefixCache(void) {
   for (__pyx_t_2 = 0; __pyx_t_2 < 30; __pyx_t_2+=1) {
     __pyx_v_i = __pyx_t_2;
 
-    /* "lxml/etree.pyx":496
+    /* "lxml/etree.pyx":499
  * cdef tuple __initPrefixCache():
  *     cdef int i
  *     return tuple([ python.PyBytes_FromFormat("ns%d", i)             # <<<<<<<<<<<<<<
  *                    for i in range(30) ])
  * 
  */
-    __pyx_t_3 = PyBytes_FromFormat(((char *)"ns%d"), __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __pyx_t_3 = PyBytes_FromFormat(((char *)"ns%d"), __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 496, __pyx_L1_error)
+    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 499, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   }
-  __pyx_t_3 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
+  __pyx_t_3 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = ((PyObject*)__pyx_t_3);
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":494
+  /* "lxml/etree.pyx":497
  *         tree.xmlSetNs(c_node, c_ns)
  * 
  * cdef tuple __initPrefixCache():             # <<<<<<<<<<<<<<
@@ -48969,7 +49046,7 @@ static PyObject *__pyx_f_4lxml_5etree___initPrefixCache(void) {
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":501
+/* "lxml/etree.pyx":504
  * cdef tuple _PREFIX_CACHE = __initPrefixCache()
  * 
  * cdef _Document _documentFactory(xmlDoc* c_doc, _BaseParser parser):             # <<<<<<<<<<<<<<
@@ -48987,20 +49064,20 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_
   __Pyx_RefNannySetupContext("_documentFactory", 0);
   __Pyx_INCREF((PyObject *)__pyx_v_parser);
 
-  /* "lxml/etree.pyx":503
+  /* "lxml/etree.pyx":506
  * cdef _Document _documentFactory(xmlDoc* c_doc, _BaseParser parser):
  *     cdef _Document result
  *     result = _Document.__new__(_Document)             # <<<<<<<<<<<<<<
  *     result._c_doc = c_doc
  *     result._ns_counter = 0
  */
-  __pyx_t_1 = __pyx_tp_new_4lxml_5etree__Document(((PyTypeObject *)__pyx_ptype_4lxml_5etree__Document), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
+  __pyx_t_1 = __pyx_tp_new_4lxml_5etree__Document(((PyTypeObject *)__pyx_ptype_4lxml_5etree__Document), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Document)))) __PYX_ERR(0, 503, __pyx_L1_error)
+  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Document)))) __PYX_ERR(0, 506, __pyx_L1_error)
   __pyx_v_result = ((struct LxmlDocument *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":504
+  /* "lxml/etree.pyx":507
  *     cdef _Document result
  *     result = _Document.__new__(_Document)
  *     result._c_doc = c_doc             # <<<<<<<<<<<<<<
@@ -49009,7 +49086,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_
  */
   __pyx_v_result->_c_doc = __pyx_v_c_doc;
 
-  /* "lxml/etree.pyx":505
+  /* "lxml/etree.pyx":508
  *     result = _Document.__new__(_Document)
  *     result._c_doc = c_doc
  *     result._ns_counter = 0             # <<<<<<<<<<<<<<
@@ -49018,7 +49095,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_
  */
   __pyx_v_result->_ns_counter = 0;
 
-  /* "lxml/etree.pyx":506
+  /* "lxml/etree.pyx":509
  *     result._c_doc = c_doc
  *     result._ns_counter = 0
  *     result._prefix_tail = None             # <<<<<<<<<<<<<<
@@ -49031,7 +49108,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_
   __Pyx_DECREF(__pyx_v_result->_prefix_tail);
   __pyx_v_result->_prefix_tail = ((PyObject*)Py_None);
 
-  /* "lxml/etree.pyx":507
+  /* "lxml/etree.pyx":510
  *     result._ns_counter = 0
  *     result._prefix_tail = None
  *     if parser is None:             # <<<<<<<<<<<<<<
@@ -49042,19 +49119,19 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":508
+    /* "lxml/etree.pyx":511
  *     result._prefix_tail = None
  *     if parser is None:
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
  *     result._parser = parser
  *     return result
  */
-    __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
+    __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF_SET(__pyx_v_parser, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1));
     __pyx_t_1 = 0;
 
-    /* "lxml/etree.pyx":507
+    /* "lxml/etree.pyx":510
  *     result._ns_counter = 0
  *     result._prefix_tail = None
  *     if parser is None:             # <<<<<<<<<<<<<<
@@ -49063,7 +49140,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_
  */
   }
 
-  /* "lxml/etree.pyx":509
+  /* "lxml/etree.pyx":512
  *     if parser is None:
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *     result._parser = parser             # <<<<<<<<<<<<<<
@@ -49076,7 +49153,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_
   __Pyx_DECREF(((PyObject *)__pyx_v_result->_parser));
   __pyx_v_result->_parser = __pyx_v_parser;
 
-  /* "lxml/etree.pyx":510
+  /* "lxml/etree.pyx":513
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *     result._parser = parser
  *     return result             # <<<<<<<<<<<<<<
@@ -49088,7 +49165,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":501
+  /* "lxml/etree.pyx":504
  * cdef tuple _PREFIX_CACHE = __initPrefixCache()
  * 
  * cdef _Document _documentFactory(xmlDoc* c_doc, _BaseParser parser):             # <<<<<<<<<<<<<<
@@ -49109,7 +49186,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":520
+/* "lxml/etree.pyx":523
  *     u"Document information provided by parser and DTD."
  *     cdef _Document _doc
  *     def __cinit__(self, tree):             # <<<<<<<<<<<<<<
@@ -49143,7 +49220,7 @@ static int __pyx_pw_4lxml_5etree_7DocInfo_1__cinit__(PyObject *__pyx_v_self, PyO
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 520, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 523, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -49154,7 +49231,7 @@ static int __pyx_pw_4lxml_5etree_7DocInfo_1__cinit__(PyObject *__pyx_v_self, PyO
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 520, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 523, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.DocInfo.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -49184,14 +49261,14 @@ static int __pyx_pf_4lxml_5etree_7DocInfo___cinit__(struct __pyx_obj_4lxml_5etre
   int __pyx_t_9;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "lxml/etree.pyx":522
+  /* "lxml/etree.pyx":525
  *     def __cinit__(self, tree):
  *         u"Create a DocInfo object for an ElementTree object or root Element."
  *         self._doc = _documentOrRaise(tree)             # <<<<<<<<<<<<<<
  *         root_name, public_id, system_url = self._doc.getdoctype()
  *         if not root_name and (public_id or system_url):
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_doc);
@@ -49199,14 +49276,14 @@ static int __pyx_pf_4lxml_5etree_7DocInfo___cinit__(struct __pyx_obj_4lxml_5etre
   __pyx_v_self->_doc = ((struct LxmlDocument *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":523
+  /* "lxml/etree.pyx":526
  *         u"Create a DocInfo object for an ElementTree object or root Element."
  *         self._doc = _documentOrRaise(tree)
  *         root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<<
  *         if not root_name and (public_id or system_url):
  *             raise ValueError, u"Could not find root node"
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getdoctype(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getdoctype(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
     PyObject* sequence = __pyx_t_1;
@@ -49218,7 +49295,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo___cinit__(struct __pyx_obj_4lxml_5etre
     if (unlikely(size != 3)) {
       if (size > 3) __Pyx_RaiseTooManyValuesError(3);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 523, __pyx_L1_error)
+      __PYX_ERR(0, 526, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -49234,17 +49311,17 @@ static int __pyx_pf_4lxml_5etree_7DocInfo___cinit__(struct __pyx_obj_4lxml_5etre
     __Pyx_INCREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_t_4);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
+    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
@@ -49254,7 +49331,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo___cinit__(struct __pyx_obj_4lxml_5etre
     __Pyx_GOTREF(__pyx_t_3);
     index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_4);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 526, __pyx_L1_error)
     __pyx_t_6 = NULL;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L4_unpacking_done;
@@ -49262,7 +49339,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo___cinit__(struct __pyx_obj_4lxml_5etre
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_6 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 523, __pyx_L1_error)
+    __PYX_ERR(0, 526, __pyx_L1_error)
     __pyx_L4_unpacking_done:;
   }
   __pyx_v_root_name = __pyx_t_2;
@@ -49272,32 +49349,32 @@ static int __pyx_pf_4lxml_5etree_7DocInfo___cinit__(struct __pyx_obj_4lxml_5etre
   __pyx_v_system_url = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":524
+  /* "lxml/etree.pyx":527
  *         self._doc = _documentOrRaise(tree)
  *         root_name, public_id, system_url = self._doc.getdoctype()
  *         if not root_name and (public_id or system_url):             # <<<<<<<<<<<<<<
  *             raise ValueError, u"Could not find root node"
  * 
  */
-  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_root_name); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_root_name); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 527, __pyx_L1_error)
   __pyx_t_9 = ((!__pyx_t_8) != 0);
   if (__pyx_t_9) {
   } else {
     __pyx_t_7 = __pyx_t_9;
     goto __pyx_L6_bool_binop_done;
   }
-  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 527, __pyx_L1_error)
   if (!__pyx_t_9) {
   } else {
     __pyx_t_7 = __pyx_t_9;
     goto __pyx_L6_bool_binop_done;
   }
-  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 527, __pyx_L1_error)
   __pyx_t_7 = __pyx_t_9;
   __pyx_L6_bool_binop_done:;
   if (__pyx_t_7) {
 
-    /* "lxml/etree.pyx":525
+    /* "lxml/etree.pyx":528
  *         root_name, public_id, system_url = self._doc.getdoctype()
  *         if not root_name and (public_id or system_url):
  *             raise ValueError, u"Could not find root node"             # <<<<<<<<<<<<<<
@@ -49305,9 +49382,9 @@ static int __pyx_pf_4lxml_5etree_7DocInfo___cinit__(struct __pyx_obj_4lxml_5etre
  *     property root_name:
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Could_not_find_root_node, 0, 0);
-    __PYX_ERR(0, 525, __pyx_L1_error)
+    __PYX_ERR(0, 528, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":524
+    /* "lxml/etree.pyx":527
  *         self._doc = _documentOrRaise(tree)
  *         root_name, public_id, system_url = self._doc.getdoctype()
  *         if not root_name and (public_id or system_url):             # <<<<<<<<<<<<<<
@@ -49316,7 +49393,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo___cinit__(struct __pyx_obj_4lxml_5etre
  */
   }
 
-  /* "lxml/etree.pyx":520
+  /* "lxml/etree.pyx":523
  *     u"Document information provided by parser and DTD."
  *     cdef _Document _doc
  *     def __cinit__(self, tree):             # <<<<<<<<<<<<<<
@@ -49343,7 +49420,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo___cinit__(struct __pyx_obj_4lxml_5etre
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":529
+/* "lxml/etree.pyx":532
  *     property root_name:
  *         u"Returns the name of the root node as defined by the DOCTYPE."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -49378,14 +49455,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(struct __pyx_
   PyObject *(*__pyx_t_6)(PyObject *);
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":530
+  /* "lxml/etree.pyx":533
  *         u"Returns the name of the root node as defined by the DOCTYPE."
  *         def __get__(self):
  *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<<
  *             return root_name
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getdoctype(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getdoctype(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
     PyObject* sequence = __pyx_t_1;
@@ -49397,7 +49474,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(struct __pyx_
     if (unlikely(size != 3)) {
       if (size > 3) __Pyx_RaiseTooManyValuesError(3);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 530, __pyx_L1_error)
+      __PYX_ERR(0, 533, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -49413,17 +49490,17 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(struct __pyx_
     __Pyx_INCREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_t_4);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
+    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
@@ -49433,7 +49510,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(struct __pyx_
     __Pyx_GOTREF(__pyx_t_3);
     index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_4);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 533, __pyx_L1_error)
     __pyx_t_6 = NULL;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L4_unpacking_done;
@@ -49441,7 +49518,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(struct __pyx_
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_6 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 530, __pyx_L1_error)
+    __PYX_ERR(0, 533, __pyx_L1_error)
     __pyx_L4_unpacking_done:;
   }
   __pyx_v_root_name = __pyx_t_2;
@@ -49451,7 +49528,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(struct __pyx_
   __pyx_v_system_url = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":531
+  /* "lxml/etree.pyx":534
  *         def __get__(self):
  *             root_name, public_id, system_url = self._doc.getdoctype()
  *             return root_name             # <<<<<<<<<<<<<<
@@ -49463,7 +49540,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(struct __pyx_
   __pyx_r = __pyx_v_root_name;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":529
+  /* "lxml/etree.pyx":532
  *     property root_name:
  *         u"Returns the name of the root node as defined by the DOCTYPE."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -49489,7 +49566,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(struct __pyx_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":534
+/* "lxml/etree.pyx":537
  * 
  *     @cython.final
  *     cdef tree.xmlDtd* _get_c_dtd(self):             # <<<<<<<<<<<<<<
@@ -49508,7 +49585,7 @@ static xmlDtd *__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(struct __pyx_obj_4lxml_5
   const xmlChar *__pyx_t_3;
   __Pyx_RefNannySetupContext("_get_c_dtd", 0);
 
-  /* "lxml/etree.pyx":536
+  /* "lxml/etree.pyx":539
  *     cdef tree.xmlDtd* _get_c_dtd(self):
  *         u"""Return the DTD. Create it if it does not yet exist."""
  *         cdef xmlDoc* c_doc = self._doc._c_doc             # <<<<<<<<<<<<<<
@@ -49518,7 +49595,7 @@ static xmlDtd *__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(struct __pyx_obj_4lxml_5
   __pyx_t_1 = __pyx_v_self->_doc->_c_doc;
   __pyx_v_c_doc = __pyx_t_1;
 
-  /* "lxml/etree.pyx":540
+  /* "lxml/etree.pyx":543
  *         cdef const_xmlChar* c_name
  * 
  *         if c_doc.intSubset:             # <<<<<<<<<<<<<<
@@ -49528,7 +49605,7 @@ static xmlDtd *__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(struct __pyx_obj_4lxml_5
   __pyx_t_2 = (__pyx_v_c_doc->intSubset != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":541
+    /* "lxml/etree.pyx":544
  * 
  *         if c_doc.intSubset:
  *             return c_doc.intSubset             # <<<<<<<<<<<<<<
@@ -49538,7 +49615,7 @@ static xmlDtd *__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(struct __pyx_obj_4lxml_5
     __pyx_r = __pyx_v_c_doc->intSubset;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":540
+    /* "lxml/etree.pyx":543
  *         cdef const_xmlChar* c_name
  * 
  *         if c_doc.intSubset:             # <<<<<<<<<<<<<<
@@ -49547,7 +49624,7 @@ static xmlDtd *__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(struct __pyx_obj_4lxml_5
  */
   }
 
-  /* "lxml/etree.pyx":543
+  /* "lxml/etree.pyx":546
  *             return c_doc.intSubset
  * 
  *         c_root_node = tree.xmlDocGetRootElement(c_doc)             # <<<<<<<<<<<<<<
@@ -49556,7 +49633,7 @@ static xmlDtd *__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(struct __pyx_obj_4lxml_5
  */
   __pyx_v_c_root_node = xmlDocGetRootElement(__pyx_v_c_doc);
 
-  /* "lxml/etree.pyx":544
+  /* "lxml/etree.pyx":547
  * 
  *         c_root_node = tree.xmlDocGetRootElement(c_doc)
  *         c_name = c_root_node.name if c_root_node else NULL             # <<<<<<<<<<<<<<
@@ -49570,7 +49647,7 @@ static xmlDtd *__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(struct __pyx_obj_4lxml_5
   }
   __pyx_v_c_name = __pyx_t_3;
 
-  /* "lxml/etree.pyx":545
+  /* "lxml/etree.pyx":548
  *         c_root_node = tree.xmlDocGetRootElement(c_doc)
  *         c_name = c_root_node.name if c_root_node else NULL
  *         return  tree.xmlCreateIntSubset(c_doc, c_name, NULL, NULL)             # <<<<<<<<<<<<<<
@@ -49580,7 +49657,7 @@ static xmlDtd *__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(struct __pyx_obj_4lxml_5
   __pyx_r = xmlCreateIntSubset(__pyx_v_c_doc, __pyx_v_c_name, NULL, NULL);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":534
+  /* "lxml/etree.pyx":537
  * 
  *     @cython.final
  *     cdef tree.xmlDtd* _get_c_dtd(self):             # <<<<<<<<<<<<<<
@@ -49594,7 +49671,7 @@ static xmlDtd *__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(struct __pyx_obj_4lxml_5
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":547
+/* "lxml/etree.pyx":550
  *         return  tree.xmlCreateIntSubset(c_doc, c_name, NULL, NULL)
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
@@ -49626,7 +49703,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_2clear(struct __pyx_obj_4lxml_5e
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("clear", 0);
 
-  /* "lxml/etree.pyx":549
+  /* "lxml/etree.pyx":552
  *     def clear(self):
  *         u"""Removes DOCTYPE and internal subset from the document."""
  *         cdef xmlDoc* c_doc = self._doc._c_doc             # <<<<<<<<<<<<<<
@@ -49636,7 +49713,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_2clear(struct __pyx_obj_4lxml_5e
   __pyx_t_1 = __pyx_v_self->_doc->_c_doc;
   __pyx_v_c_doc = __pyx_t_1;
 
-  /* "lxml/etree.pyx":550
+  /* "lxml/etree.pyx":553
  *         u"""Removes DOCTYPE and internal subset from the document."""
  *         cdef xmlDoc* c_doc = self._doc._c_doc
  *         cdef tree.xmlNode* c_dtd = <xmlNode*>c_doc.intSubset             # <<<<<<<<<<<<<<
@@ -49645,7 +49722,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_2clear(struct __pyx_obj_4lxml_5e
  */
   __pyx_v_c_dtd = ((xmlNode *)__pyx_v_c_doc->intSubset);
 
-  /* "lxml/etree.pyx":551
+  /* "lxml/etree.pyx":554
  *         cdef xmlDoc* c_doc = self._doc._c_doc
  *         cdef tree.xmlNode* c_dtd = <xmlNode*>c_doc.intSubset
  *         if c_dtd is NULL:             # <<<<<<<<<<<<<<
@@ -49655,7 +49732,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_2clear(struct __pyx_obj_4lxml_5e
   __pyx_t_2 = ((__pyx_v_c_dtd == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":552
+    /* "lxml/etree.pyx":555
  *         cdef tree.xmlNode* c_dtd = <xmlNode*>c_doc.intSubset
  *         if c_dtd is NULL:
  *             return             # <<<<<<<<<<<<<<
@@ -49666,7 +49743,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_2clear(struct __pyx_obj_4lxml_5e
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":551
+    /* "lxml/etree.pyx":554
  *         cdef xmlDoc* c_doc = self._doc._c_doc
  *         cdef tree.xmlNode* c_dtd = <xmlNode*>c_doc.intSubset
  *         if c_dtd is NULL:             # <<<<<<<<<<<<<<
@@ -49675,7 +49752,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_2clear(struct __pyx_obj_4lxml_5e
  */
   }
 
-  /* "lxml/etree.pyx":553
+  /* "lxml/etree.pyx":556
  *         if c_dtd is NULL:
  *             return
  *         tree.xmlUnlinkNode(c_dtd)             # <<<<<<<<<<<<<<
@@ -49684,7 +49761,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_2clear(struct __pyx_obj_4lxml_5e
  */
   xmlUnlinkNode(__pyx_v_c_dtd);
 
-  /* "lxml/etree.pyx":554
+  /* "lxml/etree.pyx":557
  *             return
  *         tree.xmlUnlinkNode(c_dtd)
  *         tree.xmlFreeNode(c_dtd)             # <<<<<<<<<<<<<<
@@ -49693,7 +49770,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_2clear(struct __pyx_obj_4lxml_5e
  */
   xmlFreeNode(__pyx_v_c_dtd);
 
-  /* "lxml/etree.pyx":547
+  /* "lxml/etree.pyx":550
  *         return  tree.xmlCreateIntSubset(c_doc, c_name, NULL, NULL)
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
@@ -49709,7 +49786,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_2clear(struct __pyx_obj_4lxml_5e
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":562
+/* "lxml/etree.pyx":565
  *         exist, setting this variable (even to None) will create one.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -49744,14 +49821,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(struct __pyx_
   PyObject *(*__pyx_t_6)(PyObject *);
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":563
+  /* "lxml/etree.pyx":566
  *         """
  *         def __get__(self):
  *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<<
  *             return public_id
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getdoctype(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getdoctype(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
     PyObject* sequence = __pyx_t_1;
@@ -49763,7 +49840,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(struct __pyx_
     if (unlikely(size != 3)) {
       if (size > 3) __Pyx_RaiseTooManyValuesError(3);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 563, __pyx_L1_error)
+      __PYX_ERR(0, 566, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -49779,17 +49856,17 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(struct __pyx_
     __Pyx_INCREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_t_4);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
+    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
@@ -49799,7 +49876,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(struct __pyx_
     __Pyx_GOTREF(__pyx_t_3);
     index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_4);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 563, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 566, __pyx_L1_error)
     __pyx_t_6 = NULL;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L4_unpacking_done;
@@ -49807,7 +49884,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(struct __pyx_
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_6 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 563, __pyx_L1_error)
+    __PYX_ERR(0, 566, __pyx_L1_error)
     __pyx_L4_unpacking_done:;
   }
   __pyx_v_root_name = __pyx_t_2;
@@ -49817,7 +49894,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(struct __pyx_
   __pyx_v_system_url = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":564
+  /* "lxml/etree.pyx":567
  *         def __get__(self):
  *             root_name, public_id, system_url = self._doc.getdoctype()
  *             return public_id             # <<<<<<<<<<<<<<
@@ -49829,7 +49906,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(struct __pyx_
   __pyx_r = __pyx_v_public_id;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":562
+  /* "lxml/etree.pyx":565
  *         exist, setting this variable (even to None) will create one.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -49855,7 +49932,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(struct __pyx_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":566
+/* "lxml/etree.pyx":569
  *             return public_id
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -49891,7 +49968,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
   __Pyx_RefNannySetupContext("__set__", 0);
   __Pyx_INCREF(__pyx_v_value);
 
-  /* "lxml/etree.pyx":567
+  /* "lxml/etree.pyx":570
  * 
  *         def __set__(self, value):
  *             cdef xmlChar* c_value = NULL             # <<<<<<<<<<<<<<
@@ -49900,7 +49977,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
   __pyx_v_c_value = NULL;
 
-  /* "lxml/etree.pyx":568
+  /* "lxml/etree.pyx":571
  *         def __set__(self, value):
  *             cdef xmlChar* c_value = NULL
  *             if value is not None:             # <<<<<<<<<<<<<<
@@ -49911,7 +49988,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":569
+    /* "lxml/etree.pyx":572
  *             cdef xmlChar* c_value = NULL
  *             if value is not None:
  *                 match = _find_invalid_public_id_characters(value)             # <<<<<<<<<<<<<<
@@ -49930,13 +50007,13 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
       }
     }
     if (!__pyx_t_5) {
-      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_value};
-        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_GOTREF(__pyx_t_3);
       } else
@@ -49944,19 +50021,19 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_value};
-        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_GOTREF(__pyx_t_3);
       } else
       #endif
       {
-        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 569, __pyx_L1_error)
+        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
         __Pyx_INCREF(__pyx_v_value);
         __Pyx_GIVEREF(__pyx_v_value);
         PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_value);
-        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       }
@@ -49965,44 +50042,44 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
     __pyx_v_match = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":570
+    /* "lxml/etree.pyx":573
  *             if value is not None:
  *                 match = _find_invalid_public_id_characters(value)
  *                 if match:             # <<<<<<<<<<<<<<
  *                     raise ValueError('Invalid character(s) %r in public_id.' % match.group(0))
  *                 value = _utf8(value)
  */
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_match); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 570, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_match); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 573, __pyx_L1_error)
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":571
+      /* "lxml/etree.pyx":574
  *                 match = _find_invalid_public_id_characters(value)
  *                 if match:
  *                     raise ValueError('Invalid character(s) %r in public_id.' % match.group(0))             # <<<<<<<<<<<<<<
  *                 value = _utf8(value)
  *                 c_value = tree.xmlStrdup(_xcstr(value))
  */
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_character_s_r_in_public, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_character_s_r_in_public, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GIVEREF(__pyx_t_3);
       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
       __pyx_t_3 = 0;
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 571, __pyx_L1_error)
+      __PYX_ERR(0, 574, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":570
+      /* "lxml/etree.pyx":573
  *             if value is not None:
  *                 match = _find_invalid_public_id_characters(value)
  *                 if match:             # <<<<<<<<<<<<<<
@@ -50011,19 +50088,19 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
     }
 
-    /* "lxml/etree.pyx":572
+    /* "lxml/etree.pyx":575
  *                 if match:
  *                     raise ValueError('Invalid character(s) %r in public_id.' % match.group(0))
  *                 value = _utf8(value)             # <<<<<<<<<<<<<<
  *                 c_value = tree.xmlStrdup(_xcstr(value))
  *                 if not c_value:
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":573
+    /* "lxml/etree.pyx":576
  *                     raise ValueError('Invalid character(s) %r in public_id.' % match.group(0))
  *                 value = _utf8(value)
  *                 c_value = tree.xmlStrdup(_xcstr(value))             # <<<<<<<<<<<<<<
@@ -50032,7 +50109,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
     __pyx_v_c_value = xmlStrdup((const xmlChar*)PyBytes_AS_STRING(__pyx_v_value));
 
-    /* "lxml/etree.pyx":574
+    /* "lxml/etree.pyx":577
  *                 value = _utf8(value)
  *                 c_value = tree.xmlStrdup(_xcstr(value))
  *                 if not c_value:             # <<<<<<<<<<<<<<
@@ -50042,16 +50119,16 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
     __pyx_t_2 = ((!(__pyx_v_c_value != 0)) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":575
+      /* "lxml/etree.pyx":578
  *                 c_value = tree.xmlStrdup(_xcstr(value))
  *                 if not c_value:
  *                     raise MemoryError()             # <<<<<<<<<<<<<<
  * 
  *             c_dtd = self._get_c_dtd()
  */
-      PyErr_NoMemory(); __PYX_ERR(0, 575, __pyx_L1_error)
+      PyErr_NoMemory(); __PYX_ERR(0, 578, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":574
+      /* "lxml/etree.pyx":577
  *                 value = _utf8(value)
  *                 c_value = tree.xmlStrdup(_xcstr(value))
  *                 if not c_value:             # <<<<<<<<<<<<<<
@@ -50060,7 +50137,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
     }
 
-    /* "lxml/etree.pyx":568
+    /* "lxml/etree.pyx":571
  *         def __set__(self, value):
  *             cdef xmlChar* c_value = NULL
  *             if value is not None:             # <<<<<<<<<<<<<<
@@ -50069,7 +50146,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
   }
 
-  /* "lxml/etree.pyx":577
+  /* "lxml/etree.pyx":580
  *                     raise MemoryError()
  * 
  *             c_dtd = self._get_c_dtd()             # <<<<<<<<<<<<<<
@@ -50078,7 +50155,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
   __pyx_v_c_dtd = __pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(__pyx_v_self);
 
-  /* "lxml/etree.pyx":578
+  /* "lxml/etree.pyx":581
  * 
  *             c_dtd = self._get_c_dtd()
  *             if not c_dtd:             # <<<<<<<<<<<<<<
@@ -50088,7 +50165,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
   __pyx_t_2 = ((!(__pyx_v_c_dtd != 0)) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":579
+    /* "lxml/etree.pyx":582
  *             c_dtd = self._get_c_dtd()
  *             if not c_dtd:
  *                 tree.xmlFree(c_value)             # <<<<<<<<<<<<<<
@@ -50097,16 +50174,16 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
     xmlFree(__pyx_v_c_value);
 
-    /* "lxml/etree.pyx":580
+    /* "lxml/etree.pyx":583
  *             if not c_dtd:
  *                 tree.xmlFree(c_value)
  *                 raise MemoryError()             # <<<<<<<<<<<<<<
  *             if c_dtd.ExternalID:
  *                 tree.xmlFree(<void*>c_dtd.ExternalID)
  */
-    PyErr_NoMemory(); __PYX_ERR(0, 580, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(0, 583, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":578
+    /* "lxml/etree.pyx":581
  * 
  *             c_dtd = self._get_c_dtd()
  *             if not c_dtd:             # <<<<<<<<<<<<<<
@@ -50115,7 +50192,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
   }
 
-  /* "lxml/etree.pyx":581
+  /* "lxml/etree.pyx":584
  *                 tree.xmlFree(c_value)
  *                 raise MemoryError()
  *             if c_dtd.ExternalID:             # <<<<<<<<<<<<<<
@@ -50125,7 +50202,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
   __pyx_t_2 = (__pyx_v_c_dtd->ExternalID != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":582
+    /* "lxml/etree.pyx":585
  *                 raise MemoryError()
  *             if c_dtd.ExternalID:
  *                 tree.xmlFree(<void*>c_dtd.ExternalID)             # <<<<<<<<<<<<<<
@@ -50134,7 +50211,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
     xmlFree(((void *)__pyx_v_c_dtd->ExternalID));
 
-    /* "lxml/etree.pyx":581
+    /* "lxml/etree.pyx":584
  *                 tree.xmlFree(c_value)
  *                 raise MemoryError()
  *             if c_dtd.ExternalID:             # <<<<<<<<<<<<<<
@@ -50143,7 +50220,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
   }
 
-  /* "lxml/etree.pyx":583
+  /* "lxml/etree.pyx":586
  *             if c_dtd.ExternalID:
  *                 tree.xmlFree(<void*>c_dtd.ExternalID)
  *             c_dtd.ExternalID = c_value             # <<<<<<<<<<<<<<
@@ -50152,7 +50229,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
  */
   __pyx_v_c_dtd->ExternalID = __pyx_v_c_value;
 
-  /* "lxml/etree.pyx":566
+  /* "lxml/etree.pyx":569
  *             return public_id
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -50177,7 +50254,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_9public_id_2__set__(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":591
+/* "lxml/etree.pyx":594
  *         exist, setting this variable (even to None) will create one.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -50212,14 +50289,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(struct __py
   PyObject *(*__pyx_t_6)(PyObject *);
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":592
+  /* "lxml/etree.pyx":595
  *         """
  *         def __get__(self):
  *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<<
  *             return system_url
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getdoctype(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getdoctype(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
     PyObject* sequence = __pyx_t_1;
@@ -50231,7 +50308,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(struct __py
     if (unlikely(size != 3)) {
       if (size > 3) __Pyx_RaiseTooManyValuesError(3);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 592, __pyx_L1_error)
+      __PYX_ERR(0, 595, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -50247,17 +50324,17 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(struct __py
     __Pyx_INCREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_t_4);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L1_error)
+    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 595, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
@@ -50267,7 +50344,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(struct __py
     __Pyx_GOTREF(__pyx_t_3);
     index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_4);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
     __pyx_t_6 = NULL;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L4_unpacking_done;
@@ -50275,7 +50352,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(struct __py
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_6 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 592, __pyx_L1_error)
+    __PYX_ERR(0, 595, __pyx_L1_error)
     __pyx_L4_unpacking_done:;
   }
   __pyx_v_root_name = __pyx_t_2;
@@ -50285,7 +50362,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(struct __py
   __pyx_v_system_url = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":593
+  /* "lxml/etree.pyx":596
  *         def __get__(self):
  *             root_name, public_id, system_url = self._doc.getdoctype()
  *             return system_url             # <<<<<<<<<<<<<<
@@ -50297,7 +50374,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(struct __py
   __pyx_r = __pyx_v_system_url;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":591
+  /* "lxml/etree.pyx":594
  *         exist, setting this variable (even to None) will create one.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -50323,7 +50400,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(struct __py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":595
+/* "lxml/etree.pyx":598
  *             return system_url
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -50356,7 +50433,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
   int __pyx_t_4;
   __Pyx_RefNannySetupContext("__set__", 0);
 
-  /* "lxml/etree.pyx":596
+  /* "lxml/etree.pyx":599
  * 
  *         def __set__(self, value):
  *             cdef xmlChar* c_value = NULL             # <<<<<<<<<<<<<<
@@ -50365,7 +50442,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
   __pyx_v_c_value = NULL;
 
-  /* "lxml/etree.pyx":597
+  /* "lxml/etree.pyx":600
  *         def __set__(self, value):
  *             cdef xmlChar* c_value = NULL
  *             if value is not None:             # <<<<<<<<<<<<<<
@@ -50376,52 +50453,52 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":598
+    /* "lxml/etree.pyx":601
  *             cdef xmlChar* c_value = NULL
  *             if value is not None:
  *                 bvalue = _utf8(value)             # <<<<<<<<<<<<<<
  *                 # sys_url may be any valid unicode string that can be
  *                 # enclosed in single quotes or quotes.
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_v_bvalue = ((PyObject*)__pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":601
+    /* "lxml/etree.pyx":604
  *                 # sys_url may be any valid unicode string that can be
  *                 # enclosed in single quotes or quotes.
  *                 if b"'" in bvalue and b'"' in bvalue:             # <<<<<<<<<<<<<<
  *                     raise ValueError(
  *                         'System URL may not contain both single (\') and double quotes (").')
  */
-    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__29, __pyx_v_bvalue, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 601, __pyx_L1_error)
+    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__29, __pyx_v_bvalue, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 604, __pyx_L1_error)
     __pyx_t_4 = (__pyx_t_1 != 0);
     if (__pyx_t_4) {
     } else {
       __pyx_t_2 = __pyx_t_4;
       goto __pyx_L5_bool_binop_done;
     }
-    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__30, __pyx_v_bvalue, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 601, __pyx_L1_error)
+    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__30, __pyx_v_bvalue, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 604, __pyx_L1_error)
     __pyx_t_1 = (__pyx_t_4 != 0);
     __pyx_t_2 = __pyx_t_1;
     __pyx_L5_bool_binop_done:;
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":602
+      /* "lxml/etree.pyx":605
  *                 # enclosed in single quotes or quotes.
  *                 if b"'" in bvalue and b'"' in bvalue:
  *                     raise ValueError(             # <<<<<<<<<<<<<<
  *                         'System URL may not contain both single (\') and double quotes (").')
  *                 c_value = tree.xmlStrdup(_xcstr(bvalue))
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 602, __pyx_L1_error)
+      __PYX_ERR(0, 605, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":601
+      /* "lxml/etree.pyx":604
  *                 # sys_url may be any valid unicode string that can be
  *                 # enclosed in single quotes or quotes.
  *                 if b"'" in bvalue and b'"' in bvalue:             # <<<<<<<<<<<<<<
@@ -50430,7 +50507,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
     }
 
-    /* "lxml/etree.pyx":604
+    /* "lxml/etree.pyx":607
  *                     raise ValueError(
  *                         'System URL may not contain both single (\') and double quotes (").')
  *                 c_value = tree.xmlStrdup(_xcstr(bvalue))             # <<<<<<<<<<<<<<
@@ -50439,7 +50516,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
     __pyx_v_c_value = xmlStrdup((const xmlChar*)PyBytes_AS_STRING(__pyx_v_bvalue));
 
-    /* "lxml/etree.pyx":605
+    /* "lxml/etree.pyx":608
  *                         'System URL may not contain both single (\') and double quotes (").')
  *                 c_value = tree.xmlStrdup(_xcstr(bvalue))
  *                 if not c_value:             # <<<<<<<<<<<<<<
@@ -50449,16 +50526,16 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
     __pyx_t_2 = ((!(__pyx_v_c_value != 0)) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":606
+      /* "lxml/etree.pyx":609
  *                 c_value = tree.xmlStrdup(_xcstr(bvalue))
  *                 if not c_value:
  *                     raise MemoryError()             # <<<<<<<<<<<<<<
  * 
  *             c_dtd = self._get_c_dtd()
  */
-      PyErr_NoMemory(); __PYX_ERR(0, 606, __pyx_L1_error)
+      PyErr_NoMemory(); __PYX_ERR(0, 609, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":605
+      /* "lxml/etree.pyx":608
  *                         'System URL may not contain both single (\') and double quotes (").')
  *                 c_value = tree.xmlStrdup(_xcstr(bvalue))
  *                 if not c_value:             # <<<<<<<<<<<<<<
@@ -50467,7 +50544,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
     }
 
-    /* "lxml/etree.pyx":597
+    /* "lxml/etree.pyx":600
  *         def __set__(self, value):
  *             cdef xmlChar* c_value = NULL
  *             if value is not None:             # <<<<<<<<<<<<<<
@@ -50476,7 +50553,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
   }
 
-  /* "lxml/etree.pyx":608
+  /* "lxml/etree.pyx":611
  *                     raise MemoryError()
  * 
  *             c_dtd = self._get_c_dtd()             # <<<<<<<<<<<<<<
@@ -50485,7 +50562,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
   __pyx_v_c_dtd = __pyx_f_4lxml_5etree_7DocInfo__get_c_dtd(__pyx_v_self);
 
-  /* "lxml/etree.pyx":609
+  /* "lxml/etree.pyx":612
  * 
  *             c_dtd = self._get_c_dtd()
  *             if not c_dtd:             # <<<<<<<<<<<<<<
@@ -50495,7 +50572,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
   __pyx_t_2 = ((!(__pyx_v_c_dtd != 0)) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":610
+    /* "lxml/etree.pyx":613
  *             c_dtd = self._get_c_dtd()
  *             if not c_dtd:
  *                 tree.xmlFree(c_value)             # <<<<<<<<<<<<<<
@@ -50504,16 +50581,16 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
     xmlFree(__pyx_v_c_value);
 
-    /* "lxml/etree.pyx":611
+    /* "lxml/etree.pyx":614
  *             if not c_dtd:
  *                 tree.xmlFree(c_value)
  *                 raise MemoryError()             # <<<<<<<<<<<<<<
  *             if c_dtd.SystemID:
  *                 tree.xmlFree(<void*>c_dtd.SystemID)
  */
-    PyErr_NoMemory(); __PYX_ERR(0, 611, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(0, 614, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":609
+    /* "lxml/etree.pyx":612
  * 
  *             c_dtd = self._get_c_dtd()
  *             if not c_dtd:             # <<<<<<<<<<<<<<
@@ -50522,7 +50599,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
   }
 
-  /* "lxml/etree.pyx":612
+  /* "lxml/etree.pyx":615
  *                 tree.xmlFree(c_value)
  *                 raise MemoryError()
  *             if c_dtd.SystemID:             # <<<<<<<<<<<<<<
@@ -50532,7 +50609,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
   __pyx_t_2 = (__pyx_v_c_dtd->SystemID != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":613
+    /* "lxml/etree.pyx":616
  *                 raise MemoryError()
  *             if c_dtd.SystemID:
  *                 tree.xmlFree(<void*>c_dtd.SystemID)             # <<<<<<<<<<<<<<
@@ -50541,7 +50618,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
     xmlFree(((void *)__pyx_v_c_dtd->SystemID));
 
-    /* "lxml/etree.pyx":612
+    /* "lxml/etree.pyx":615
  *                 tree.xmlFree(c_value)
  *                 raise MemoryError()
  *             if c_dtd.SystemID:             # <<<<<<<<<<<<<<
@@ -50550,7 +50627,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
   }
 
-  /* "lxml/etree.pyx":614
+  /* "lxml/etree.pyx":617
  *             if c_dtd.SystemID:
  *                 tree.xmlFree(<void*>c_dtd.SystemID)
  *             c_dtd.SystemID = c_value             # <<<<<<<<<<<<<<
@@ -50559,7 +50636,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
  */
   __pyx_v_c_dtd->SystemID = __pyx_v_c_value;
 
-  /* "lxml/etree.pyx":595
+  /* "lxml/etree.pyx":598
  *             return system_url
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -50580,7 +50657,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_10system_url_2__set__(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":618
+/* "lxml/etree.pyx":621
  *     property xml_version:
  *         u"Returns the XML version as declared by the document."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -50613,14 +50690,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(struct __p
   PyObject *(*__pyx_t_5)(PyObject *);
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":619
+  /* "lxml/etree.pyx":622
  *         u"Returns the XML version as declared by the document."
  *         def __get__(self):
  *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<<
  *             return xml_version
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getxmlinfo(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getxmlinfo(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
     PyObject* sequence = __pyx_t_1;
@@ -50632,7 +50709,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(struct __p
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 619, __pyx_L1_error)
+      __PYX_ERR(0, 622, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -50645,15 +50722,15 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(struct __p
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error)
+    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
@@ -50661,7 +50738,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(struct __p
     __Pyx_GOTREF(__pyx_t_2);
     index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_3);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 622, __pyx_L1_error)
     __pyx_t_5 = NULL;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L4_unpacking_done;
@@ -50669,7 +50746,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(struct __p
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 619, __pyx_L1_error)
+    __PYX_ERR(0, 622, __pyx_L1_error)
     __pyx_L4_unpacking_done:;
   }
   __pyx_v_xml_version = __pyx_t_2;
@@ -50677,7 +50754,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(struct __p
   __pyx_v_encoding = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "lxml/etree.pyx":620
+  /* "lxml/etree.pyx":623
  *         def __get__(self):
  *             xml_version, encoding = self._doc.getxmlinfo()
  *             return xml_version             # <<<<<<<<<<<<<<
@@ -50689,7 +50766,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(struct __p
   __pyx_r = __pyx_v_xml_version;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":618
+  /* "lxml/etree.pyx":621
  *     property xml_version:
  *         u"Returns the XML version as declared by the document."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -50713,7 +50790,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(struct __p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":624
+/* "lxml/etree.pyx":627
  *     property encoding:
  *         u"Returns the encoding name as declared by the document."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -50746,14 +50823,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(struct __pyx_o
   PyObject *(*__pyx_t_5)(PyObject *);
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":625
+  /* "lxml/etree.pyx":628
  *         u"Returns the encoding name as declared by the document."
  *         def __get__(self):
  *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<<
  *             return encoding
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getxmlinfo(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getxmlinfo(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
     PyObject* sequence = __pyx_t_1;
@@ -50765,7 +50842,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(struct __pyx_o
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 625, __pyx_L1_error)
+      __PYX_ERR(0, 628, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -50778,15 +50855,15 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(struct __pyx_o
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error)
+    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
@@ -50794,7 +50871,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(struct __pyx_o
     __Pyx_GOTREF(__pyx_t_2);
     index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_3);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 625, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 628, __pyx_L1_error)
     __pyx_t_5 = NULL;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L4_unpacking_done;
@@ -50802,7 +50879,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(struct __pyx_o
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 625, __pyx_L1_error)
+    __PYX_ERR(0, 628, __pyx_L1_error)
     __pyx_L4_unpacking_done:;
   }
   __pyx_v_xml_version = __pyx_t_2;
@@ -50810,7 +50887,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(struct __pyx_o
   __pyx_v_encoding = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "lxml/etree.pyx":626
+  /* "lxml/etree.pyx":629
  *         def __get__(self):
  *             xml_version, encoding = self._doc.getxmlinfo()
  *             return encoding             # <<<<<<<<<<<<<<
@@ -50822,7 +50899,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(struct __pyx_o
   __pyx_r = __pyx_v_encoding;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":624
+  /* "lxml/etree.pyx":627
  *     property encoding:
  *         u"Returns the encoding name as declared by the document."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -50846,7 +50923,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(struct __pyx_o
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":636
+/* "lxml/etree.pyx":639
  *         ``standalone`` flag was set to ``'yes'`` or not.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -50873,7 +50950,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10standalone___get__(struct __py
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":637
+  /* "lxml/etree.pyx":640
  *         """
  *         def __get__(self):
  *             return self._doc.isstandalone()             # <<<<<<<<<<<<<<
@@ -50881,13 +50958,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10standalone___get__(struct __py
  *     property URL:
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_isstandalone(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_isstandalone(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":636
+  /* "lxml/etree.pyx":639
  *         ``standalone`` flag was set to ``'yes'`` or not.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -50906,7 +50983,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10standalone___get__(struct __py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":641
+/* "lxml/etree.pyx":644
  *     property URL:
  *         u"The source URL of the document (or None if unknown)."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -50934,7 +51011,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(struct __pyx_obj_4l
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":642
+  /* "lxml/etree.pyx":645
  *         u"The source URL of the document (or None if unknown)."
  *         def __get__(self):
  *             if self._doc._c_doc.URL is NULL:             # <<<<<<<<<<<<<<
@@ -50944,7 +51021,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(struct __pyx_obj_4l
   __pyx_t_1 = ((__pyx_v_self->_doc->_c_doc->URL == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":643
+    /* "lxml/etree.pyx":646
  *         def __get__(self):
  *             if self._doc._c_doc.URL is NULL:
  *                 return None             # <<<<<<<<<<<<<<
@@ -50956,7 +51033,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(struct __pyx_obj_4l
     __pyx_r = Py_None;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":642
+    /* "lxml/etree.pyx":645
  *         u"The source URL of the document (or None if unknown)."
  *         def __get__(self):
  *             if self._doc._c_doc.URL is NULL:             # <<<<<<<<<<<<<<
@@ -50965,7 +51042,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(struct __pyx_obj_4l
  */
   }
 
-  /* "lxml/etree.pyx":644
+  /* "lxml/etree.pyx":647
  *             if self._doc._c_doc.URL is NULL:
  *                 return None
  *             return _decodeFilename(self._doc._c_doc.URL)             # <<<<<<<<<<<<<<
@@ -50973,13 +51050,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(struct __pyx_obj_4l
  *             url = _encodeFilename(url)
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_self->_doc->_c_doc->URL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_self->_doc->_c_doc->URL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":641
+  /* "lxml/etree.pyx":644
  *     property URL:
  *         u"The source URL of the document (or None if unknown)."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -50998,7 +51075,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(struct __pyx_obj_4l
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":645
+/* "lxml/etree.pyx":648
  *                 return None
  *             return _decodeFilename(self._doc._c_doc.URL)
  *         def __set__(self, url):             # <<<<<<<<<<<<<<
@@ -51030,19 +51107,19 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_3URL_2__set__(struct __pyx_obj_4lxml_5
   __Pyx_RefNannySetupContext("__set__", 0);
   __Pyx_INCREF(__pyx_v_url);
 
-  /* "lxml/etree.pyx":646
+  /* "lxml/etree.pyx":649
  *             return _decodeFilename(self._doc._c_doc.URL)
  *         def __set__(self, url):
  *             url = _encodeFilename(url)             # <<<<<<<<<<<<<<
  *             c_oldurl = self._doc._c_doc.URL
  *             if url is None:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":647
+  /* "lxml/etree.pyx":650
  *         def __set__(self, url):
  *             url = _encodeFilename(url)
  *             c_oldurl = self._doc._c_doc.URL             # <<<<<<<<<<<<<<
@@ -51052,7 +51129,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_3URL_2__set__(struct __pyx_obj_4lxml_5
   __pyx_t_2 = __pyx_v_self->_doc->_c_doc->URL;
   __pyx_v_c_oldurl = __pyx_t_2;
 
-  /* "lxml/etree.pyx":648
+  /* "lxml/etree.pyx":651
  *             url = _encodeFilename(url)
  *             c_oldurl = self._doc._c_doc.URL
  *             if url is None:             # <<<<<<<<<<<<<<
@@ -51063,7 +51140,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_3URL_2__set__(struct __pyx_obj_4lxml_5
   __pyx_t_4 = (__pyx_t_3 != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":649
+    /* "lxml/etree.pyx":652
  *             c_oldurl = self._doc._c_doc.URL
  *             if url is None:
  *                 self._doc._c_doc.URL = NULL             # <<<<<<<<<<<<<<
@@ -51072,7 +51149,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_3URL_2__set__(struct __pyx_obj_4lxml_5
  */
     __pyx_v_self->_doc->_c_doc->URL = NULL;
 
-    /* "lxml/etree.pyx":648
+    /* "lxml/etree.pyx":651
  *             url = _encodeFilename(url)
  *             c_oldurl = self._doc._c_doc.URL
  *             if url is None:             # <<<<<<<<<<<<<<
@@ -51082,7 +51159,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_3URL_2__set__(struct __pyx_obj_4lxml_5
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":651
+  /* "lxml/etree.pyx":654
  *                 self._doc._c_doc.URL = NULL
  *             else:
  *                 self._doc._c_doc.URL = tree.xmlStrdup(_xcstr(url))             # <<<<<<<<<<<<<<
@@ -51094,7 +51171,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_3URL_2__set__(struct __pyx_obj_4lxml_5
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":652
+  /* "lxml/etree.pyx":655
  *             else:
  *                 self._doc._c_doc.URL = tree.xmlStrdup(_xcstr(url))
  *             if c_oldurl is not NULL:             # <<<<<<<<<<<<<<
@@ -51104,7 +51181,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_3URL_2__set__(struct __pyx_obj_4lxml_5
   __pyx_t_4 = ((__pyx_v_c_oldurl != NULL) != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":653
+    /* "lxml/etree.pyx":656
  *                 self._doc._c_doc.URL = tree.xmlStrdup(_xcstr(url))
  *             if c_oldurl is not NULL:
  *                 tree.xmlFree(<void*>c_oldurl)             # <<<<<<<<<<<<<<
@@ -51113,7 +51190,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_3URL_2__set__(struct __pyx_obj_4lxml_5
  */
     xmlFree(((void *)__pyx_v_c_oldurl));
 
-    /* "lxml/etree.pyx":652
+    /* "lxml/etree.pyx":655
  *             else:
  *                 self._doc._c_doc.URL = tree.xmlStrdup(_xcstr(url))
  *             if c_oldurl is not NULL:             # <<<<<<<<<<<<<<
@@ -51122,7 +51199,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_3URL_2__set__(struct __pyx_obj_4lxml_5
  */
   }
 
-  /* "lxml/etree.pyx":645
+  /* "lxml/etree.pyx":648
  *                 return None
  *             return _decodeFilename(self._doc._c_doc.URL)
  *         def __set__(self, url):             # <<<<<<<<<<<<<<
@@ -51143,7 +51220,7 @@ static int __pyx_pf_4lxml_5etree_7DocInfo_3URL_2__set__(struct __pyx_obj_4lxml_5
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":657
+/* "lxml/etree.pyx":660
  *     property doctype:
  *         u"Returns a DOCTYPE declaration string for the document."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -51181,14 +51258,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
   int __pyx_t_8;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":658
+  /* "lxml/etree.pyx":661
  *         u"Returns a DOCTYPE declaration string for the document."
  *         def __get__(self):
  *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<<
  *             if system_url:
  *                 # If '"' in system_url, we must escape it with single
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getdoctype(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getdoctype(__pyx_v_self->_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
     PyObject* sequence = __pyx_t_1;
@@ -51200,7 +51277,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
     if (unlikely(size != 3)) {
       if (size > 3) __Pyx_RaiseTooManyValuesError(3);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 658, __pyx_L1_error)
+      __PYX_ERR(0, 661, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -51216,17 +51293,17 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
     __Pyx_INCREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_t_4);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error)
+    __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
@@ -51236,7 +51313,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
     __Pyx_GOTREF(__pyx_t_3);
     index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_4);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 658, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 661, __pyx_L1_error)
     __pyx_t_6 = NULL;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L4_unpacking_done;
@@ -51244,7 +51321,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_6 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 658, __pyx_L1_error)
+    __PYX_ERR(0, 661, __pyx_L1_error)
     __pyx_L4_unpacking_done:;
   }
   __pyx_v_root_name = __pyx_t_2;
@@ -51254,40 +51331,40 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
   __pyx_v_system_url = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":659
+  /* "lxml/etree.pyx":662
  *         def __get__(self):
  *             root_name, public_id, system_url = self._doc.getdoctype()
  *             if system_url:             # <<<<<<<<<<<<<<
  *                 # If '"' in system_url, we must escape it with single
  *                 # quotes, otherwise escape with double quotes. If url
  */
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 659, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 662, __pyx_L1_error)
   if (__pyx_t_7) {
 
-    /* "lxml/etree.pyx":664
+    /* "lxml/etree.pyx":667
  *                 # contains both a single quote and a double quote, XML
  *                 # standard is being violated.
  *                 if '"' in system_url:             # <<<<<<<<<<<<<<
  *                     quoted_system_url = u"'%s'" % system_url
  *                 else:
  */
-    __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__30, __pyx_v_system_url, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 664, __pyx_L1_error)
+    __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__30, __pyx_v_system_url, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 667, __pyx_L1_error)
     __pyx_t_8 = (__pyx_t_7 != 0);
     if (__pyx_t_8) {
 
-      /* "lxml/etree.pyx":665
+      /* "lxml/etree.pyx":668
  *                 # standard is being violated.
  *                 if '"' in system_url:
  *                     quoted_system_url = u"'%s'" % system_url             # <<<<<<<<<<<<<<
  *                 else:
  *                     quoted_system_url = u'"%s"' % system_url
  */
-      __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s, __pyx_v_system_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
+      __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s, __pyx_v_system_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_v_quoted_system_url = ((PyObject*)__pyx_t_1);
       __pyx_t_1 = 0;
 
-      /* "lxml/etree.pyx":664
+      /* "lxml/etree.pyx":667
  *                 # contains both a single quote and a double quote, XML
  *                 # standard is being violated.
  *                 if '"' in system_url:             # <<<<<<<<<<<<<<
@@ -51297,7 +51374,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
       goto __pyx_L6;
     }
 
-    /* "lxml/etree.pyx":667
+    /* "lxml/etree.pyx":670
  *                     quoted_system_url = u"'%s'" % system_url
  *                 else:
  *                     quoted_system_url = u'"%s"' % system_url             # <<<<<<<<<<<<<<
@@ -51305,14 +51382,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
  *                 if system_url:
  */
     /*else*/ {
-      __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_2, __pyx_v_system_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
+      __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_s_2, __pyx_v_system_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_v_quoted_system_url = ((PyObject*)__pyx_t_1);
       __pyx_t_1 = 0;
     }
     __pyx_L6:;
 
-    /* "lxml/etree.pyx":659
+    /* "lxml/etree.pyx":662
  *         def __get__(self):
  *             root_name, public_id, system_url = self._doc.getdoctype()
  *             if system_url:             # <<<<<<<<<<<<<<
@@ -51321,27 +51398,27 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
  */
   }
 
-  /* "lxml/etree.pyx":668
+  /* "lxml/etree.pyx":671
  *                 else:
  *                     quoted_system_url = u'"%s"' % system_url
  *             if public_id:             # <<<<<<<<<<<<<<
  *                 if system_url:
  *                     return u'<!DOCTYPE %s PUBLIC "%s" %s>' % (
  */
-  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 671, __pyx_L1_error)
   if (__pyx_t_8) {
 
-    /* "lxml/etree.pyx":669
+    /* "lxml/etree.pyx":672
  *                     quoted_system_url = u'"%s"' % system_url
  *             if public_id:
  *                 if system_url:             # <<<<<<<<<<<<<<
  *                     return u'<!DOCTYPE %s PUBLIC "%s" %s>' % (
  *                         root_name, public_id, quoted_system_url)
  */
-    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 672, __pyx_L1_error)
     if (__pyx_t_8) {
 
-      /* "lxml/etree.pyx":670
+      /* "lxml/etree.pyx":673
  *             if public_id:
  *                 if system_url:
  *                     return u'<!DOCTYPE %s PUBLIC "%s" %s>' % (             # <<<<<<<<<<<<<<
@@ -51350,15 +51427,15 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
  */
       __Pyx_XDECREF(__pyx_r);
 
-      /* "lxml/etree.pyx":671
+      /* "lxml/etree.pyx":674
  *                 if system_url:
  *                     return u'<!DOCTYPE %s PUBLIC "%s" %s>' % (
  *                         root_name, public_id, quoted_system_url)             # <<<<<<<<<<<<<<
  *                 else:
  *                     return u'<!DOCTYPE %s PUBLIC "%s">' % (
  */
-      if (unlikely(!__pyx_v_quoted_system_url)) { __Pyx_RaiseUnboundLocalError("quoted_system_url"); __PYX_ERR(0, 671, __pyx_L1_error) }
-      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
+      if (unlikely(!__pyx_v_quoted_system_url)) { __Pyx_RaiseUnboundLocalError("quoted_system_url"); __PYX_ERR(0, 674, __pyx_L1_error) }
+      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_INCREF(__pyx_v_root_name);
       __Pyx_GIVEREF(__pyx_v_root_name);
@@ -51370,21 +51447,21 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
       __Pyx_GIVEREF(__pyx_v_quoted_system_url);
       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_quoted_system_url);
 
-      /* "lxml/etree.pyx":670
+      /* "lxml/etree.pyx":673
  *             if public_id:
  *                 if system_url:
  *                     return u'<!DOCTYPE %s PUBLIC "%s" %s>' % (             # <<<<<<<<<<<<<<
  *                         root_name, public_id, quoted_system_url)
  *                 else:
  */
-      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_DOCTYPE_s_PUBLIC_s_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error)
+      __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_DOCTYPE_s_PUBLIC_s_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 673, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_r = __pyx_t_4;
       __pyx_t_4 = 0;
       goto __pyx_L0;
 
-      /* "lxml/etree.pyx":669
+      /* "lxml/etree.pyx":672
  *                     quoted_system_url = u'"%s"' % system_url
  *             if public_id:
  *                 if system_url:             # <<<<<<<<<<<<<<
@@ -51393,7 +51470,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
  */
     }
 
-    /* "lxml/etree.pyx":673
+    /* "lxml/etree.pyx":676
  *                         root_name, public_id, quoted_system_url)
  *                 else:
  *                     return u'<!DOCTYPE %s PUBLIC "%s">' % (             # <<<<<<<<<<<<<<
@@ -51403,14 +51480,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
     /*else*/ {
       __Pyx_XDECREF(__pyx_r);
 
-      /* "lxml/etree.pyx":674
+      /* "lxml/etree.pyx":677
  *                 else:
  *                     return u'<!DOCTYPE %s PUBLIC "%s">' % (
  *                         root_name, public_id)             # <<<<<<<<<<<<<<
  *             elif system_url:
  *                 return u'<!DOCTYPE %s SYSTEM %s>' % (
  */
-      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_v_root_name);
       __Pyx_GIVEREF(__pyx_v_root_name);
@@ -51419,14 +51496,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
       __Pyx_GIVEREF(__pyx_v_public_id);
       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_public_id);
 
-      /* "lxml/etree.pyx":673
+      /* "lxml/etree.pyx":676
  *                         root_name, public_id, quoted_system_url)
  *                 else:
  *                     return u'<!DOCTYPE %s PUBLIC "%s">' % (             # <<<<<<<<<<<<<<
  *                         root_name, public_id)
  *             elif system_url:
  */
-      __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_DOCTYPE_s_PUBLIC_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
+      __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_DOCTYPE_s_PUBLIC_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __pyx_r = __pyx_t_1;
@@ -51434,7 +51511,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
       goto __pyx_L0;
     }
 
-    /* "lxml/etree.pyx":668
+    /* "lxml/etree.pyx":671
  *                 else:
  *                     quoted_system_url = u'"%s"' % system_url
  *             if public_id:             # <<<<<<<<<<<<<<
@@ -51443,17 +51520,17 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
  */
   }
 
-  /* "lxml/etree.pyx":675
+  /* "lxml/etree.pyx":678
  *                     return u'<!DOCTYPE %s PUBLIC "%s">' % (
  *                         root_name, public_id)
  *             elif system_url:             # <<<<<<<<<<<<<<
  *                 return u'<!DOCTYPE %s SYSTEM %s>' % (
  *                     root_name, quoted_system_url)
  */
-  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 675, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 678, __pyx_L1_error)
   if (__pyx_t_8) {
 
-    /* "lxml/etree.pyx":676
+    /* "lxml/etree.pyx":679
  *                         root_name, public_id)
  *             elif system_url:
  *                 return u'<!DOCTYPE %s SYSTEM %s>' % (             # <<<<<<<<<<<<<<
@@ -51462,15 +51539,15 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "lxml/etree.pyx":677
+    /* "lxml/etree.pyx":680
  *             elif system_url:
  *                 return u'<!DOCTYPE %s SYSTEM %s>' % (
  *                     root_name, quoted_system_url)             # <<<<<<<<<<<<<<
  *             elif self._doc.hasdoctype():
  *                 return u'<!DOCTYPE %s>' % root_name
  */
-    if (unlikely(!__pyx_v_quoted_system_url)) { __Pyx_RaiseUnboundLocalError("quoted_system_url"); __PYX_ERR(0, 677, __pyx_L1_error) }
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
+    if (unlikely(!__pyx_v_quoted_system_url)) { __Pyx_RaiseUnboundLocalError("quoted_system_url"); __PYX_ERR(0, 680, __pyx_L1_error) }
+    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_INCREF(__pyx_v_root_name);
     __Pyx_GIVEREF(__pyx_v_root_name);
@@ -51479,21 +51556,21 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
     __Pyx_GIVEREF(__pyx_v_quoted_system_url);
     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_quoted_system_url);
 
-    /* "lxml/etree.pyx":676
+    /* "lxml/etree.pyx":679
  *                         root_name, public_id)
  *             elif system_url:
  *                 return u'<!DOCTYPE %s SYSTEM %s>' % (             # <<<<<<<<<<<<<<
  *                     root_name, quoted_system_url)
  *             elif self._doc.hasdoctype():
  */
-    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_DOCTYPE_s_SYSTEM_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error)
+    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_DOCTYPE_s_SYSTEM_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_r = __pyx_t_4;
     __pyx_t_4 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":675
+    /* "lxml/etree.pyx":678
  *                     return u'<!DOCTYPE %s PUBLIC "%s">' % (
  *                         root_name, public_id)
  *             elif system_url:             # <<<<<<<<<<<<<<
@@ -51502,7 +51579,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
  */
   }
 
-  /* "lxml/etree.pyx":678
+  /* "lxml/etree.pyx":681
  *                 return u'<!DOCTYPE %s SYSTEM %s>' % (
  *                     root_name, quoted_system_url)
  *             elif self._doc.hasdoctype():             # <<<<<<<<<<<<<<
@@ -51512,7 +51589,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
   __pyx_t_8 = (__pyx_f_4lxml_5etree_9_Document_hasdoctype(__pyx_v_self->_doc) != 0);
   if (__pyx_t_8) {
 
-    /* "lxml/etree.pyx":679
+    /* "lxml/etree.pyx":682
  *                     root_name, quoted_system_url)
  *             elif self._doc.hasdoctype():
  *                 return u'<!DOCTYPE %s>' % root_name             # <<<<<<<<<<<<<<
@@ -51520,13 +51597,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
  *                 return u""
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_DOCTYPE_s, __pyx_v_root_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error)
+    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_DOCTYPE_s, __pyx_v_root_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_r = __pyx_t_4;
     __pyx_t_4 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":678
+    /* "lxml/etree.pyx":681
  *                 return u'<!DOCTYPE %s SYSTEM %s>' % (
  *                     root_name, quoted_system_url)
  *             elif self._doc.hasdoctype():             # <<<<<<<<<<<<<<
@@ -51535,7 +51612,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
  */
   }
 
-  /* "lxml/etree.pyx":681
+  /* "lxml/etree.pyx":684
  *                 return u'<!DOCTYPE %s>' % root_name
  *             else:
  *                 return u""             # <<<<<<<<<<<<<<
@@ -51549,7 +51626,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
     goto __pyx_L0;
   }
 
-  /* "lxml/etree.pyx":657
+  /* "lxml/etree.pyx":660
  *     property doctype:
  *         u"Returns a DOCTYPE declaration string for the document."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -51576,7 +51653,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":685
+/* "lxml/etree.pyx":688
  *     property internalDTD:
  *         u"Returns a DTD validator based on the internal subset of the document."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -51603,7 +51680,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11internalDTD___get__(struct __p
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":686
+  /* "lxml/etree.pyx":689
  *         u"Returns a DTD validator based on the internal subset of the document."
  *         def __get__(self):
  *             return _dtdFactory(self._doc._c_doc.intSubset)             # <<<<<<<<<<<<<<
@@ -51611,13 +51688,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11internalDTD___get__(struct __p
  *     property externalDTD:
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__dtdFactory(__pyx_v_self->_doc->_c_doc->intSubset)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__dtdFactory(__pyx_v_self->_doc->_c_doc->intSubset)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":685
+  /* "lxml/etree.pyx":688
  *     property internalDTD:
  *         u"Returns a DTD validator based on the internal subset of the document."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -51636,7 +51713,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11internalDTD___get__(struct __p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":690
+/* "lxml/etree.pyx":693
  *     property externalDTD:
  *         u"Returns a DTD validator based on the external subset of the document."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -51663,7 +51740,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11externalDTD___get__(struct __p
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":691
+  /* "lxml/etree.pyx":694
  *         u"Returns a DTD validator based on the external subset of the document."
  *         def __get__(self):
  *             return _dtdFactory(self._doc._c_doc.extSubset)             # <<<<<<<<<<<<<<
@@ -51671,13 +51748,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11externalDTD___get__(struct __p
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__dtdFactory(__pyx_v_self->_doc->_c_doc->extSubset)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__dtdFactory(__pyx_v_self->_doc->_c_doc->extSubset)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":690
+  /* "lxml/etree.pyx":693
  *     property externalDTD:
  *         u"Returns a DTD validator based on the external subset of the document."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -51696,7 +51773,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11externalDTD___get__(struct __p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":707
+/* "lxml/etree.pyx":710
  *     cdef object _tag
  * 
  *     def _init(self):             # <<<<<<<<<<<<<<
@@ -51731,7 +51808,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element__init(CYTHON_UNUSED struct Lxml
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":714
+/* "lxml/etree.pyx":717
  *         """
  * 
  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
@@ -51756,7 +51833,7 @@ static void __pyx_pf_4lxml_5etree_8_Element_2__dealloc__(struct LxmlElement *__p
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("__dealloc__", 0);
 
-  /* "lxml/etree.pyx":717
+  /* "lxml/etree.pyx":720
  *         #print "trying to free node:", <int>self._c_node
  *         #displayNode(self._c_node, 0)
  *         if self._c_node is not NULL:             # <<<<<<<<<<<<<<
@@ -51766,16 +51843,16 @@ static void __pyx_pf_4lxml_5etree_8_Element_2__dealloc__(struct LxmlElement *__p
   __pyx_t_1 = ((__pyx_v_self->_c_node != NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":718
+    /* "lxml/etree.pyx":721
  *         #displayNode(self._c_node, 0)
  *         if self._c_node is not NULL:
  *             _unregisterProxy(self)             # <<<<<<<<<<<<<<
  *             attemptDeallocation(self._c_node)
  * 
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree__unregisterProxy(__pyx_v_self); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 718, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__unregisterProxy(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 721, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":719
+    /* "lxml/etree.pyx":722
  *         if self._c_node is not NULL:
  *             _unregisterProxy(self)
  *             attemptDeallocation(self._c_node)             # <<<<<<<<<<<<<<
@@ -51784,7 +51861,7 @@ static void __pyx_pf_4lxml_5etree_8_Element_2__dealloc__(struct LxmlElement *__p
  */
     __pyx_f_4lxml_5etree_attemptDeallocation(__pyx_v_self->_c_node);
 
-    /* "lxml/etree.pyx":717
+    /* "lxml/etree.pyx":720
  *         #print "trying to free node:", <int>self._c_node
  *         #displayNode(self._c_node, 0)
  *         if self._c_node is not NULL:             # <<<<<<<<<<<<<<
@@ -51793,7 +51870,7 @@ static void __pyx_pf_4lxml_5etree_8_Element_2__dealloc__(struct LxmlElement *__p
  */
   }
 
-  /* "lxml/etree.pyx":714
+  /* "lxml/etree.pyx":717
  *         """
  * 
  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
@@ -51809,7 +51886,7 @@ static void __pyx_pf_4lxml_5etree_8_Element_2__dealloc__(struct LxmlElement *__p
   __Pyx_RefNannyFinishContext();
 }
 
-/* "lxml/etree.pyx":723
+/* "lxml/etree.pyx":726
  *     # MANIPULATORS
  * 
  *     def __setitem__(self, x, value):             # <<<<<<<<<<<<<<
@@ -51853,7 +51930,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
   xmlNode *__pyx_t_7;
   __Pyx_RefNannySetupContext("__setitem__", 0);
 
-  /* "lxml/etree.pyx":728
+  /* "lxml/etree.pyx":731
  *         Replaces the given subelement index or slice.
  *         """
  *         cdef xmlNode* c_node = NULL             # <<<<<<<<<<<<<<
@@ -51862,7 +51939,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  */
   __pyx_v_c_node = NULL;
 
-  /* "lxml/etree.pyx":733
+  /* "lxml/etree.pyx":736
  *         cdef _Element element
  *         cdef bint left_to_right
  *         cdef Py_ssize_t slicelength = 0, step = 0             # <<<<<<<<<<<<<<
@@ -51872,16 +51949,16 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
   __pyx_v_slicelength = 0;
   __pyx_v_step = 0;
 
-  /* "lxml/etree.pyx":734
+  /* "lxml/etree.pyx":737
  *         cdef bint left_to_right
  *         cdef Py_ssize_t slicelength = 0, step = 0
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         if value is None:
  *             raise ValueError, u"cannot assign None"
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 734, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 737, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":735
+  /* "lxml/etree.pyx":738
  *         cdef Py_ssize_t slicelength = 0, step = 0
  *         _assertValidNode(self)
  *         if value is None:             # <<<<<<<<<<<<<<
@@ -51892,7 +51969,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":736
+    /* "lxml/etree.pyx":739
  *         _assertValidNode(self)
  *         if value is None:
  *             raise ValueError, u"cannot assign None"             # <<<<<<<<<<<<<<
@@ -51900,9 +51977,9 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  *             # slice assignment
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_cannot_assign_None, 0, 0);
-    __PYX_ERR(0, 736, __pyx_L1_error)
+    __PYX_ERR(0, 739, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":735
+    /* "lxml/etree.pyx":738
  *         cdef Py_ssize_t slicelength = 0, step = 0
  *         _assertValidNode(self)
  *         if value is None:             # <<<<<<<<<<<<<<
@@ -51911,7 +51988,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  */
   }
 
-  /* "lxml/etree.pyx":737
+  /* "lxml/etree.pyx":740
  *         if value is None:
  *             raise ValueError, u"cannot assign None"
  *         if isinstance(x, slice):             # <<<<<<<<<<<<<<
@@ -51922,16 +51999,16 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
   __pyx_t_2 = (__pyx_t_3 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":739
+    /* "lxml/etree.pyx":742
  *         if isinstance(x, slice):
  *             # slice assignment
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<<
  *             if step > 0:
  *                 left_to_right = 1
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__findChildSlice(((PyObject*)__pyx_v_x), __pyx_v_self->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 739, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__findChildSlice(((PyObject*)__pyx_v_x), __pyx_v_self->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 742, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":740
+    /* "lxml/etree.pyx":743
  *             # slice assignment
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)
  *             if step > 0:             # <<<<<<<<<<<<<<
@@ -51941,7 +52018,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
     __pyx_t_2 = ((__pyx_v_step > 0) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":741
+      /* "lxml/etree.pyx":744
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)
  *             if step > 0:
  *                 left_to_right = 1             # <<<<<<<<<<<<<<
@@ -51950,7 +52027,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  */
       __pyx_v_left_to_right = 1;
 
-      /* "lxml/etree.pyx":740
+      /* "lxml/etree.pyx":743
  *             # slice assignment
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)
  *             if step > 0:             # <<<<<<<<<<<<<<
@@ -51960,7 +52037,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
       goto __pyx_L5;
     }
 
-    /* "lxml/etree.pyx":743
+    /* "lxml/etree.pyx":746
  *                 left_to_right = 1
  *             else:
  *                 left_to_right = 0             # <<<<<<<<<<<<<<
@@ -51970,7 +52047,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
     /*else*/ {
       __pyx_v_left_to_right = 0;
 
-      /* "lxml/etree.pyx":744
+      /* "lxml/etree.pyx":747
  *             else:
  *                 left_to_right = 0
  *                 step = -step             # <<<<<<<<<<<<<<
@@ -51981,16 +52058,16 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
     }
     __pyx_L5:;
 
-    /* "lxml/etree.pyx":745
+    /* "lxml/etree.pyx":748
  *                 left_to_right = 0
  *                 step = -step
  *             _replaceSlice(self, c_node, slicelength, step, left_to_right, value)             # <<<<<<<<<<<<<<
  *             return
  *         else:
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__replaceSlice(__pyx_v_self, __pyx_v_c_node, __pyx_v_slicelength, __pyx_v_step, __pyx_v_left_to_right, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 745, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__replaceSlice(__pyx_v_self, __pyx_v_c_node, __pyx_v_slicelength, __pyx_v_step, __pyx_v_left_to_right, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 748, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":746
+    /* "lxml/etree.pyx":749
  *                 step = -step
  *             _replaceSlice(self, c_node, slicelength, step, left_to_right, value)
  *             return             # <<<<<<<<<<<<<<
@@ -52000,7 +52077,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
     __pyx_r = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":737
+    /* "lxml/etree.pyx":740
  *         if value is None:
  *             raise ValueError, u"cannot assign None"
  *         if isinstance(x, slice):             # <<<<<<<<<<<<<<
@@ -52009,7 +52086,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  */
   }
 
-  /* "lxml/etree.pyx":749
+  /* "lxml/etree.pyx":752
  *         else:
  *             # otherwise: normal item assignment
  *             element = value             # <<<<<<<<<<<<<<
@@ -52017,32 +52094,32 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  *             c_node = _findChild(self._c_node, x)
  */
   /*else*/ {
-    if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 749, __pyx_L1_error)
+    if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 752, __pyx_L1_error)
     __pyx_t_4 = __pyx_v_value;
     __Pyx_INCREF(__pyx_t_4);
     __pyx_v_element = ((struct LxmlElement *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":750
+    /* "lxml/etree.pyx":753
  *             # otherwise: normal item assignment
  *             element = value
  *             _assertValidNode(element)             # <<<<<<<<<<<<<<
  *             c_node = _findChild(self._c_node, x)
  *             if c_node is NULL:
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 750, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 753, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":751
+    /* "lxml/etree.pyx":754
  *             element = value
  *             _assertValidNode(element)
  *             c_node = _findChild(self._c_node, x)             # <<<<<<<<<<<<<<
  *             if c_node is NULL:
  *                 raise IndexError, u"list index out of range"
  */
-    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 754, __pyx_L1_error)
     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(__pyx_v_self->_c_node, __pyx_t_5);
 
-    /* "lxml/etree.pyx":752
+    /* "lxml/etree.pyx":755
  *             _assertValidNode(element)
  *             c_node = _findChild(self._c_node, x)
  *             if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -52052,7 +52129,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
     __pyx_t_2 = ((__pyx_v_c_node == NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":753
+      /* "lxml/etree.pyx":756
  *             c_node = _findChild(self._c_node, x)
  *             if c_node is NULL:
  *                 raise IndexError, u"list index out of range"             # <<<<<<<<<<<<<<
@@ -52060,9 +52137,9 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  *             c_next = element._c_node.next
  */
       __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_list_index_out_of_range, 0, 0);
-      __PYX_ERR(0, 753, __pyx_L1_error)
+      __PYX_ERR(0, 756, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":752
+      /* "lxml/etree.pyx":755
  *             _assertValidNode(element)
  *             c_node = _findChild(self._c_node, x)
  *             if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -52071,7 +52148,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  */
     }
 
-    /* "lxml/etree.pyx":754
+    /* "lxml/etree.pyx":757
  *             if c_node is NULL:
  *                 raise IndexError, u"list index out of range"
  *             c_source_doc = element._c_node.doc             # <<<<<<<<<<<<<<
@@ -52081,7 +52158,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
     __pyx_t_6 = __pyx_v_element->_c_node->doc;
     __pyx_v_c_source_doc = __pyx_t_6;
 
-    /* "lxml/etree.pyx":755
+    /* "lxml/etree.pyx":758
  *                 raise IndexError, u"list index out of range"
  *             c_source_doc = element._c_node.doc
  *             c_next = element._c_node.next             # <<<<<<<<<<<<<<
@@ -52091,7 +52168,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
     __pyx_t_7 = __pyx_v_element->_c_node->next;
     __pyx_v_c_next = __pyx_t_7;
 
-    /* "lxml/etree.pyx":756
+    /* "lxml/etree.pyx":759
  *             c_source_doc = element._c_node.doc
  *             c_next = element._c_node.next
  *             _removeText(c_node.next)             # <<<<<<<<<<<<<<
@@ -52100,7 +52177,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  */
     __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);
 
-    /* "lxml/etree.pyx":757
+    /* "lxml/etree.pyx":760
  *             c_next = element._c_node.next
  *             _removeText(c_node.next)
  *             tree.xmlReplaceNode(c_node, element._c_node)             # <<<<<<<<<<<<<<
@@ -52109,7 +52186,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  */
     xmlReplaceNode(__pyx_v_c_node, __pyx_v_element->_c_node);
 
-    /* "lxml/etree.pyx":758
+    /* "lxml/etree.pyx":761
  *             _removeText(c_node.next)
  *             tree.xmlReplaceNode(c_node, element._c_node)
  *             _moveTail(c_next, element._c_node)             # <<<<<<<<<<<<<<
@@ -52118,7 +52195,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  */
     __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_element->_c_node);
 
-    /* "lxml/etree.pyx":759
+    /* "lxml/etree.pyx":762
  *             tree.xmlReplaceNode(c_node, element._c_node)
  *             _moveTail(c_next, element._c_node)
  *             moveNodeToDocument(self._doc, c_source_doc, element._c_node)             # <<<<<<<<<<<<<<
@@ -52127,10 +52204,10 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  */
     __pyx_t_4 = ((PyObject *)__pyx_v_self->_doc);
     __Pyx_INCREF(__pyx_t_4);
-    __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 759, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 762, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":760
+    /* "lxml/etree.pyx":763
  *             _moveTail(c_next, element._c_node)
  *             moveNodeToDocument(self._doc, c_source_doc, element._c_node)
  *             if not attemptDeallocation(c_node):             # <<<<<<<<<<<<<<
@@ -52140,7 +52217,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
     __pyx_t_2 = ((!(__pyx_f_4lxml_5etree_attemptDeallocation(__pyx_v_c_node) != 0)) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":761
+      /* "lxml/etree.pyx":764
  *             moveNodeToDocument(self._doc, c_source_doc, element._c_node)
  *             if not attemptDeallocation(c_node):
  *                 moveNodeToDocument(self._doc, c_node.doc, c_node)             # <<<<<<<<<<<<<<
@@ -52149,10 +52226,10 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
  */
       __pyx_t_4 = ((PyObject *)__pyx_v_self->_doc);
       __Pyx_INCREF(__pyx_t_4);
-      __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 761, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 764, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-      /* "lxml/etree.pyx":760
+      /* "lxml/etree.pyx":763
  *             _moveTail(c_next, element._c_node)
  *             moveNodeToDocument(self._doc, c_source_doc, element._c_node)
  *             if not attemptDeallocation(c_node):             # <<<<<<<<<<<<<<
@@ -52162,7 +52239,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
     }
   }
 
-  /* "lxml/etree.pyx":723
+  /* "lxml/etree.pyx":726
  *     # MANIPULATORS
  * 
  *     def __setitem__(self, x, value):             # <<<<<<<<<<<<<<
@@ -52183,7 +52260,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4__setitem__(struct LxmlElement *__py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":763
+/* "lxml/etree.pyx":766
  *                 moveNodeToDocument(self._doc, c_node.doc, c_node)
  * 
  *     def __delitem__(self, x):             # <<<<<<<<<<<<<<
@@ -52223,7 +52300,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
   Py_ssize_t __pyx_t_6;
   __Pyx_RefNannySetupContext("__delitem__", 0);
 
-  /* "lxml/etree.pyx":768
+  /* "lxml/etree.pyx":771
  *         Deletes the given subelement or a slice.
  *         """
  *         cdef xmlNode* c_node = NULL             # <<<<<<<<<<<<<<
@@ -52232,7 +52309,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  */
   __pyx_v_c_node = NULL;
 
-  /* "lxml/etree.pyx":770
+  /* "lxml/etree.pyx":773
  *         cdef xmlNode* c_node = NULL
  *         cdef xmlNode* c_next
  *         cdef Py_ssize_t step = 0, slicelength = 0             # <<<<<<<<<<<<<<
@@ -52242,16 +52319,16 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
   __pyx_v_step = 0;
   __pyx_v_slicelength = 0;
 
-  /* "lxml/etree.pyx":771
+  /* "lxml/etree.pyx":774
  *         cdef xmlNode* c_next
  *         cdef Py_ssize_t step = 0, slicelength = 0
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         if isinstance(x, slice):
  *             # slice deletion
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 771, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":772
+  /* "lxml/etree.pyx":775
  *         cdef Py_ssize_t step = 0, slicelength = 0
  *         _assertValidNode(self)
  *         if isinstance(x, slice):             # <<<<<<<<<<<<<<
@@ -52262,18 +52339,18 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":774
+    /* "lxml/etree.pyx":777
  *         if isinstance(x, slice):
  *             # slice deletion
  *             if _isFullSlice(<slice>x):             # <<<<<<<<<<<<<<
  *                 c_node = self._c_node.children
  *                 if c_node is not NULL:
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__isFullSlice(((PyObject*)__pyx_v_x)); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 774, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__isFullSlice(((PyObject*)__pyx_v_x)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 777, __pyx_L1_error)
     __pyx_t_2 = (__pyx_t_3 != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":775
+      /* "lxml/etree.pyx":778
  *             # slice deletion
  *             if _isFullSlice(<slice>x):
  *                 c_node = self._c_node.children             # <<<<<<<<<<<<<<
@@ -52283,7 +52360,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
       __pyx_t_4 = __pyx_v_self->_c_node->children;
       __pyx_v_c_node = __pyx_t_4;
 
-      /* "lxml/etree.pyx":776
+      /* "lxml/etree.pyx":779
  *             if _isFullSlice(<slice>x):
  *                 c_node = self._c_node.children
  *                 if c_node is not NULL:             # <<<<<<<<<<<<<<
@@ -52293,7 +52370,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
       __pyx_t_2 = ((__pyx_v_c_node != NULL) != 0);
       if (__pyx_t_2) {
 
-        /* "lxml/etree.pyx":777
+        /* "lxml/etree.pyx":780
  *                 c_node = self._c_node.children
  *                 if c_node is not NULL:
  *                     if not _isElement(c_node):             # <<<<<<<<<<<<<<
@@ -52303,7 +52380,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
         __pyx_t_2 = ((!(_isElement(__pyx_v_c_node) != 0)) != 0);
         if (__pyx_t_2) {
 
-          /* "lxml/etree.pyx":778
+          /* "lxml/etree.pyx":781
  *                 if c_node is not NULL:
  *                     if not _isElement(c_node):
  *                         c_node = _nextElement(c_node)             # <<<<<<<<<<<<<<
@@ -52312,7 +52389,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  */
           __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
 
-          /* "lxml/etree.pyx":777
+          /* "lxml/etree.pyx":780
  *                 c_node = self._c_node.children
  *                 if c_node is not NULL:
  *                     if not _isElement(c_node):             # <<<<<<<<<<<<<<
@@ -52321,7 +52398,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  */
         }
 
-        /* "lxml/etree.pyx":779
+        /* "lxml/etree.pyx":782
  *                     if not _isElement(c_node):
  *                         c_node = _nextElement(c_node)
  *                     while c_node is not NULL:             # <<<<<<<<<<<<<<
@@ -52332,7 +52409,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
           __pyx_t_2 = ((__pyx_v_c_node != NULL) != 0);
           if (!__pyx_t_2) break;
 
-          /* "lxml/etree.pyx":780
+          /* "lxml/etree.pyx":783
  *                         c_node = _nextElement(c_node)
  *                     while c_node is not NULL:
  *                         c_next = _nextElement(c_node)             # <<<<<<<<<<<<<<
@@ -52341,7 +52418,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  */
           __pyx_v_c_next = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
 
-          /* "lxml/etree.pyx":781
+          /* "lxml/etree.pyx":784
  *                     while c_node is not NULL:
  *                         c_next = _nextElement(c_node)
  *                         _removeNode(self._doc, c_node)             # <<<<<<<<<<<<<<
@@ -52350,10 +52427,10 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  */
           __pyx_t_5 = ((PyObject *)__pyx_v_self->_doc);
           __Pyx_INCREF(__pyx_t_5);
-          __pyx_t_1 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 781, __pyx_L1_error)
+          __pyx_t_1 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 784, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-          /* "lxml/etree.pyx":782
+          /* "lxml/etree.pyx":785
  *                         c_next = _nextElement(c_node)
  *                         _removeNode(self._doc, c_node)
  *                         c_node = c_next             # <<<<<<<<<<<<<<
@@ -52363,7 +52440,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
           __pyx_v_c_node = __pyx_v_c_next;
         }
 
-        /* "lxml/etree.pyx":776
+        /* "lxml/etree.pyx":779
  *             if _isFullSlice(<slice>x):
  *                 c_node = self._c_node.children
  *                 if c_node is not NULL:             # <<<<<<<<<<<<<<
@@ -52372,7 +52449,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  */
       }
 
-      /* "lxml/etree.pyx":774
+      /* "lxml/etree.pyx":777
  *         if isinstance(x, slice):
  *             # slice deletion
  *             if _isFullSlice(<slice>x):             # <<<<<<<<<<<<<<
@@ -52382,7 +52459,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
       goto __pyx_L4;
     }
 
-    /* "lxml/etree.pyx":784
+    /* "lxml/etree.pyx":787
  *                         c_node = c_next
  *             else:
  *                 _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<<
@@ -52390,9 +52467,9 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  *         else:
  */
     /*else*/ {
-      __pyx_t_1 = __pyx_f_4lxml_5etree__findChildSlice(((PyObject*)__pyx_v_x), __pyx_v_self->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 784, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__findChildSlice(((PyObject*)__pyx_v_x), __pyx_v_self->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 787, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":785
+      /* "lxml/etree.pyx":788
  *             else:
  *                 _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)
  *                 _deleteSlice(self._doc, c_node, slicelength, step)             # <<<<<<<<<<<<<<
@@ -52401,12 +52478,12 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  */
       __pyx_t_5 = ((PyObject *)__pyx_v_self->_doc);
       __Pyx_INCREF(__pyx_t_5);
-      __pyx_t_1 = __pyx_f_4lxml_5etree__deleteSlice(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node, __pyx_v_slicelength, __pyx_v_step); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 785, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__deleteSlice(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node, __pyx_v_slicelength, __pyx_v_step); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 788, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
     __pyx_L4:;
 
-    /* "lxml/etree.pyx":772
+    /* "lxml/etree.pyx":775
  *         cdef Py_ssize_t step = 0, slicelength = 0
  *         _assertValidNode(self)
  *         if isinstance(x, slice):             # <<<<<<<<<<<<<<
@@ -52416,7 +52493,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":788
+  /* "lxml/etree.pyx":791
  *         else:
  *             # item deletion
  *             c_node = _findChild(self._c_node, x)             # <<<<<<<<<<<<<<
@@ -52424,10 +52501,10 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  *                 raise IndexError, u"index out of range: %d" % x
  */
   /*else*/ {
-    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 791, __pyx_L1_error)
     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(__pyx_v_self->_c_node, __pyx_t_6);
 
-    /* "lxml/etree.pyx":789
+    /* "lxml/etree.pyx":792
  *             # item deletion
  *             c_node = _findChild(self._c_node, x)
  *             if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -52437,20 +52514,20 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
     __pyx_t_2 = ((__pyx_v_c_node == NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":790
+      /* "lxml/etree.pyx":793
  *             c_node = _findChild(self._c_node, x)
  *             if c_node is NULL:
  *                 raise IndexError, u"index out of range: %d" % x             # <<<<<<<<<<<<<<
  *             _removeText(c_node.next)
  *             _removeNode(self._doc, c_node)
  */
-      __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_index_out_of_range_d, __pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 790, __pyx_L1_error)
+      __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_index_out_of_range_d, __pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __PYX_ERR(0, 790, __pyx_L1_error)
+      __PYX_ERR(0, 793, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":789
+      /* "lxml/etree.pyx":792
  *             # item deletion
  *             c_node = _findChild(self._c_node, x)
  *             if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -52459,7 +52536,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  */
     }
 
-    /* "lxml/etree.pyx":791
+    /* "lxml/etree.pyx":794
  *             if c_node is NULL:
  *                 raise IndexError, u"index out of range: %d" % x
  *             _removeText(c_node.next)             # <<<<<<<<<<<<<<
@@ -52468,7 +52545,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  */
     __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);
 
-    /* "lxml/etree.pyx":792
+    /* "lxml/etree.pyx":795
  *                 raise IndexError, u"index out of range: %d" % x
  *             _removeText(c_node.next)
  *             _removeNode(self._doc, c_node)             # <<<<<<<<<<<<<<
@@ -52477,12 +52554,12 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
  */
     __pyx_t_5 = ((PyObject *)__pyx_v_self->_doc);
     __Pyx_INCREF(__pyx_t_5);
-    __pyx_t_1 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 792, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 795, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":763
+  /* "lxml/etree.pyx":766
  *                 moveNodeToDocument(self._doc, c_node.doc, c_node)
  * 
  *     def __delitem__(self, x):             # <<<<<<<<<<<<<<
@@ -52502,7 +52579,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_6__delitem__(struct LxmlElement *__py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":794
+/* "lxml/etree.pyx":797
  *             _removeNode(self._doc, c_node)
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
@@ -52533,7 +52610,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_8__deepcopy__(struct LxmlElemen
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__deepcopy__", 0);
 
-  /* "lxml/etree.pyx":796
+  /* "lxml/etree.pyx":799
  *     def __deepcopy__(self, memo):
  *         u"__deepcopy__(self, memo)"
  *         return self.__copy__()             # <<<<<<<<<<<<<<
@@ -52541,7 +52618,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_8__deepcopy__(struct LxmlElemen
  *     def __copy__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 796, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 799, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -52554,10 +52631,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_8__deepcopy__(struct LxmlElemen
     }
   }
   if (__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else {
-    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -52565,7 +52642,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_8__deepcopy__(struct LxmlElemen
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":794
+  /* "lxml/etree.pyx":797
  *             _removeNode(self._doc, c_node)
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
@@ -52586,7 +52663,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_8__deepcopy__(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":798
+/* "lxml/etree.pyx":801
  *         return self.__copy__()
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
@@ -52625,26 +52702,26 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
   xmlNode *__pyx_t_7;
   __Pyx_RefNannySetupContext("__copy__", 0);
 
-  /* "lxml/etree.pyx":803
+  /* "lxml/etree.pyx":806
  *         cdef xmlNode* c_node
  *         cdef _Document new_doc
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         c_doc = _copyDocRoot(self._doc._c_doc, self._c_node) # recursive
  *         new_doc = _documentFactory(c_doc, self._doc._parser)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 803, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 806, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":804
+  /* "lxml/etree.pyx":807
  *         cdef _Document new_doc
  *         _assertValidNode(self)
  *         c_doc = _copyDocRoot(self._doc._c_doc, self._c_node) # recursive             # <<<<<<<<<<<<<<
  *         new_doc = _documentFactory(c_doc, self._doc._parser)
  *         root = new_doc.getroot()
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_self->_doc->_c_doc, __pyx_v_self->_c_node); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(0, 804, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_self->_doc->_c_doc, __pyx_v_self->_c_node); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(0, 807, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_2;
 
-  /* "lxml/etree.pyx":805
+  /* "lxml/etree.pyx":808
  *         _assertValidNode(self)
  *         c_doc = _copyDocRoot(self._doc._c_doc, self._c_node) # recursive
  *         new_doc = _documentFactory(c_doc, self._doc._parser)             # <<<<<<<<<<<<<<
@@ -52653,25 +52730,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
  */
   __pyx_t_3 = ((PyObject *)__pyx_v_self->_doc->_parser);
   __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_3))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error)
+  __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_3))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_new_doc = ((struct LxmlDocument *)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":806
+  /* "lxml/etree.pyx":809
  *         c_doc = _copyDocRoot(self._doc._c_doc, self._c_node) # recursive
  *         new_doc = _documentFactory(c_doc, self._doc._parser)
  *         root = new_doc.getroot()             # <<<<<<<<<<<<<<
  *         if root is not None:
  *             return root
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_new_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_new_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_v_root = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":807
+  /* "lxml/etree.pyx":810
  *         new_doc = _documentFactory(c_doc, self._doc._parser)
  *         root = new_doc.getroot()
  *         if root is not None:             # <<<<<<<<<<<<<<
@@ -52682,7 +52759,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
   __pyx_t_6 = (__pyx_t_5 != 0);
   if (__pyx_t_6) {
 
-    /* "lxml/etree.pyx":808
+    /* "lxml/etree.pyx":811
  *         root = new_doc.getroot()
  *         if root is not None:
  *             return root             # <<<<<<<<<<<<<<
@@ -52694,7 +52771,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
     __pyx_r = __pyx_v_root;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":807
+    /* "lxml/etree.pyx":810
  *         new_doc = _documentFactory(c_doc, self._doc._parser)
  *         root = new_doc.getroot()
  *         if root is not None:             # <<<<<<<<<<<<<<
@@ -52703,7 +52780,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
  */
   }
 
-  /* "lxml/etree.pyx":810
+  /* "lxml/etree.pyx":813
  *             return root
  *         # Comment/PI
  *         c_node = c_doc.children             # <<<<<<<<<<<<<<
@@ -52713,7 +52790,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
   __pyx_t_7 = __pyx_v_c_doc->children;
   __pyx_v_c_node = __pyx_t_7;
 
-  /* "lxml/etree.pyx":811
+  /* "lxml/etree.pyx":814
  *         # Comment/PI
  *         c_node = c_doc.children
  *         while c_node is not NULL and c_node.type != self._c_node.type:             # <<<<<<<<<<<<<<
@@ -52732,7 +52809,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
     __pyx_L6_bool_binop_done:;
     if (!__pyx_t_6) break;
 
-    /* "lxml/etree.pyx":812
+    /* "lxml/etree.pyx":815
  *         c_node = c_doc.children
  *         while c_node is not NULL and c_node.type != self._c_node.type:
  *             c_node = c_node.next             # <<<<<<<<<<<<<<
@@ -52743,7 +52820,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
     __pyx_v_c_node = __pyx_t_7;
   }
 
-  /* "lxml/etree.pyx":813
+  /* "lxml/etree.pyx":816
  *         while c_node is not NULL and c_node.type != self._c_node.type:
  *             c_node = c_node.next
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -52753,7 +52830,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
   __pyx_t_6 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_6) {
 
-    /* "lxml/etree.pyx":814
+    /* "lxml/etree.pyx":817
  *             c_node = c_node.next
  *         if c_node is NULL:
  *             return None             # <<<<<<<<<<<<<<
@@ -52765,7 +52842,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
     __pyx_r = Py_None;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":813
+    /* "lxml/etree.pyx":816
  *         while c_node is not NULL and c_node.type != self._c_node.type:
  *             c_node = c_node.next
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -52774,7 +52851,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
  */
   }
 
-  /* "lxml/etree.pyx":815
+  /* "lxml/etree.pyx":818
  *         if c_node is NULL:
  *             return None
  *         return _elementFactory(new_doc, c_node)             # <<<<<<<<<<<<<<
@@ -52782,13 +52859,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
  *     def set(self, key, value):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_new_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 815, __pyx_L1_error)
+  __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_new_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_r = __pyx_t_4;
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":798
+  /* "lxml/etree.pyx":801
  *         return self.__copy__()
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
@@ -52810,7 +52887,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10__copy__(struct LxmlElement *
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":817
+/* "lxml/etree.pyx":820
  *         return _elementFactory(new_doc, c_node)
  * 
  *     def set(self, key, value):             # <<<<<<<<<<<<<<
@@ -52851,11 +52928,11 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_13set(PyObject *__pyx_v_self, P
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(0, 817, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(0, 820, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 817, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 820, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -52868,7 +52945,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_13set(PyObject *__pyx_v_self, P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 817, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 820, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Element.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -52887,25 +52964,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_12set(struct LxmlElement *__pyx
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("set", 0);
 
-  /* "lxml/etree.pyx":822
+  /* "lxml/etree.pyx":825
  *         Sets an element attribute.
  *         """
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         _setAttributeValue(self, key, value)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 822, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 825, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":823
+  /* "lxml/etree.pyx":826
  *         """
  *         _assertValidNode(self)
  *         _setAttributeValue(self, key, value)             # <<<<<<<<<<<<<<
  * 
  *     def append(self, _Element element not None):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__setAttributeValue(__pyx_v_self, __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 823, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__setAttributeValue(__pyx_v_self, __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 826, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":817
+  /* "lxml/etree.pyx":820
  *         return _elementFactory(new_doc, c_node)
  * 
  *     def set(self, key, value):             # <<<<<<<<<<<<<<
@@ -52925,7 +53002,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_12set(struct LxmlElement *__pyx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":825
+/* "lxml/etree.pyx":828
  *         _setAttributeValue(self, key, value)
  * 
  *     def append(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -52941,7 +53018,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_15append(PyObject *__pyx_v_self
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("append (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 825, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 828, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_8_Element_14append(((struct LxmlElement *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_element));
 
   /* function exit code */
@@ -52959,34 +53036,34 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_14append(struct LxmlElement *__
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("append", 0);
 
-  /* "lxml/etree.pyx":830
+  /* "lxml/etree.pyx":833
  *         Adds a subelement to the end of this element.
  *         """
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         _assertValidNode(element)
  *         _appendChild(self, element)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 830, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 833, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":831
+  /* "lxml/etree.pyx":834
  *         """
  *         _assertValidNode(self)
  *         _assertValidNode(element)             # <<<<<<<<<<<<<<
  *         _appendChild(self, element)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 831, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 834, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":832
+  /* "lxml/etree.pyx":835
  *         _assertValidNode(self)
  *         _assertValidNode(element)
  *         _appendChild(self, element)             # <<<<<<<<<<<<<<
  * 
  *     def addnext(self, _Element element not None):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 832, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 835, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":825
+  /* "lxml/etree.pyx":828
  *         _setAttributeValue(self, key, value)
  * 
  *     def append(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -53006,7 +53083,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_14append(struct LxmlElement *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":834
+/* "lxml/etree.pyx":837
  *         _appendChild(self, element)
  * 
  *     def addnext(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -53022,7 +53099,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_17addnext(PyObject *__pyx_v_sel
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("addnext (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 834, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 837, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_8_Element_16addnext(((struct LxmlElement *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_element));
 
   /* function exit code */
@@ -53042,25 +53119,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_16addnext(struct LxmlElement *_
   int __pyx_t_3;
   __Pyx_RefNannySetupContext("addnext", 0);
 
-  /* "lxml/etree.pyx":844
+  /* "lxml/etree.pyx":847
  *         discarded when adding at the root level.
  *         """
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         _assertValidNode(element)
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 844, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 847, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":845
+  /* "lxml/etree.pyx":848
  *         """
  *         _assertValidNode(self)
  *         _assertValidNode(element)             # <<<<<<<<<<<<<<
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  *             if element._c_node.type != tree.XML_PI_NODE:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 845, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 848, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":846
+  /* "lxml/etree.pyx":849
  *         _assertValidNode(self)
  *         _assertValidNode(element)
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):             # <<<<<<<<<<<<<<
@@ -53078,7 +53155,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_16addnext(struct LxmlElement *_
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":847
+    /* "lxml/etree.pyx":850
  *         _assertValidNode(element)
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  *             if element._c_node.type != tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
@@ -53088,7 +53165,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_16addnext(struct LxmlElement *_
     __pyx_t_2 = ((__pyx_v_element->_c_node->type != XML_PI_NODE) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":848
+      /* "lxml/etree.pyx":851
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  *             if element._c_node.type != tree.XML_PI_NODE:
  *                 if element._c_node.type != tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
@@ -53098,7 +53175,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_16addnext(struct LxmlElement *_
       __pyx_t_2 = ((__pyx_v_element->_c_node->type != XML_COMMENT_NODE) != 0);
       if (__pyx_t_2) {
 
-        /* "lxml/etree.pyx":849
+        /* "lxml/etree.pyx":852
  *             if element._c_node.type != tree.XML_PI_NODE:
  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"             # <<<<<<<<<<<<<<
@@ -53106,9 +53183,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_16addnext(struct LxmlElement *_
  *         _appendSibling(self, element)
  */
         __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Only_processing_instructions_and, 0, 0);
-        __PYX_ERR(0, 849, __pyx_L1_error)
+        __PYX_ERR(0, 852, __pyx_L1_error)
 
-        /* "lxml/etree.pyx":848
+        /* "lxml/etree.pyx":851
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  *             if element._c_node.type != tree.XML_PI_NODE:
  *                 if element._c_node.type != tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
@@ -53117,7 +53194,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_16addnext(struct LxmlElement *_
  */
       }
 
-      /* "lxml/etree.pyx":847
+      /* "lxml/etree.pyx":850
  *         _assertValidNode(element)
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  *             if element._c_node.type != tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
@@ -53126,16 +53203,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_16addnext(struct LxmlElement *_
  */
     }
 
-    /* "lxml/etree.pyx":850
+    /* "lxml/etree.pyx":853
  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
  *             element.tail = None             # <<<<<<<<<<<<<<
  *         _appendSibling(self, element)
  * 
  */
-    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_tail, Py_None) < 0) __PYX_ERR(0, 850, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_tail, Py_None) < 0) __PYX_ERR(0, 853, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":846
+    /* "lxml/etree.pyx":849
  *         _assertValidNode(self)
  *         _assertValidNode(element)
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):             # <<<<<<<<<<<<<<
@@ -53144,16 +53221,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_16addnext(struct LxmlElement *_
  */
   }
 
-  /* "lxml/etree.pyx":851
+  /* "lxml/etree.pyx":854
  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
  *             element.tail = None
  *         _appendSibling(self, element)             # <<<<<<<<<<<<<<
  * 
  *     def addprevious(self, _Element element not None):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__appendSibling(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 851, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__appendSibling(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 854, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":834
+  /* "lxml/etree.pyx":837
  *         _appendChild(self, element)
  * 
  *     def addnext(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -53173,7 +53250,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_16addnext(struct LxmlElement *_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":853
+/* "lxml/etree.pyx":856
  *         _appendSibling(self, element)
  * 
  *     def addprevious(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -53189,7 +53266,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_19addprevious(PyObject *__pyx_v
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("addprevious (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 853, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 856, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_8_Element_18addprevious(((struct LxmlElement *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_element));
 
   /* function exit code */
@@ -53209,25 +53286,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_18addprevious(struct LxmlElemen
   int __pyx_t_3;
   __Pyx_RefNannySetupContext("addprevious", 0);
 
-  /* "lxml/etree.pyx":863
+  /* "lxml/etree.pyx":866
  *         automatically discarded when adding at the root level.
  *         """
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         _assertValidNode(element)
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 863, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 866, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":864
+  /* "lxml/etree.pyx":867
  *         """
  *         _assertValidNode(self)
  *         _assertValidNode(element)             # <<<<<<<<<<<<<<
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  *             if element._c_node.type != tree.XML_PI_NODE:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 864, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 867, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":865
+  /* "lxml/etree.pyx":868
  *         _assertValidNode(self)
  *         _assertValidNode(element)
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):             # <<<<<<<<<<<<<<
@@ -53245,7 +53322,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_18addprevious(struct LxmlElemen
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":866
+    /* "lxml/etree.pyx":869
  *         _assertValidNode(element)
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  *             if element._c_node.type != tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
@@ -53255,7 +53332,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_18addprevious(struct LxmlElemen
     __pyx_t_2 = ((__pyx_v_element->_c_node->type != XML_PI_NODE) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":867
+      /* "lxml/etree.pyx":870
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  *             if element._c_node.type != tree.XML_PI_NODE:
  *                 if element._c_node.type != tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
@@ -53265,7 +53342,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_18addprevious(struct LxmlElemen
       __pyx_t_2 = ((__pyx_v_element->_c_node->type != XML_COMMENT_NODE) != 0);
       if (__pyx_t_2) {
 
-        /* "lxml/etree.pyx":868
+        /* "lxml/etree.pyx":871
  *             if element._c_node.type != tree.XML_PI_NODE:
  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"             # <<<<<<<<<<<<<<
@@ -53273,9 +53350,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_18addprevious(struct LxmlElemen
  *         _prependSibling(self, element)
  */
         __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Only_processing_instructions_and, 0, 0);
-        __PYX_ERR(0, 868, __pyx_L1_error)
+        __PYX_ERR(0, 871, __pyx_L1_error)
 
-        /* "lxml/etree.pyx":867
+        /* "lxml/etree.pyx":870
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  *             if element._c_node.type != tree.XML_PI_NODE:
  *                 if element._c_node.type != tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
@@ -53284,7 +53361,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_18addprevious(struct LxmlElemen
  */
       }
 
-      /* "lxml/etree.pyx":866
+      /* "lxml/etree.pyx":869
  *         _assertValidNode(element)
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
  *             if element._c_node.type != tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
@@ -53293,16 +53370,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_18addprevious(struct LxmlElemen
  */
     }
 
-    /* "lxml/etree.pyx":869
+    /* "lxml/etree.pyx":872
  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
  *             element.tail = None             # <<<<<<<<<<<<<<
  *         _prependSibling(self, element)
  * 
  */
-    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_tail, Py_None) < 0) __PYX_ERR(0, 869, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_tail, Py_None) < 0) __PYX_ERR(0, 872, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":865
+    /* "lxml/etree.pyx":868
  *         _assertValidNode(self)
  *         _assertValidNode(element)
  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):             # <<<<<<<<<<<<<<
@@ -53311,16 +53388,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_18addprevious(struct LxmlElemen
  */
   }
 
-  /* "lxml/etree.pyx":870
+  /* "lxml/etree.pyx":873
  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
  *             element.tail = None
  *         _prependSibling(self, element)             # <<<<<<<<<<<<<<
  * 
  *     def extend(self, elements):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__prependSibling(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 870, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__prependSibling(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 873, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":853
+  /* "lxml/etree.pyx":856
  *         _appendSibling(self, element)
  * 
  *     def addprevious(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -53340,7 +53417,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_18addprevious(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":872
+/* "lxml/etree.pyx":875
  *         _prependSibling(self, element)
  * 
  *     def extend(self, elements):             # <<<<<<<<<<<<<<
@@ -53376,16 +53453,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_20extend(struct LxmlElement *__
   int __pyx_t_7;
   __Pyx_RefNannySetupContext("extend", 0);
 
-  /* "lxml/etree.pyx":878
+  /* "lxml/etree.pyx":881
  *         """
  *         cdef _Element element
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         for element in elements:
  *             if element is None:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 878, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 881, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":879
+  /* "lxml/etree.pyx":882
  *         cdef _Element element
  *         _assertValidNode(self)
  *         for element in elements:             # <<<<<<<<<<<<<<
@@ -53396,26 +53473,26 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_20extend(struct LxmlElement *__
     __pyx_t_2 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
     __pyx_t_4 = NULL;
   } else {
-    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error)
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error)
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_4)) {
       if (likely(PyList_CheckExact(__pyx_t_2))) {
         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 879, __pyx_L1_error)
+        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 882, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 882, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       } else {
         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 879, __pyx_L1_error)
+        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 882, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 882, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       }
@@ -53424,18 +53501,18 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_20extend(struct LxmlElement *__
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 879, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 882, __pyx_L1_error)
         }
         break;
       }
       __Pyx_GOTREF(__pyx_t_5);
     }
-    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 879, __pyx_L1_error)
+    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 882, __pyx_L1_error)
     __Pyx_XDECREF_SET(__pyx_v_element, ((struct LxmlElement *)__pyx_t_5));
     __pyx_t_5 = 0;
 
-    /* "lxml/etree.pyx":880
+    /* "lxml/etree.pyx":883
  *         _assertValidNode(self)
  *         for element in elements:
  *             if element is None:             # <<<<<<<<<<<<<<
@@ -53446,7 +53523,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_20extend(struct LxmlElement *__
     __pyx_t_7 = (__pyx_t_6 != 0);
     if (__pyx_t_7) {
 
-      /* "lxml/etree.pyx":881
+      /* "lxml/etree.pyx":884
  *         for element in elements:
  *             if element is None:
  *                 raise TypeError, u"Node must not be None"             # <<<<<<<<<<<<<<
@@ -53454,9 +53531,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_20extend(struct LxmlElement *__
  *             _appendChild(self, element)
  */
       __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Node_must_not_be_None, 0, 0);
-      __PYX_ERR(0, 881, __pyx_L1_error)
+      __PYX_ERR(0, 884, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":880
+      /* "lxml/etree.pyx":883
  *         _assertValidNode(self)
  *         for element in elements:
  *             if element is None:             # <<<<<<<<<<<<<<
@@ -53465,25 +53542,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_20extend(struct LxmlElement *__
  */
     }
 
-    /* "lxml/etree.pyx":882
+    /* "lxml/etree.pyx":885
  *             if element is None:
  *                 raise TypeError, u"Node must not be None"
  *             _assertValidNode(element)             # <<<<<<<<<<<<<<
  *             _appendChild(self, element)
  * 
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 882, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 885, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":883
+    /* "lxml/etree.pyx":886
  *                 raise TypeError, u"Node must not be None"
  *             _assertValidNode(element)
  *             _appendChild(self, element)             # <<<<<<<<<<<<<<
  * 
  *     def clear(self):
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 883, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 886, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":879
+    /* "lxml/etree.pyx":882
  *         cdef _Element element
  *         _assertValidNode(self)
  *         for element in elements:             # <<<<<<<<<<<<<<
@@ -53493,7 +53570,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_20extend(struct LxmlElement *__
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":872
+  /* "lxml/etree.pyx":875
  *         _prependSibling(self, element)
  * 
  *     def extend(self, elements):             # <<<<<<<<<<<<<<
@@ -53516,7 +53593,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_20extend(struct LxmlElement *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":885
+/* "lxml/etree.pyx":888
  *             _appendChild(self, element)
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
@@ -53553,16 +53630,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("clear", 0);
 
-  /* "lxml/etree.pyx":895
+  /* "lxml/etree.pyx":898
  *         cdef xmlNode* c_node
  *         cdef xmlNode* c_node_next
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         c_node = self._c_node
  *         # remove self.text and self.tail
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 895, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 898, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":896
+  /* "lxml/etree.pyx":899
  *         cdef xmlNode* c_node_next
  *         _assertValidNode(self)
  *         c_node = self._c_node             # <<<<<<<<<<<<<<
@@ -53572,7 +53649,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
   __pyx_t_2 = __pyx_v_self->_c_node;
   __pyx_v_c_node = __pyx_t_2;
 
-  /* "lxml/etree.pyx":898
+  /* "lxml/etree.pyx":901
  *         c_node = self._c_node
  *         # remove self.text and self.tail
  *         _removeText(c_node.children)             # <<<<<<<<<<<<<<
@@ -53581,7 +53658,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
  */
   __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->children);
 
-  /* "lxml/etree.pyx":899
+  /* "lxml/etree.pyx":902
  *         # remove self.text and self.tail
  *         _removeText(c_node.children)
  *         _removeText(c_node.next)             # <<<<<<<<<<<<<<
@@ -53590,7 +53667,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
  */
   __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);
 
-  /* "lxml/etree.pyx":901
+  /* "lxml/etree.pyx":904
  *         _removeText(c_node.next)
  *         # remove all attributes
  *         c_attr = c_node.properties             # <<<<<<<<<<<<<<
@@ -53600,7 +53677,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
   __pyx_t_3 = __pyx_v_c_node->properties;
   __pyx_v_c_attr = __pyx_t_3;
 
-  /* "lxml/etree.pyx":902
+  /* "lxml/etree.pyx":905
  *         # remove all attributes
  *         c_attr = c_node.properties
  *         while c_attr is not NULL:             # <<<<<<<<<<<<<<
@@ -53611,7 +53688,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
     __pyx_t_4 = ((__pyx_v_c_attr != NULL) != 0);
     if (!__pyx_t_4) break;
 
-    /* "lxml/etree.pyx":903
+    /* "lxml/etree.pyx":906
  *         c_attr = c_node.properties
  *         while c_attr is not NULL:
  *             c_attr_next = c_attr.next             # <<<<<<<<<<<<<<
@@ -53621,7 +53698,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
     __pyx_t_3 = __pyx_v_c_attr->next;
     __pyx_v_c_attr_next = __pyx_t_3;
 
-    /* "lxml/etree.pyx":904
+    /* "lxml/etree.pyx":907
  *         while c_attr is not NULL:
  *             c_attr_next = c_attr.next
  *             tree.xmlRemoveProp(c_attr)             # <<<<<<<<<<<<<<
@@ -53630,7 +53707,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
  */
     xmlRemoveProp(__pyx_v_c_attr);
 
-    /* "lxml/etree.pyx":905
+    /* "lxml/etree.pyx":908
  *             c_attr_next = c_attr.next
  *             tree.xmlRemoveProp(c_attr)
  *             c_attr = c_attr_next             # <<<<<<<<<<<<<<
@@ -53640,7 +53717,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
     __pyx_v_c_attr = __pyx_v_c_attr_next;
   }
 
-  /* "lxml/etree.pyx":907
+  /* "lxml/etree.pyx":910
  *             c_attr = c_attr_next
  *         # remove all subelements
  *         c_node = c_node.children             # <<<<<<<<<<<<<<
@@ -53650,7 +53727,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
   __pyx_t_2 = __pyx_v_c_node->children;
   __pyx_v_c_node = __pyx_t_2;
 
-  /* "lxml/etree.pyx":908
+  /* "lxml/etree.pyx":911
  *         # remove all subelements
  *         c_node = c_node.children
  *         if c_node is not NULL:             # <<<<<<<<<<<<<<
@@ -53660,7 +53737,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
   __pyx_t_4 = ((__pyx_v_c_node != NULL) != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":909
+    /* "lxml/etree.pyx":912
  *         c_node = c_node.children
  *         if c_node is not NULL:
  *             if not _isElement(c_node):             # <<<<<<<<<<<<<<
@@ -53670,7 +53747,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
     __pyx_t_4 = ((!(_isElement(__pyx_v_c_node) != 0)) != 0);
     if (__pyx_t_4) {
 
-      /* "lxml/etree.pyx":910
+      /* "lxml/etree.pyx":913
  *         if c_node is not NULL:
  *             if not _isElement(c_node):
  *                 c_node = _nextElement(c_node)             # <<<<<<<<<<<<<<
@@ -53679,7 +53756,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
  */
       __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
 
-      /* "lxml/etree.pyx":909
+      /* "lxml/etree.pyx":912
  *         c_node = c_node.children
  *         if c_node is not NULL:
  *             if not _isElement(c_node):             # <<<<<<<<<<<<<<
@@ -53688,7 +53765,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
  */
     }
 
-    /* "lxml/etree.pyx":911
+    /* "lxml/etree.pyx":914
  *             if not _isElement(c_node):
  *                 c_node = _nextElement(c_node)
  *             while c_node is not NULL:             # <<<<<<<<<<<<<<
@@ -53699,7 +53776,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
       __pyx_t_4 = ((__pyx_v_c_node != NULL) != 0);
       if (!__pyx_t_4) break;
 
-      /* "lxml/etree.pyx":912
+      /* "lxml/etree.pyx":915
  *                 c_node = _nextElement(c_node)
  *             while c_node is not NULL:
  *                 c_node_next = _nextElement(c_node)             # <<<<<<<<<<<<<<
@@ -53708,7 +53785,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
  */
       __pyx_v_c_node_next = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
 
-      /* "lxml/etree.pyx":913
+      /* "lxml/etree.pyx":916
  *             while c_node is not NULL:
  *                 c_node_next = _nextElement(c_node)
  *                 _removeNode(self._doc, c_node)             # <<<<<<<<<<<<<<
@@ -53717,10 +53794,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
  */
       __pyx_t_5 = ((PyObject *)__pyx_v_self->_doc);
       __Pyx_INCREF(__pyx_t_5);
-      __pyx_t_1 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 913, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 916, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "lxml/etree.pyx":914
+      /* "lxml/etree.pyx":917
  *                 c_node_next = _nextElement(c_node)
  *                 _removeNode(self._doc, c_node)
  *                 c_node = c_node_next             # <<<<<<<<<<<<<<
@@ -53730,7 +53807,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
       __pyx_v_c_node = __pyx_v_c_node_next;
     }
 
-    /* "lxml/etree.pyx":908
+    /* "lxml/etree.pyx":911
  *         # remove all subelements
  *         c_node = c_node.children
  *         if c_node is not NULL:             # <<<<<<<<<<<<<<
@@ -53739,7 +53816,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
  */
   }
 
-  /* "lxml/etree.pyx":885
+  /* "lxml/etree.pyx":888
  *             _appendChild(self, element)
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
@@ -53760,7 +53837,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_22clear(struct LxmlElement *__p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":916
+/* "lxml/etree.pyx":919
  *                 c_node = c_node_next
  * 
  *     def insert(self, index, _Element element not None):             # <<<<<<<<<<<<<<
@@ -53801,11 +53878,11 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_25insert(PyObject *__pyx_v_self
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_element)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(0, 916, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(0, 919, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(0, 916, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(0, 919, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -53818,13 +53895,13 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_25insert(PyObject *__pyx_v_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 916, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 919, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Element.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 916, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 919, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_8_Element_24insert(((struct LxmlElement *)__pyx_v_self), __pyx_v_index, __pyx_v_element);
 
   /* function exit code */
@@ -53850,35 +53927,35 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__
   PyObject *__pyx_t_6 = NULL;
   __Pyx_RefNannySetupContext("insert", 0);
 
-  /* "lxml/etree.pyx":924
+  /* "lxml/etree.pyx":927
  *         cdef xmlNode* c_next
  *         cdef xmlDoc* c_source_doc
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         _assertValidNode(element)
  *         c_node = _findChild(self._c_node, index)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 927, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":925
+  /* "lxml/etree.pyx":928
  *         cdef xmlDoc* c_source_doc
  *         _assertValidNode(self)
  *         _assertValidNode(element)             # <<<<<<<<<<<<<<
  *         c_node = _findChild(self._c_node, index)
  *         if c_node is NULL:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 925, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 928, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":926
+  /* "lxml/etree.pyx":929
  *         _assertValidNode(self)
  *         _assertValidNode(element)
  *         c_node = _findChild(self._c_node, index)             # <<<<<<<<<<<<<<
  *         if c_node is NULL:
  *             _appendChild(self, element)
  */
-  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 926, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L1_error)
   __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(__pyx_v_self->_c_node, __pyx_t_2);
 
-  /* "lxml/etree.pyx":927
+  /* "lxml/etree.pyx":930
  *         _assertValidNode(element)
  *         c_node = _findChild(self._c_node, index)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -53888,16 +53965,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__
   __pyx_t_3 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":928
+    /* "lxml/etree.pyx":931
  *         c_node = _findChild(self._c_node, index)
  *         if c_node is NULL:
  *             _appendChild(self, element)             # <<<<<<<<<<<<<<
  *             return
  *         c_source_doc = c_node.doc
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 928, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_self, __pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 931, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":929
+    /* "lxml/etree.pyx":932
  *         if c_node is NULL:
  *             _appendChild(self, element)
  *             return             # <<<<<<<<<<<<<<
@@ -53908,7 +53985,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":927
+    /* "lxml/etree.pyx":930
  *         _assertValidNode(element)
  *         c_node = _findChild(self._c_node, index)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -53917,7 +53994,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__
  */
   }
 
-  /* "lxml/etree.pyx":930
+  /* "lxml/etree.pyx":933
  *             _appendChild(self, element)
  *             return
  *         c_source_doc = c_node.doc             # <<<<<<<<<<<<<<
@@ -53927,7 +54004,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__
   __pyx_t_4 = __pyx_v_c_node->doc;
   __pyx_v_c_source_doc = __pyx_t_4;
 
-  /* "lxml/etree.pyx":931
+  /* "lxml/etree.pyx":934
  *             return
  *         c_source_doc = c_node.doc
  *         c_next = element._c_node.next             # <<<<<<<<<<<<<<
@@ -53937,7 +54014,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__
   __pyx_t_5 = __pyx_v_element->_c_node->next;
   __pyx_v_c_next = __pyx_t_5;
 
-  /* "lxml/etree.pyx":932
+  /* "lxml/etree.pyx":935
  *         c_source_doc = c_node.doc
  *         c_next = element._c_node.next
  *         tree.xmlAddPrevSibling(c_node, element._c_node)             # <<<<<<<<<<<<<<
@@ -53946,7 +54023,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__
  */
   xmlAddPrevSibling(__pyx_v_c_node, __pyx_v_element->_c_node);
 
-  /* "lxml/etree.pyx":933
+  /* "lxml/etree.pyx":936
  *         c_next = element._c_node.next
  *         tree.xmlAddPrevSibling(c_node, element._c_node)
  *         _moveTail(c_next, element._c_node)             # <<<<<<<<<<<<<<
@@ -53955,7 +54032,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__
  */
   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_element->_c_node);
 
-  /* "lxml/etree.pyx":934
+  /* "lxml/etree.pyx":937
  *         tree.xmlAddPrevSibling(c_node, element._c_node)
  *         _moveTail(c_next, element._c_node)
  *         moveNodeToDocument(self._doc, c_source_doc, element._c_node)             # <<<<<<<<<<<<<<
@@ -53964,10 +54041,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__
  */
   __pyx_t_6 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_6);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_6), __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 934, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_6), __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 937, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":916
+  /* "lxml/etree.pyx":919
  *                 c_node = c_node_next
  * 
  *     def insert(self, index, _Element element not None):             # <<<<<<<<<<<<<<
@@ -53988,7 +54065,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_24insert(struct LxmlElement *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":936
+/* "lxml/etree.pyx":939
  *         moveNodeToDocument(self._doc, c_source_doc, element._c_node)
  * 
  *     def remove(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -54004,7 +54081,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_27remove(PyObject *__pyx_v_self
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("remove (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 936, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 939, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_8_Element_26remove(((struct LxmlElement *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_element));
 
   /* function exit code */
@@ -54027,25 +54104,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_26remove(struct LxmlElement *__
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("remove", 0);
 
-  /* "lxml/etree.pyx":945
+  /* "lxml/etree.pyx":948
  *         cdef xmlNode* c_node
  *         cdef xmlNode* c_next
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         _assertValidNode(element)
  *         c_node = element._c_node
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 945, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 948, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":946
+  /* "lxml/etree.pyx":949
  *         cdef xmlNode* c_next
  *         _assertValidNode(self)
  *         _assertValidNode(element)             # <<<<<<<<<<<<<<
  *         c_node = element._c_node
  *         if c_node.parent is not self._c_node:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 946, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 949, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":947
+  /* "lxml/etree.pyx":950
  *         _assertValidNode(self)
  *         _assertValidNode(element)
  *         c_node = element._c_node             # <<<<<<<<<<<<<<
@@ -54055,7 +54132,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_26remove(struct LxmlElement *__
   __pyx_t_2 = __pyx_v_element->_c_node;
   __pyx_v_c_node = __pyx_t_2;
 
-  /* "lxml/etree.pyx":948
+  /* "lxml/etree.pyx":951
  *         _assertValidNode(element)
  *         c_node = element._c_node
  *         if c_node.parent is not self._c_node:             # <<<<<<<<<<<<<<
@@ -54065,7 +54142,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_26remove(struct LxmlElement *__
   __pyx_t_3 = ((__pyx_v_c_node->parent != __pyx_v_self->_c_node) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":949
+    /* "lxml/etree.pyx":952
  *         c_node = element._c_node
  *         if c_node.parent is not self._c_node:
  *             raise ValueError, u"Element is not a child of this node."             # <<<<<<<<<<<<<<
@@ -54073,9 +54150,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_26remove(struct LxmlElement *__
  *         tree.xmlUnlinkNode(c_node)
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Element_is_not_a_child_of_this_n, 0, 0);
-    __PYX_ERR(0, 949, __pyx_L1_error)
+    __PYX_ERR(0, 952, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":948
+    /* "lxml/etree.pyx":951
  *         _assertValidNode(element)
  *         c_node = element._c_node
  *         if c_node.parent is not self._c_node:             # <<<<<<<<<<<<<<
@@ -54084,7 +54161,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_26remove(struct LxmlElement *__
  */
   }
 
-  /* "lxml/etree.pyx":950
+  /* "lxml/etree.pyx":953
  *         if c_node.parent is not self._c_node:
  *             raise ValueError, u"Element is not a child of this node."
  *         c_next = element._c_node.next             # <<<<<<<<<<<<<<
@@ -54094,7 +54171,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_26remove(struct LxmlElement *__
   __pyx_t_2 = __pyx_v_element->_c_node->next;
   __pyx_v_c_next = __pyx_t_2;
 
-  /* "lxml/etree.pyx":951
+  /* "lxml/etree.pyx":954
  *             raise ValueError, u"Element is not a child of this node."
  *         c_next = element._c_node.next
  *         tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<<
@@ -54103,7 +54180,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_26remove(struct LxmlElement *__
  */
   xmlUnlinkNode(__pyx_v_c_node);
 
-  /* "lxml/etree.pyx":952
+  /* "lxml/etree.pyx":955
  *         c_next = element._c_node.next
  *         tree.xmlUnlinkNode(c_node)
  *         _moveTail(c_next, c_node)             # <<<<<<<<<<<<<<
@@ -54112,7 +54189,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_26remove(struct LxmlElement *__
  */
   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_c_node);
 
-  /* "lxml/etree.pyx":954
+  /* "lxml/etree.pyx":957
  *         _moveTail(c_next, c_node)
  *         # fix namespace declarations
  *         moveNodeToDocument(self._doc, c_node.doc, c_node)             # <<<<<<<<<<<<<<
@@ -54121,10 +54198,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_26remove(struct LxmlElement *__
  */
   __pyx_t_4 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 954, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 957, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":936
+  /* "lxml/etree.pyx":939
  *         moveNodeToDocument(self._doc, c_source_doc, element._c_node)
  * 
  *     def remove(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -54145,7 +54222,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_26remove(struct LxmlElement *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":956
+/* "lxml/etree.pyx":959
  *         moveNodeToDocument(self._doc, c_node.doc, c_node)
  * 
  *     def replace(self, _Element old_element not None,             # <<<<<<<<<<<<<<
@@ -54186,11 +54263,11 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_29replace(PyObject *__pyx_v_sel
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_element)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("replace", 1, 2, 2, 1); __PYX_ERR(0, 956, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("replace", 1, 2, 2, 1); __PYX_ERR(0, 959, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 956, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 959, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -54203,14 +54280,14 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_29replace(PyObject *__pyx_v_sel
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("replace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 956, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("replace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 959, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Element.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_element), __pyx_ptype_4lxml_5etree__Element, 0, "old_element", 0))) __PYX_ERR(0, 956, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_element), __pyx_ptype_4lxml_5etree__Element, 0, "new_element", 0))) __PYX_ERR(0, 957, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_element), __pyx_ptype_4lxml_5etree__Element, 0, "old_element", 0))) __PYX_ERR(0, 959, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_element), __pyx_ptype_4lxml_5etree__Element, 0, "new_element", 0))) __PYX_ERR(0, 960, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_8_Element_28replace(((struct LxmlElement *)__pyx_v_self), __pyx_v_old_element, __pyx_v_new_element);
 
   /* function exit code */
@@ -54237,34 +54314,34 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("replace", 0);
 
-  /* "lxml/etree.pyx":967
+  /* "lxml/etree.pyx":970
  *         cdef xmlNode* c_new_next
  *         cdef xmlDoc* c_source_doc
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         _assertValidNode(old_element)
  *         _assertValidNode(new_element)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 967, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 970, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":968
+  /* "lxml/etree.pyx":971
  *         cdef xmlDoc* c_source_doc
  *         _assertValidNode(self)
  *         _assertValidNode(old_element)             # <<<<<<<<<<<<<<
  *         _assertValidNode(new_element)
  *         c_old_node = old_element._c_node
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_old_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 968, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_old_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 971, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":969
+  /* "lxml/etree.pyx":972
  *         _assertValidNode(self)
  *         _assertValidNode(old_element)
  *         _assertValidNode(new_element)             # <<<<<<<<<<<<<<
  *         c_old_node = old_element._c_node
  *         if c_old_node.parent is not self._c_node:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_new_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 969, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_new_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 972, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":970
+  /* "lxml/etree.pyx":973
  *         _assertValidNode(old_element)
  *         _assertValidNode(new_element)
  *         c_old_node = old_element._c_node             # <<<<<<<<<<<<<<
@@ -54274,7 +54351,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
   __pyx_t_2 = __pyx_v_old_element->_c_node;
   __pyx_v_c_old_node = __pyx_t_2;
 
-  /* "lxml/etree.pyx":971
+  /* "lxml/etree.pyx":974
  *         _assertValidNode(new_element)
  *         c_old_node = old_element._c_node
  *         if c_old_node.parent is not self._c_node:             # <<<<<<<<<<<<<<
@@ -54284,7 +54361,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
   __pyx_t_3 = ((__pyx_v_c_old_node->parent != __pyx_v_self->_c_node) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":972
+    /* "lxml/etree.pyx":975
  *         c_old_node = old_element._c_node
  *         if c_old_node.parent is not self._c_node:
  *             raise ValueError, u"Element is not a child of this node."             # <<<<<<<<<<<<<<
@@ -54292,9 +54369,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
  *         c_new_node = new_element._c_node
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Element_is_not_a_child_of_this_n, 0, 0);
-    __PYX_ERR(0, 972, __pyx_L1_error)
+    __PYX_ERR(0, 975, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":971
+    /* "lxml/etree.pyx":974
  *         _assertValidNode(new_element)
  *         c_old_node = old_element._c_node
  *         if c_old_node.parent is not self._c_node:             # <<<<<<<<<<<<<<
@@ -54303,7 +54380,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
  */
   }
 
-  /* "lxml/etree.pyx":973
+  /* "lxml/etree.pyx":976
  *         if c_old_node.parent is not self._c_node:
  *             raise ValueError, u"Element is not a child of this node."
  *         c_old_next = c_old_node.next             # <<<<<<<<<<<<<<
@@ -54313,7 +54390,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
   __pyx_t_2 = __pyx_v_c_old_node->next;
   __pyx_v_c_old_next = __pyx_t_2;
 
-  /* "lxml/etree.pyx":974
+  /* "lxml/etree.pyx":977
  *             raise ValueError, u"Element is not a child of this node."
  *         c_old_next = c_old_node.next
  *         c_new_node = new_element._c_node             # <<<<<<<<<<<<<<
@@ -54323,7 +54400,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
   __pyx_t_2 = __pyx_v_new_element->_c_node;
   __pyx_v_c_new_node = __pyx_t_2;
 
-  /* "lxml/etree.pyx":975
+  /* "lxml/etree.pyx":978
  *         c_old_next = c_old_node.next
  *         c_new_node = new_element._c_node
  *         c_new_next = c_new_node.next             # <<<<<<<<<<<<<<
@@ -54333,7 +54410,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
   __pyx_t_2 = __pyx_v_c_new_node->next;
   __pyx_v_c_new_next = __pyx_t_2;
 
-  /* "lxml/etree.pyx":976
+  /* "lxml/etree.pyx":979
  *         c_new_node = new_element._c_node
  *         c_new_next = c_new_node.next
  *         c_source_doc = c_new_node.doc             # <<<<<<<<<<<<<<
@@ -54343,7 +54420,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
   __pyx_t_4 = __pyx_v_c_new_node->doc;
   __pyx_v_c_source_doc = __pyx_t_4;
 
-  /* "lxml/etree.pyx":977
+  /* "lxml/etree.pyx":980
  *         c_new_next = c_new_node.next
  *         c_source_doc = c_new_node.doc
  *         tree.xmlReplaceNode(c_old_node, c_new_node)             # <<<<<<<<<<<<<<
@@ -54352,7 +54429,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
  */
   xmlReplaceNode(__pyx_v_c_old_node, __pyx_v_c_new_node);
 
-  /* "lxml/etree.pyx":978
+  /* "lxml/etree.pyx":981
  *         c_source_doc = c_new_node.doc
  *         tree.xmlReplaceNode(c_old_node, c_new_node)
  *         _moveTail(c_new_next, c_new_node)             # <<<<<<<<<<<<<<
@@ -54361,7 +54438,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
  */
   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_new_next, __pyx_v_c_new_node);
 
-  /* "lxml/etree.pyx":979
+  /* "lxml/etree.pyx":982
  *         tree.xmlReplaceNode(c_old_node, c_new_node)
  *         _moveTail(c_new_next, c_new_node)
  *         _moveTail(c_old_next, c_old_node)             # <<<<<<<<<<<<<<
@@ -54370,7 +54447,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
  */
   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_old_next, __pyx_v_c_old_node);
 
-  /* "lxml/etree.pyx":980
+  /* "lxml/etree.pyx":983
  *         _moveTail(c_new_next, c_new_node)
  *         _moveTail(c_old_next, c_old_node)
  *         moveNodeToDocument(self._doc, c_source_doc, c_new_node)             # <<<<<<<<<<<<<<
@@ -54379,10 +54456,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
  */
   __pyx_t_5 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_5);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_source_doc, __pyx_v_c_new_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 980, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_source_doc, __pyx_v_c_new_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 983, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/etree.pyx":982
+  /* "lxml/etree.pyx":985
  *         moveNodeToDocument(self._doc, c_source_doc, c_new_node)
  *         # fix namespace declarations
  *         moveNodeToDocument(self._doc, c_old_node.doc, c_old_node)             # <<<<<<<<<<<<<<
@@ -54391,10 +54468,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
  */
   __pyx_t_5 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_5);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_old_node->doc, __pyx_v_c_old_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 982, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_old_node->doc, __pyx_v_c_old_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 985, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/etree.pyx":956
+  /* "lxml/etree.pyx":959
  *         moveNodeToDocument(self._doc, c_node.doc, c_node)
  * 
  *     def replace(self, _Element old_element not None,             # <<<<<<<<<<<<<<
@@ -54415,7 +54492,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_28replace(struct LxmlElement *_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":988
+/* "lxml/etree.pyx":991
  *         u"""Element tag
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -54445,7 +54522,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(struct LxmlElement
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":989
+  /* "lxml/etree.pyx":992
  *         """
  *         def __get__(self):
  *             if self._tag is not None:             # <<<<<<<<<<<<<<
@@ -54456,7 +54533,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(struct LxmlElement
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":990
+    /* "lxml/etree.pyx":993
  *         def __get__(self):
  *             if self._tag is not None:
  *                 return self._tag             # <<<<<<<<<<<<<<
@@ -54468,7 +54545,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(struct LxmlElement
     __pyx_r = __pyx_v_self->_tag;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":989
+    /* "lxml/etree.pyx":992
  *         """
  *         def __get__(self):
  *             if self._tag is not None:             # <<<<<<<<<<<<<<
@@ -54477,23 +54554,23 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(struct LxmlElement
  */
   }
 
-  /* "lxml/etree.pyx":991
+  /* "lxml/etree.pyx":994
  *             if self._tag is not None:
  *                 return self._tag
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             self._tag = _namespacedName(self._c_node)
  *             return self._tag
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 991, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 994, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":992
+  /* "lxml/etree.pyx":995
  *                 return self._tag
  *             _assertValidNode(self)
  *             self._tag = _namespacedName(self._c_node)             # <<<<<<<<<<<<<<
  *             return self._tag
  * 
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__namespacedName(__pyx_v_self->_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 992, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__namespacedName(__pyx_v_self->_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 995, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_4);
   __Pyx_GOTREF(__pyx_v_self->_tag);
@@ -54501,7 +54578,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(struct LxmlElement
   __pyx_v_self->_tag = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":993
+  /* "lxml/etree.pyx":996
  *             _assertValidNode(self)
  *             self._tag = _namespacedName(self._c_node)
  *             return self._tag             # <<<<<<<<<<<<<<
@@ -54513,7 +54590,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(struct LxmlElement
   __pyx_r = __pyx_v_self->_tag;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":988
+  /* "lxml/etree.pyx":991
  *         u"""Element tag
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -54532,7 +54609,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(struct LxmlElement
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":995
+/* "lxml/etree.pyx":998
  *             return self._tag
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -54568,23 +54645,23 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
   int __pyx_t_7;
   __Pyx_RefNannySetupContext("__set__", 0);
 
-  /* "lxml/etree.pyx":997
+  /* "lxml/etree.pyx":1000
  *         def __set__(self, value):
  *             cdef _BaseParser parser
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             ns, name = _getNsTag(value)
  *             parser = self._doc._parser
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 997, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1000, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":998
+  /* "lxml/etree.pyx":1001
  *             cdef _BaseParser parser
  *             _assertValidNode(self)
  *             ns, name = _getNsTag(value)             # <<<<<<<<<<<<<<
  *             parser = self._doc._parser
  *             if parser is not None and parser._for_html:
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (likely(__pyx_t_2 != Py_None)) {
     PyObject* sequence = __pyx_t_2;
@@ -54596,7 +54673,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 998, __pyx_L1_error)
+      __PYX_ERR(0, 1001, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
@@ -54604,21 +54681,21 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
     __Pyx_INCREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_t_4);
     #else
-    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1001, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1001, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     #endif
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 998, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 1001, __pyx_L1_error)
   }
   __pyx_v_ns = __pyx_t_3;
   __pyx_t_3 = 0;
   __pyx_v_name = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":999
+  /* "lxml/etree.pyx":1002
  *             _assertValidNode(self)
  *             ns, name = _getNsTag(value)
  *             parser = self._doc._parser             # <<<<<<<<<<<<<<
@@ -54630,7 +54707,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
   __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":1000
+  /* "lxml/etree.pyx":1003
  *             ns, name = _getNsTag(value)
  *             parser = self._doc._parser
  *             if parser is not None and parser._for_html:             # <<<<<<<<<<<<<<
@@ -54649,16 +54726,16 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":1001
+    /* "lxml/etree.pyx":1004
  *             parser = self._doc._parser
  *             if parser is not None and parser._for_html:
  *                 _htmlTagValidOrRaise(name)             # <<<<<<<<<<<<<<
  *             else:
  *                 _tagValidOrRaise(name)
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1001, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1004, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":1000
+    /* "lxml/etree.pyx":1003
  *             ns, name = _getNsTag(value)
  *             parser = self._doc._parser
  *             if parser is not None and parser._for_html:             # <<<<<<<<<<<<<<
@@ -54668,7 +54745,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":1003
+  /* "lxml/etree.pyx":1006
  *                 _htmlTagValidOrRaise(name)
  *             else:
  *                 _tagValidOrRaise(name)             # <<<<<<<<<<<<<<
@@ -54676,11 +54753,11 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
  *             tree.xmlNodeSetName(self._c_node, _xcstr(name))
  */
   /*else*/ {
-    __pyx_t_1 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1003, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1006, __pyx_L1_error)
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":1004
+  /* "lxml/etree.pyx":1007
  *             else:
  *                 _tagValidOrRaise(name)
  *             self._tag = value             # <<<<<<<<<<<<<<
@@ -54693,7 +54770,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
   __Pyx_DECREF(__pyx_v_self->_tag);
   __pyx_v_self->_tag = __pyx_v_value;
 
-  /* "lxml/etree.pyx":1005
+  /* "lxml/etree.pyx":1008
  *                 _tagValidOrRaise(name)
  *             self._tag = value
  *             tree.xmlNodeSetName(self._c_node, _xcstr(name))             # <<<<<<<<<<<<<<
@@ -54702,7 +54779,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
  */
   xmlNodeSetName(__pyx_v_self->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_name));
 
-  /* "lxml/etree.pyx":1006
+  /* "lxml/etree.pyx":1009
  *             self._tag = value
  *             tree.xmlNodeSetName(self._c_node, _xcstr(name))
  *             if ns is None:             # <<<<<<<<<<<<<<
@@ -54713,7 +54790,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
   __pyx_t_7 = (__pyx_t_5 != 0);
   if (__pyx_t_7) {
 
-    /* "lxml/etree.pyx":1007
+    /* "lxml/etree.pyx":1010
  *             tree.xmlNodeSetName(self._c_node, _xcstr(name))
  *             if ns is None:
  *                 self._c_node.ns = NULL             # <<<<<<<<<<<<<<
@@ -54722,7 +54799,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
  */
     __pyx_v_self->_c_node->ns = NULL;
 
-    /* "lxml/etree.pyx":1006
+    /* "lxml/etree.pyx":1009
  *             self._tag = value
  *             tree.xmlNodeSetName(self._c_node, _xcstr(name))
  *             if ns is None:             # <<<<<<<<<<<<<<
@@ -54732,7 +54809,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
     goto __pyx_L6;
   }
 
-  /* "lxml/etree.pyx":1009
+  /* "lxml/etree.pyx":1012
  *                 self._c_node.ns = NULL
  *             else:
  *                 self._doc._setNodeNs(self._c_node, _xcstr(ns))             # <<<<<<<<<<<<<<
@@ -54740,11 +54817,11 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
  *     property attrib:
  */
   /*else*/ {
-    __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document__setNodeNs(__pyx_v_self->_doc, __pyx_v_self->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1009, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document__setNodeNs(__pyx_v_self->_doc, __pyx_v_self->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1012, __pyx_L1_error)
   }
   __pyx_L6:;
 
-  /* "lxml/etree.pyx":995
+  /* "lxml/etree.pyx":998
  *             return self._tag
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -54769,7 +54846,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_3tag_2__set__(struct LxmlElement *__p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1015
+/* "lxml/etree.pyx":1018
  *         keys(), values() and items() to access element attributes.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -54797,7 +54874,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6attrib___get__(struct LxmlElem
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1016
+  /* "lxml/etree.pyx":1019
  *         """
  *         def __get__(self):
  *             return _Attrib.__new__(_Attrib, self)             # <<<<<<<<<<<<<<
@@ -54805,19 +54882,19 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6attrib___get__(struct LxmlElem
  *     property text:
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1019, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_2 = __pyx_tp_new_4lxml_5etree__Attrib(((PyTypeObject *)__pyx_ptype_4lxml_5etree__Attrib), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error)
+  __pyx_t_2 = __pyx_tp_new_4lxml_5etree__Attrib(((PyTypeObject *)__pyx_ptype_4lxml_5etree__Attrib), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1019, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1015
+  /* "lxml/etree.pyx":1018
  *         keys(), values() and items() to access element attributes.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -54837,7 +54914,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6attrib___get__(struct LxmlElem
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1022
+/* "lxml/etree.pyx":1025
  *         the value None, if there was no text.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -54865,16 +54942,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4text___get__(struct LxmlElemen
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1023
+  /* "lxml/etree.pyx":1026
  *         """
  *         def __get__(self):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             return _collectText(self._c_node.children)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1023, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1026, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1024
+  /* "lxml/etree.pyx":1027
  *         def __get__(self):
  *             _assertValidNode(self)
  *             return _collectText(self._c_node.children)             # <<<<<<<<<<<<<<
@@ -54882,13 +54959,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4text___get__(struct LxmlElemen
  *         def __set__(self, value):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->_c_node->children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->_c_node->children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1027, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1022
+  /* "lxml/etree.pyx":1025
  *         the value None, if there was no text.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -54907,7 +54984,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4text___get__(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1026
+/* "lxml/etree.pyx":1029
  *             return _collectText(self._c_node.children)
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -54939,16 +55016,16 @@ static int __pyx_pf_4lxml_5etree_8_Element_4text_2__set__(struct LxmlElement *__
   __Pyx_RefNannySetupContext("__set__", 0);
   __Pyx_INCREF(__pyx_v_value);
 
-  /* "lxml/etree.pyx":1027
+  /* "lxml/etree.pyx":1030
  * 
  *         def __set__(self, value):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             if isinstance(value, QName):
  *                 value = _resolveQNameText(self, value).decode('utf8')
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1027, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1030, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1028
+  /* "lxml/etree.pyx":1031
  *         def __set__(self, value):
  *             _assertValidNode(self)
  *             if isinstance(value, QName):             # <<<<<<<<<<<<<<
@@ -54959,26 +55036,26 @@ static int __pyx_pf_4lxml_5etree_8_Element_4text_2__set__(struct LxmlElement *__
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1029
+    /* "lxml/etree.pyx":1032
  *             _assertValidNode(self)
  *             if isinstance(value, QName):
  *                 value = _resolveQNameText(self, value).decode('utf8')             # <<<<<<<<<<<<<<
  *             _setNodeText(self._c_node, value)
  * 
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__resolveQNameText(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__resolveQNameText(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (unlikely(__pyx_t_4 == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
-      __PYX_ERR(0, 1029, __pyx_L1_error)
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
+      __PYX_ERR(0, 1032, __pyx_L1_error)
     }
-    __pyx_t_5 = __Pyx_decode_bytes(__pyx_t_4, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1029, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_decode_bytes(__pyx_t_4, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_5);
     __pyx_t_5 = 0;
 
-    /* "lxml/etree.pyx":1028
+    /* "lxml/etree.pyx":1031
  *         def __set__(self, value):
  *             _assertValidNode(self)
  *             if isinstance(value, QName):             # <<<<<<<<<<<<<<
@@ -54987,16 +55064,16 @@ static int __pyx_pf_4lxml_5etree_8_Element_4text_2__set__(struct LxmlElement *__
  */
   }
 
-  /* "lxml/etree.pyx":1030
+  /* "lxml/etree.pyx":1033
  *             if isinstance(value, QName):
  *                 value = _resolveQNameText(self, value).decode('utf8')
  *             _setNodeText(self._c_node, value)             # <<<<<<<<<<<<<<
  * 
  *         # using 'del el.text' is the wrong thing to do
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_self->_c_node, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1030, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_self->_c_node, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1033, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1026
+  /* "lxml/etree.pyx":1029
  *             return _collectText(self._c_node.children)
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -55018,7 +55095,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4text_2__set__(struct LxmlElement *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1041
+/* "lxml/etree.pyx":1044
  *         there was no text.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -55046,16 +55123,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4tail___get__(struct LxmlElemen
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1042
+  /* "lxml/etree.pyx":1045
  *         """
  *         def __get__(self):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             return _collectText(self._c_node.next)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1042, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1045, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1043
+  /* "lxml/etree.pyx":1046
  *         def __get__(self):
  *             _assertValidNode(self)
  *             return _collectText(self._c_node.next)             # <<<<<<<<<<<<<<
@@ -55063,13 +55140,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4tail___get__(struct LxmlElemen
  *         def __set__(self, value):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->_c_node->next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->_c_node->next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1046, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1041
+  /* "lxml/etree.pyx":1044
  *         there was no text.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -55088,7 +55165,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4tail___get__(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1045
+/* "lxml/etree.pyx":1048
  *             return _collectText(self._c_node.next)
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -55115,25 +55192,25 @@ static int __pyx_pf_4lxml_5etree_8_Element_4tail_2__set__(struct LxmlElement *__
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__set__", 0);
 
-  /* "lxml/etree.pyx":1046
+  /* "lxml/etree.pyx":1049
  * 
  *         def __set__(self, value):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             _setTailText(self._c_node, value)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1046, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1049, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1047
+  /* "lxml/etree.pyx":1050
  *         def __set__(self, value):
  *             _assertValidNode(self)
  *             _setTailText(self._c_node, value)             # <<<<<<<<<<<<<<
  * 
  *         # using 'del el.tail' is the wrong thing to do
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_self->_c_node, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1047, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_self->_c_node, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1050, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1045
+  /* "lxml/etree.pyx":1048
  *             return _collectText(self._c_node.next)
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -55152,7 +55229,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4tail_2__set__(struct LxmlElement *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1057
+/* "lxml/etree.pyx":1060
  *         u"""Namespace prefix or None.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -55180,7 +55257,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(struct LxmlElem
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1058
+  /* "lxml/etree.pyx":1061
  *         """
  *         def __get__(self):
  *             if self._c_node.ns is not NULL:             # <<<<<<<<<<<<<<
@@ -55190,7 +55267,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(struct LxmlElem
   __pyx_t_1 = ((__pyx_v_self->_c_node->ns != NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":1059
+    /* "lxml/etree.pyx":1062
  *         def __get__(self):
  *             if self._c_node.ns is not NULL:
  *                 if self._c_node.ns.prefix is not NULL:             # <<<<<<<<<<<<<<
@@ -55200,7 +55277,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(struct LxmlElem
     __pyx_t_1 = ((__pyx_v_self->_c_node->ns->prefix != NULL) != 0);
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":1060
+      /* "lxml/etree.pyx":1063
  *             if self._c_node.ns is not NULL:
  *                 if self._c_node.ns.prefix is not NULL:
  *                     return funicode(self._c_node.ns.prefix)             # <<<<<<<<<<<<<<
@@ -55208,13 +55285,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(struct LxmlElem
  * 
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->_c_node->ns->prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error)
+      __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->_c_node->ns->prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_r = __pyx_t_2;
       __pyx_t_2 = 0;
       goto __pyx_L0;
 
-      /* "lxml/etree.pyx":1059
+      /* "lxml/etree.pyx":1062
  *         def __get__(self):
  *             if self._c_node.ns is not NULL:
  *                 if self._c_node.ns.prefix is not NULL:             # <<<<<<<<<<<<<<
@@ -55223,7 +55300,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(struct LxmlElem
  */
     }
 
-    /* "lxml/etree.pyx":1058
+    /* "lxml/etree.pyx":1061
  *         """
  *         def __get__(self):
  *             if self._c_node.ns is not NULL:             # <<<<<<<<<<<<<<
@@ -55232,7 +55309,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(struct LxmlElem
  */
   }
 
-  /* "lxml/etree.pyx":1061
+  /* "lxml/etree.pyx":1064
  *                 if self._c_node.ns.prefix is not NULL:
  *                     return funicode(self._c_node.ns.prefix)
  *             return None             # <<<<<<<<<<<<<<
@@ -55244,7 +55321,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(struct LxmlElem
   __pyx_r = Py_None;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1057
+  /* "lxml/etree.pyx":1060
  *         u"""Namespace prefix or None.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -55263,7 +55340,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(struct LxmlElem
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1067
+/* "lxml/etree.pyx":1070
  *         u"""Original line number as found by the parser or None if unknown.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -55293,16 +55370,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(struct Lxm
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1069
+  /* "lxml/etree.pyx":1072
  *         def __get__(self):
  *             cdef long line
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             line = tree.xmlGetLineNo(self._c_node)
  *             return line if line > 0 else None
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1069, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1072, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1070
+  /* "lxml/etree.pyx":1073
  *             cdef long line
  *             _assertValidNode(self)
  *             line = tree.xmlGetLineNo(self._c_node)             # <<<<<<<<<<<<<<
@@ -55311,7 +55388,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(struct Lxm
  */
   __pyx_v_line = xmlGetLineNo(__pyx_v_self->_c_node);
 
-  /* "lxml/etree.pyx":1071
+  /* "lxml/etree.pyx":1074
  *             _assertValidNode(self)
  *             line = tree.xmlGetLineNo(self._c_node)
  *             return line if line > 0 else None             # <<<<<<<<<<<<<<
@@ -55320,7 +55397,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(struct Lxm
  */
   __Pyx_XDECREF(__pyx_r);
   if (((__pyx_v_line > 0) != 0)) {
-    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_2 = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -55332,7 +55409,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(struct Lxm
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1067
+  /* "lxml/etree.pyx":1070
  *         u"""Original line number as found by the parser or None if unknown.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -55352,7 +55429,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(struct Lxm
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1073
+/* "lxml/etree.pyx":1076
  *             return line if line > 0 else None
  * 
  *         def __set__(self, line):             # <<<<<<<<<<<<<<
@@ -55382,28 +55459,28 @@ static int __pyx_pf_4lxml_5etree_8_Element_10sourceline_2__set__(struct LxmlElem
   unsigned short __pyx_t_4;
   __Pyx_RefNannySetupContext("__set__", 0);
 
-  /* "lxml/etree.pyx":1074
+  /* "lxml/etree.pyx":1077
  * 
  *         def __set__(self, line):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             if line <= 0:
  *                 self._c_node.line = 0
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1074, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1077, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1075
+  /* "lxml/etree.pyx":1078
  *         def __set__(self, line):
  *             _assertValidNode(self)
  *             if line <= 0:             # <<<<<<<<<<<<<<
  *                 self._c_node.line = 0
  *             else:
  */
-  __pyx_t_2 = PyObject_RichCompare(__pyx_v_line, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __pyx_L1_error)
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1075, __pyx_L1_error)
+  __pyx_t_2 = PyObject_RichCompare(__pyx_v_line, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1078, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1076
+    /* "lxml/etree.pyx":1079
  *             _assertValidNode(self)
  *             if line <= 0:
  *                 self._c_node.line = 0             # <<<<<<<<<<<<<<
@@ -55412,7 +55489,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_10sourceline_2__set__(struct LxmlElem
  */
     __pyx_v_self->_c_node->line = 0;
 
-    /* "lxml/etree.pyx":1075
+    /* "lxml/etree.pyx":1078
  *         def __set__(self, line):
  *             _assertValidNode(self)
  *             if line <= 0:             # <<<<<<<<<<<<<<
@@ -55422,7 +55499,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_10sourceline_2__set__(struct LxmlElem
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":1078
+  /* "lxml/etree.pyx":1081
  *                 self._c_node.line = 0
  *             else:
  *                 self._c_node.line = line             # <<<<<<<<<<<<<<
@@ -55430,12 +55507,12 @@ static int __pyx_pf_4lxml_5etree_8_Element_10sourceline_2__set__(struct LxmlElem
  *     # not in ElementTree, read-only
  */
   /*else*/ {
-    __pyx_t_4 = __Pyx_PyInt_As_unsigned_short(__pyx_v_line); if (unlikely((__pyx_t_4 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 1078, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyInt_As_unsigned_short(__pyx_v_line); if (unlikely((__pyx_t_4 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L1_error)
     __pyx_v_self->_c_node->line = __pyx_t_4;
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":1073
+  /* "lxml/etree.pyx":1076
  *             return line if line > 0 else None
  * 
  *         def __set__(self, line):             # <<<<<<<<<<<<<<
@@ -55455,7 +55532,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_10sourceline_2__set__(struct LxmlElem
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1088
+/* "lxml/etree.pyx":1091
  *         Note that changing the returned dict has no effect on the Element.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -55491,28 +55568,28 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(struct LxmlEleme
   xmlNs *__pyx_t_6;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1091
+  /* "lxml/etree.pyx":1094
  *             cdef xmlNode* c_node
  *             cdef xmlNs* c_ns
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             nsmap = {}
  *             c_node = self._c_node
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1091, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1094, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1092
+  /* "lxml/etree.pyx":1095
  *             cdef xmlNs* c_ns
  *             _assertValidNode(self)
  *             nsmap = {}             # <<<<<<<<<<<<<<
  *             c_node = self._c_node
  *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
  */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1092, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_v_nsmap = ((PyObject*)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":1093
+  /* "lxml/etree.pyx":1096
  *             _assertValidNode(self)
  *             nsmap = {}
  *             c_node = self._c_node             # <<<<<<<<<<<<<<
@@ -55522,7 +55599,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(struct LxmlEleme
   __pyx_t_3 = __pyx_v_self->_c_node;
   __pyx_v_c_node = __pyx_t_3;
 
-  /* "lxml/etree.pyx":1094
+  /* "lxml/etree.pyx":1097
  *             nsmap = {}
  *             c_node = self._c_node
  *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -55541,7 +55618,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(struct LxmlEleme
     __pyx_L5_bool_binop_done:;
     if (!__pyx_t_4) break;
 
-    /* "lxml/etree.pyx":1095
+    /* "lxml/etree.pyx":1098
  *             c_node = self._c_node
  *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
  *                 c_ns = c_node.nsDef             # <<<<<<<<<<<<<<
@@ -55551,7 +55628,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(struct LxmlEleme
     __pyx_t_6 = __pyx_v_c_node->nsDef;
     __pyx_v_c_ns = __pyx_t_6;
 
-    /* "lxml/etree.pyx":1096
+    /* "lxml/etree.pyx":1099
  *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
  *                 c_ns = c_node.nsDef
  *                 while c_ns is not NULL:             # <<<<<<<<<<<<<<
@@ -55562,42 +55639,42 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(struct LxmlEleme
       __pyx_t_4 = ((__pyx_v_c_ns != NULL) != 0);
       if (!__pyx_t_4) break;
 
-      /* "lxml/etree.pyx":1097
+      /* "lxml/etree.pyx":1100
  *                 c_ns = c_node.nsDef
  *                 while c_ns is not NULL:
  *                     prefix = funicodeOrNone(c_ns.prefix)             # <<<<<<<<<<<<<<
  *                     if prefix not in nsmap:
  *                         nsmap[prefix] = funicodeOrNone(c_ns.href)
  */
-      __pyx_t_2 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_ns->prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1097, __pyx_L1_error)
+      __pyx_t_2 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_ns->prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_2);
       __pyx_t_2 = 0;
 
-      /* "lxml/etree.pyx":1098
+      /* "lxml/etree.pyx":1101
  *                 while c_ns is not NULL:
  *                     prefix = funicodeOrNone(c_ns.prefix)
  *                     if prefix not in nsmap:             # <<<<<<<<<<<<<<
  *                         nsmap[prefix] = funicodeOrNone(c_ns.href)
  *                     c_ns = c_ns.next
  */
-      __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_prefix, __pyx_v_nsmap, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1098, __pyx_L1_error)
+      __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_prefix, __pyx_v_nsmap, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1101, __pyx_L1_error)
       __pyx_t_5 = (__pyx_t_4 != 0);
       if (__pyx_t_5) {
 
-        /* "lxml/etree.pyx":1099
+        /* "lxml/etree.pyx":1102
  *                     prefix = funicodeOrNone(c_ns.prefix)
  *                     if prefix not in nsmap:
  *                         nsmap[prefix] = funicodeOrNone(c_ns.href)             # <<<<<<<<<<<<<<
  *                     c_ns = c_ns.next
  *                 c_node = c_node.parent
  */
-        __pyx_t_2 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_ns->href); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error)
+        __pyx_t_2 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_ns->href); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
-        if (unlikely(PyDict_SetItem(__pyx_v_nsmap, __pyx_v_prefix, __pyx_t_2) < 0)) __PYX_ERR(0, 1099, __pyx_L1_error)
+        if (unlikely(PyDict_SetItem(__pyx_v_nsmap, __pyx_v_prefix, __pyx_t_2) < 0)) __PYX_ERR(0, 1102, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-        /* "lxml/etree.pyx":1098
+        /* "lxml/etree.pyx":1101
  *                 while c_ns is not NULL:
  *                     prefix = funicodeOrNone(c_ns.prefix)
  *                     if prefix not in nsmap:             # <<<<<<<<<<<<<<
@@ -55606,7 +55683,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(struct LxmlEleme
  */
       }
 
-      /* "lxml/etree.pyx":1100
+      /* "lxml/etree.pyx":1103
  *                     if prefix not in nsmap:
  *                         nsmap[prefix] = funicodeOrNone(c_ns.href)
  *                     c_ns = c_ns.next             # <<<<<<<<<<<<<<
@@ -55617,7 +55694,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(struct LxmlEleme
       __pyx_v_c_ns = __pyx_t_6;
     }
 
-    /* "lxml/etree.pyx":1101
+    /* "lxml/etree.pyx":1104
  *                         nsmap[prefix] = funicodeOrNone(c_ns.href)
  *                     c_ns = c_ns.next
  *                 c_node = c_node.parent             # <<<<<<<<<<<<<<
@@ -55628,7 +55705,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(struct LxmlEleme
     __pyx_v_c_node = __pyx_t_3;
   }
 
-  /* "lxml/etree.pyx":1102
+  /* "lxml/etree.pyx":1105
  *                     c_ns = c_ns.next
  *                 c_node = c_node.parent
  *             return nsmap             # <<<<<<<<<<<<<<
@@ -55640,7 +55717,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(struct LxmlEleme
   __pyx_r = __pyx_v_nsmap;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1088
+  /* "lxml/etree.pyx":1091
  *         Note that changing the returned dict has no effect on the Element.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -55661,7 +55738,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(struct LxmlEleme
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1116
+/* "lxml/etree.pyx":1119
  *         Element, regardless of the document type (XML or HTML).
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -55700,16 +55777,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
   PyObject *__pyx_t_11 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1117
+  /* "lxml/etree.pyx":1120
  *         """
  *         def __get__(self):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             c_base = tree.xmlNodeGetBase(self._doc._c_doc, self._c_node)
  *             if c_base is NULL:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1117, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1120, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1118
+  /* "lxml/etree.pyx":1121
  *         def __get__(self):
  *             _assertValidNode(self)
  *             c_base = tree.xmlNodeGetBase(self._doc._c_doc, self._c_node)             # <<<<<<<<<<<<<<
@@ -55718,7 +55795,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
  */
   __pyx_v_c_base = xmlNodeGetBase(__pyx_v_self->_doc->_c_doc, __pyx_v_self->_c_node);
 
-  /* "lxml/etree.pyx":1119
+  /* "lxml/etree.pyx":1122
  *             _assertValidNode(self)
  *             c_base = tree.xmlNodeGetBase(self._doc._c_doc, self._c_node)
  *             if c_base is NULL:             # <<<<<<<<<<<<<<
@@ -55728,7 +55805,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
   __pyx_t_2 = ((__pyx_v_c_base == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1120
+    /* "lxml/etree.pyx":1123
  *             c_base = tree.xmlNodeGetBase(self._doc._c_doc, self._c_node)
  *             if c_base is NULL:
  *                 if self._doc._c_doc.URL is NULL:             # <<<<<<<<<<<<<<
@@ -55738,7 +55815,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
     __pyx_t_2 = ((__pyx_v_self->_doc->_c_doc->URL == NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":1121
+      /* "lxml/etree.pyx":1124
  *             if c_base is NULL:
  *                 if self._doc._c_doc.URL is NULL:
  *                     return None             # <<<<<<<<<<<<<<
@@ -55750,7 +55827,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
       __pyx_r = Py_None;
       goto __pyx_L0;
 
-      /* "lxml/etree.pyx":1120
+      /* "lxml/etree.pyx":1123
  *             c_base = tree.xmlNodeGetBase(self._doc._c_doc, self._c_node)
  *             if c_base is NULL:
  *                 if self._doc._c_doc.URL is NULL:             # <<<<<<<<<<<<<<
@@ -55759,7 +55836,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
  */
     }
 
-    /* "lxml/etree.pyx":1122
+    /* "lxml/etree.pyx":1125
  *                 if self._doc._c_doc.URL is NULL:
  *                     return None
  *                 return _decodeFilename(self._doc._c_doc.URL)             # <<<<<<<<<<<<<<
@@ -55767,13 +55844,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
  *                 base = _decodeFilename(c_base)
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_self->_doc->_c_doc->URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_self->_doc->_c_doc->URL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1125, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1119
+    /* "lxml/etree.pyx":1122
  *             _assertValidNode(self)
  *             c_base = tree.xmlNodeGetBase(self._doc._c_doc, self._c_node)
  *             if c_base is NULL:             # <<<<<<<<<<<<<<
@@ -55782,7 +55859,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
  */
   }
 
-  /* "lxml/etree.pyx":1123
+  /* "lxml/etree.pyx":1126
  *                     return None
  *                 return _decodeFilename(self._doc._c_doc.URL)
  *             try:             # <<<<<<<<<<<<<<
@@ -55791,20 +55868,20 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
  */
   /*try:*/ {
 
-    /* "lxml/etree.pyx":1124
+    /* "lxml/etree.pyx":1127
  *                 return _decodeFilename(self._doc._c_doc.URL)
  *             try:
  *                 base = _decodeFilename(c_base)             # <<<<<<<<<<<<<<
  *             finally:
  *                 tree.xmlFree(c_base)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_c_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1124, __pyx_L6_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_c_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1127, __pyx_L6_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_v_base = __pyx_t_3;
     __pyx_t_3 = 0;
   }
 
-  /* "lxml/etree.pyx":1126
+  /* "lxml/etree.pyx":1129
  *                 base = _decodeFilename(c_base)
  *             finally:
  *                 tree.xmlFree(c_base)             # <<<<<<<<<<<<<<
@@ -55834,7 +55911,6 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
       {
         xmlFree(__pyx_v_c_base);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_10);
@@ -55852,7 +55928,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
     __pyx_L7:;
   }
 
-  /* "lxml/etree.pyx":1127
+  /* "lxml/etree.pyx":1130
  *             finally:
  *                 tree.xmlFree(c_base)
  *             return base             # <<<<<<<<<<<<<<
@@ -55864,7 +55940,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
   __pyx_r = __pyx_v_base;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1116
+  /* "lxml/etree.pyx":1119
  *         Element, regardless of the document type (XML or HTML).
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -55884,7 +55960,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1129
+/* "lxml/etree.pyx":1132
  *             return base
  * 
  *         def __set__(self, url):             # <<<<<<<<<<<<<<
@@ -55916,16 +55992,16 @@ static int __pyx_pf_4lxml_5etree_8_Element_4base_2__set__(struct LxmlElement *__
   __Pyx_RefNannySetupContext("__set__", 0);
   __Pyx_INCREF(__pyx_v_url);
 
-  /* "lxml/etree.pyx":1130
+  /* "lxml/etree.pyx":1133
  * 
  *         def __set__(self, url):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             if url is None:
  *                 c_base = <const_xmlChar*>NULL
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1130, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1133, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1131
+  /* "lxml/etree.pyx":1134
  *         def __set__(self, url):
  *             _assertValidNode(self)
  *             if url is None:             # <<<<<<<<<<<<<<
@@ -55936,7 +56012,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4base_2__set__(struct LxmlElement *__
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1132
+    /* "lxml/etree.pyx":1135
  *             _assertValidNode(self)
  *             if url is None:
  *                 c_base = <const_xmlChar*>NULL             # <<<<<<<<<<<<<<
@@ -55945,7 +56021,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4base_2__set__(struct LxmlElement *__
  */
     __pyx_v_c_base = ((const xmlChar *)NULL);
 
-    /* "lxml/etree.pyx":1131
+    /* "lxml/etree.pyx":1134
  *         def __set__(self, url):
  *             _assertValidNode(self)
  *             if url is None:             # <<<<<<<<<<<<<<
@@ -55955,7 +56031,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4base_2__set__(struct LxmlElement *__
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":1134
+  /* "lxml/etree.pyx":1137
  *                 c_base = <const_xmlChar*>NULL
  *             else:
  *                 url = _encodeFilename(url)             # <<<<<<<<<<<<<<
@@ -55963,12 +56039,12 @@ static int __pyx_pf_4lxml_5etree_8_Element_4base_2__set__(struct LxmlElement *__
  *             tree.xmlNodeSetBase(self._c_node, c_base)
  */
   /*else*/ {
-    __pyx_t_4 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_url); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1134, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_url); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1137, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF_SET(__pyx_v_url, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1135
+    /* "lxml/etree.pyx":1138
  *             else:
  *                 url = _encodeFilename(url)
  *                 c_base = _xcstr(url)             # <<<<<<<<<<<<<<
@@ -55979,7 +56055,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4base_2__set__(struct LxmlElement *__
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":1136
+  /* "lxml/etree.pyx":1139
  *                 url = _encodeFilename(url)
  *                 c_base = _xcstr(url)
  *             tree.xmlNodeSetBase(self._c_node, c_base)             # <<<<<<<<<<<<<<
@@ -55988,7 +56064,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4base_2__set__(struct LxmlElement *__
  */
   xmlNodeSetBase(__pyx_v_self->_c_node, __pyx_v_c_base);
 
-  /* "lxml/etree.pyx":1129
+  /* "lxml/etree.pyx":1132
  *             return base
  * 
  *         def __set__(self, url):             # <<<<<<<<<<<<<<
@@ -56009,7 +56085,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_4base_2__set__(struct LxmlElement *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1139
+/* "lxml/etree.pyx":1142
  * 
  *     # ACCESSORS
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -56042,7 +56118,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_30__repr__(struct LxmlElement *
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "lxml/etree.pyx":1141
+  /* "lxml/etree.pyx":1144
  *     def __repr__(self):
  *         u"__repr__(self)"
  *         return "<Element %s at 0x%x>" % (strrepr(self.tag), id(self))             # <<<<<<<<<<<<<<
@@ -56050,20 +56126,20 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_30__repr__(struct LxmlElement *
  *     def __getitem__(self, x):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1141, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_2);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
@@ -56071,14 +56147,14 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_30__repr__(struct LxmlElement *
   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
   __pyx_t_2 = 0;
   __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Element_s_at_0x_x, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1141, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Element_s_at_0x_x, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1139
+  /* "lxml/etree.pyx":1142
  * 
  *     # ACCESSORS
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -56099,7 +56175,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_30__repr__(struct LxmlElement *
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1143
+/* "lxml/etree.pyx":1146
  *         return "<Element %s at 0x%x>" % (strrepr(self.tag), id(self))
  * 
  *     def __getitem__(self, x):             # <<<<<<<<<<<<<<
@@ -56144,7 +56220,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
   Py_ssize_t __pyx_t_8;
   __Pyx_RefNannySetupContext("__getitem__", 0);
 
-  /* "lxml/etree.pyx":1147
+  /* "lxml/etree.pyx":1150
  *         slice.
  *         """
  *         cdef xmlNode* c_node = NULL             # <<<<<<<<<<<<<<
@@ -56153,7 +56229,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  */
   __pyx_v_c_node = NULL;
 
-  /* "lxml/etree.pyx":1148
+  /* "lxml/etree.pyx":1151
  *         """
  *         cdef xmlNode* c_node = NULL
  *         cdef Py_ssize_t step = 0, slicelength = 0             # <<<<<<<<<<<<<<
@@ -56163,16 +56239,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
   __pyx_v_step = 0;
   __pyx_v_slicelength = 0;
 
-  /* "lxml/etree.pyx":1152
+  /* "lxml/etree.pyx":1155
  *         cdef _node_to_node_function next_element
  *         cdef list result
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         if isinstance(x, slice):
  *             # slicing
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1152, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1155, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1153
+  /* "lxml/etree.pyx":1156
  *         cdef list result
  *         _assertValidNode(self)
  *         if isinstance(x, slice):             # <<<<<<<<<<<<<<
@@ -56183,18 +56259,18 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1155
+    /* "lxml/etree.pyx":1158
  *         if isinstance(x, slice):
  *             # slicing
  *             if _isFullSlice(<slice>x):             # <<<<<<<<<<<<<<
  *                 return _collectChildren(self)
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__isFullSlice(((PyObject*)__pyx_v_x)); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1155, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__isFullSlice(((PyObject*)__pyx_v_x)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1158, __pyx_L1_error)
     __pyx_t_2 = (__pyx_t_3 != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":1156
+      /* "lxml/etree.pyx":1159
  *             # slicing
  *             if _isFullSlice(<slice>x):
  *                 return _collectChildren(self)             # <<<<<<<<<<<<<<
@@ -56202,13 +56278,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  *             if c_node is NULL:
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_4 = __pyx_f_4lxml_5etree__collectChildren(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1156, __pyx_L1_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__collectChildren(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_r = __pyx_t_4;
       __pyx_t_4 = 0;
       goto __pyx_L0;
 
-      /* "lxml/etree.pyx":1155
+      /* "lxml/etree.pyx":1158
  *         if isinstance(x, slice):
  *             # slicing
  *             if _isFullSlice(<slice>x):             # <<<<<<<<<<<<<<
@@ -56217,16 +56293,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  */
     }
 
-    /* "lxml/etree.pyx":1157
+    /* "lxml/etree.pyx":1160
  *             if _isFullSlice(<slice>x):
  *                 return _collectChildren(self)
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<<
  *             if c_node is NULL:
  *                 return []
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__findChildSlice(((PyObject*)__pyx_v_x), __pyx_v_self->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1157, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__findChildSlice(((PyObject*)__pyx_v_x), __pyx_v_self->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1160, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":1158
+    /* "lxml/etree.pyx":1161
  *                 return _collectChildren(self)
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)
  *             if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -56236,7 +56312,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
     __pyx_t_2 = ((__pyx_v_c_node == NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":1159
+      /* "lxml/etree.pyx":1162
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)
  *             if c_node is NULL:
  *                 return []             # <<<<<<<<<<<<<<
@@ -56244,13 +56320,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  *                 next_element = _nextElement
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error)
+      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1162, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_r = __pyx_t_4;
       __pyx_t_4 = 0;
       goto __pyx_L0;
 
-      /* "lxml/etree.pyx":1158
+      /* "lxml/etree.pyx":1161
  *                 return _collectChildren(self)
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)
  *             if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -56259,7 +56335,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  */
     }
 
-    /* "lxml/etree.pyx":1160
+    /* "lxml/etree.pyx":1163
  *             if c_node is NULL:
  *                 return []
  *             if step > 0:             # <<<<<<<<<<<<<<
@@ -56269,7 +56345,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
     __pyx_t_2 = ((__pyx_v_step > 0) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":1161
+      /* "lxml/etree.pyx":1164
  *                 return []
  *             if step > 0:
  *                 next_element = _nextElement             # <<<<<<<<<<<<<<
@@ -56278,7 +56354,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  */
       __pyx_v_next_element = __pyx_f_4lxml_5etree__nextElement;
 
-      /* "lxml/etree.pyx":1160
+      /* "lxml/etree.pyx":1163
  *             if c_node is NULL:
  *                 return []
  *             if step > 0:             # <<<<<<<<<<<<<<
@@ -56288,7 +56364,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
       goto __pyx_L6;
     }
 
-    /* "lxml/etree.pyx":1163
+    /* "lxml/etree.pyx":1166
  *                 next_element = _nextElement
  *             else:
  *                 step = -step             # <<<<<<<<<<<<<<
@@ -56298,7 +56374,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
     /*else*/ {
       __pyx_v_step = (-__pyx_v_step);
 
-      /* "lxml/etree.pyx":1164
+      /* "lxml/etree.pyx":1167
  *             else:
  *                 step = -step
  *                 next_element = _previousElement             # <<<<<<<<<<<<<<
@@ -56309,19 +56385,19 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
     }
     __pyx_L6:;
 
-    /* "lxml/etree.pyx":1165
+    /* "lxml/etree.pyx":1168
  *                 step = -step
  *                 next_element = _previousElement
  *             result = []             # <<<<<<<<<<<<<<
  *             c = 0
  *             while c_node is not NULL and c < slicelength:
  */
-    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1165, __pyx_L1_error)
+    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1168, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_result = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1166
+    /* "lxml/etree.pyx":1169
  *                 next_element = _previousElement
  *             result = []
  *             c = 0             # <<<<<<<<<<<<<<
@@ -56330,7 +56406,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  */
     __pyx_v_c = 0;
 
-    /* "lxml/etree.pyx":1167
+    /* "lxml/etree.pyx":1170
  *             result = []
  *             c = 0
  *             while c_node is not NULL and c < slicelength:             # <<<<<<<<<<<<<<
@@ -56349,7 +56425,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
       __pyx_L9_bool_binop_done:;
       if (!__pyx_t_2) break;
 
-      /* "lxml/etree.pyx":1168
+      /* "lxml/etree.pyx":1171
  *             c = 0
  *             while c_node is not NULL and c < slicelength:
  *                 result.append(_elementFactory(self._doc, c_node))             # <<<<<<<<<<<<<<
@@ -56358,13 +56434,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  */
       __pyx_t_4 = ((PyObject *)__pyx_v_self->_doc);
       __Pyx_INCREF(__pyx_t_4);
-      __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1168, __pyx_L1_error)
+      __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1171, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1168, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1171, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "lxml/etree.pyx":1169
+      /* "lxml/etree.pyx":1172
  *             while c_node is not NULL and c < slicelength:
  *                 result.append(_elementFactory(self._doc, c_node))
  *                 c += 1             # <<<<<<<<<<<<<<
@@ -56373,7 +56449,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  */
       __pyx_v_c = (__pyx_v_c + 1);
 
-      /* "lxml/etree.pyx":1170
+      /* "lxml/etree.pyx":1173
  *                 result.append(_elementFactory(self._doc, c_node))
  *                 c += 1
  *                 for i in range(step):             # <<<<<<<<<<<<<<
@@ -56384,7 +56460,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
       for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
         __pyx_v_i = __pyx_t_8;
 
-        /* "lxml/etree.pyx":1171
+        /* "lxml/etree.pyx":1174
  *                 c += 1
  *                 for i in range(step):
  *                     c_node = next_element(c_node)             # <<<<<<<<<<<<<<
@@ -56395,7 +56471,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
       }
     }
 
-    /* "lxml/etree.pyx":1172
+    /* "lxml/etree.pyx":1175
  *                 for i in range(step):
  *                     c_node = next_element(c_node)
  *             return result             # <<<<<<<<<<<<<<
@@ -56407,7 +56483,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
     __pyx_r = __pyx_v_result;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1153
+    /* "lxml/etree.pyx":1156
  *         cdef list result
  *         _assertValidNode(self)
  *         if isinstance(x, slice):             # <<<<<<<<<<<<<<
@@ -56416,7 +56492,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  */
   }
 
-  /* "lxml/etree.pyx":1175
+  /* "lxml/etree.pyx":1178
  *         else:
  *             # indexing
  *             c_node = _findChild(self._c_node, x)             # <<<<<<<<<<<<<<
@@ -56424,10 +56500,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  *                 raise IndexError, u"list index out of range"
  */
   /*else*/ {
-    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1175, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1178, __pyx_L1_error)
     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(__pyx_v_self->_c_node, __pyx_t_7);
 
-    /* "lxml/etree.pyx":1176
+    /* "lxml/etree.pyx":1179
  *             # indexing
  *             c_node = _findChild(self._c_node, x)
  *             if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -56437,7 +56513,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
     __pyx_t_2 = ((__pyx_v_c_node == NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":1177
+      /* "lxml/etree.pyx":1180
  *             c_node = _findChild(self._c_node, x)
  *             if c_node is NULL:
  *                 raise IndexError, u"list index out of range"             # <<<<<<<<<<<<<<
@@ -56445,9 +56521,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  * 
  */
       __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_list_index_out_of_range, 0, 0);
-      __PYX_ERR(0, 1177, __pyx_L1_error)
+      __PYX_ERR(0, 1180, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":1176
+      /* "lxml/etree.pyx":1179
  *             # indexing
  *             c_node = _findChild(self._c_node, x)
  *             if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -56456,7 +56532,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
  */
     }
 
-    /* "lxml/etree.pyx":1178
+    /* "lxml/etree.pyx":1181
  *             if c_node is NULL:
  *                 raise IndexError, u"list index out of range"
  *             return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
@@ -56466,7 +56542,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
     __Pyx_XDECREF(__pyx_r);
     __pyx_t_5 = ((PyObject *)__pyx_v_self->_doc);
     __Pyx_INCREF(__pyx_t_5);
-    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L1_error)
+    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1181, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_r = __pyx_t_4;
@@ -56474,7 +56550,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
     goto __pyx_L0;
   }
 
-  /* "lxml/etree.pyx":1143
+  /* "lxml/etree.pyx":1146
  *         return "<Element %s at 0x%x>" % (strrepr(self.tag), id(self))
  * 
  *     def __getitem__(self, x):             # <<<<<<<<<<<<<<
@@ -56495,7 +56571,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_32__getitem__(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1180
+/* "lxml/etree.pyx":1183
  *             return _elementFactory(self._doc, c_node)
  * 
  *     def __len__(self):             # <<<<<<<<<<<<<<
@@ -56526,16 +56602,16 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_8_Element_34__len__(struct LxmlElement *
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__len__", 0);
 
-  /* "lxml/etree.pyx":1185
+  /* "lxml/etree.pyx":1188
  *         Returns the number of subelements.
  *         """
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         return _countElements(self._c_node.children)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1185, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1188, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1186
+  /* "lxml/etree.pyx":1189
  *         """
  *         _assertValidNode(self)
  *         return _countElements(self._c_node.children)             # <<<<<<<<<<<<<<
@@ -56545,7 +56621,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_8_Element_34__len__(struct LxmlElement *
   __pyx_r = __pyx_f_4lxml_5etree__countElements(__pyx_v_self->_c_node->children);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1180
+  /* "lxml/etree.pyx":1183
  *             return _elementFactory(self._doc, c_node)
  * 
  *     def __len__(self):             # <<<<<<<<<<<<<<
@@ -56562,7 +56638,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_8_Element_34__len__(struct LxmlElement *
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1188
+/* "lxml/etree.pyx":1191
  *         return _countElements(self._c_node.children)
  * 
  *     def __nonzero__(self):             # <<<<<<<<<<<<<<
@@ -56589,97 +56665,53 @@ static int __pyx_pf_4lxml_5etree_8_Element_36__nonzero__(struct LxmlElement *__p
   __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
+  int __pyx_t_3;
   __Pyx_RefNannySetupContext("__nonzero__", 0);
 
-  /* "lxml/etree.pyx":1190
+  /* "lxml/etree.pyx":1193
  *     def __nonzero__(self):
  *         #u"__nonzero__(self)" # currently fails in Py3.1
  *         import warnings             # <<<<<<<<<<<<<<
  *         warnings.warn(
  *             u"The behavior of this method will change in future versions. "
  */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_warnings = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":1191
+  /* "lxml/etree.pyx":1194
  *         #u"__nonzero__(self)" # currently fails in Py3.1
  *         import warnings
  *         warnings.warn(             # <<<<<<<<<<<<<<
  *             u"The behavior of this method will change in future versions. "
  *             u"Use specific 'len(elem)' or 'elem is not None' test instead.",
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
 
-  /* "lxml/etree.pyx":1195
+  /* "lxml/etree.pyx":1197
+ *             u"The behavior of this method will change in future versions. "
  *             u"Use specific 'len(elem)' or 'elem is not None' test instead.",
- *             FutureWarning
- *             )             # <<<<<<<<<<<<<<
+ *             FutureWarning             # <<<<<<<<<<<<<<
+ *             )
  *         # emulate old behaviour
- *         _assertValidNode(self)
  */
-  __pyx_t_3 = NULL;
-  __pyx_t_4 = 0;
-  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
-    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
-    if (likely(__pyx_t_3)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
-      __Pyx_INCREF(__pyx_t_3);
-      __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_2, function);
-      __pyx_t_4 = 1;
-    }
-  }
-  #if CYTHON_FAST_PYCALL
-  if (PyFunction_Check(__pyx_t_2)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_The_behavior_of_this_method_will, __pyx_builtin_FutureWarning};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_GOTREF(__pyx_t_1);
-  } else
-  #endif
-  #if CYTHON_FAST_PYCCALL
-  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_The_behavior_of_this_method_will, __pyx_builtin_FutureWarning};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_GOTREF(__pyx_t_1);
-  } else
-  #endif
-  {
-    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1191, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_5);
-    if (__pyx_t_3) {
-      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
-    }
-    __Pyx_INCREF(__pyx_kp_u_The_behavior_of_this_method_will);
-    __Pyx_GIVEREF(__pyx_kp_u_The_behavior_of_this_method_will);
-    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_u_The_behavior_of_this_method_will);
-    __Pyx_INCREF(__pyx_builtin_FutureWarning);
-    __Pyx_GIVEREF(__pyx_builtin_FutureWarning);
-    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_builtin_FutureWarning);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1194, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":1197
+  /* "lxml/etree.pyx":1200
  *             )
  *         # emulate old behaviour
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         return _hasChild(self._c_node)
  * 
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1197, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1200, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1198
+  /* "lxml/etree.pyx":1201
  *         # emulate old behaviour
  *         _assertValidNode(self)
  *         return _hasChild(self._c_node)             # <<<<<<<<<<<<<<
@@ -56689,7 +56721,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_36__nonzero__(struct LxmlElement *__p
   __pyx_r = __pyx_f_4lxml_5etree__hasChild(__pyx_v_self->_c_node);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1188
+  /* "lxml/etree.pyx":1191
  *         return _countElements(self._c_node.children)
  * 
  *     def __nonzero__(self):             # <<<<<<<<<<<<<<
@@ -56701,8 +56733,6 @@ static int __pyx_pf_4lxml_5etree_8_Element_36__nonzero__(struct LxmlElement *__p
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_5);
   __Pyx_AddTraceback("lxml.etree._Element.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   __pyx_L0:;
@@ -56711,7 +56741,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_36__nonzero__(struct LxmlElement *__p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1200
+/* "lxml/etree.pyx":1203
  *         return _hasChild(self._c_node)
  * 
  *     def __contains__(self, element):             # <<<<<<<<<<<<<<
@@ -56746,16 +56776,16 @@ static int __pyx_pf_4lxml_5etree_8_Element_38__contains__(struct LxmlElement *__
   xmlNode *__pyx_t_4;
   __Pyx_RefNannySetupContext("__contains__", 0);
 
-  /* "lxml/etree.pyx":1203
+  /* "lxml/etree.pyx":1206
  *         u"__contains__(self, element)"
  *         cdef xmlNode* c_node
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         if not isinstance(element, _Element):
  *             return 0
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1203, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1206, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1204
+  /* "lxml/etree.pyx":1207
  *         cdef xmlNode* c_node
  *         _assertValidNode(self)
  *         if not isinstance(element, _Element):             # <<<<<<<<<<<<<<
@@ -56766,7 +56796,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_38__contains__(struct LxmlElement *__
   __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1205
+    /* "lxml/etree.pyx":1208
  *         _assertValidNode(self)
  *         if not isinstance(element, _Element):
  *             return 0             # <<<<<<<<<<<<<<
@@ -56776,7 +56806,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_38__contains__(struct LxmlElement *__
     __pyx_r = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1204
+    /* "lxml/etree.pyx":1207
  *         cdef xmlNode* c_node
  *         _assertValidNode(self)
  *         if not isinstance(element, _Element):             # <<<<<<<<<<<<<<
@@ -56785,7 +56815,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_38__contains__(struct LxmlElement *__
  */
   }
 
-  /* "lxml/etree.pyx":1206
+  /* "lxml/etree.pyx":1209
  *         if not isinstance(element, _Element):
  *             return 0
  *         c_node = (<_Element>element)._c_node             # <<<<<<<<<<<<<<
@@ -56795,7 +56825,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_38__contains__(struct LxmlElement *__
   __pyx_t_4 = ((struct LxmlElement *)__pyx_v_element)->_c_node;
   __pyx_v_c_node = __pyx_t_4;
 
-  /* "lxml/etree.pyx":1207
+  /* "lxml/etree.pyx":1210
  *             return 0
  *         c_node = (<_Element>element)._c_node
  *         return c_node is not NULL and c_node.parent is self._c_node             # <<<<<<<<<<<<<<
@@ -56814,7 +56844,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_38__contains__(struct LxmlElement *__
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1200
+  /* "lxml/etree.pyx":1203
  *         return _hasChild(self._c_node)
  * 
  *     def __contains__(self, element):             # <<<<<<<<<<<<<<
@@ -56831,7 +56861,7 @@ static int __pyx_pf_4lxml_5etree_8_Element_38__contains__(struct LxmlElement *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1209
+/* "lxml/etree.pyx":1212
  *         return c_node is not NULL and c_node.parent is self._c_node
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -56863,7 +56893,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_40__iter__(struct LxmlElement *
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "lxml/etree.pyx":1211
+  /* "lxml/etree.pyx":1214
  *     def __iter__(self):
  *         u"__iter__(self)"
  *         return ElementChildIterator(self)             # <<<<<<<<<<<<<<
@@ -56871,19 +56901,19 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_40__iter__(struct LxmlElement *
  *     def __reversed__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementChildIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementChildIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1214, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1209
+  /* "lxml/etree.pyx":1212
  *         return c_node is not NULL and c_node.parent is self._c_node
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -56903,7 +56933,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_40__iter__(struct LxmlElement *
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1213
+/* "lxml/etree.pyx":1216
  *         return ElementChildIterator(self)
  * 
  *     def __reversed__(self):             # <<<<<<<<<<<<<<
@@ -56934,7 +56964,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_42__reversed__(struct LxmlEleme
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__reversed__", 0);
 
-  /* "lxml/etree.pyx":1215
+  /* "lxml/etree.pyx":1218
  *     def __reversed__(self):
  *         u"__reversed__(self)"
  *         return ElementChildIterator(self, reversed=True)             # <<<<<<<<<<<<<<
@@ -56942,15 +56972,15 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_42__reversed__(struct LxmlEleme
  *     def index(self, _Element child not None, start=None, stop=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1215, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1215, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reversed, Py_True) < 0) __PYX_ERR(0, 1215, __pyx_L1_error)
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementChildIterator), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1215, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reversed, Py_True) < 0) __PYX_ERR(0, 1218, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementChildIterator), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -56958,7 +56988,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_42__reversed__(struct LxmlEleme
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1213
+  /* "lxml/etree.pyx":1216
  *         return ElementChildIterator(self)
  * 
  *     def __reversed__(self):             # <<<<<<<<<<<<<<
@@ -56979,7 +57009,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_42__reversed__(struct LxmlEleme
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1217
+/* "lxml/etree.pyx":1220
  *         return ElementChildIterator(self, reversed=True)
  * 
  *     def index(self, _Element child not None, start=None, stop=None):             # <<<<<<<<<<<<<<
@@ -57035,7 +57065,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_45index(PyObject *__pyx_v_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "index") < 0)) __PYX_ERR(0, 1217, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "index") < 0)) __PYX_ERR(0, 1220, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -57054,13 +57084,13 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_45index(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("index", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1217, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("index", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1220, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Element.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_child), __pyx_ptype_4lxml_5etree__Element, 0, "child", 0))) __PYX_ERR(0, 1217, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_child), __pyx_ptype_4lxml_5etree__Element, 0, "child", 0))) __PYX_ERR(0, 1220, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_8_Element_44index(((struct LxmlElement *)__pyx_v_self), __pyx_v_child, __pyx_v_start, __pyx_v_stop);
 
   /* function exit code */
@@ -57090,25 +57120,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   Py_ssize_t __pyx_t_7;
   __Pyx_RefNannySetupContext("index", 0);
 
-  /* "lxml/etree.pyx":1228
+  /* "lxml/etree.pyx":1231
  *         cdef xmlNode* c_child
  *         cdef xmlNode* c_start_node
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         _assertValidNode(child)
  *         c_child = child._c_node
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1228, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1231, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1229
+  /* "lxml/etree.pyx":1232
  *         cdef xmlNode* c_start_node
  *         _assertValidNode(self)
  *         _assertValidNode(child)             # <<<<<<<<<<<<<<
  *         c_child = child._c_node
  *         if c_child.parent is not self._c_node:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_child); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1229, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_child); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1232, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1230
+  /* "lxml/etree.pyx":1233
  *         _assertValidNode(self)
  *         _assertValidNode(child)
  *         c_child = child._c_node             # <<<<<<<<<<<<<<
@@ -57118,7 +57148,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   __pyx_t_2 = __pyx_v_child->_c_node;
   __pyx_v_c_child = __pyx_t_2;
 
-  /* "lxml/etree.pyx":1231
+  /* "lxml/etree.pyx":1234
  *         _assertValidNode(child)
  *         c_child = child._c_node
  *         if c_child.parent is not self._c_node:             # <<<<<<<<<<<<<<
@@ -57128,7 +57158,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   __pyx_t_3 = ((__pyx_v_c_child->parent != __pyx_v_self->_c_node) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1232
+    /* "lxml/etree.pyx":1235
  *         c_child = child._c_node
  *         if c_child.parent is not self._c_node:
  *             raise ValueError, u"Element is not a child of this node."             # <<<<<<<<<<<<<<
@@ -57136,9 +57166,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  *         # handle the unbounded search straight away (normal case)
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Element_is_not_a_child_of_this_n, 0, 0);
-    __PYX_ERR(0, 1232, __pyx_L1_error)
+    __PYX_ERR(0, 1235, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":1231
+    /* "lxml/etree.pyx":1234
  *         _assertValidNode(child)
  *         c_child = child._c_node
  *         if c_child.parent is not self._c_node:             # <<<<<<<<<<<<<<
@@ -57147,7 +57177,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
   }
 
-  /* "lxml/etree.pyx":1235
+  /* "lxml/etree.pyx":1238
  * 
  *         # handle the unbounded search straight away (normal case)
  *         if stop is None and (start is None or start == 0):             # <<<<<<<<<<<<<<
@@ -57168,15 +57198,15 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     __pyx_t_3 = __pyx_t_4;
     goto __pyx_L5_bool_binop_done;
   }
-  __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_start, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1235, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_start, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1238, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1235, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1238, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_3 = __pyx_t_4;
   __pyx_L5_bool_binop_done:;
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1236
+    /* "lxml/etree.pyx":1239
  *         # handle the unbounded search straight away (normal case)
  *         if stop is None and (start is None or start == 0):
  *             k = 0             # <<<<<<<<<<<<<<
@@ -57185,7 +57215,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
     __pyx_v_k = 0;
 
-    /* "lxml/etree.pyx":1237
+    /* "lxml/etree.pyx":1240
  *         if stop is None and (start is None or start == 0):
  *             k = 0
  *             c_child = c_child.prev             # <<<<<<<<<<<<<<
@@ -57195,7 +57225,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     __pyx_t_2 = __pyx_v_c_child->prev;
     __pyx_v_c_child = __pyx_t_2;
 
-    /* "lxml/etree.pyx":1238
+    /* "lxml/etree.pyx":1241
  *             k = 0
  *             c_child = c_child.prev
  *             while c_child is not NULL:             # <<<<<<<<<<<<<<
@@ -57206,7 +57236,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_t_3 = ((__pyx_v_c_child != NULL) != 0);
       if (!__pyx_t_3) break;
 
-      /* "lxml/etree.pyx":1239
+      /* "lxml/etree.pyx":1242
  *             c_child = c_child.prev
  *             while c_child is not NULL:
  *                 if _isElement(c_child):             # <<<<<<<<<<<<<<
@@ -57216,7 +57246,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_t_3 = (_isElement(__pyx_v_c_child) != 0);
       if (__pyx_t_3) {
 
-        /* "lxml/etree.pyx":1240
+        /* "lxml/etree.pyx":1243
  *             while c_child is not NULL:
  *                 if _isElement(c_child):
  *                     k += 1             # <<<<<<<<<<<<<<
@@ -57225,7 +57255,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
         __pyx_v_k = (__pyx_v_k + 1);
 
-        /* "lxml/etree.pyx":1239
+        /* "lxml/etree.pyx":1242
  *             c_child = c_child.prev
  *             while c_child is not NULL:
  *                 if _isElement(c_child):             # <<<<<<<<<<<<<<
@@ -57234,7 +57264,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
       }
 
-      /* "lxml/etree.pyx":1241
+      /* "lxml/etree.pyx":1244
  *                 if _isElement(c_child):
  *                     k += 1
  *                 c_child = c_child.prev             # <<<<<<<<<<<<<<
@@ -57245,7 +57275,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_v_c_child = __pyx_t_2;
     }
 
-    /* "lxml/etree.pyx":1242
+    /* "lxml/etree.pyx":1245
  *                     k += 1
  *                 c_child = c_child.prev
  *             return k             # <<<<<<<<<<<<<<
@@ -57253,13 +57283,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  *         # check indices
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1242, __pyx_L1_error)
+    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_r = __pyx_t_6;
     __pyx_t_6 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1235
+    /* "lxml/etree.pyx":1238
  * 
  *         # handle the unbounded search straight away (normal case)
  *         if stop is None and (start is None or start == 0):             # <<<<<<<<<<<<<<
@@ -57268,7 +57298,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
   }
 
-  /* "lxml/etree.pyx":1245
+  /* "lxml/etree.pyx":1248
  * 
  *         # check indices
  *         if start is None:             # <<<<<<<<<<<<<<
@@ -57279,7 +57309,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   __pyx_t_4 = (__pyx_t_3 != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":1246
+    /* "lxml/etree.pyx":1249
  *         # check indices
  *         if start is None:
  *             c_start = 0             # <<<<<<<<<<<<<<
@@ -57288,7 +57318,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
     __pyx_v_c_start = 0;
 
-    /* "lxml/etree.pyx":1245
+    /* "lxml/etree.pyx":1248
  * 
  *         # check indices
  *         if start is None:             # <<<<<<<<<<<<<<
@@ -57298,7 +57328,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     goto __pyx_L11;
   }
 
-  /* "lxml/etree.pyx":1248
+  /* "lxml/etree.pyx":1251
  *             c_start = 0
  *         else:
  *             c_start = start             # <<<<<<<<<<<<<<
@@ -57306,12 +57336,12 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  *             c_stop = 0
  */
   /*else*/ {
-    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_start); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1248, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_start); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1251, __pyx_L1_error)
     __pyx_v_c_start = __pyx_t_7;
   }
   __pyx_L11:;
 
-  /* "lxml/etree.pyx":1249
+  /* "lxml/etree.pyx":1252
  *         else:
  *             c_start = start
  *         if stop is None:             # <<<<<<<<<<<<<<
@@ -57322,7 +57352,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   __pyx_t_3 = (__pyx_t_4 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1250
+    /* "lxml/etree.pyx":1253
  *             c_start = start
  *         if stop is None:
  *             c_stop = 0             # <<<<<<<<<<<<<<
@@ -57331,7 +57361,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
     __pyx_v_c_stop = 0;
 
-    /* "lxml/etree.pyx":1249
+    /* "lxml/etree.pyx":1252
  *         else:
  *             c_start = start
  *         if stop is None:             # <<<<<<<<<<<<<<
@@ -57341,7 +57371,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     goto __pyx_L12;
   }
 
-  /* "lxml/etree.pyx":1252
+  /* "lxml/etree.pyx":1255
  *             c_stop = 0
  *         else:
  *             c_stop = stop             # <<<<<<<<<<<<<<
@@ -57349,10 +57379,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):
  */
   /*else*/ {
-    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_stop); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1252, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_stop); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1255, __pyx_L1_error)
     __pyx_v_c_stop = __pyx_t_7;
 
-    /* "lxml/etree.pyx":1253
+    /* "lxml/etree.pyx":1256
  *         else:
  *             c_stop = stop
  *             if c_stop == 0 or \             # <<<<<<<<<<<<<<
@@ -57366,7 +57396,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       goto __pyx_L14_bool_binop_done;
     }
 
-    /* "lxml/etree.pyx":1254
+    /* "lxml/etree.pyx":1257
  *             c_stop = stop
  *             if c_stop == 0 or \
  *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):             # <<<<<<<<<<<<<<
@@ -57389,7 +57419,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     __pyx_t_3 = __pyx_t_4;
     __pyx_L14_bool_binop_done:;
 
-    /* "lxml/etree.pyx":1253
+    /* "lxml/etree.pyx":1256
  *         else:
  *             c_stop = stop
  *             if c_stop == 0 or \             # <<<<<<<<<<<<<<
@@ -57398,7 +57428,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":1255
+      /* "lxml/etree.pyx":1258
  *             if c_stop == 0 or \
  *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):
  *                 raise ValueError, u"list.index(x): x not in slice"             # <<<<<<<<<<<<<<
@@ -57406,9 +57436,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  *         # for negative slice indices, check slice before searching index
  */
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_list_index_x_x_not_in_slice, 0, 0);
-      __PYX_ERR(0, 1255, __pyx_L1_error)
+      __PYX_ERR(0, 1258, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":1253
+      /* "lxml/etree.pyx":1256
  *         else:
  *             c_stop = stop
  *             if c_stop == 0 or \             # <<<<<<<<<<<<<<
@@ -57419,7 +57449,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   }
   __pyx_L12:;
 
-  /* "lxml/etree.pyx":1258
+  /* "lxml/etree.pyx":1261
  * 
  *         # for negative slice indices, check slice before searching index
  *         if c_start < 0 or c_stop < 0:             # <<<<<<<<<<<<<<
@@ -57437,7 +57467,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   __pyx_L19_bool_binop_done:;
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1260
+    /* "lxml/etree.pyx":1263
  *         if c_start < 0 or c_stop < 0:
  *             # start from right, at most up to leftmost(c_start, c_stop)
  *             if c_start < c_stop:             # <<<<<<<<<<<<<<
@@ -57447,7 +57477,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     __pyx_t_3 = ((__pyx_v_c_start < __pyx_v_c_stop) != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":1261
+      /* "lxml/etree.pyx":1264
  *             # start from right, at most up to leftmost(c_start, c_stop)
  *             if c_start < c_stop:
  *                 k = -c_start             # <<<<<<<<<<<<<<
@@ -57456,7 +57486,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
       __pyx_v_k = (-__pyx_v_c_start);
 
-      /* "lxml/etree.pyx":1260
+      /* "lxml/etree.pyx":1263
  *         if c_start < 0 or c_stop < 0:
  *             # start from right, at most up to leftmost(c_start, c_stop)
  *             if c_start < c_stop:             # <<<<<<<<<<<<<<
@@ -57466,7 +57496,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       goto __pyx_L21;
     }
 
-    /* "lxml/etree.pyx":1263
+    /* "lxml/etree.pyx":1266
  *                 k = -c_start
  *             else:
  *                 k = -c_stop             # <<<<<<<<<<<<<<
@@ -57478,7 +57508,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     }
     __pyx_L21:;
 
-    /* "lxml/etree.pyx":1264
+    /* "lxml/etree.pyx":1267
  *             else:
  *                 k = -c_stop
  *             c_start_node = self._c_node.last             # <<<<<<<<<<<<<<
@@ -57488,7 +57518,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     __pyx_t_2 = __pyx_v_self->_c_node->last;
     __pyx_v_c_start_node = __pyx_t_2;
 
-    /* "lxml/etree.pyx":1265
+    /* "lxml/etree.pyx":1268
  *                 k = -c_stop
  *             c_start_node = self._c_node.last
  *             l = 1             # <<<<<<<<<<<<<<
@@ -57497,7 +57527,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
     __pyx_v_l = 1;
 
-    /* "lxml/etree.pyx":1266
+    /* "lxml/etree.pyx":1269
  *             c_start_node = self._c_node.last
  *             l = 1
  *             while c_start_node != c_child and l < k:             # <<<<<<<<<<<<<<
@@ -57516,7 +57546,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_L24_bool_binop_done:;
       if (!__pyx_t_3) break;
 
-      /* "lxml/etree.pyx":1267
+      /* "lxml/etree.pyx":1270
  *             l = 1
  *             while c_start_node != c_child and l < k:
  *                 if _isElement(c_start_node):             # <<<<<<<<<<<<<<
@@ -57526,7 +57556,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_t_3 = (_isElement(__pyx_v_c_start_node) != 0);
       if (__pyx_t_3) {
 
-        /* "lxml/etree.pyx":1268
+        /* "lxml/etree.pyx":1271
  *             while c_start_node != c_child and l < k:
  *                 if _isElement(c_start_node):
  *                     l += 1             # <<<<<<<<<<<<<<
@@ -57535,7 +57565,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
         __pyx_v_l = (__pyx_v_l + 1);
 
-        /* "lxml/etree.pyx":1267
+        /* "lxml/etree.pyx":1270
  *             l = 1
  *             while c_start_node != c_child and l < k:
  *                 if _isElement(c_start_node):             # <<<<<<<<<<<<<<
@@ -57544,7 +57574,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
       }
 
-      /* "lxml/etree.pyx":1269
+      /* "lxml/etree.pyx":1272
  *                 if _isElement(c_start_node):
  *                     l += 1
  *                 c_start_node = c_start_node.prev             # <<<<<<<<<<<<<<
@@ -57555,7 +57585,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_v_c_start_node = __pyx_t_2;
     }
 
-    /* "lxml/etree.pyx":1270
+    /* "lxml/etree.pyx":1273
  *                     l += 1
  *                 c_start_node = c_start_node.prev
  *             if c_start_node == c_child:             # <<<<<<<<<<<<<<
@@ -57565,7 +57595,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     __pyx_t_3 = ((__pyx_v_c_start_node == __pyx_v_c_child) != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":1272
+      /* "lxml/etree.pyx":1275
  *             if c_start_node == c_child:
  *                 # found! before slice end?
  *                 if c_stop < 0 and l <= -c_stop:             # <<<<<<<<<<<<<<
@@ -57583,7 +57613,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_L29_bool_binop_done:;
       if (__pyx_t_3) {
 
-        /* "lxml/etree.pyx":1273
+        /* "lxml/etree.pyx":1276
  *                 # found! before slice end?
  *                 if c_stop < 0 and l <= -c_stop:
  *                     raise ValueError, u"list.index(x): x not in slice"             # <<<<<<<<<<<<<<
@@ -57591,9 +57621,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  *                 raise ValueError, u"list.index(x): x not in slice"
  */
         __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_list_index_x_x_not_in_slice, 0, 0);
-        __PYX_ERR(0, 1273, __pyx_L1_error)
+        __PYX_ERR(0, 1276, __pyx_L1_error)
 
-        /* "lxml/etree.pyx":1272
+        /* "lxml/etree.pyx":1275
  *             if c_start_node == c_child:
  *                 # found! before slice end?
  *                 if c_stop < 0 and l <= -c_stop:             # <<<<<<<<<<<<<<
@@ -57602,7 +57632,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
       }
 
-      /* "lxml/etree.pyx":1270
+      /* "lxml/etree.pyx":1273
  *                     l += 1
  *                 c_start_node = c_start_node.prev
  *             if c_start_node == c_child:             # <<<<<<<<<<<<<<
@@ -57612,7 +57642,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       goto __pyx_L27;
     }
 
-    /* "lxml/etree.pyx":1274
+    /* "lxml/etree.pyx":1277
  *                 if c_stop < 0 and l <= -c_stop:
  *                     raise ValueError, u"list.index(x): x not in slice"
  *             elif c_start < 0:             # <<<<<<<<<<<<<<
@@ -57622,7 +57652,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     __pyx_t_3 = ((__pyx_v_c_start < 0) != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":1275
+      /* "lxml/etree.pyx":1278
  *                     raise ValueError, u"list.index(x): x not in slice"
  *             elif c_start < 0:
  *                 raise ValueError, u"list.index(x): x not in slice"             # <<<<<<<<<<<<<<
@@ -57630,9 +57660,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  *         # now determine the index backwards from child
  */
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_list_index_x_x_not_in_slice, 0, 0);
-      __PYX_ERR(0, 1275, __pyx_L1_error)
+      __PYX_ERR(0, 1278, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":1274
+      /* "lxml/etree.pyx":1277
  *                 if c_stop < 0 and l <= -c_stop:
  *                     raise ValueError, u"list.index(x): x not in slice"
  *             elif c_start < 0:             # <<<<<<<<<<<<<<
@@ -57642,7 +57672,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     }
     __pyx_L27:;
 
-    /* "lxml/etree.pyx":1258
+    /* "lxml/etree.pyx":1261
  * 
  *         # for negative slice indices, check slice before searching index
  *         if c_start < 0 or c_stop < 0:             # <<<<<<<<<<<<<<
@@ -57651,7 +57681,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
   }
 
-  /* "lxml/etree.pyx":1278
+  /* "lxml/etree.pyx":1281
  * 
  *         # now determine the index backwards from child
  *         c_child = c_child.prev             # <<<<<<<<<<<<<<
@@ -57661,7 +57691,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   __pyx_t_2 = __pyx_v_c_child->prev;
   __pyx_v_c_child = __pyx_t_2;
 
-  /* "lxml/etree.pyx":1279
+  /* "lxml/etree.pyx":1282
  *         # now determine the index backwards from child
  *         c_child = c_child.prev
  *         k = 0             # <<<<<<<<<<<<<<
@@ -57670,7 +57700,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
   __pyx_v_k = 0;
 
-  /* "lxml/etree.pyx":1280
+  /* "lxml/etree.pyx":1283
  *         c_child = c_child.prev
  *         k = 0
  *         if c_stop > 0:             # <<<<<<<<<<<<<<
@@ -57680,7 +57710,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   __pyx_t_3 = ((__pyx_v_c_stop > 0) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1282
+    /* "lxml/etree.pyx":1285
  *         if c_stop > 0:
  *             # we can optimize: stop after c_stop elements if not found
  *             while c_child != NULL and k < c_stop:             # <<<<<<<<<<<<<<
@@ -57699,7 +57729,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_L34_bool_binop_done:;
       if (!__pyx_t_3) break;
 
-      /* "lxml/etree.pyx":1283
+      /* "lxml/etree.pyx":1286
  *             # we can optimize: stop after c_stop elements if not found
  *             while c_child != NULL and k < c_stop:
  *                 if _isElement(c_child):             # <<<<<<<<<<<<<<
@@ -57709,7 +57739,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_t_3 = (_isElement(__pyx_v_c_child) != 0);
       if (__pyx_t_3) {
 
-        /* "lxml/etree.pyx":1284
+        /* "lxml/etree.pyx":1287
  *             while c_child != NULL and k < c_stop:
  *                 if _isElement(c_child):
  *                     k += 1             # <<<<<<<<<<<<<<
@@ -57718,7 +57748,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
         __pyx_v_k = (__pyx_v_k + 1);
 
-        /* "lxml/etree.pyx":1283
+        /* "lxml/etree.pyx":1286
  *             # we can optimize: stop after c_stop elements if not found
  *             while c_child != NULL and k < c_stop:
  *                 if _isElement(c_child):             # <<<<<<<<<<<<<<
@@ -57727,7 +57757,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
       }
 
-      /* "lxml/etree.pyx":1285
+      /* "lxml/etree.pyx":1288
  *                 if _isElement(c_child):
  *                     k += 1
  *                 c_child = c_child.prev             # <<<<<<<<<<<<<<
@@ -57738,7 +57768,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_v_c_child = __pyx_t_2;
     }
 
-    /* "lxml/etree.pyx":1286
+    /* "lxml/etree.pyx":1289
  *                     k += 1
  *                 c_child = c_child.prev
  *             if k < c_stop:             # <<<<<<<<<<<<<<
@@ -57748,7 +57778,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     __pyx_t_3 = ((__pyx_v_k < __pyx_v_c_stop) != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":1287
+      /* "lxml/etree.pyx":1290
  *                 c_child = c_child.prev
  *             if k < c_stop:
  *                 return k             # <<<<<<<<<<<<<<
@@ -57756,13 +57786,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  *             # traverse all
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1287, __pyx_L1_error)
+      __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1290, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __pyx_r = __pyx_t_6;
       __pyx_t_6 = 0;
       goto __pyx_L0;
 
-      /* "lxml/etree.pyx":1286
+      /* "lxml/etree.pyx":1289
  *                     k += 1
  *                 c_child = c_child.prev
  *             if k < c_stop:             # <<<<<<<<<<<<<<
@@ -57771,7 +57801,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
     }
 
-    /* "lxml/etree.pyx":1280
+    /* "lxml/etree.pyx":1283
  *         c_child = c_child.prev
  *         k = 0
  *         if c_stop > 0:             # <<<<<<<<<<<<<<
@@ -57781,7 +57811,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     goto __pyx_L31;
   }
 
-  /* "lxml/etree.pyx":1290
+  /* "lxml/etree.pyx":1293
  *         else:
  *             # traverse all
  *             while c_child != NULL:             # <<<<<<<<<<<<<<
@@ -57793,7 +57823,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_t_3 = ((__pyx_v_c_child != NULL) != 0);
       if (!__pyx_t_3) break;
 
-      /* "lxml/etree.pyx":1291
+      /* "lxml/etree.pyx":1294
  *             # traverse all
  *             while c_child != NULL:
  *                 if _isElement(c_child):             # <<<<<<<<<<<<<<
@@ -57803,7 +57833,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_t_3 = (_isElement(__pyx_v_c_child) != 0);
       if (__pyx_t_3) {
 
-        /* "lxml/etree.pyx":1292
+        /* "lxml/etree.pyx":1295
  *             while c_child != NULL:
  *                 if _isElement(c_child):
  *                     k = k + 1             # <<<<<<<<<<<<<<
@@ -57812,7 +57842,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
         __pyx_v_k = (__pyx_v_k + 1);
 
-        /* "lxml/etree.pyx":1291
+        /* "lxml/etree.pyx":1294
  *             # traverse all
  *             while c_child != NULL:
  *                 if _isElement(c_child):             # <<<<<<<<<<<<<<
@@ -57821,7 +57851,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
       }
 
-      /* "lxml/etree.pyx":1293
+      /* "lxml/etree.pyx":1296
  *                 if _isElement(c_child):
  *                     k = k + 1
  *                 c_child = c_child.prev             # <<<<<<<<<<<<<<
@@ -57832,7 +57862,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_v_c_child = __pyx_t_2;
     }
 
-    /* "lxml/etree.pyx":1294
+    /* "lxml/etree.pyx":1297
  *                     k = k + 1
  *                 c_child = c_child.prev
  *             if c_start > 0:             # <<<<<<<<<<<<<<
@@ -57842,7 +57872,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
     __pyx_t_3 = ((__pyx_v_c_start > 0) != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":1295
+      /* "lxml/etree.pyx":1298
  *                 c_child = c_child.prev
  *             if c_start > 0:
  *                 if k >= c_start:             # <<<<<<<<<<<<<<
@@ -57852,7 +57882,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       __pyx_t_3 = ((__pyx_v_k >= __pyx_v_c_start) != 0);
       if (__pyx_t_3) {
 
-        /* "lxml/etree.pyx":1296
+        /* "lxml/etree.pyx":1299
  *             if c_start > 0:
  *                 if k >= c_start:
  *                     return k             # <<<<<<<<<<<<<<
@@ -57860,13 +57890,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  *                 return k
  */
         __Pyx_XDECREF(__pyx_r);
-        __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1296, __pyx_L1_error)
+        __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __pyx_r = __pyx_t_6;
         __pyx_t_6 = 0;
         goto __pyx_L0;
 
-        /* "lxml/etree.pyx":1295
+        /* "lxml/etree.pyx":1298
  *                 c_child = c_child.prev
  *             if c_start > 0:
  *                 if k >= c_start:             # <<<<<<<<<<<<<<
@@ -57875,7 +57905,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
       }
 
-      /* "lxml/etree.pyx":1294
+      /* "lxml/etree.pyx":1297
  *                     k = k + 1
  *                 c_child = c_child.prev
  *             if c_start > 0:             # <<<<<<<<<<<<<<
@@ -57885,7 +57915,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
       goto __pyx_L41;
     }
 
-    /* "lxml/etree.pyx":1298
+    /* "lxml/etree.pyx":1301
  *                     return k
  *             else:
  *                 return k             # <<<<<<<<<<<<<<
@@ -57894,7 +57924,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
     /*else*/ {
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1298, __pyx_L1_error)
+      __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1301, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __pyx_r = __pyx_t_6;
       __pyx_t_6 = 0;
@@ -57904,7 +57934,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   }
   __pyx_L31:;
 
-  /* "lxml/etree.pyx":1299
+  /* "lxml/etree.pyx":1302
  *             else:
  *                 return k
  *         if c_start != 0 or c_stop != 0:             # <<<<<<<<<<<<<<
@@ -57922,7 +57952,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   __pyx_L44_bool_binop_done:;
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1300
+    /* "lxml/etree.pyx":1303
  *                 return k
  *         if c_start != 0 or c_stop != 0:
  *             raise ValueError, u"list.index(x): x not in slice"             # <<<<<<<<<<<<<<
@@ -57930,9 +57960,9 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  *             raise ValueError, u"list.index(x): x not in list"
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_list_index_x_x_not_in_slice, 0, 0);
-    __PYX_ERR(0, 1300, __pyx_L1_error)
+    __PYX_ERR(0, 1303, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":1299
+    /* "lxml/etree.pyx":1302
  *             else:
  *                 return k
  *         if c_start != 0 or c_stop != 0:             # <<<<<<<<<<<<<<
@@ -57941,7 +57971,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
   }
 
-  /* "lxml/etree.pyx":1302
+  /* "lxml/etree.pyx":1305
  *             raise ValueError, u"list.index(x): x not in slice"
  *         else:
  *             raise ValueError, u"list.index(x): x not in list"             # <<<<<<<<<<<<<<
@@ -57950,10 +57980,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_list_index_x_x_not_in_list, 0, 0);
-    __PYX_ERR(0, 1302, __pyx_L1_error)
+    __PYX_ERR(0, 1305, __pyx_L1_error)
   }
 
-  /* "lxml/etree.pyx":1217
+  /* "lxml/etree.pyx":1220
  *         return ElementChildIterator(self, reversed=True)
  * 
  *     def index(self, _Element child not None, start=None, stop=None):             # <<<<<<<<<<<<<<
@@ -57972,7 +58002,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_44index(struct LxmlElement *__p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1304
+/* "lxml/etree.pyx":1307
  *             raise ValueError, u"list.index(x): x not in list"
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
@@ -58018,7 +58048,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_47get(PyObject *__pyx_v_self, P
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 1304, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 1307, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -58034,7 +58064,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_47get(PyObject *__pyx_v_self, P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1304, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1307, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Element.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -58054,16 +58084,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_46get(struct LxmlElement *__pyx
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("get", 0);
 
-  /* "lxml/etree.pyx":1309
+  /* "lxml/etree.pyx":1312
  *         Gets an element attribute.
  *         """
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         return _getAttributeValue(self, key, default)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1309, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1312, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1310
+  /* "lxml/etree.pyx":1313
  *         """
  *         _assertValidNode(self)
  *         return _getAttributeValue(self, key, default)             # <<<<<<<<<<<<<<
@@ -58071,13 +58101,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_46get(struct LxmlElement *__pyx
  *     def keys(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__getAttributeValue(__pyx_v_self, __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1310, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__getAttributeValue(__pyx_v_self, __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1304
+  /* "lxml/etree.pyx":1307
  *             raise ValueError, u"list.index(x): x not in list"
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
@@ -58096,7 +58126,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_46get(struct LxmlElement *__pyx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1312
+/* "lxml/etree.pyx":1315
  *         return _getAttributeValue(self, key, default)
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
@@ -58126,16 +58156,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_48keys(struct LxmlElement *__py
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("keys", 0);
 
-  /* "lxml/etree.pyx":1318
+  /* "lxml/etree.pyx":1321
  *         arbitrary order (just like for an ordinary Python dictionary).
  *         """
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         return _collectAttributes(self._c_node, 1)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1318, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1321, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1319
+  /* "lxml/etree.pyx":1322
  *         """
  *         _assertValidNode(self)
  *         return _collectAttributes(self._c_node, 1)             # <<<<<<<<<<<<<<
@@ -58143,13 +58173,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_48keys(struct LxmlElement *__py
  *     def values(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_c_node, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_c_node, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1312
+  /* "lxml/etree.pyx":1315
  *         return _getAttributeValue(self, key, default)
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
@@ -58168,7 +58198,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_48keys(struct LxmlElement *__py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1321
+/* "lxml/etree.pyx":1324
  *         return _collectAttributes(self._c_node, 1)
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
@@ -58198,16 +58228,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_50values(struct LxmlElement *__
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("values", 0);
 
-  /* "lxml/etree.pyx":1327
+  /* "lxml/etree.pyx":1330
  *         attributes are returned in an arbitrary order.
  *         """
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         return _collectAttributes(self._c_node, 2)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1327, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1330, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1328
+  /* "lxml/etree.pyx":1331
  *         """
  *         _assertValidNode(self)
  *         return _collectAttributes(self._c_node, 2)             # <<<<<<<<<<<<<<
@@ -58215,13 +58245,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_50values(struct LxmlElement *__
  *     def items(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_c_node, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_c_node, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1321
+  /* "lxml/etree.pyx":1324
  *         return _collectAttributes(self._c_node, 1)
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
@@ -58240,7 +58270,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_50values(struct LxmlElement *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1330
+/* "lxml/etree.pyx":1333
  *         return _collectAttributes(self._c_node, 2)
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
@@ -58270,16 +58300,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_52items(struct LxmlElement *__p
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("items", 0);
 
-  /* "lxml/etree.pyx":1336
+  /* "lxml/etree.pyx":1339
  *         an arbitrary order.
  *         """
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         return _collectAttributes(self._c_node, 3)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1336, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1339, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1337
+  /* "lxml/etree.pyx":1340
  *         """
  *         _assertValidNode(self)
  *         return _collectAttributes(self._c_node, 3)             # <<<<<<<<<<<<<<
@@ -58287,13 +58317,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_52items(struct LxmlElement *__p
  *     def getchildren(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_c_node, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_c_node, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1340, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1330
+  /* "lxml/etree.pyx":1333
  *         return _collectAttributes(self._c_node, 2)
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
@@ -58312,7 +58342,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_52items(struct LxmlElement *__p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1339
+/* "lxml/etree.pyx":1342
  *         return _collectAttributes(self._c_node, 3)
  * 
  *     def getchildren(self):             # <<<<<<<<<<<<<<
@@ -58342,16 +58372,16 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_54getchildren(struct LxmlElemen
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("getchildren", 0);
 
-  /* "lxml/etree.pyx":1349
+  /* "lxml/etree.pyx":1352
  *           ``list(element)`` or simply iterate over elements.
  *         """
  *         _assertValidNode(self)             # <<<<<<<<<<<<<<
  *         return _collectChildren(self)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1349, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1352, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1350
+  /* "lxml/etree.pyx":1353
  *         """
  *         _assertValidNode(self)
  *         return _collectChildren(self)             # <<<<<<<<<<<<<<
@@ -58359,13 +58389,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_54getchildren(struct LxmlElemen
  *     def getparent(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectChildren(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1350, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectChildren(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1339
+  /* "lxml/etree.pyx":1342
  *         return _collectAttributes(self._c_node, 3)
  * 
  *     def getchildren(self):             # <<<<<<<<<<<<<<
@@ -58384,7 +58414,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_54getchildren(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1352
+/* "lxml/etree.pyx":1355
  *         return _collectChildren(self)
  * 
  *     def getparent(self):             # <<<<<<<<<<<<<<
@@ -58416,7 +58446,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_56getparent(struct LxmlElement
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("getparent", 0);
 
-  /* "lxml/etree.pyx":1359
+  /* "lxml/etree.pyx":1362
  *         cdef xmlNode* c_node
  *         #_assertValidNode(self) # not needed
  *         c_node = _parentElement(self._c_node)             # <<<<<<<<<<<<<<
@@ -58425,7 +58455,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_56getparent(struct LxmlElement
  */
   __pyx_v_c_node = __pyx_f_4lxml_5etree__parentElement(__pyx_v_self->_c_node);
 
-  /* "lxml/etree.pyx":1360
+  /* "lxml/etree.pyx":1363
  *         #_assertValidNode(self) # not needed
  *         c_node = _parentElement(self._c_node)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -58435,7 +58465,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_56getparent(struct LxmlElement
   __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":1361
+    /* "lxml/etree.pyx":1364
  *         c_node = _parentElement(self._c_node)
  *         if c_node is NULL:
  *             return None             # <<<<<<<<<<<<<<
@@ -58447,7 +58477,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_56getparent(struct LxmlElement
     __pyx_r = Py_None;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1360
+    /* "lxml/etree.pyx":1363
  *         #_assertValidNode(self) # not needed
  *         c_node = _parentElement(self._c_node)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -58456,7 +58486,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_56getparent(struct LxmlElement
  */
   }
 
-  /* "lxml/etree.pyx":1362
+  /* "lxml/etree.pyx":1365
  *         if c_node is NULL:
  *             return None
  *         return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
@@ -58466,14 +58496,14 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_56getparent(struct LxmlElement
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_2 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_2), __pyx_v_c_node)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_2), __pyx_v_c_node)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1365, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1352
+  /* "lxml/etree.pyx":1355
  *         return _collectChildren(self)
  * 
  *     def getparent(self):             # <<<<<<<<<<<<<<
@@ -58493,7 +58523,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_56getparent(struct LxmlElement
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1364
+/* "lxml/etree.pyx":1367
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def getnext(self):             # <<<<<<<<<<<<<<
@@ -58525,7 +58555,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_58getnext(struct LxmlElement *_
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("getnext", 0);
 
-  /* "lxml/etree.pyx":1371
+  /* "lxml/etree.pyx":1374
  *         cdef xmlNode* c_node
  *         #_assertValidNode(self) # not needed
  *         c_node = _nextElement(self._c_node)             # <<<<<<<<<<<<<<
@@ -58534,7 +58564,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_58getnext(struct LxmlElement *_
  */
   __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_self->_c_node);
 
-  /* "lxml/etree.pyx":1372
+  /* "lxml/etree.pyx":1375
  *         #_assertValidNode(self) # not needed
  *         c_node = _nextElement(self._c_node)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -58544,7 +58574,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_58getnext(struct LxmlElement *_
   __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":1373
+    /* "lxml/etree.pyx":1376
  *         c_node = _nextElement(self._c_node)
  *         if c_node is NULL:
  *             return None             # <<<<<<<<<<<<<<
@@ -58556,7 +58586,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_58getnext(struct LxmlElement *_
     __pyx_r = Py_None;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1372
+    /* "lxml/etree.pyx":1375
  *         #_assertValidNode(self) # not needed
  *         c_node = _nextElement(self._c_node)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -58565,7 +58595,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_58getnext(struct LxmlElement *_
  */
   }
 
-  /* "lxml/etree.pyx":1374
+  /* "lxml/etree.pyx":1377
  *         if c_node is NULL:
  *             return None
  *         return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
@@ -58575,14 +58605,14 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_58getnext(struct LxmlElement *_
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_2 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_2), __pyx_v_c_node)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1374, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_2), __pyx_v_c_node)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1377, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1364
+  /* "lxml/etree.pyx":1367
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def getnext(self):             # <<<<<<<<<<<<<<
@@ -58602,7 +58632,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_58getnext(struct LxmlElement *_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1376
+/* "lxml/etree.pyx":1379
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def getprevious(self):             # <<<<<<<<<<<<<<
@@ -58634,7 +58664,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_60getprevious(struct LxmlElemen
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("getprevious", 0);
 
-  /* "lxml/etree.pyx":1383
+  /* "lxml/etree.pyx":1386
  *         cdef xmlNode* c_node
  *         #_assertValidNode(self) # not needed
  *         c_node = _previousElement(self._c_node)             # <<<<<<<<<<<<<<
@@ -58643,7 +58673,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_60getprevious(struct LxmlElemen
  */
   __pyx_v_c_node = __pyx_f_4lxml_5etree__previousElement(__pyx_v_self->_c_node);
 
-  /* "lxml/etree.pyx":1384
+  /* "lxml/etree.pyx":1387
  *         #_assertValidNode(self) # not needed
  *         c_node = _previousElement(self._c_node)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -58653,7 +58683,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_60getprevious(struct LxmlElemen
   __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":1385
+    /* "lxml/etree.pyx":1388
  *         c_node = _previousElement(self._c_node)
  *         if c_node is NULL:
  *             return None             # <<<<<<<<<<<<<<
@@ -58665,7 +58695,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_60getprevious(struct LxmlElemen
     __pyx_r = Py_None;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1384
+    /* "lxml/etree.pyx":1387
  *         #_assertValidNode(self) # not needed
  *         c_node = _previousElement(self._c_node)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -58674,7 +58704,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_60getprevious(struct LxmlElemen
  */
   }
 
-  /* "lxml/etree.pyx":1386
+  /* "lxml/etree.pyx":1389
  *         if c_node is NULL:
  *             return None
  *         return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
@@ -58684,14 +58714,14 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_60getprevious(struct LxmlElemen
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_2 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_2), __pyx_v_c_node)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_2), __pyx_v_c_node)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1389, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1376
+  /* "lxml/etree.pyx":1379
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def getprevious(self):             # <<<<<<<<<<<<<<
@@ -58711,7 +58741,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_60getprevious(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1388
+/* "lxml/etree.pyx":1391
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def itersiblings(self, tag=None, *tags, preceding=False):             # <<<<<<<<<<<<<<
@@ -58769,7 +58799,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_63itersiblings(PyObject *__pyx_
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "itersiblings") < 0)) __PYX_ERR(0, 1388, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "itersiblings") < 0)) __PYX_ERR(0, 1391, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -58808,7 +58838,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_62itersiblings(struct LxmlEleme
   __Pyx_RefNannySetupContext("itersiblings", 0);
   __Pyx_INCREF(__pyx_v_tags);
 
-  /* "lxml/etree.pyx":1402
+  /* "lxml/etree.pyx":1405
  *         see `iter`.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -58819,25 +58849,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_62itersiblings(struct LxmlEleme
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1403
+    /* "lxml/etree.pyx":1406
  *         """
  *         if tag is not None:
  *             tags += (tag,)             # <<<<<<<<<<<<<<
  *         return SiblingsIterator(self, tags, preceding=preceding)
  * 
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1403, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1406, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tag);
-    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1403, __pyx_L1_error)
+    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1406, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF_SET(__pyx_v_tags, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1402
+    /* "lxml/etree.pyx":1405
  *         see `iter`.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -58846,7 +58876,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_62itersiblings(struct LxmlEleme
  */
   }
 
-  /* "lxml/etree.pyx":1404
+  /* "lxml/etree.pyx":1407
  *         if tag is not None:
  *             tags += (tag,)
  *         return SiblingsIterator(self, tags, preceding=preceding)             # <<<<<<<<<<<<<<
@@ -58854,7 +58884,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_62itersiblings(struct LxmlEleme
  *     def iterancestors(self, tag=None, *tags):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1404, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1407, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
@@ -58862,10 +58892,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_62itersiblings(struct LxmlEleme
   __Pyx_INCREF(__pyx_v_tags);
   __Pyx_GIVEREF(__pyx_v_tags);
   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tags);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1404, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_preceding, __pyx_v_preceding) < 0) __PYX_ERR(0, 1404, __pyx_L1_error)
-  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_SiblingsIterator), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1404, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_preceding, __pyx_v_preceding) < 0) __PYX_ERR(0, 1407, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_SiblingsIterator), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1407, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -58873,7 +58903,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_62itersiblings(struct LxmlEleme
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1388
+  /* "lxml/etree.pyx":1391
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def itersiblings(self, tag=None, *tags, preceding=False):             # <<<<<<<<<<<<<<
@@ -58895,7 +58925,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_62itersiblings(struct LxmlEleme
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1406
+/* "lxml/etree.pyx":1409
  *         return SiblingsIterator(self, tags, preceding=preceding)
  * 
  *     def iterancestors(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -58946,7 +58976,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_65iterancestors(PyObject *__pyx
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "iterancestors") < 0)) __PYX_ERR(0, 1406, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "iterancestors") < 0)) __PYX_ERR(0, 1409, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -58983,7 +59013,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_64iterancestors(struct LxmlElem
   __Pyx_RefNannySetupContext("iterancestors", 0);
   __Pyx_INCREF(__pyx_v_tags);
 
-  /* "lxml/etree.pyx":1414
+  /* "lxml/etree.pyx":1417
  *         see `iter`.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -58994,25 +59024,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_64iterancestors(struct LxmlElem
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1415
+    /* "lxml/etree.pyx":1418
  *         """
  *         if tag is not None:
  *             tags += (tag,)             # <<<<<<<<<<<<<<
  *         return AncestorsIterator(self, tags)
  * 
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1415, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1418, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tag);
-    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __pyx_L1_error)
+    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF_SET(__pyx_v_tags, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1414
+    /* "lxml/etree.pyx":1417
  *         see `iter`.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59021,7 +59051,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_64iterancestors(struct LxmlElem
  */
   }
 
-  /* "lxml/etree.pyx":1416
+  /* "lxml/etree.pyx":1419
  *         if tag is not None:
  *             tags += (tag,)
  *         return AncestorsIterator(self, tags)             # <<<<<<<<<<<<<<
@@ -59029,7 +59059,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_64iterancestors(struct LxmlElem
  *     def iterdescendants(self, tag=None, *tags):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1416, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1419, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
@@ -59037,14 +59067,14 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_64iterancestors(struct LxmlElem
   __Pyx_INCREF(__pyx_v_tags);
   __Pyx_GIVEREF(__pyx_v_tags);
   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tags);
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_AncestorsIterator), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_AncestorsIterator), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1406
+  /* "lxml/etree.pyx":1409
  *         return SiblingsIterator(self, tags, preceding=preceding)
  * 
  *     def iterancestors(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -59065,7 +59095,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_64iterancestors(struct LxmlElem
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1418
+/* "lxml/etree.pyx":1421
  *         return AncestorsIterator(self, tags)
  * 
  *     def iterdescendants(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -59116,7 +59146,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_67iterdescendants(PyObject *__p
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "iterdescendants") < 0)) __PYX_ERR(0, 1418, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "iterdescendants") < 0)) __PYX_ERR(0, 1421, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -59154,7 +59184,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_66iterdescendants(struct LxmlEl
   __Pyx_RefNannySetupContext("iterdescendants", 0);
   __Pyx_INCREF(__pyx_v_tags);
 
-  /* "lxml/etree.pyx":1427
+  /* "lxml/etree.pyx":1430
  *         with a specific tag, see `iter`.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59165,25 +59195,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_66iterdescendants(struct LxmlEl
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1428
+    /* "lxml/etree.pyx":1431
  *         """
  *         if tag is not None:
  *             tags += (tag,)             # <<<<<<<<<<<<<<
  *         return ElementDepthFirstIterator(self, tags, inclusive=False)
  * 
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1428, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tag);
-    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1428, __pyx_L1_error)
+    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1431, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF_SET(__pyx_v_tags, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1427
+    /* "lxml/etree.pyx":1430
  *         with a specific tag, see `iter`.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59192,7 +59222,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_66iterdescendants(struct LxmlEl
  */
   }
 
-  /* "lxml/etree.pyx":1429
+  /* "lxml/etree.pyx":1432
  *         if tag is not None:
  *             tags += (tag,)
  *         return ElementDepthFirstIterator(self, tags, inclusive=False)             # <<<<<<<<<<<<<<
@@ -59200,7 +59230,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_66iterdescendants(struct LxmlEl
  *     def iterchildren(self, tag=None, *tags, reversed=False):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1432, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
@@ -59208,10 +59238,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_66iterdescendants(struct LxmlEl
   __Pyx_INCREF(__pyx_v_tags);
   __Pyx_GIVEREF(__pyx_v_tags);
   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tags);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1432, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inclusive, Py_False) < 0) __PYX_ERR(0, 1429, __pyx_L1_error)
-  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1429, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inclusive, Py_False) < 0) __PYX_ERR(0, 1432, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1432, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -59219,7 +59249,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_66iterdescendants(struct LxmlEl
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1418
+  /* "lxml/etree.pyx":1421
  *         return AncestorsIterator(self, tags)
  * 
  *     def iterdescendants(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -59241,7 +59271,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_66iterdescendants(struct LxmlEl
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1431
+/* "lxml/etree.pyx":1434
  *         return ElementDepthFirstIterator(self, tags, inclusive=False)
  * 
  *     def iterchildren(self, tag=None, *tags, reversed=False):             # <<<<<<<<<<<<<<
@@ -59299,7 +59329,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_69iterchildren(PyObject *__pyx_
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "iterchildren") < 0)) __PYX_ERR(0, 1431, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "iterchildren") < 0)) __PYX_ERR(0, 1434, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -59338,7 +59368,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_68iterchildren(struct LxmlEleme
   __Pyx_RefNannySetupContext("iterchildren", 0);
   __Pyx_INCREF(__pyx_v_tags);
 
-  /* "lxml/etree.pyx":1440
+  /* "lxml/etree.pyx":1443
  *         to find only elements with a specific tag, see `iter`.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59349,25 +59379,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_68iterchildren(struct LxmlEleme
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1441
+    /* "lxml/etree.pyx":1444
  *         """
  *         if tag is not None:
  *             tags += (tag,)             # <<<<<<<<<<<<<<
  *         return ElementChildIterator(self, tags, reversed=reversed)
  * 
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1441, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1444, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tag);
-    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1441, __pyx_L1_error)
+    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1444, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF_SET(__pyx_v_tags, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1440
+    /* "lxml/etree.pyx":1443
  *         to find only elements with a specific tag, see `iter`.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59376,7 +59406,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_68iterchildren(struct LxmlEleme
  */
   }
 
-  /* "lxml/etree.pyx":1442
+  /* "lxml/etree.pyx":1445
  *         if tag is not None:
  *             tags += (tag,)
  *         return ElementChildIterator(self, tags, reversed=reversed)             # <<<<<<<<<<<<<<
@@ -59384,7 +59414,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_68iterchildren(struct LxmlEleme
  *     def getroottree(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1445, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
@@ -59392,10 +59422,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_68iterchildren(struct LxmlEleme
   __Pyx_INCREF(__pyx_v_tags);
   __Pyx_GIVEREF(__pyx_v_tags);
   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tags);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1442, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_reversed, __pyx_v_reversed) < 0) __PYX_ERR(0, 1442, __pyx_L1_error)
-  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementChildIterator), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1442, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_reversed, __pyx_v_reversed) < 0) __PYX_ERR(0, 1445, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementChildIterator), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1445, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -59403,7 +59433,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_68iterchildren(struct LxmlEleme
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1431
+  /* "lxml/etree.pyx":1434
  *         return ElementDepthFirstIterator(self, tags, inclusive=False)
  * 
  *     def iterchildren(self, tag=None, *tags, reversed=False):             # <<<<<<<<<<<<<<
@@ -59425,7 +59455,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_68iterchildren(struct LxmlEleme
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1444
+/* "lxml/etree.pyx":1447
  *         return ElementChildIterator(self, tags, reversed=reversed)
  * 
  *     def getroottree(self):             # <<<<<<<<<<<<<<
@@ -59456,7 +59486,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_70getroottree(struct LxmlElemen
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("getroottree", 0);
 
-  /* "lxml/etree.pyx":1453
+  /* "lxml/etree.pyx":1456
  *         returns None (for the root element) and then build an ElementTree for
  *         the last parent that was returned."""
  *         _assertValidDoc(self._doc)             # <<<<<<<<<<<<<<
@@ -59465,10 +59495,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_70getroottree(struct LxmlElemen
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1453, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1456, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":1454
+  /* "lxml/etree.pyx":1457
  *         the last parent that was returned."""
  *         _assertValidDoc(self._doc)
  *         return _elementTreeFactory(self._doc, None)             # <<<<<<<<<<<<<<
@@ -59478,14 +59508,14 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_70getroottree(struct LxmlElemen
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)__pyx_t_1), ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1454, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)__pyx_t_1), ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1457, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1444
+  /* "lxml/etree.pyx":1447
  *         return ElementChildIterator(self, tags, reversed=reversed)
  * 
  *     def getroottree(self):             # <<<<<<<<<<<<<<
@@ -59505,7 +59535,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_70getroottree(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1456
+/* "lxml/etree.pyx":1459
  *         return _elementTreeFactory(self._doc, None)
  * 
  *     def getiterator(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -59556,7 +59586,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_73getiterator(PyObject *__pyx_v
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "getiterator") < 0)) __PYX_ERR(0, 1456, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "getiterator") < 0)) __PYX_ERR(0, 1459, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -59593,7 +59623,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_72getiterator(struct LxmlElemen
   __Pyx_RefNannySetupContext("getiterator", 0);
   __Pyx_INCREF(__pyx_v_tags);
 
-  /* "lxml/etree.pyx":1474
+  /* "lxml/etree.pyx":1477
  *           with older versions of lxml or ElementTree.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59604,25 +59634,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_72getiterator(struct LxmlElemen
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1475
+    /* "lxml/etree.pyx":1478
  *         """
  *         if tag is not None:
  *             tags += (tag,)             # <<<<<<<<<<<<<<
  *         return ElementDepthFirstIterator(self, tags)
  * 
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1475, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1478, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tag);
-    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __pyx_L1_error)
+    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF_SET(__pyx_v_tags, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1474
+    /* "lxml/etree.pyx":1477
  *           with older versions of lxml or ElementTree.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59631,7 +59661,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_72getiterator(struct LxmlElemen
  */
   }
 
-  /* "lxml/etree.pyx":1476
+  /* "lxml/etree.pyx":1479
  *         if tag is not None:
  *             tags += (tag,)
  *         return ElementDepthFirstIterator(self, tags)             # <<<<<<<<<<<<<<
@@ -59639,7 +59669,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_72getiterator(struct LxmlElemen
  *     def iter(self, tag=None, *tags):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1476, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1479, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
@@ -59647,14 +59677,14 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_72getiterator(struct LxmlElemen
   __Pyx_INCREF(__pyx_v_tags);
   __Pyx_GIVEREF(__pyx_v_tags);
   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tags);
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1476, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1479, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1456
+  /* "lxml/etree.pyx":1459
  *         return _elementTreeFactory(self._doc, None)
  * 
  *     def getiterator(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -59675,7 +59705,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_72getiterator(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1478
+/* "lxml/etree.pyx":1481
  *         return ElementDepthFirstIterator(self, tags)
  * 
  *     def iter(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -59726,7 +59756,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_75iter(PyObject *__pyx_v_self,
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "iter") < 0)) __PYX_ERR(0, 1478, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "iter") < 0)) __PYX_ERR(0, 1481, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -59763,7 +59793,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_74iter(struct LxmlElement *__py
   __Pyx_RefNannySetupContext("iter", 0);
   __Pyx_INCREF(__pyx_v_tags);
 
-  /* "lxml/etree.pyx":1497
+  /* "lxml/etree.pyx":1500
  *         matching any of these tags, in document order.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59774,25 +59804,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_74iter(struct LxmlElement *__py
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1498
+    /* "lxml/etree.pyx":1501
  *         """
  *         if tag is not None:
  *             tags += (tag,)             # <<<<<<<<<<<<<<
  *         return ElementDepthFirstIterator(self, tags)
  * 
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1501, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tag);
-    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1498, __pyx_L1_error)
+    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1501, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF_SET(__pyx_v_tags, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1497
+    /* "lxml/etree.pyx":1500
  *         matching any of these tags, in document order.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59801,7 +59831,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_74iter(struct LxmlElement *__py
  */
   }
 
-  /* "lxml/etree.pyx":1499
+  /* "lxml/etree.pyx":1502
  *         if tag is not None:
  *             tags += (tag,)
  *         return ElementDepthFirstIterator(self, tags)             # <<<<<<<<<<<<<<
@@ -59809,7 +59839,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_74iter(struct LxmlElement *__py
  *     def itertext(self, tag=None, *tags, with_tail=True):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1499, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1502, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
@@ -59817,14 +59847,14 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_74iter(struct LxmlElement *__py
   __Pyx_INCREF(__pyx_v_tags);
   __Pyx_GIVEREF(__pyx_v_tags);
   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tags);
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1499, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1502, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1478
+  /* "lxml/etree.pyx":1481
  *         return ElementDepthFirstIterator(self, tags)
  * 
  *     def iter(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -59845,7 +59875,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_74iter(struct LxmlElement *__py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1501
+/* "lxml/etree.pyx":1504
  *         return ElementDepthFirstIterator(self, tags)
  * 
  *     def itertext(self, tag=None, *tags, with_tail=True):             # <<<<<<<<<<<<<<
@@ -59903,7 +59933,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_77itertext(PyObject *__pyx_v_se
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "itertext") < 0)) __PYX_ERR(0, 1501, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "itertext") < 0)) __PYX_ERR(0, 1504, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -59942,7 +59972,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_76itertext(struct LxmlElement *
   __Pyx_RefNannySetupContext("itertext", 0);
   __Pyx_INCREF(__pyx_v_tags);
 
-  /* "lxml/etree.pyx":1512
+  /* "lxml/etree.pyx":1515
  *         over tail text.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59953,25 +59983,25 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_76itertext(struct LxmlElement *
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1513
+    /* "lxml/etree.pyx":1516
  *         """
  *         if tag is not None:
  *             tags += (tag,)             # <<<<<<<<<<<<<<
  *         return ElementTextIterator(self, tags, with_tail=with_tail)
  * 
  */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1513, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tag);
-    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1513, __pyx_L1_error)
+    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1516, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF_SET(__pyx_v_tags, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1512
+    /* "lxml/etree.pyx":1515
  *         over tail text.
  *         """
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -59980,7 +60010,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_76itertext(struct LxmlElement *
  */
   }
 
-  /* "lxml/etree.pyx":1514
+  /* "lxml/etree.pyx":1517
  *         if tag is not None:
  *             tags += (tag,)
  *         return ElementTextIterator(self, tags, with_tail=with_tail)             # <<<<<<<<<<<<<<
@@ -59988,7 +60018,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_76itertext(struct LxmlElement *
  *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
@@ -59996,10 +60026,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_76itertext(struct LxmlElement *
   __Pyx_INCREF(__pyx_v_tags);
   __Pyx_GIVEREF(__pyx_v_tags);
   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tags);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1514, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_with_tail, __pyx_v_with_tail) < 0) __PYX_ERR(0, 1514, __pyx_L1_error)
-  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementTextIterator), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_with_tail, __pyx_v_with_tail) < 0) __PYX_ERR(0, 1517, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ElementTextIterator), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -60007,7 +60037,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_76itertext(struct LxmlElement *
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1501
+  /* "lxml/etree.pyx":1504
  *         return ElementDepthFirstIterator(self, tags)
  * 
  *     def itertext(self, tag=None, *tags, with_tail=True):             # <<<<<<<<<<<<<<
@@ -60029,7 +60059,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_76itertext(struct LxmlElement *
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1516
+/* "lxml/etree.pyx":1519
  *         return ElementTextIterator(self, tags, with_tail=with_tail)
  * 
  *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
@@ -60088,7 +60118,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_79makeelement(PyObject *__pyx_v
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, pos_args, "makeelement") < 0)) __PYX_ERR(0, 1516, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, pos_args, "makeelement") < 0)) __PYX_ERR(0, 1519, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -60107,7 +60137,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_79makeelement(PyObject *__pyx_v
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("makeelement", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1516, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("makeelement", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1519, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v__extra); __pyx_v__extra = 0;
   __Pyx_AddTraceback("lxml.etree._Element.makeelement", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -60130,7 +60160,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_78makeelement(struct LxmlElemen
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("makeelement", 0);
 
-  /* "lxml/etree.pyx":1521
+  /* "lxml/etree.pyx":1524
  *         Creates a new element associated with the same document.
  *         """
  *         _assertValidDoc(self._doc)             # <<<<<<<<<<<<<<
@@ -60139,10 +60169,10 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_78makeelement(struct LxmlElemen
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1521, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1524, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":1522
+  /* "lxml/etree.pyx":1525
  *         """
  *         _assertValidDoc(self._doc)
  *         return _makeElement(_tag, NULL, self._doc, None, None, None,             # <<<<<<<<<<<<<<
@@ -60153,21 +60183,21 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_78makeelement(struct LxmlElemen
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_doc);
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "lxml/etree.pyx":1523
+  /* "lxml/etree.pyx":1526
  *         _assertValidDoc(self._doc)
  *         return _makeElement(_tag, NULL, self._doc, None, None, None,
  *                             attrib, nsmap, _extra)             # <<<<<<<<<<<<<<
  * 
  *     def find(self, path, namespaces=None):
  */
-  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v__tag, NULL, ((struct LxmlDocument *)__pyx_t_1), ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None), Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1522, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v__tag, NULL, ((struct LxmlDocument *)__pyx_t_1), ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None), Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1516
+  /* "lxml/etree.pyx":1519
  *         return ElementTextIterator(self, tags, with_tail=with_tail)
  * 
  *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
@@ -60187,7 +60217,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_78makeelement(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1525
+/* "lxml/etree.pyx":1528
  *                             attrib, nsmap, _extra)
  * 
  *     def find(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -60233,7 +60263,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_81find(PyObject *__pyx_v_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find") < 0)) __PYX_ERR(0, 1525, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find") < 0)) __PYX_ERR(0, 1528, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -60249,7 +60279,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_81find(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("find", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1525, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("find", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1528, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Element.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -60275,7 +60305,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_80find(struct LxmlElement *__py
   __Pyx_RefNannySetupContext("find", 0);
   __Pyx_INCREF(__pyx_v_path);
 
-  /* "lxml/etree.pyx":1534
+  /* "lxml/etree.pyx":1537
  *         prefixes in the path expression.
  *         """
  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
@@ -60286,7 +60316,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_80find(struct LxmlElement *__py
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1535
+    /* "lxml/etree.pyx":1538
  *         """
  *         if isinstance(path, QName):
  *             path = (<QName>path).text             # <<<<<<<<<<<<<<
@@ -60298,7 +60328,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_80find(struct LxmlElement *__py
     __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":1534
+    /* "lxml/etree.pyx":1537
  *         prefixes in the path expression.
  *         """
  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
@@ -60307,7 +60337,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_80find(struct LxmlElement *__py
  */
   }
 
-  /* "lxml/etree.pyx":1536
+  /* "lxml/etree.pyx":1539
  *         if isinstance(path, QName):
  *             path = (<QName>path).text
  *         return _elementpath.find(self, path, namespaces)             # <<<<<<<<<<<<<<
@@ -60315,7 +60345,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_80find(struct LxmlElement *__py
  *     def findtext(self, path, default=None, namespaces=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_s_find); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1536, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_s_find); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1539, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_5 = NULL;
   __pyx_t_6 = 0;
@@ -60332,7 +60362,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_80find(struct LxmlElement *__py
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1536, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1539, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -60340,13 +60370,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_80find(struct LxmlElement *__py
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1536, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1539, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1536, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1539, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_5) {
       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
@@ -60360,7 +60390,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_80find(struct LxmlElement *__py
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_namespaces);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1536, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1539, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -60369,7 +60399,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_80find(struct LxmlElement *__py
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1525
+  /* "lxml/etree.pyx":1528
  *                             attrib, nsmap, _extra)
  * 
  *     def find(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -60392,7 +60422,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_80find(struct LxmlElement *__py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1538
+/* "lxml/etree.pyx":1541
  *         return _elementpath.find(self, path, namespaces)
  * 
  *     def findtext(self, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
@@ -60448,7 +60478,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_83findtext(PyObject *__pyx_v_se
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findtext") < 0)) __PYX_ERR(0, 1538, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findtext") < 0)) __PYX_ERR(0, 1541, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -60467,7 +60497,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_83findtext(PyObject *__pyx_v_se
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("findtext", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1538, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("findtext", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1541, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Element.findtext", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -60493,7 +60523,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_82findtext(struct LxmlElement *
   __Pyx_RefNannySetupContext("findtext", 0);
   __Pyx_INCREF(__pyx_v_path);
 
-  /* "lxml/etree.pyx":1547
+  /* "lxml/etree.pyx":1550
  *         prefixes in the path expression.
  *         """
  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
@@ -60504,7 +60534,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_82findtext(struct LxmlElement *
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1548
+    /* "lxml/etree.pyx":1551
  *         """
  *         if isinstance(path, QName):
  *             path = (<QName>path).text             # <<<<<<<<<<<<<<
@@ -60516,7 +60546,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_82findtext(struct LxmlElement *
     __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":1547
+    /* "lxml/etree.pyx":1550
  *         prefixes in the path expression.
  *         """
  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
@@ -60525,7 +60555,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_82findtext(struct LxmlElement *
  */
   }
 
-  /* "lxml/etree.pyx":1549
+  /* "lxml/etree.pyx":1552
  *         if isinstance(path, QName):
  *             path = (<QName>path).text
  *         return _elementpath.findtext(self, path, default, namespaces)             # <<<<<<<<<<<<<<
@@ -60533,7 +60563,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_82findtext(struct LxmlElement *
  *     def findall(self, path, namespaces=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_s_findtext); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1549, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_s_findtext); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1552, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_5 = NULL;
   __pyx_t_6 = 0;
@@ -60550,7 +60580,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_82findtext(struct LxmlElement *
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[5] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_path, __pyx_v_default, __pyx_v_namespaces};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1549, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1552, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -60558,13 +60588,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_82findtext(struct LxmlElement *
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[5] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_path, __pyx_v_default, __pyx_v_namespaces};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1549, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1552, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1549, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1552, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_5) {
       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
@@ -60581,7 +60611,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_82findtext(struct LxmlElement *
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_namespaces);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1549, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1552, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -60590,7 +60620,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_82findtext(struct LxmlElement *
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1538
+  /* "lxml/etree.pyx":1541
  *         return _elementpath.find(self, path, namespaces)
  * 
  *     def findtext(self, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
@@ -60613,7 +60643,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_82findtext(struct LxmlElement *
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1551
+/* "lxml/etree.pyx":1554
  *         return _elementpath.findtext(self, path, default, namespaces)
  * 
  *     def findall(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -60659,7 +60689,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_85findall(PyObject *__pyx_v_sel
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findall") < 0)) __PYX_ERR(0, 1551, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findall") < 0)) __PYX_ERR(0, 1554, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -60675,7 +60705,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_85findall(PyObject *__pyx_v_sel
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("findall", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1551, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("findall", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1554, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Element.findall", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -60701,7 +60731,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_84findall(struct LxmlElement *_
   __Pyx_RefNannySetupContext("findall", 0);
   __Pyx_INCREF(__pyx_v_path);
 
-  /* "lxml/etree.pyx":1560
+  /* "lxml/etree.pyx":1563
  *         prefixes in the path expression.
  *         """
  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
@@ -60712,7 +60742,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_84findall(struct LxmlElement *_
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1561
+    /* "lxml/etree.pyx":1564
  *         """
  *         if isinstance(path, QName):
  *             path = (<QName>path).text             # <<<<<<<<<<<<<<
@@ -60724,7 +60754,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_84findall(struct LxmlElement *_
     __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":1560
+    /* "lxml/etree.pyx":1563
  *         prefixes in the path expression.
  *         """
  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
@@ -60733,7 +60763,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_84findall(struct LxmlElement *_
  */
   }
 
-  /* "lxml/etree.pyx":1562
+  /* "lxml/etree.pyx":1565
  *         if isinstance(path, QName):
  *             path = (<QName>path).text
  *         return _elementpath.findall(self, path, namespaces)             # <<<<<<<<<<<<<<
@@ -60741,7 +60771,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_84findall(struct LxmlElement *_
  *     def iterfind(self, path, namespaces=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_s_findall); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1562, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_s_findall); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1565, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_5 = NULL;
   __pyx_t_6 = 0;
@@ -60758,7 +60788,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_84findall(struct LxmlElement *_
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1565, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -60766,13 +60796,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_84findall(struct LxmlElement *_
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1565, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1562, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1565, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_5) {
       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
@@ -60786,7 +60816,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_84findall(struct LxmlElement *_
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_namespaces);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1565, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -60795,7 +60825,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_84findall(struct LxmlElement *_
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1551
+  /* "lxml/etree.pyx":1554
  *         return _elementpath.findtext(self, path, default, namespaces)
  * 
  *     def findall(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -60818,7 +60848,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_84findall(struct LxmlElement *_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1564
+/* "lxml/etree.pyx":1567
  *         return _elementpath.findall(self, path, namespaces)
  * 
  *     def iterfind(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -60864,7 +60894,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_87iterfind(PyObject *__pyx_v_se
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterfind") < 0)) __PYX_ERR(0, 1564, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterfind") < 0)) __PYX_ERR(0, 1567, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -60880,7 +60910,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_87iterfind(PyObject *__pyx_v_se
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("iterfind", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1564, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("iterfind", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1567, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Element.iterfind", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -60906,7 +60936,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_86iterfind(struct LxmlElement *
   __Pyx_RefNannySetupContext("iterfind", 0);
   __Pyx_INCREF(__pyx_v_path);
 
-  /* "lxml/etree.pyx":1573
+  /* "lxml/etree.pyx":1576
  *         prefixes in the path expression.
  *         """
  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
@@ -60917,7 +60947,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_86iterfind(struct LxmlElement *
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1574
+    /* "lxml/etree.pyx":1577
  *         """
  *         if isinstance(path, QName):
  *             path = (<QName>path).text             # <<<<<<<<<<<<<<
@@ -60929,7 +60959,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_86iterfind(struct LxmlElement *
     __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":1573
+    /* "lxml/etree.pyx":1576
  *         prefixes in the path expression.
  *         """
  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
@@ -60938,7 +60968,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_86iterfind(struct LxmlElement *
  */
   }
 
-  /* "lxml/etree.pyx":1575
+  /* "lxml/etree.pyx":1578
  *         if isinstance(path, QName):
  *             path = (<QName>path).text
  *         return _elementpath.iterfind(self, path, namespaces)             # <<<<<<<<<<<<<<
@@ -60946,7 +60976,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_86iterfind(struct LxmlElement *
  *     def xpath(self, _path, *, namespaces=None, extensions=None,
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_s_iterfind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_s_iterfind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1578, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_5 = NULL;
   __pyx_t_6 = 0;
@@ -60963,7 +60993,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_86iterfind(struct LxmlElement *
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1575, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1578, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -60971,13 +61001,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_86iterfind(struct LxmlElement *
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1575, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1578, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1575, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1578, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_5) {
       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
@@ -60991,7 +61021,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_86iterfind(struct LxmlElement *
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_namespaces);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1575, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1578, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -61000,7 +61030,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_86iterfind(struct LxmlElement *
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1564
+  /* "lxml/etree.pyx":1567
  *         return _elementpath.findall(self, path, namespaces)
  * 
  *     def iterfind(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -61023,7 +61053,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_86iterfind(struct LxmlElement *
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1577
+/* "lxml/etree.pyx":1580
  *         return _elementpath.iterfind(self, path, namespaces)
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
@@ -61052,7 +61082,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_89xpath(PyObject *__pyx_v_self,
     values[1] = ((PyObject *)Py_None);
     values[2] = ((PyObject *)Py_None);
 
-    /* "lxml/etree.pyx":1578
+    /* "lxml/etree.pyx":1581
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,
  *               smart_strings=True, **_variables):             # <<<<<<<<<<<<<<
@@ -61083,7 +61113,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_89xpath(PyObject *__pyx_v_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__variables, values, pos_args, "xpath") < 0)) __PYX_ERR(0, 1577, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__variables, values, pos_args, "xpath") < 0)) __PYX_ERR(0, 1580, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -61097,7 +61127,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_89xpath(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("xpath", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1577, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("xpath", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1580, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v__variables); __pyx_v__variables = 0;
   __Pyx_AddTraceback("lxml.etree._Element.xpath", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -61106,7 +61136,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_89xpath(PyObject *__pyx_v_self,
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_4lxml_5etree_8_Element_88xpath(((struct LxmlElement *)__pyx_v_self), __pyx_v__path, __pyx_v_namespaces, __pyx_v_extensions, __pyx_v_smart_strings, __pyx_v__variables);
 
-  /* "lxml/etree.pyx":1577
+  /* "lxml/etree.pyx":1580
  *         return _elementpath.iterfind(self, path, namespaces)
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
@@ -61129,55 +61159,55 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_88xpath(struct LxmlElement *__p
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("xpath", 0);
 
-  /* "lxml/etree.pyx":1583
+  /* "lxml/etree.pyx":1586
  *         Evaluate an xpath expression using the element as context node.
  *         """
  *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,             # <<<<<<<<<<<<<<
  *                                           extensions=extensions,
  *                                           smart_strings=smart_strings)
  */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1583, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1583, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_namespaces, __pyx_v_namespaces) < 0) __PYX_ERR(0, 1583, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_namespaces, __pyx_v_namespaces) < 0) __PYX_ERR(0, 1586, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1584
+  /* "lxml/etree.pyx":1587
  *         """
  *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,
  *                                           extensions=extensions,             # <<<<<<<<<<<<<<
  *                                           smart_strings=smart_strings)
  *         return evaluator(_path, **_variables)
  */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extensions, __pyx_v_extensions) < 0) __PYX_ERR(0, 1583, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extensions, __pyx_v_extensions) < 0) __PYX_ERR(0, 1586, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1585
+  /* "lxml/etree.pyx":1588
  *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,
  *                                           extensions=extensions,
  *                                           smart_strings=smart_strings)             # <<<<<<<<<<<<<<
  *         return evaluator(_path, **_variables)
  * 
  */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_smart_strings, __pyx_v_smart_strings) < 0) __PYX_ERR(0, 1583, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_smart_strings, __pyx_v_smart_strings) < 0) __PYX_ERR(0, 1586, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1583
+  /* "lxml/etree.pyx":1586
  *         Evaluate an xpath expression using the element as context node.
  *         """
  *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,             # <<<<<<<<<<<<<<
  *                                           extensions=extensions,
  *                                           smart_strings=smart_strings)
  */
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPathElementEvaluator), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1583, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPathElementEvaluator), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1586, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_evaluator = ((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "lxml/etree.pyx":1586
+  /* "lxml/etree.pyx":1589
  *                                           extensions=extensions,
  *                                           smart_strings=smart_strings)
  *         return evaluator(_path, **_variables)             # <<<<<<<<<<<<<<
@@ -61185,19 +61215,19 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_88xpath(struct LxmlElement *__p
  *     def cssselect(self, expr, *, translator='xml'):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1586, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1589, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(__pyx_v__path);
   __Pyx_GIVEREF(__pyx_v__path);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__path);
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_evaluator), __pyx_t_3, __pyx_v__variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_evaluator), __pyx_t_3, __pyx_v__variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1577
+  /* "lxml/etree.pyx":1580
  *         return _elementpath.iterfind(self, path, namespaces)
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
@@ -61219,7 +61249,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_88xpath(struct LxmlElement *__p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1588
+/* "lxml/etree.pyx":1591
  *         return evaluator(_path, **_variables)
  * 
  *     def cssselect(self, expr, *, translator='xml'):             # <<<<<<<<<<<<<<
@@ -61262,7 +61292,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_91cssselect(PyObject *__pyx_v_s
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cssselect") < 0)) __PYX_ERR(0, 1588, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cssselect") < 0)) __PYX_ERR(0, 1591, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -61274,7 +61304,7 @@ static PyObject *__pyx_pw_4lxml_5etree_8_Element_91cssselect(PyObject *__pyx_v_s
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("cssselect", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1588, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("cssselect", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1591, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Element.cssselect", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -61297,29 +61327,29 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_90cssselect(struct LxmlElement
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("cssselect", 0);
 
-  /* "lxml/etree.pyx":1598
+  /* "lxml/etree.pyx":1601
  *         """
  *         # Do the import here to make the dependency optional.
  *         from lxml.cssselect import CSSSelector             # <<<<<<<<<<<<<<
  *         return CSSSelector(expr, translator=translator)(self)
  * 
  */
-  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1598, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_n_s_CSSSelector);
   __Pyx_GIVEREF(__pyx_n_s_CSSSelector);
   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_CSSSelector);
-  __pyx_t_2 = __Pyx_Import(__pyx_n_s_lxml_cssselect, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1598, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_lxml_cssselect, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CSSSelector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1598, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CSSSelector); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_t_1);
   __pyx_v_CSSSelector = __pyx_t_1;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":1599
+  /* "lxml/etree.pyx":1602
  *         # Do the import here to make the dependency optional.
  *         from lxml.cssselect import CSSSelector
  *         return CSSSelector(expr, translator=translator)(self)             # <<<<<<<<<<<<<<
@@ -61327,15 +61357,15 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_90cssselect(struct LxmlElement
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_expr);
   __Pyx_GIVEREF(__pyx_v_expr);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_expr);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1599, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_translator, __pyx_v_translator) < 0) __PYX_ERR(0, 1599, __pyx_L1_error)
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_CSSSelector, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1599, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_translator, __pyx_v_translator) < 0) __PYX_ERR(0, 1602, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_CSSSelector, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -61350,13 +61380,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_90cssselect(struct LxmlElement
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1599, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1602, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_4)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
-      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1599, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1602, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_2);
     } else
@@ -61364,19 +61394,19 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_90cssselect(struct LxmlElement
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
-      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1599, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1602, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_2);
     } else
     #endif
     {
-      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L1_error)
+      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_INCREF(((PyObject *)__pyx_v_self));
       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
       PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_self));
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1599, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1602, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     }
@@ -61386,7 +61416,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_90cssselect(struct LxmlElement
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1588
+  /* "lxml/etree.pyx":1591
  *         return evaluator(_path, **_variables)
  * 
  *     def cssselect(self, expr, *, translator='xml'):             # <<<<<<<<<<<<<<
@@ -61409,7 +61439,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Element_90cssselect(struct LxmlElement
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1608
+/* "lxml/etree.pyx":1611
  * 
  * @cython.linetrace(False)
  * cdef _Element _elementFactory(_Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -61430,19 +61460,19 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
   PyObject *__pyx_t_6 = NULL;
   __Pyx_RefNannySetupContext("_elementFactory", 0);
 
-  /* "lxml/etree.pyx":1610
+  /* "lxml/etree.pyx":1613
  * cdef _Element _elementFactory(_Document doc, xmlNode* c_node):
  *     cdef _Element result
  *     result = getProxy(c_node)             # <<<<<<<<<<<<<<
  *     if result is not None:
  *         return result
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1610, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_result = ((struct LxmlElement *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":1611
+  /* "lxml/etree.pyx":1614
  *     cdef _Element result
  *     result = getProxy(c_node)
  *     if result is not None:             # <<<<<<<<<<<<<<
@@ -61453,7 +61483,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1612
+    /* "lxml/etree.pyx":1615
  *     result = getProxy(c_node)
  *     if result is not None:
  *         return result             # <<<<<<<<<<<<<<
@@ -61465,7 +61495,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
     __pyx_r = __pyx_v_result;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1611
+    /* "lxml/etree.pyx":1614
  *     cdef _Element result
  *     result = getProxy(c_node)
  *     if result is not None:             # <<<<<<<<<<<<<<
@@ -61474,7 +61504,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
  */
   }
 
-  /* "lxml/etree.pyx":1613
+  /* "lxml/etree.pyx":1616
  *     if result is not None:
  *         return result
  *     if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -61484,7 +61514,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
   __pyx_t_3 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1614
+    /* "lxml/etree.pyx":1617
  *         return result
  *     if c_node is NULL:
  *         return None             # <<<<<<<<<<<<<<
@@ -61496,7 +61526,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
     __pyx_r = ((struct LxmlElement *)Py_None);
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1613
+    /* "lxml/etree.pyx":1616
  *     if result is not None:
  *         return result
  *     if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -61505,7 +61535,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
  */
   }
 
-  /* "lxml/etree.pyx":1617
+  /* "lxml/etree.pyx":1620
  * 
  *     element_class = LOOKUP_ELEMENT_CLASS(
  *         ELEMENT_CLASS_LOOKUP_STATE, doc, c_node)             # <<<<<<<<<<<<<<
@@ -61515,20 +61545,20 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
   __pyx_t_1 = __pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE;
   __Pyx_INCREF(__pyx_t_1);
 
-  /* "lxml/etree.pyx":1616
+  /* "lxml/etree.pyx":1619
  *         return None
  * 
  *     element_class = LOOKUP_ELEMENT_CLASS(             # <<<<<<<<<<<<<<
  *         ELEMENT_CLASS_LOOKUP_STATE, doc, c_node)
  *     if hasProxy(c_node):
  */
-  __pyx_t_4 = __pyx_v_4lxml_5etree_LOOKUP_ELEMENT_CLASS(__pyx_t_1, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1616, __pyx_L1_error)
+  __pyx_t_4 = __pyx_v_4lxml_5etree_LOOKUP_ELEMENT_CLASS(__pyx_t_1, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1619, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_element_class = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":1618
+  /* "lxml/etree.pyx":1621
  *     element_class = LOOKUP_ELEMENT_CLASS(
  *         ELEMENT_CLASS_LOOKUP_STATE, doc, c_node)
  *     if hasProxy(c_node):             # <<<<<<<<<<<<<<
@@ -61538,7 +61568,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
   __pyx_t_3 = (__pyx_f_4lxml_5etree_hasProxy(__pyx_v_c_node) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1620
+    /* "lxml/etree.pyx":1623
  *     if hasProxy(c_node):
  *         # prevent re-entry race condition - we just called into Python
  *         return getProxy(c_node)             # <<<<<<<<<<<<<<
@@ -61546,13 +61576,13 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
  *     if hasProxy(c_node):
  */
     __Pyx_XDECREF(((PyObject *)__pyx_r));
-    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1620, __pyx_L1_error)
+    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1623, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_r = ((struct LxmlElement *)__pyx_t_4);
     __pyx_t_4 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1618
+    /* "lxml/etree.pyx":1621
  *     element_class = LOOKUP_ELEMENT_CLASS(
  *         ELEMENT_CLASS_LOOKUP_STATE, doc, c_node)
  *     if hasProxy(c_node):             # <<<<<<<<<<<<<<
@@ -61561,20 +61591,20 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
  */
   }
 
-  /* "lxml/etree.pyx":1621
+  /* "lxml/etree.pyx":1624
  *         # prevent re-entry race condition - we just called into Python
  *         return getProxy(c_node)
  *     result = NEW_ELEMENT(element_class)             # <<<<<<<<<<<<<<
  *     if hasProxy(c_node):
  *         # prevent re-entry race condition - we just called into Python
  */
-  __pyx_t_4 = PY_NEW(__pyx_v_element_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1621, __pyx_L1_error)
+  __pyx_t_4 = PY_NEW(__pyx_v_element_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1624, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 1621, __pyx_L1_error)
+  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 1624, __pyx_L1_error)
   __Pyx_DECREF_SET(__pyx_v_result, ((struct LxmlElement *)__pyx_t_4));
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":1622
+  /* "lxml/etree.pyx":1625
  *         return getProxy(c_node)
  *     result = NEW_ELEMENT(element_class)
  *     if hasProxy(c_node):             # <<<<<<<<<<<<<<
@@ -61584,7 +61614,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
   __pyx_t_3 = (__pyx_f_4lxml_5etree_hasProxy(__pyx_v_c_node) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1624
+    /* "lxml/etree.pyx":1627
  *     if hasProxy(c_node):
  *         # prevent re-entry race condition - we just called into Python
  *         result._c_node = NULL             # <<<<<<<<<<<<<<
@@ -61593,7 +61623,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
  */
     __pyx_v_result->_c_node = NULL;
 
-    /* "lxml/etree.pyx":1625
+    /* "lxml/etree.pyx":1628
  *         # prevent re-entry race condition - we just called into Python
  *         result._c_node = NULL
  *         return getProxy(c_node)             # <<<<<<<<<<<<<<
@@ -61601,13 +61631,13 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
  *     _registerProxy(result, doc, c_node)
  */
     __Pyx_XDECREF(((PyObject *)__pyx_r));
-    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1625, __pyx_L1_error)
+    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1628, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_r = ((struct LxmlElement *)__pyx_t_4);
     __pyx_t_4 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1622
+    /* "lxml/etree.pyx":1625
  *         return getProxy(c_node)
  *     result = NEW_ELEMENT(element_class)
  *     if hasProxy(c_node):             # <<<<<<<<<<<<<<
@@ -61616,16 +61646,16 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
  */
   }
 
-  /* "lxml/etree.pyx":1627
+  /* "lxml/etree.pyx":1630
  *         return getProxy(c_node)
  * 
  *     _registerProxy(result, doc, c_node)             # <<<<<<<<<<<<<<
  *     if element_class is not _Element:
  *         result._init()
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__registerProxy(__pyx_v_result, __pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 1627, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__registerProxy(__pyx_v_result, __pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1630, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1628
+  /* "lxml/etree.pyx":1631
  * 
  *     _registerProxy(result, doc, c_node)
  *     if element_class is not _Element:             # <<<<<<<<<<<<<<
@@ -61636,14 +61666,14 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
   __pyx_t_2 = (__pyx_t_3 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1629
+    /* "lxml/etree.pyx":1632
  *     _registerProxy(result, doc, c_node)
  *     if element_class is not _Element:
  *         result._init()             # <<<<<<<<<<<<<<
  *     return result
  * 
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_init_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s_init_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1632, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -61656,16 +61686,16 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
       }
     }
     if (__pyx_t_6) {
-      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1629, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1632, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     } else {
-      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1629, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1632, __pyx_L1_error)
     }
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1628
+    /* "lxml/etree.pyx":1631
  * 
  *     _registerProxy(result, doc, c_node)
  *     if element_class is not _Element:             # <<<<<<<<<<<<<<
@@ -61674,7 +61704,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
  */
   }
 
-  /* "lxml/etree.pyx":1630
+  /* "lxml/etree.pyx":1633
  *     if element_class is not _Element:
  *         result._init()
  *     return result             # <<<<<<<<<<<<<<
@@ -61686,7 +61716,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1608
+  /* "lxml/etree.pyx":1611
  * 
  * @cython.linetrace(False)
  * cdef _Element _elementFactory(_Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -61709,7 +61739,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocum
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1635
+/* "lxml/etree.pyx":1638
  * @cython.internal
  * cdef class __ContentOnlyElement(_Element):
  *     cdef int _raiseImmutable(self) except -1:             # <<<<<<<<<<<<<<
@@ -61722,7 +61752,7 @@ static int __pyx_f_4lxml_5etree_20__ContentOnlyElement__raiseImmutable(CYTHON_UN
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_raiseImmutable", 0);
 
-  /* "lxml/etree.pyx":1636
+  /* "lxml/etree.pyx":1639
  * cdef class __ContentOnlyElement(_Element):
  *     cdef int _raiseImmutable(self) except -1:
  *         raise TypeError, u"this element does not have children or attributes"             # <<<<<<<<<<<<<<
@@ -61730,9 +61760,9 @@ static int __pyx_f_4lxml_5etree_20__ContentOnlyElement__raiseImmutable(CYTHON_UN
  *     def set(self, key, value):
  */
   __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_this_element_does_not_have_child, 0, 0);
-  __PYX_ERR(0, 1636, __pyx_L1_error)
+  __PYX_ERR(0, 1639, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1635
+  /* "lxml/etree.pyx":1638
  * @cython.internal
  * cdef class __ContentOnlyElement(_Element):
  *     cdef int _raiseImmutable(self) except -1:             # <<<<<<<<<<<<<<
@@ -61748,7 +61778,7 @@ static int __pyx_f_4lxml_5etree_20__ContentOnlyElement__raiseImmutable(CYTHON_UN
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1638
+/* "lxml/etree.pyx":1641
  *         raise TypeError, u"this element does not have children or attributes"
  * 
  *     def set(self, key, value):             # <<<<<<<<<<<<<<
@@ -61789,11 +61819,11 @@ static PyObject *__pyx_pw_4lxml_5etree_20__ContentOnlyElement_1set(PyObject *__p
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(0, 1638, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(0, 1641, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 1638, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 1641, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -61806,7 +61836,7 @@ static PyObject *__pyx_pw_4lxml_5etree_20__ContentOnlyElement_1set(PyObject *__p
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1638, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1641, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -61825,16 +61855,16 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_set(struct __pyx_o
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("set", 0);
 
-  /* "lxml/etree.pyx":1640
+  /* "lxml/etree.pyx":1643
  *     def set(self, key, value):
  *         u"set(self, key, value)"
  *         self._raiseImmutable()             # <<<<<<<<<<<<<<
  * 
  *     def append(self, value):
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)__pyx_v_self->__pyx_vtab)->_raiseImmutable(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1640, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)__pyx_v_self->__pyx_vtab)->_raiseImmutable(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1643, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1638
+  /* "lxml/etree.pyx":1641
  *         raise TypeError, u"this element does not have children or attributes"
  * 
  *     def set(self, key, value):             # <<<<<<<<<<<<<<
@@ -61854,7 +61884,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_set(struct __pyx_o
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1642
+/* "lxml/etree.pyx":1645
  *         self._raiseImmutable()
  * 
  *     def append(self, value):             # <<<<<<<<<<<<<<
@@ -61883,16 +61913,16 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_2append(struct __p
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("append", 0);
 
-  /* "lxml/etree.pyx":1644
+  /* "lxml/etree.pyx":1647
  *     def append(self, value):
  *         u"append(self, value)"
  *         self._raiseImmutable()             # <<<<<<<<<<<<<<
  * 
  *     def insert(self, index, value):
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)__pyx_v_self->__pyx_vtab)->_raiseImmutable(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1644, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)__pyx_v_self->__pyx_vtab)->_raiseImmutable(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1647, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1642
+  /* "lxml/etree.pyx":1645
  *         self._raiseImmutable()
  * 
  *     def append(self, value):             # <<<<<<<<<<<<<<
@@ -61912,7 +61942,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_2append(struct __p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1646
+/* "lxml/etree.pyx":1649
  *         self._raiseImmutable()
  * 
  *     def insert(self, index, value):             # <<<<<<<<<<<<<<
@@ -61953,11 +61983,11 @@ static PyObject *__pyx_pw_4lxml_5etree_20__ContentOnlyElement_5insert(PyObject *
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(0, 1646, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(0, 1649, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(0, 1646, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(0, 1649, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -61970,7 +62000,7 @@ static PyObject *__pyx_pw_4lxml_5etree_20__ContentOnlyElement_5insert(PyObject *
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1646, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1649, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -61989,16 +62019,16 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_4insert(struct __p
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("insert", 0);
 
-  /* "lxml/etree.pyx":1648
+  /* "lxml/etree.pyx":1651
  *     def insert(self, index, value):
  *         u"insert(self, index, value)"
  *         self._raiseImmutable()             # <<<<<<<<<<<<<<
  * 
  *     def __setitem__(self, index, value):
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)__pyx_v_self->__pyx_vtab)->_raiseImmutable(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1648, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)__pyx_v_self->__pyx_vtab)->_raiseImmutable(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1651, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1646
+  /* "lxml/etree.pyx":1649
  *         self._raiseImmutable()
  * 
  *     def insert(self, index, value):             # <<<<<<<<<<<<<<
@@ -62018,7 +62048,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_4insert(struct __p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1650
+/* "lxml/etree.pyx":1653
  *         self._raiseImmutable()
  * 
  *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
@@ -62049,16 +62079,16 @@ static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_6__setitem__(struct __py
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__setitem__", 0);
 
-  /* "lxml/etree.pyx":1652
+  /* "lxml/etree.pyx":1655
  *     def __setitem__(self, index, value):
  *         u"__setitem__(self, index, value)"
  *         self._raiseImmutable()             # <<<<<<<<<<<<<<
  * 
  *     property attrib:
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)__pyx_v_self->__pyx_vtab)->_raiseImmutable(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1652, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)__pyx_v_self->__pyx_vtab)->_raiseImmutable(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1655, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1650
+  /* "lxml/etree.pyx":1653
  *         self._raiseImmutable()
  * 
  *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
@@ -62077,7 +62107,7 @@ static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_6__setitem__(struct __py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1655
+/* "lxml/etree.pyx":1658
  * 
  *     property attrib:
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -62103,7 +62133,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_6attrib___get__(CY
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1656
+  /* "lxml/etree.pyx":1659
  *     property attrib:
  *         def __get__(self):
  *             return IMMUTABLE_EMPTY_MAPPING             # <<<<<<<<<<<<<<
@@ -62115,7 +62145,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_6attrib___get__(CY
   __pyx_r = __pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1655
+  /* "lxml/etree.pyx":1658
  * 
  *     property attrib:
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -62130,7 +62160,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_6attrib___get__(CY
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1659
+/* "lxml/etree.pyx":1662
  * 
  *     property text:
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -62158,16 +62188,16 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___get__(stru
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1660
+  /* "lxml/etree.pyx":1663
  *     property text:
  *         def __get__(self):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             return funicodeOrEmpty(self._c_node.content)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1660, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1663, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1661
+  /* "lxml/etree.pyx":1664
  *         def __get__(self):
  *             _assertValidNode(self)
  *             return funicodeOrEmpty(self._c_node.content)             # <<<<<<<<<<<<<<
@@ -62175,13 +62205,13 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___get__(stru
  *         def __set__(self, value):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_funicodeOrEmpty(__pyx_v_self->__pyx_base._c_node->content); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1661, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_funicodeOrEmpty(__pyx_v_self->__pyx_base._c_node->content); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1664, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1659
+  /* "lxml/etree.pyx":1662
  * 
  *     property text:
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -62200,7 +62230,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___get__(stru
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1663
+/* "lxml/etree.pyx":1666
  *             return funicodeOrEmpty(self._c_node.content)
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -62232,16 +62262,16 @@ static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text_2__set__(struct __
   __Pyx_RefNannySetupContext("__set__", 0);
   __Pyx_INCREF(__pyx_v_value);
 
-  /* "lxml/etree.pyx":1665
+  /* "lxml/etree.pyx":1668
  *         def __set__(self, value):
  *             cdef tree.xmlDict* c_dict
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             if value is None:
  *                 c_text = <const_xmlChar*>NULL
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1665, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1668, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1666
+  /* "lxml/etree.pyx":1669
  *             cdef tree.xmlDict* c_dict
  *             _assertValidNode(self)
  *             if value is None:             # <<<<<<<<<<<<<<
@@ -62252,7 +62282,7 @@ static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text_2__set__(struct __
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1667
+    /* "lxml/etree.pyx":1670
  *             _assertValidNode(self)
  *             if value is None:
  *                 c_text = <const_xmlChar*>NULL             # <<<<<<<<<<<<<<
@@ -62261,7 +62291,7 @@ static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text_2__set__(struct __
  */
     __pyx_v_c_text = ((const xmlChar *)NULL);
 
-    /* "lxml/etree.pyx":1666
+    /* "lxml/etree.pyx":1669
  *             cdef tree.xmlDict* c_dict
  *             _assertValidNode(self)
  *             if value is None:             # <<<<<<<<<<<<<<
@@ -62271,7 +62301,7 @@ static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text_2__set__(struct __
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":1669
+  /* "lxml/etree.pyx":1672
  *                 c_text = <const_xmlChar*>NULL
  *             else:
  *                 value = _utf8(value)             # <<<<<<<<<<<<<<
@@ -62279,12 +62309,12 @@ static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text_2__set__(struct __
  *             tree.xmlNodeSetContent(self._c_node, c_text)
  */
   /*else*/ {
-    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1669, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1672, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1670
+    /* "lxml/etree.pyx":1673
  *             else:
  *                 value = _utf8(value)
  *                 c_text = _xcstr(value)             # <<<<<<<<<<<<<<
@@ -62295,7 +62325,7 @@ static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text_2__set__(struct __
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":1671
+  /* "lxml/etree.pyx":1674
  *                 value = _utf8(value)
  *                 c_text = _xcstr(value)
  *             tree.xmlNodeSetContent(self._c_node, c_text)             # <<<<<<<<<<<<<<
@@ -62304,7 +62334,7 @@ static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text_2__set__(struct __
  */
   xmlNodeSetContent(__pyx_v_self->__pyx_base._c_node, __pyx_v_c_text);
 
-  /* "lxml/etree.pyx":1663
+  /* "lxml/etree.pyx":1666
  *             return funicodeOrEmpty(self._c_node.content)
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -62325,7 +62355,7 @@ static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text_2__set__(struct __
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1674
+/* "lxml/etree.pyx":1677
  * 
  *     # ACCESSORS
  *     def __getitem__(self, x):             # <<<<<<<<<<<<<<
@@ -62358,7 +62388,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_8__getitem__(CYTHO
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__getitem__", 0);
 
-  /* "lxml/etree.pyx":1676
+  /* "lxml/etree.pyx":1679
  *     def __getitem__(self, x):
  *         u"__getitem__(self, x)"
  *         if isinstance(x, slice):             # <<<<<<<<<<<<<<
@@ -62369,7 +62399,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_8__getitem__(CYTHO
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1677
+    /* "lxml/etree.pyx":1680
  *         u"__getitem__(self, x)"
  *         if isinstance(x, slice):
  *             return []             # <<<<<<<<<<<<<<
@@ -62377,13 +62407,13 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_8__getitem__(CYTHO
  *             raise IndexError, u"list index out of range"
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1677, __pyx_L1_error)
+    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1680, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1676
+    /* "lxml/etree.pyx":1679
  *     def __getitem__(self, x):
  *         u"__getitem__(self, x)"
  *         if isinstance(x, slice):             # <<<<<<<<<<<<<<
@@ -62392,7 +62422,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_8__getitem__(CYTHO
  */
   }
 
-  /* "lxml/etree.pyx":1679
+  /* "lxml/etree.pyx":1682
  *             return []
  *         else:
  *             raise IndexError, u"list index out of range"             # <<<<<<<<<<<<<<
@@ -62401,10 +62431,10 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_8__getitem__(CYTHO
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_list_index_out_of_range, 0, 0);
-    __PYX_ERR(0, 1679, __pyx_L1_error)
+    __PYX_ERR(0, 1682, __pyx_L1_error)
   }
 
-  /* "lxml/etree.pyx":1674
+  /* "lxml/etree.pyx":1677
  * 
  *     # ACCESSORS
  *     def __getitem__(self, x):             # <<<<<<<<<<<<<<
@@ -62423,7 +62453,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_8__getitem__(CYTHO
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1681
+/* "lxml/etree.pyx":1684
  *             raise IndexError, u"list index out of range"
  * 
  *     def __len__(self):             # <<<<<<<<<<<<<<
@@ -62453,7 +62483,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_20__ContentOnlyElement_10__len__(CYTHON_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__len__", 0);
 
-  /* "lxml/etree.pyx":1683
+  /* "lxml/etree.pyx":1686
  *     def __len__(self):
  *         u"__len__(self)"
  *         return 0             # <<<<<<<<<<<<<<
@@ -62463,7 +62493,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_20__ContentOnlyElement_10__len__(CYTHON_
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1681
+  /* "lxml/etree.pyx":1684
  *             raise IndexError, u"list index out of range"
  * 
  *     def __len__(self):             # <<<<<<<<<<<<<<
@@ -62477,7 +62507,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_20__ContentOnlyElement_10__len__(CYTHON_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1685
+/* "lxml/etree.pyx":1688
  *         return 0
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
@@ -62523,7 +62553,7 @@ static PyObject *__pyx_pw_4lxml_5etree_20__ContentOnlyElement_13get(PyObject *__
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 1685, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 1688, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -62539,7 +62569,7 @@ static PyObject *__pyx_pw_4lxml_5etree_20__ContentOnlyElement_13get(PyObject *__
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1685, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1688, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -62557,7 +62587,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_12get(CYTHON_UNUSE
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("get", 0);
 
-  /* "lxml/etree.pyx":1687
+  /* "lxml/etree.pyx":1690
  *     def get(self, key, default=None):
  *         u"get(self, key, default=None)"
  *         return None             # <<<<<<<<<<<<<<
@@ -62569,7 +62599,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_12get(CYTHON_UNUSE
   __pyx_r = Py_None;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1685
+  /* "lxml/etree.pyx":1688
  *         return 0
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
@@ -62584,7 +62614,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_12get(CYTHON_UNUSE
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1689
+/* "lxml/etree.pyx":1692
  *         return None
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
@@ -62613,7 +62643,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_14keys(CYTHON_UNUS
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("keys", 0);
 
-  /* "lxml/etree.pyx":1691
+  /* "lxml/etree.pyx":1694
  *     def keys(self):
  *         u"keys(self)"
  *         return []             # <<<<<<<<<<<<<<
@@ -62621,13 +62651,13 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_14keys(CYTHON_UNUS
  *     def items(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1691, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1694, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1689
+  /* "lxml/etree.pyx":1692
  *         return None
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
@@ -62646,7 +62676,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_14keys(CYTHON_UNUS
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1693
+/* "lxml/etree.pyx":1696
  *         return []
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
@@ -62675,7 +62705,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_16items(CYTHON_UNU
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("items", 0);
 
-  /* "lxml/etree.pyx":1695
+  /* "lxml/etree.pyx":1698
  *     def items(self):
  *         u"items(self)"
  *         return []             # <<<<<<<<<<<<<<
@@ -62683,13 +62713,13 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_16items(CYTHON_UNU
  *     def values(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1695, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1698, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1693
+  /* "lxml/etree.pyx":1696
  *         return []
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
@@ -62708,7 +62738,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_16items(CYTHON_UNU
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1697
+/* "lxml/etree.pyx":1700
  *         return []
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
@@ -62737,7 +62767,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_18values(CYTHON_UN
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("values", 0);
 
-  /* "lxml/etree.pyx":1699
+  /* "lxml/etree.pyx":1702
  *     def values(self):
  *         u"values(self)"
  *         return []             # <<<<<<<<<<<<<<
@@ -62745,13 +62775,13 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_18values(CYTHON_UN
  * cdef class _Comment(__ContentOnlyElement):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1699, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1702, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1697
+  /* "lxml/etree.pyx":1700
  *         return []
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
@@ -62770,7 +62800,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_18values(CYTHON_UN
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1703
+/* "lxml/etree.pyx":1706
  * cdef class _Comment(__ContentOnlyElement):
  *     property tag:
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -62797,7 +62827,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Comment_3tag___get__(CYTHON_UNUSED stru
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1704
+  /* "lxml/etree.pyx":1707
  *     property tag:
  *         def __get__(self):
  *             return Comment             # <<<<<<<<<<<<<<
@@ -62805,13 +62835,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Comment_3tag___get__(CYTHON_UNUSED stru
  *     def __repr__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1704, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1707, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1703
+  /* "lxml/etree.pyx":1706
  * cdef class _Comment(__ContentOnlyElement):
  *     property tag:
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -62830,7 +62860,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Comment_3tag___get__(CYTHON_UNUSED stru
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1706
+/* "lxml/etree.pyx":1709
  *             return Comment
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -62858,7 +62888,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Comment___repr__(struct __pyx_obj_4lxml
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "lxml/etree.pyx":1707
+  /* "lxml/etree.pyx":1710
  * 
  *     def __repr__(self):
  *         return "<!--%s-->" % strrepr(self.text)             # <<<<<<<<<<<<<<
@@ -62866,19 +62896,19 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Comment___repr__(struct __pyx_obj_4lxml
  * cdef class _ProcessingInstruction(__ContentOnlyElement):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1707, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1707, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1707, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1706
+  /* "lxml/etree.pyx":1709
  *             return Comment
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -62898,7 +62928,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8_Comment___repr__(struct __pyx_obj_4lxml
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1711
+/* "lxml/etree.pyx":1714
  * cdef class _ProcessingInstruction(__ContentOnlyElement):
  *     property tag:
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -62925,7 +62955,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_3tag___get__(CYT
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1712
+  /* "lxml/etree.pyx":1715
  *     property tag:
  *         def __get__(self):
  *             return ProcessingInstruction             # <<<<<<<<<<<<<<
@@ -62933,13 +62963,13 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_3tag___get__(CYT
  *     property target:
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1712, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1715, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1711
+  /* "lxml/etree.pyx":1714
  * cdef class _ProcessingInstruction(__ContentOnlyElement):
  *     property tag:
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -62958,7 +62988,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_3tag___get__(CYT
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1716
+/* "lxml/etree.pyx":1719
  *     property target:
  *         # not in ElementTree
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -62986,16 +63016,16 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___get__(
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1717
+  /* "lxml/etree.pyx":1720
  *         # not in ElementTree
  *         def __get__(self):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             return funicode(self._c_node.name)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1717, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1720, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1718
+  /* "lxml/etree.pyx":1721
  *         def __get__(self):
  *             _assertValidNode(self)
  *             return funicode(self._c_node.name)             # <<<<<<<<<<<<<<
@@ -63003,13 +63033,13 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___get__(
  *         def __set__(self, value):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1718, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1721, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1716
+  /* "lxml/etree.pyx":1719
  *     property target:
  *         # not in ElementTree
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -63028,7 +63058,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___get__(
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1720
+/* "lxml/etree.pyx":1723
  *             return funicode(self._c_node.name)
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -63058,28 +63088,28 @@ static int __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target_2__set__(struc
   __Pyx_RefNannySetupContext("__set__", 0);
   __Pyx_INCREF(__pyx_v_value);
 
-  /* "lxml/etree.pyx":1721
+  /* "lxml/etree.pyx":1724
  * 
  *         def __set__(self, value):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             value = _utf8(value)
  *             c_text = _xcstr(value)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1721, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1724, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1722
+  /* "lxml/etree.pyx":1725
  *         def __set__(self, value):
  *             _assertValidNode(self)
  *             value = _utf8(value)             # <<<<<<<<<<<<<<
  *             c_text = _xcstr(value)
  *             tree.xmlNodeSetName(self._c_node, c_text)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1722, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1725, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":1723
+  /* "lxml/etree.pyx":1726
  *             _assertValidNode(self)
  *             value = _utf8(value)
  *             c_text = _xcstr(value)             # <<<<<<<<<<<<<<
@@ -63088,7 +63118,7 @@ static int __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target_2__set__(struc
  */
   __pyx_v_c_text = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_value);
 
-  /* "lxml/etree.pyx":1724
+  /* "lxml/etree.pyx":1727
  *             value = _utf8(value)
  *             c_text = _xcstr(value)
  *             tree.xmlNodeSetName(self._c_node, c_text)             # <<<<<<<<<<<<<<
@@ -63097,7 +63127,7 @@ static int __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target_2__set__(struc
  */
   xmlNodeSetName(__pyx_v_self->__pyx_base.__pyx_base._c_node, __pyx_v_c_text);
 
-  /* "lxml/etree.pyx":1720
+  /* "lxml/etree.pyx":1723
  *             return funicode(self._c_node.name)
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -63118,7 +63148,7 @@ static int __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target_2__set__(struc
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1726
+/* "lxml/etree.pyx":1729
  *             tree.xmlNodeSetName(self._c_node, c_text)
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -63149,29 +63179,29 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(struct
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "lxml/etree.pyx":1727
+  /* "lxml/etree.pyx":1730
  * 
  *     def __repr__(self):
  *         text = self.text             # <<<<<<<<<<<<<<
  *         if text:
  *             return "<?%s %s?>" % (strrepr(self.target),
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1727, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1730, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_text = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":1728
+  /* "lxml/etree.pyx":1731
  *     def __repr__(self):
  *         text = self.text
  *         if text:             # <<<<<<<<<<<<<<
  *             return "<?%s %s?>" % (strrepr(self.target),
  *                                   strrepr(text))
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1728, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1731, __pyx_L1_error)
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1729
+    /* "lxml/etree.pyx":1732
  *         text = self.text
  *         if text:
  *             return "<?%s %s?>" % (strrepr(self.target),             # <<<<<<<<<<<<<<
@@ -63179,30 +63209,30 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(struct
  *         else:
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1729, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1729, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1732, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "lxml/etree.pyx":1730
+    /* "lxml/etree.pyx":1733
  *         if text:
  *             return "<?%s %s?>" % (strrepr(self.target),
  *                                   strrepr(text))             # <<<<<<<<<<<<<<
  *         else:
  *             return "<?%s?>" % strrepr(self.target)
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree_strrepr(__pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1730, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_strrepr(__pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1733, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
 
-    /* "lxml/etree.pyx":1729
+    /* "lxml/etree.pyx":1732
  *         text = self.text
  *         if text:
  *             return "<?%s %s?>" % (strrepr(self.target),             # <<<<<<<<<<<<<<
  *                                   strrepr(text))
  *         else:
  */
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L1_error)
+    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1732, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_GIVEREF(__pyx_t_3);
     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
@@ -63210,14 +63240,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(struct
     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
     __pyx_t_3 = 0;
     __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1729, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1728
+    /* "lxml/etree.pyx":1731
  *     def __repr__(self):
  *         text = self.text
  *         if text:             # <<<<<<<<<<<<<<
@@ -63226,7 +63256,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(struct
  */
   }
 
-  /* "lxml/etree.pyx":1732
+  /* "lxml/etree.pyx":1735
  *                                   strrepr(text))
  *         else:
  *             return "<?%s?>" % strrepr(self.target)             # <<<<<<<<<<<<<<
@@ -63235,12 +63265,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(struct
  */
   /*else*/ {
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1735, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1732, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1735, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_4, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_4, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1735, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_1;
@@ -63248,7 +63278,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(struct
     goto __pyx_L0;
   }
 
-  /* "lxml/etree.pyx":1726
+  /* "lxml/etree.pyx":1729
  *             tree.xmlNodeSetName(self._c_node, c_text)
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -63270,7 +63300,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(struct
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1734
+/* "lxml/etree.pyx":1737
  *             return "<?%s?>" % strrepr(self.target)
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
@@ -63316,7 +63346,7 @@ static PyObject *__pyx_pw_4lxml_5etree_22_ProcessingInstruction_3get(PyObject *_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 1734, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 1737, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -63332,7 +63362,7 @@ static PyObject *__pyx_pw_4lxml_5etree_22_ProcessingInstruction_3get(PyObject *_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1734, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1737, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ProcessingInstruction.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -63355,7 +63385,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_2get(struct __py
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("get", 0);
 
-  /* "lxml/etree.pyx":1746
+  /* "lxml/etree.pyx":1749
  *         It is not guaranteed to work for all possible text content.
  *         """
  *         return self.attrib.get(key, default)             # <<<<<<<<<<<<<<
@@ -63363,9 +63393,9 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_2get(struct __py
  *     property attrib:
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attrib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1746, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attrib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1749, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1746, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1749, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_2 = NULL;
@@ -63383,7 +63413,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_2get(struct __py
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_key, __pyx_v_default};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1746, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1749, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -63391,13 +63421,13 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_2get(struct __py
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_key, __pyx_v_default};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1746, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1749, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1746, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1749, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_2) {
       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
@@ -63408,7 +63438,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_2get(struct __py
     __Pyx_INCREF(__pyx_v_default);
     __Pyx_GIVEREF(__pyx_v_default);
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_default);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1746, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1749, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -63417,7 +63447,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_2get(struct __py
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1734
+  /* "lxml/etree.pyx":1737
  *             return "<?%s?>" % strrepr(self.target)
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
@@ -63439,7 +63469,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_2get(struct __py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1754
+/* "lxml/etree.pyx":1757
  *         XML node, although this is not guaranteed to stay this way.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -63461,6 +63491,9 @@ static PyObject *__pyx_pw_4lxml_5etree_22_ProcessingInstruction_6attrib_1__get__
 }
 
 static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(struct __pyx_obj_4lxml_5etree__ProcessingInstruction *__pyx_v_self) {
+  PyObject *__pyx_7genexpr__pyx_v_attr = NULL;
+  PyObject *__pyx_7genexpr__pyx_v_value1 = NULL;
+  PyObject *__pyx_7genexpr__pyx_v_value2 = NULL;
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
@@ -63476,7 +63509,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
   int __pyx_t_11;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1755
+  /* "lxml/etree.pyx":1758
  *         """
  *         def __get__(self):
  *             return { attr : (value1 or value2)             # <<<<<<<<<<<<<<
@@ -63485,22 +63518,19 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
  */
   __Pyx_XDECREF(__pyx_r);
   { /* enter inner scope */
-    PyObject *__pyx_7genexpr__pyx_v_attr = NULL;
-    PyObject *__pyx_7genexpr__pyx_v_value1 = NULL;
-    PyObject *__pyx_7genexpr__pyx_v_value2 = NULL;
-    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __pyx_L5_error)
+    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1758, __pyx_L5_error)
     __Pyx_GOTREF(__pyx_t_1);
 
-    /* "lxml/etree.pyx":1756
+    /* "lxml/etree.pyx":1759
  *         def __get__(self):
  *             return { attr : (value1 or value2)
  *                      for attr, value1, value2 in _FIND_PI_ATTRIBUTES(u' ' + self.text) }             # <<<<<<<<<<<<<<
  * 
  * cdef object _FIND_PI_ATTRIBUTES = re.compile(ur'\s+(\w+)\s*=\s*(?:\'([^\']*)\'|"([^"]*)")', re.U).findall
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1756, __pyx_L5_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1759, __pyx_L5_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyNumber_Add(__pyx_kp_u__15, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1756, __pyx_L5_error)
+    __pyx_t_4 = PyNumber_Add(__pyx_kp_u__15, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1759, __pyx_L5_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_INCREF(__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES);
@@ -63515,14 +63545,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
       }
     }
     if (!__pyx_t_5) {
-      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1756, __pyx_L5_error)
+      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L5_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_2);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_3)) {
         PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
-        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1756, __pyx_L5_error)
+        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L5_error)
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -63531,20 +63561,20 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
         PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
-        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1756, __pyx_L5_error)
+        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L5_error)
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else
       #endif
       {
-        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1756, __pyx_L5_error)
+        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1759, __pyx_L5_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
         __Pyx_GIVEREF(__pyx_t_4);
         PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
         __pyx_t_4 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1756, __pyx_L5_error)
+        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L5_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       }
@@ -63554,9 +63584,9 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
       __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
       __pyx_t_8 = NULL;
     } else {
-      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1756, __pyx_L5_error)
+      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1759, __pyx_L5_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1756, __pyx_L5_error)
+      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1759, __pyx_L5_error)
     }
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     for (;;) {
@@ -63564,17 +63594,17 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
         if (likely(PyList_CheckExact(__pyx_t_3))) {
           if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1756, __pyx_L5_error)
+          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1759, __pyx_L5_error)
           #else
-          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1756, __pyx_L5_error)
+          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L5_error)
           __Pyx_GOTREF(__pyx_t_2);
           #endif
         } else {
           if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1756, __pyx_L5_error)
+          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1759, __pyx_L5_error)
           #else
-          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1756, __pyx_L5_error)
+          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L5_error)
           __Pyx_GOTREF(__pyx_t_2);
           #endif
         }
@@ -63583,8 +63613,8 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
         if (unlikely(!__pyx_t_2)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 1756, __pyx_L5_error)
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            else __PYX_ERR(0, 1759, __pyx_L5_error)
           }
           break;
         }
@@ -63600,7 +63630,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
         if (unlikely(size != 3)) {
           if (size > 3) __Pyx_RaiseTooManyValuesError(3);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(0, 1756, __pyx_L5_error)
+          __PYX_ERR(0, 1759, __pyx_L5_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -63616,17 +63646,17 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
         __Pyx_INCREF(__pyx_t_4);
         __Pyx_INCREF(__pyx_t_5);
         #else
-        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1756, __pyx_L5_error)
+        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1759, __pyx_L5_error)
         __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1756, __pyx_L5_error)
+        __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1759, __pyx_L5_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1756, __pyx_L5_error)
+        __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1759, __pyx_L5_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1756, __pyx_L5_error)
+        __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1759, __pyx_L5_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
         __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
@@ -63636,7 +63666,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
         __Pyx_GOTREF(__pyx_t_4);
         index = 2; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_5);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(0, 1756, __pyx_L5_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(0, 1759, __pyx_L5_error)
         __pyx_t_10 = NULL;
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         goto __pyx_L9_unpacking_done;
@@ -63644,7 +63674,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         __pyx_t_10 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(0, 1756, __pyx_L5_error)
+        __PYX_ERR(0, 1759, __pyx_L5_error)
         __pyx_L9_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_attr, __pyx_t_6);
@@ -63654,14 +63684,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
       __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_value2, __pyx_t_5);
       __pyx_t_5 = 0;
 
-      /* "lxml/etree.pyx":1755
+      /* "lxml/etree.pyx":1758
  *         """
  *         def __get__(self):
  *             return { attr : (value1 or value2)             # <<<<<<<<<<<<<<
  *                      for attr, value1, value2 in _FIND_PI_ATTRIBUTES(u' ' + self.text) }
  * 
  */
-      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_7genexpr__pyx_v_value1); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1755, __pyx_L5_error)
+      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_7genexpr__pyx_v_value1); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1758, __pyx_L5_error)
       if (!__pyx_t_11) {
       } else {
         __Pyx_INCREF(__pyx_7genexpr__pyx_v_value1);
@@ -63671,10 +63701,10 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
       __Pyx_INCREF(__pyx_7genexpr__pyx_v_value2);
       __pyx_t_2 = __pyx_7genexpr__pyx_v_value2;
       __pyx_L10_bool_binop_done:;
-      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_attr, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1755, __pyx_L5_error)
+      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_attr, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1758, __pyx_L5_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-      /* "lxml/etree.pyx":1756
+      /* "lxml/etree.pyx":1759
  *         def __get__(self):
  *             return { attr : (value1 or value2)
  *                      for attr, value1, value2 in _FIND_PI_ATTRIBUTES(u' ' + self.text) }             # <<<<<<<<<<<<<<
@@ -63683,14 +63713,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
  */
     }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_attr);
-    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_value1);
-    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_value2);
+    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_attr); __pyx_7genexpr__pyx_v_attr = 0;
+    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_value1); __pyx_7genexpr__pyx_v_value1 = 0;
+    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_value2); __pyx_7genexpr__pyx_v_value2 = 0;
     goto __pyx_L12_exit_scope;
     __pyx_L5_error:;
-    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_attr);
-    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_value1);
-    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_value2);
+    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_attr); __pyx_7genexpr__pyx_v_attr = 0;
+    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_value1); __pyx_7genexpr__pyx_v_value1 = 0;
+    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_value2); __pyx_7genexpr__pyx_v_value2 = 0;
     goto __pyx_L1_error;
     __pyx_L12_exit_scope:;
   } /* exit inner scope */
@@ -63698,7 +63728,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1754
+  /* "lxml/etree.pyx":1757
  *         XML node, although this is not guaranteed to stay this way.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -63718,12 +63748,15 @@ static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6attrib___get__(
   __Pyx_AddTraceback("lxml.etree._ProcessingInstruction.attrib.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
+  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_attr);
+  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_value1);
+  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_value2);
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1762
+/* "lxml/etree.pyx":1765
  * cdef class _Entity(__ContentOnlyElement):
  *     property tag:
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -63750,7 +63783,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity_3tag___get__(CYTHON_UNUSED struc
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1763
+  /* "lxml/etree.pyx":1766
  *     property tag:
  *         def __get__(self):
  *             return Entity             # <<<<<<<<<<<<<<
@@ -63758,13 +63791,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity_3tag___get__(CYTHON_UNUSED struc
  *     property name:
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1763, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1766, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1762
+  /* "lxml/etree.pyx":1765
  * cdef class _Entity(__ContentOnlyElement):
  *     property tag:
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -63783,7 +63816,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity_3tag___get__(CYTHON_UNUSED struc
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1767
+/* "lxml/etree.pyx":1770
  *     property name:
  *         # not in ElementTree
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -63811,16 +63844,16 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4name___get__(struct __pyx_obj_4
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1768
+  /* "lxml/etree.pyx":1771
  *         # not in ElementTree
  *         def __get__(self):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             return funicode(self._c_node.name)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1768, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1771, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1769
+  /* "lxml/etree.pyx":1772
  *         def __get__(self):
  *             _assertValidNode(self)
  *             return funicode(self._c_node.name)             # <<<<<<<<<<<<<<
@@ -63828,13 +63861,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4name___get__(struct __pyx_obj_4
  *         def __set__(self, value):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1769, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1772, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1767
+  /* "lxml/etree.pyx":1770
  *     property name:
  *         # not in ElementTree
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -63853,7 +63886,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4name___get__(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1771
+/* "lxml/etree.pyx":1774
  *             return funicode(self._c_node.name)
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -63886,69 +63919,69 @@ static int __pyx_pf_4lxml_5etree_7_Entity_4name_2__set__(struct __pyx_obj_4lxml_
   PyObject *__pyx_t_6 = NULL;
   __Pyx_RefNannySetupContext("__set__", 0);
 
-  /* "lxml/etree.pyx":1772
+  /* "lxml/etree.pyx":1775
  * 
  *         def __set__(self, value):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             value_utf = _utf8(value)
  *             if b'&' in value_utf or b';' in value_utf:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1772, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1775, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1773
+  /* "lxml/etree.pyx":1776
  *         def __set__(self, value):
  *             _assertValidNode(self)
  *             value_utf = _utf8(value)             # <<<<<<<<<<<<<<
  *             if b'&' in value_utf or b';' in value_utf:
  *                 raise ValueError(u"Invalid entity name '%s'" % value)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1773, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1776, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_v_value_utf = ((PyObject*)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":1774
+  /* "lxml/etree.pyx":1777
  *             _assertValidNode(self)
  *             value_utf = _utf8(value)
  *             if b'&' in value_utf or b';' in value_utf:             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"Invalid entity name '%s'" % value)
  *             tree.xmlNodeSetName(self._c_node, _xcstr(value_utf))
  */
-  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__32, __pyx_v_value_utf, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1774, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__33, __pyx_v_value_utf, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1777, __pyx_L1_error)
   __pyx_t_5 = (__pyx_t_4 != 0);
   if (!__pyx_t_5) {
   } else {
     __pyx_t_3 = __pyx_t_5;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__33, __pyx_v_value_utf, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1774, __pyx_L1_error)
+  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__34, __pyx_v_value_utf, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1777, __pyx_L1_error)
   __pyx_t_4 = (__pyx_t_5 != 0);
   __pyx_t_3 = __pyx_t_4;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":1775
+    /* "lxml/etree.pyx":1778
  *             value_utf = _utf8(value)
  *             if b'&' in value_utf or b';' in value_utf:
  *                 raise ValueError(u"Invalid entity name '%s'" % value)             # <<<<<<<<<<<<<<
  *             tree.xmlNodeSetName(self._c_node, _xcstr(value_utf))
  * 
  */
-    __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Invalid_entity_name_s, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1775, __pyx_L1_error)
+    __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Invalid_entity_name_s, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1778, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1775, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1778, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_GIVEREF(__pyx_t_2);
     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
     __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1775, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1778, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 1775, __pyx_L1_error)
+    __PYX_ERR(0, 1778, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":1774
+    /* "lxml/etree.pyx":1777
  *             _assertValidNode(self)
  *             value_utf = _utf8(value)
  *             if b'&' in value_utf or b';' in value_utf:             # <<<<<<<<<<<<<<
@@ -63957,7 +63990,7 @@ static int __pyx_pf_4lxml_5etree_7_Entity_4name_2__set__(struct __pyx_obj_4lxml_
  */
   }
 
-  /* "lxml/etree.pyx":1776
+  /* "lxml/etree.pyx":1779
  *             if b'&' in value_utf or b';' in value_utf:
  *                 raise ValueError(u"Invalid entity name '%s'" % value)
  *             tree.xmlNodeSetName(self._c_node, _xcstr(value_utf))             # <<<<<<<<<<<<<<
@@ -63966,7 +63999,7 @@ static int __pyx_pf_4lxml_5etree_7_Entity_4name_2__set__(struct __pyx_obj_4lxml_
  */
   xmlNodeSetName(__pyx_v_self->__pyx_base.__pyx_base._c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_value_utf));
 
-  /* "lxml/etree.pyx":1771
+  /* "lxml/etree.pyx":1774
  *             return funicode(self._c_node.name)
  * 
  *         def __set__(self, value):             # <<<<<<<<<<<<<<
@@ -63988,7 +64021,7 @@ static int __pyx_pf_4lxml_5etree_7_Entity_4name_2__set__(struct __pyx_obj_4lxml_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1781
+/* "lxml/etree.pyx":1784
  *         # FIXME: should this be None or '&[VALUE];' or the resolved
  *         # entity value ?
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -64017,16 +64050,16 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4text___get__(struct __pyx_obj_4
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1782
+  /* "lxml/etree.pyx":1785
  *         # entity value ?
  *         def __get__(self):
  *             _assertValidNode(self)             # <<<<<<<<<<<<<<
  *             return u'&%s;' % funicode(self._c_node.name)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1782, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1785, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1783
+  /* "lxml/etree.pyx":1786
  *         def __get__(self):
  *             _assertValidNode(self)
  *             return u'&%s;' % funicode(self._c_node.name)             # <<<<<<<<<<<<<<
@@ -64034,16 +64067,16 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4text___get__(struct __pyx_obj_4
  *     def __repr__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1783, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1786, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_s_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1783, __pyx_L1_error)
+  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_s_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1786, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1781
+  /* "lxml/etree.pyx":1784
  *         # FIXME: should this be None or '&[VALUE];' or the resolved
  *         # entity value ?
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -64063,7 +64096,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4text___get__(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1785
+/* "lxml/etree.pyx":1788
  *             return u'&%s;' % funicode(self._c_node.name)
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -64091,7 +64124,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity___repr__(struct __pyx_obj_4lxml_
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "lxml/etree.pyx":1786
+  /* "lxml/etree.pyx":1789
  * 
  *     def __repr__(self):
  *         return "&%s;" % strrepr(self.name)             # <<<<<<<<<<<<<<
@@ -64099,19 +64132,19 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity___repr__(struct __pyx_obj_4lxml_
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1786, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1789, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1785
+  /* "lxml/etree.pyx":1788
  *             return u'&%s;' % funicode(self._c_node.name)
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -64131,7 +64164,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Entity___repr__(struct __pyx_obj_4lxml_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1812
+/* "lxml/etree.pyx":1815
  *     cdef readonly unicode localname
  *     cdef readonly unicode namespace
  *     def __init__(self, text_or_uri_or_element, tag=None):             # <<<<<<<<<<<<<<
@@ -64175,7 +64208,7 @@ static int __pyx_pw_4lxml_5etree_5QName_1__init__(PyObject *__pyx_v_self, PyObje
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1812, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1815, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -64191,7 +64224,7 @@ static int __pyx_pw_4lxml_5etree_5QName_1__init__(PyObject *__pyx_v_self, PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1812, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1815, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.QName.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -64218,7 +64251,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
   __Pyx_RefNannySetupContext("__init__", 0);
   __Pyx_INCREF(__pyx_v_text_or_uri_or_element);
 
-  /* "lxml/etree.pyx":1813
+  /* "lxml/etree.pyx":1816
  *     cdef readonly unicode namespace
  *     def __init__(self, text_or_uri_or_element, tag=None):
  *         if not _isString(text_or_uri_or_element):             # <<<<<<<<<<<<<<
@@ -64228,7 +64261,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
   __pyx_t_1 = ((!(_isString(__pyx_v_text_or_uri_or_element) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":1814
+    /* "lxml/etree.pyx":1817
  *     def __init__(self, text_or_uri_or_element, tag=None):
  *         if not _isString(text_or_uri_or_element):
  *             if isinstance(text_or_uri_or_element, _Element):             # <<<<<<<<<<<<<<
@@ -64239,19 +64272,19 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
     __pyx_t_2 = (__pyx_t_1 != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":1815
+      /* "lxml/etree.pyx":1818
  *         if not _isString(text_or_uri_or_element):
  *             if isinstance(text_or_uri_or_element, _Element):
  *                 text_or_uri_or_element = (<_Element>text_or_uri_or_element).tag             # <<<<<<<<<<<<<<
  *                 if not _isString(text_or_uri_or_element):
  *                     raise ValueError, (u"Invalid input tag of type %r" %
  */
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_text_or_uri_or_element, __pyx_n_s_tag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1815, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_text_or_uri_or_element, __pyx_n_s_tag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1818, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF_SET(__pyx_v_text_or_uri_or_element, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":1816
+      /* "lxml/etree.pyx":1819
  *             if isinstance(text_or_uri_or_element, _Element):
  *                 text_or_uri_or_element = (<_Element>text_or_uri_or_element).tag
  *                 if not _isString(text_or_uri_or_element):             # <<<<<<<<<<<<<<
@@ -64261,20 +64294,20 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
       __pyx_t_2 = ((!(_isString(__pyx_v_text_or_uri_or_element) != 0)) != 0);
       if (__pyx_t_2) {
 
-        /* "lxml/etree.pyx":1817
+        /* "lxml/etree.pyx":1820
  *                 text_or_uri_or_element = (<_Element>text_or_uri_or_element).tag
  *                 if not _isString(text_or_uri_or_element):
  *                     raise ValueError, (u"Invalid input tag of type %r" %             # <<<<<<<<<<<<<<
  *                                        type(text_or_uri_or_element))
  *             elif isinstance(text_or_uri_or_element, QName):
  */
-        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Invalid_input_tag_of_type_r, ((PyObject *)Py_TYPE(__pyx_v_text_or_uri_or_element))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1817, __pyx_L1_error)
+        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Invalid_input_tag_of_type_r, ((PyObject *)Py_TYPE(__pyx_v_text_or_uri_or_element))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1820, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0, 0);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __PYX_ERR(0, 1817, __pyx_L1_error)
+        __PYX_ERR(0, 1820, __pyx_L1_error)
 
-        /* "lxml/etree.pyx":1816
+        /* "lxml/etree.pyx":1819
  *             if isinstance(text_or_uri_or_element, _Element):
  *                 text_or_uri_or_element = (<_Element>text_or_uri_or_element).tag
  *                 if not _isString(text_or_uri_or_element):             # <<<<<<<<<<<<<<
@@ -64283,7 +64316,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
  */
       }
 
-      /* "lxml/etree.pyx":1814
+      /* "lxml/etree.pyx":1817
  *     def __init__(self, text_or_uri_or_element, tag=None):
  *         if not _isString(text_or_uri_or_element):
  *             if isinstance(text_or_uri_or_element, _Element):             # <<<<<<<<<<<<<<
@@ -64293,7 +64326,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
       goto __pyx_L4;
     }
 
-    /* "lxml/etree.pyx":1819
+    /* "lxml/etree.pyx":1822
  *                     raise ValueError, (u"Invalid input tag of type %r" %
  *                                        type(text_or_uri_or_element))
  *             elif isinstance(text_or_uri_or_element, QName):             # <<<<<<<<<<<<<<
@@ -64304,7 +64337,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
     __pyx_t_1 = (__pyx_t_2 != 0);
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":1820
+      /* "lxml/etree.pyx":1823
  *                                        type(text_or_uri_or_element))
  *             elif isinstance(text_or_uri_or_element, QName):
  *                 text_or_uri_or_element = (<QName>text_or_uri_or_element).text             # <<<<<<<<<<<<<<
@@ -64316,7 +64349,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
       __Pyx_DECREF_SET(__pyx_v_text_or_uri_or_element, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":1819
+      /* "lxml/etree.pyx":1822
  *                     raise ValueError, (u"Invalid input tag of type %r" %
  *                                        type(text_or_uri_or_element))
  *             elif isinstance(text_or_uri_or_element, QName):             # <<<<<<<<<<<<<<
@@ -64326,7 +64359,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
       goto __pyx_L4;
     }
 
-    /* "lxml/etree.pyx":1822
+    /* "lxml/etree.pyx":1825
  *                 text_or_uri_or_element = (<QName>text_or_uri_or_element).text
  *             else:
  *                 text_or_uri_or_element = unicode(text_or_uri_or_element)             # <<<<<<<<<<<<<<
@@ -64334,12 +64367,12 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
  *         ns_utf, tag_utf = _getNsTag(text_or_uri_or_element)
  */
     /*else*/ {
-      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1822, __pyx_L1_error)
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1825, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_v_text_or_uri_or_element);
       __Pyx_GIVEREF(__pyx_v_text_or_uri_or_element);
       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_text_or_uri_or_element);
-      __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1822, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1825, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_DECREF_SET(__pyx_v_text_or_uri_or_element, __pyx_t_4);
@@ -64347,7 +64380,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
     }
     __pyx_L4:;
 
-    /* "lxml/etree.pyx":1813
+    /* "lxml/etree.pyx":1816
  *     cdef readonly unicode namespace
  *     def __init__(self, text_or_uri_or_element, tag=None):
  *         if not _isString(text_or_uri_or_element):             # <<<<<<<<<<<<<<
@@ -64356,14 +64389,14 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
  */
   }
 
-  /* "lxml/etree.pyx":1824
+  /* "lxml/etree.pyx":1827
  *                 text_or_uri_or_element = unicode(text_or_uri_or_element)
  * 
  *         ns_utf, tag_utf = _getNsTag(text_or_uri_or_element)             # <<<<<<<<<<<<<<
  *         if tag is not None:
  *             # either ('ns', 'tag') or ('{ns}oldtag', 'newtag')
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_text_or_uri_or_element); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1824, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_text_or_uri_or_element); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1827, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (likely(__pyx_t_4 != Py_None)) {
     PyObject* sequence = __pyx_t_4;
@@ -64375,7 +64408,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 1824, __pyx_L1_error)
+      __PYX_ERR(0, 1827, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
@@ -64383,21 +64416,21 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
     __Pyx_INCREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_t_5);
     #else
-    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1824, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1827, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1824, __pyx_L1_error)
+    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1827, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     #endif
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 1824, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 1827, __pyx_L1_error)
   }
   __pyx_v_ns_utf = __pyx_t_3;
   __pyx_t_3 = 0;
   __pyx_v_tag_utf = __pyx_t_5;
   __pyx_t_5 = 0;
 
-  /* "lxml/etree.pyx":1825
+  /* "lxml/etree.pyx":1828
  * 
  *         ns_utf, tag_utf = _getNsTag(text_or_uri_or_element)
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -64408,7 +64441,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1827
+    /* "lxml/etree.pyx":1830
  *         if tag is not None:
  *             # either ('ns', 'tag') or ('{ns}oldtag', 'newtag')
  *             if ns_utf is None:             # <<<<<<<<<<<<<<
@@ -64419,7 +64452,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
     __pyx_t_1 = (__pyx_t_2 != 0);
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":1828
+      /* "lxml/etree.pyx":1831
  *             # either ('ns', 'tag') or ('{ns}oldtag', 'newtag')
  *             if ns_utf is None:
  *                 ns_utf = tag_utf # case 1: namespace ended up as tag name             # <<<<<<<<<<<<<<
@@ -64429,7 +64462,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
       __Pyx_INCREF(__pyx_v_tag_utf);
       __Pyx_DECREF_SET(__pyx_v_ns_utf, __pyx_v_tag_utf);
 
-      /* "lxml/etree.pyx":1827
+      /* "lxml/etree.pyx":1830
  *         if tag is not None:
  *             # either ('ns', 'tag') or ('{ns}oldtag', 'newtag')
  *             if ns_utf is None:             # <<<<<<<<<<<<<<
@@ -64438,19 +64471,19 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
  */
     }
 
-    /* "lxml/etree.pyx":1829
+    /* "lxml/etree.pyx":1832
  *             if ns_utf is None:
  *                 ns_utf = tag_utf # case 1: namespace ended up as tag name
  *             tag_utf = _utf8(tag)             # <<<<<<<<<<<<<<
  *         _tagValidOrRaise(tag_utf)
  *         self.localname = (<bytes>tag_utf).decode('utf8')
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1829, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1832, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF_SET(__pyx_v_tag_utf, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1825
+    /* "lxml/etree.pyx":1828
  * 
  *         ns_utf, tag_utf = _getNsTag(text_or_uri_or_element)
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -64459,16 +64492,16 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
  */
   }
 
-  /* "lxml/etree.pyx":1830
+  /* "lxml/etree.pyx":1833
  *                 ns_utf = tag_utf # case 1: namespace ended up as tag name
  *             tag_utf = _utf8(tag)
  *         _tagValidOrRaise(tag_utf)             # <<<<<<<<<<<<<<
  *         self.localname = (<bytes>tag_utf).decode('utf8')
  *         if ns_utf is None:
  */
-  __pyx_t_6 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_tag_utf); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1830, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_tag_utf); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1833, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1831
+  /* "lxml/etree.pyx":1834
  *             tag_utf = _utf8(tag)
  *         _tagValidOrRaise(tag_utf)
  *         self.localname = (<bytes>tag_utf).decode('utf8')             # <<<<<<<<<<<<<<
@@ -64476,19 +64509,19 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
  *             self.namespace = None
  */
   if (unlikely(__pyx_v_tag_utf == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
-    __PYX_ERR(0, 1831, __pyx_L1_error)
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
+    __PYX_ERR(0, 1834, __pyx_L1_error)
   }
-  __pyx_t_4 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1831, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1831, __pyx_L1_error)
+  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1834, __pyx_L1_error)
   __Pyx_GIVEREF(__pyx_t_4);
   __Pyx_GOTREF(__pyx_v_self->localname);
   __Pyx_DECREF(__pyx_v_self->localname);
   __pyx_v_self->localname = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":1832
+  /* "lxml/etree.pyx":1835
  *         _tagValidOrRaise(tag_utf)
  *         self.localname = (<bytes>tag_utf).decode('utf8')
  *         if ns_utf is None:             # <<<<<<<<<<<<<<
@@ -64499,7 +64532,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1833
+    /* "lxml/etree.pyx":1836
  *         self.localname = (<bytes>tag_utf).decode('utf8')
  *         if ns_utf is None:
  *             self.namespace = None             # <<<<<<<<<<<<<<
@@ -64512,7 +64545,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
     __Pyx_DECREF(__pyx_v_self->namespace);
     __pyx_v_self->namespace = ((PyObject*)Py_None);
 
-    /* "lxml/etree.pyx":1834
+    /* "lxml/etree.pyx":1837
  *         if ns_utf is None:
  *             self.namespace = None
  *             self.text = self.localname             # <<<<<<<<<<<<<<
@@ -64527,7 +64560,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
     __pyx_v_self->text = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1832
+    /* "lxml/etree.pyx":1835
  *         _tagValidOrRaise(tag_utf)
  *         self.localname = (<bytes>tag_utf).decode('utf8')
  *         if ns_utf is None:             # <<<<<<<<<<<<<<
@@ -64537,7 +64570,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
     goto __pyx_L8;
   }
 
-  /* "lxml/etree.pyx":1836
+  /* "lxml/etree.pyx":1839
  *             self.text = self.localname
  *         else:
  *             self.namespace = (<bytes>ns_utf).decode('utf8')             # <<<<<<<<<<<<<<
@@ -64546,26 +64579,26 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
  */
   /*else*/ {
     if (unlikely(__pyx_v_ns_utf == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
-      __PYX_ERR(0, 1836, __pyx_L1_error)
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
+      __PYX_ERR(0, 1839, __pyx_L1_error)
     }
-    __pyx_t_4 = __Pyx_decode_bytes(((PyObject*)__pyx_v_ns_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1836, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_decode_bytes(((PyObject*)__pyx_v_ns_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1839, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1836, __pyx_L1_error)
+    if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1839, __pyx_L1_error)
     __Pyx_GIVEREF(__pyx_t_4);
     __Pyx_GOTREF(__pyx_v_self->namespace);
     __Pyx_DECREF(__pyx_v_self->namespace);
     __pyx_v_self->namespace = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1837
+    /* "lxml/etree.pyx":1840
  *         else:
  *             self.namespace = (<bytes>ns_utf).decode('utf8')
  *             self.text = u"{%s}%s" % (self.namespace, self.localname)             # <<<<<<<<<<<<<<
  *     def __str__(self):
  *         return self.text
  */
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1837, __pyx_L1_error)
+    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1840, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_v_self->namespace);
     __Pyx_GIVEREF(__pyx_v_self->namespace);
@@ -64573,7 +64606,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
     __Pyx_INCREF(__pyx_v_self->localname);
     __Pyx_GIVEREF(__pyx_v_self->localname);
     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->localname);
-    __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s_s_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1837, __pyx_L1_error)
+    __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_s_s_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1840, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GIVEREF(__pyx_t_5);
@@ -64584,7 +64617,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
   }
   __pyx_L8:;
 
-  /* "lxml/etree.pyx":1812
+  /* "lxml/etree.pyx":1815
  *     cdef readonly unicode localname
  *     cdef readonly unicode namespace
  *     def __init__(self, text_or_uri_or_element, tag=None):             # <<<<<<<<<<<<<<
@@ -64609,7 +64642,7 @@ static int __pyx_pf_4lxml_5etree_5QName___init__(struct __pyx_obj_4lxml_5etree_Q
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1838
+/* "lxml/etree.pyx":1841
  *             self.namespace = (<bytes>ns_utf).decode('utf8')
  *             self.text = u"{%s}%s" % (self.namespace, self.localname)
  *     def __str__(self):             # <<<<<<<<<<<<<<
@@ -64635,7 +64668,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_2__str__(struct __pyx_obj_4lxml_5e
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__str__", 0);
 
-  /* "lxml/etree.pyx":1839
+  /* "lxml/etree.pyx":1842
  *             self.text = u"{%s}%s" % (self.namespace, self.localname)
  *     def __str__(self):
  *         return self.text             # <<<<<<<<<<<<<<
@@ -64647,7 +64680,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_2__str__(struct __pyx_obj_4lxml_5e
   __pyx_r = __pyx_v_self->text;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1838
+  /* "lxml/etree.pyx":1841
  *             self.namespace = (<bytes>ns_utf).decode('utf8')
  *             self.text = u"{%s}%s" % (self.namespace, self.localname)
  *     def __str__(self):             # <<<<<<<<<<<<<<
@@ -64662,7 +64695,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_2__str__(struct __pyx_obj_4lxml_5e
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1840
+/* "lxml/etree.pyx":1843
  *     def __str__(self):
  *         return self.text
  *     def __hash__(self):             # <<<<<<<<<<<<<<
@@ -64690,7 +64723,7 @@ static Py_hash_t __pyx_pf_4lxml_5etree_5QName_4__hash__(struct __pyx_obj_4lxml_5
   Py_hash_t __pyx_t_2;
   __Pyx_RefNannySetupContext("__hash__", 0);
 
-  /* "lxml/etree.pyx":1841
+  /* "lxml/etree.pyx":1844
  *         return self.text
  *     def __hash__(self):
  *         return hash(self.text)             # <<<<<<<<<<<<<<
@@ -64699,12 +64732,12 @@ static Py_hash_t __pyx_pf_4lxml_5etree_5QName_4__hash__(struct __pyx_obj_4lxml_5
  */
   __pyx_t_1 = __pyx_v_self->text;
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1841, __pyx_L1_error)
+  __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(0, 1844, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_2;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1840
+  /* "lxml/etree.pyx":1843
  *     def __str__(self):
  *         return self.text
  *     def __hash__(self):             # <<<<<<<<<<<<<<
@@ -64723,7 +64756,7 @@ static Py_hash_t __pyx_pf_4lxml_5etree_5QName_4__hash__(struct __pyx_obj_4lxml_5
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1842
+/* "lxml/etree.pyx":1845
  *     def __hash__(self):
  *         return hash(self.text)
  *     def __richcmp__(one, other, int op):             # <<<<<<<<<<<<<<
@@ -64760,7 +64793,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
   __Pyx_INCREF(__pyx_v_one);
   __Pyx_INCREF(__pyx_v_other);
 
-  /* "lxml/etree.pyx":1843
+  /* "lxml/etree.pyx":1846
  *         return hash(self.text)
  *     def __richcmp__(one, other, int op):
  *         try:             # <<<<<<<<<<<<<<
@@ -64776,7 +64809,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
     __Pyx_XGOTREF(__pyx_t_3);
     /*try:*/ {
 
-      /* "lxml/etree.pyx":1844
+      /* "lxml/etree.pyx":1847
  *     def __richcmp__(one, other, int op):
  *         try:
  *             if type(one) is QName:             # <<<<<<<<<<<<<<
@@ -64787,7 +64820,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
       __pyx_t_5 = (__pyx_t_4 != 0);
       if (__pyx_t_5) {
 
-        /* "lxml/etree.pyx":1845
+        /* "lxml/etree.pyx":1848
  *         try:
  *             if type(one) is QName:
  *                 one = (<QName>one).text             # <<<<<<<<<<<<<<
@@ -64799,7 +64832,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
         __Pyx_DECREF_SET(__pyx_v_one, __pyx_t_6);
         __pyx_t_6 = 0;
 
-        /* "lxml/etree.pyx":1844
+        /* "lxml/etree.pyx":1847
  *     def __richcmp__(one, other, int op):
  *         try:
  *             if type(one) is QName:             # <<<<<<<<<<<<<<
@@ -64809,7 +64842,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
         goto __pyx_L9;
       }
 
-      /* "lxml/etree.pyx":1846
+      /* "lxml/etree.pyx":1849
  *             if type(one) is QName:
  *                 one = (<QName>one).text
  *             elif not isinstance(one, unicode):             # <<<<<<<<<<<<<<
@@ -64820,25 +64853,25 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
       __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0);
       if (__pyx_t_4) {
 
-        /* "lxml/etree.pyx":1847
+        /* "lxml/etree.pyx":1850
  *                 one = (<QName>one).text
  *             elif not isinstance(one, unicode):
  *                 one = unicode(one)             # <<<<<<<<<<<<<<
  *             if type(other) is QName:
  *                 other = (<QName>other).text
  */
-        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1847, __pyx_L3_error)
+        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1850, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_INCREF(__pyx_v_one);
         __Pyx_GIVEREF(__pyx_v_one);
         PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_one);
-        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1847, __pyx_L3_error)
+        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1850, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_DECREF_SET(__pyx_v_one, __pyx_t_7);
         __pyx_t_7 = 0;
 
-        /* "lxml/etree.pyx":1846
+        /* "lxml/etree.pyx":1849
  *             if type(one) is QName:
  *                 one = (<QName>one).text
  *             elif not isinstance(one, unicode):             # <<<<<<<<<<<<<<
@@ -64848,7 +64881,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
       }
       __pyx_L9:;
 
-      /* "lxml/etree.pyx":1848
+      /* "lxml/etree.pyx":1851
  *             elif not isinstance(one, unicode):
  *                 one = unicode(one)
  *             if type(other) is QName:             # <<<<<<<<<<<<<<
@@ -64859,7 +64892,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
       __pyx_t_5 = (__pyx_t_4 != 0);
       if (__pyx_t_5) {
 
-        /* "lxml/etree.pyx":1849
+        /* "lxml/etree.pyx":1852
  *                 one = unicode(one)
  *             if type(other) is QName:
  *                 other = (<QName>other).text             # <<<<<<<<<<<<<<
@@ -64871,7 +64904,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
         __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_7);
         __pyx_t_7 = 0;
 
-        /* "lxml/etree.pyx":1848
+        /* "lxml/etree.pyx":1851
  *             elif not isinstance(one, unicode):
  *                 one = unicode(one)
  *             if type(other) is QName:             # <<<<<<<<<<<<<<
@@ -64881,7 +64914,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
         goto __pyx_L10;
       }
 
-      /* "lxml/etree.pyx":1850
+      /* "lxml/etree.pyx":1853
  *             if type(other) is QName:
  *                 other = (<QName>other).text
  *             elif not isinstance(other, unicode):             # <<<<<<<<<<<<<<
@@ -64892,25 +64925,25 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
       __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0);
       if (__pyx_t_4) {
 
-        /* "lxml/etree.pyx":1851
+        /* "lxml/etree.pyx":1854
  *                 other = (<QName>other).text
  *             elif not isinstance(other, unicode):
  *                 other = unicode(other)             # <<<<<<<<<<<<<<
  *         except (ValueError, UnicodeDecodeError):
  *             return NotImplemented
  */
-        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1851, __pyx_L3_error)
+        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1854, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_INCREF(__pyx_v_other);
         __Pyx_GIVEREF(__pyx_v_other);
         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_other);
-        __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1851, __pyx_L3_error)
+        __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1854, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_6);
         __pyx_t_6 = 0;
 
-        /* "lxml/etree.pyx":1850
+        /* "lxml/etree.pyx":1853
  *             if type(other) is QName:
  *                 other = (<QName>other).text
  *             elif not isinstance(other, unicode):             # <<<<<<<<<<<<<<
@@ -64920,7 +64953,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
       }
       __pyx_L10:;
 
-      /* "lxml/etree.pyx":1843
+      /* "lxml/etree.pyx":1846
  *         return hash(self.text)
  *     def __richcmp__(one, other, int op):
  *         try:             # <<<<<<<<<<<<<<
@@ -64933,11 +64966,10 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "lxml/etree.pyx":1852
+    /* "lxml/etree.pyx":1855
  *             elif not isinstance(other, unicode):
  *                 other = unicode(other)
  *         except (ValueError, UnicodeDecodeError):             # <<<<<<<<<<<<<<
@@ -64947,12 +64979,12 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
     __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
     if (__pyx_t_8) {
       __Pyx_AddTraceback("lxml.etree.QName.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 1852, __pyx_L5_except_error)
+      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 1855, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GOTREF(__pyx_t_9);
 
-      /* "lxml/etree.pyx":1853
+      /* "lxml/etree.pyx":1856
  *                 other = unicode(other)
  *         except (ValueError, UnicodeDecodeError):
  *             return NotImplemented             # <<<<<<<<<<<<<<
@@ -64970,21 +65002,19 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
     goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
 
-    /* "lxml/etree.pyx":1843
+    /* "lxml/etree.pyx":1846
  *         return hash(self.text)
  *     def __richcmp__(one, other, int op):
  *         try:             # <<<<<<<<<<<<<<
  *             if type(one) is QName:
  *                 one = (<QName>one).text
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L6_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -64993,7 +65023,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
     __pyx_L8_try_end:;
   }
 
-  /* "lxml/etree.pyx":1854
+  /* "lxml/etree.pyx":1857
  *         except (ValueError, UnicodeDecodeError):
  *             return NotImplemented
  *         return python.PyObject_RichCompare(one, other, op)             # <<<<<<<<<<<<<<
@@ -65001,13 +65031,13 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_9 = PyObject_RichCompare(__pyx_v_one, __pyx_v_other, __pyx_v_op); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1854, __pyx_L1_error)
+  __pyx_t_9 = PyObject_RichCompare(__pyx_v_one, __pyx_v_other, __pyx_v_op); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1857, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __pyx_r = __pyx_t_9;
   __pyx_t_9 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1842
+  /* "lxml/etree.pyx":1845
  *     def __hash__(self):
  *         return hash(self.text)
  *     def __richcmp__(one, other, int op):             # <<<<<<<<<<<<<<
@@ -65030,7 +65060,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_6__richcmp__(PyObject *__pyx_v_one
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1809
+/* "lxml/etree.pyx":1812
  *     their text content.
  *     """
  *     cdef readonly unicode text             # <<<<<<<<<<<<<<
@@ -65067,7 +65097,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_4text___get__(struct __pyx_obj_4lx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1810
+/* "lxml/etree.pyx":1813
  *     """
  *     cdef readonly unicode text
  *     cdef readonly unicode localname             # <<<<<<<<<<<<<<
@@ -65104,7 +65134,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_9localname___get__(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1811
+/* "lxml/etree.pyx":1814
  *     cdef readonly unicode text
  *     cdef readonly unicode localname
  *     cdef readonly unicode namespace             # <<<<<<<<<<<<<<
@@ -65141,7 +65171,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5QName_9namespace___get__(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1867
+/* "lxml/etree.pyx":1870
  * 
  *     @cython.final
  *     cdef int _assertHasRoot(self) except -1:             # <<<<<<<<<<<<<<
@@ -65155,7 +65185,7 @@ static int __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(struct LxmlElement
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("_assertHasRoot", 0);
 
-  /* "lxml/etree.pyx":1873
+  /* "lxml/etree.pyx":1876
  *         the caller program.
  *         """
  *         assert self._context_node is not None, \             # <<<<<<<<<<<<<<
@@ -65167,12 +65197,12 @@ static int __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(struct LxmlElement
     __pyx_t_1 = (((PyObject *)__pyx_v_self->_context_node) != Py_None);
     if (unlikely(!(__pyx_t_1 != 0))) {
       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_ElementTree_not_initialized_miss);
-      __PYX_ERR(0, 1873, __pyx_L1_error)
+      __PYX_ERR(0, 1876, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "lxml/etree.pyx":1875
+  /* "lxml/etree.pyx":1878
  *         assert self._context_node is not None, \
  *                u"ElementTree not initialized, missing root"
  *         return 0             # <<<<<<<<<<<<<<
@@ -65182,7 +65212,7 @@ static int __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(struct LxmlElement
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1867
+  /* "lxml/etree.pyx":1870
  * 
  *     @cython.final
  *     cdef int _assertHasRoot(self) except -1:             # <<<<<<<<<<<<<<
@@ -65199,7 +65229,7 @@ static int __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(struct LxmlElement
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1877
+/* "lxml/etree.pyx":1880
  *         return 0
  * 
  *     def parse(self, source, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
@@ -65252,7 +65282,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_1parse(PyObject *__pyx_v_s
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse") < 0)) __PYX_ERR(0, 1877, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse") < 0)) __PYX_ERR(0, 1880, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -65269,13 +65299,13 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_1parse(PyObject *__pyx_v_s
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("parse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1877, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("parse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1880, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ElementTree.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 1877, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 1880, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_12_ElementTree_parse(((struct LxmlElementTree *)__pyx_v_self), __pyx_v_source, __pyx_v_parser, __pyx_v_base_url);
 
   /* function exit code */
@@ -65304,7 +65334,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
   PyObject *__pyx_t_10 = NULL;
   __Pyx_RefNannySetupContext("parse", 0);
 
-  /* "lxml/etree.pyx":1882
+  /* "lxml/etree.pyx":1885
  *         Updates self with the content of source and returns its root
  *         """
  *         cdef _Document doc = None             # <<<<<<<<<<<<<<
@@ -65314,7 +65344,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
   __Pyx_INCREF(Py_None);
   __pyx_v_doc = ((struct LxmlDocument *)Py_None);
 
-  /* "lxml/etree.pyx":1883
+  /* "lxml/etree.pyx":1886
  *         """
  *         cdef _Document doc = None
  *         try:             # <<<<<<<<<<<<<<
@@ -65330,35 +65360,35 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
     __Pyx_XGOTREF(__pyx_t_3);
     /*try:*/ {
 
-      /* "lxml/etree.pyx":1884
+      /* "lxml/etree.pyx":1887
  *         cdef _Document doc = None
  *         try:
  *             doc = _parseDocument(source, parser, base_url)             # <<<<<<<<<<<<<<
  *             self._context_node = doc.getroot()
  *             if self._context_node is None:
  */
-      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_source, __pyx_v_parser, __pyx_v_base_url)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1884, __pyx_L3_error)
+      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_source, __pyx_v_parser, __pyx_v_base_url)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1887, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF_SET(__pyx_v_doc, ((struct LxmlDocument *)__pyx_t_4));
       __pyx_t_4 = 0;
 
-      /* "lxml/etree.pyx":1885
+      /* "lxml/etree.pyx":1888
  *         try:
  *             doc = _parseDocument(source, parser, base_url)
  *             self._context_node = doc.getroot()             # <<<<<<<<<<<<<<
  *             if self._context_node is None:
  *                 self._doc = doc
  */
-      __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1885, __pyx_L3_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1888, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_4);
-      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 1885, __pyx_L3_error)
+      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 1888, __pyx_L3_error)
       __Pyx_GIVEREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_v_self->_context_node);
       __Pyx_DECREF(((PyObject *)__pyx_v_self->_context_node));
       __pyx_v_self->_context_node = ((struct LxmlElement *)__pyx_t_4);
       __pyx_t_4 = 0;
 
-      /* "lxml/etree.pyx":1886
+      /* "lxml/etree.pyx":1889
  *             doc = _parseDocument(source, parser, base_url)
  *             self._context_node = doc.getroot()
  *             if self._context_node is None:             # <<<<<<<<<<<<<<
@@ -65369,7 +65399,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
       __pyx_t_6 = (__pyx_t_5 != 0);
       if (__pyx_t_6) {
 
-        /* "lxml/etree.pyx":1887
+        /* "lxml/etree.pyx":1890
  *             self._context_node = doc.getroot()
  *             if self._context_node is None:
  *                 self._doc = doc             # <<<<<<<<<<<<<<
@@ -65382,7 +65412,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
         __Pyx_DECREF(((PyObject *)__pyx_v_self->_doc));
         __pyx_v_self->_doc = __pyx_v_doc;
 
-        /* "lxml/etree.pyx":1886
+        /* "lxml/etree.pyx":1889
  *             doc = _parseDocument(source, parser, base_url)
  *             self._context_node = doc.getroot()
  *             if self._context_node is None:             # <<<<<<<<<<<<<<
@@ -65391,7 +65421,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
  */
       }
 
-      /* "lxml/etree.pyx":1883
+      /* "lxml/etree.pyx":1886
  *         """
  *         cdef _Document doc = None
  *         try:             # <<<<<<<<<<<<<<
@@ -65404,39 +65434,38 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1888
+    /* "lxml/etree.pyx":1891
  *             if self._context_node is None:
  *                 self._doc = doc
  *         except _TargetParserResult as result_container:             # <<<<<<<<<<<<<<
  *             # raises a TypeError if we don't get an _Element
  *             self._context_node = result_container.result
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1888, __pyx_L5_except_error)
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1891, __pyx_L5_except_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     if (__pyx_t_7) {
       __Pyx_AddTraceback("lxml.etree._ElementTree.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 1888, __pyx_L5_except_error)
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 1891, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_GOTREF(__pyx_t_9);
       __Pyx_INCREF(__pyx_t_8);
       __pyx_v_result_container = __pyx_t_8;
 
-      /* "lxml/etree.pyx":1890
+      /* "lxml/etree.pyx":1893
  *         except _TargetParserResult as result_container:
  *             # raises a TypeError if we don't get an _Element
  *             self._context_node = result_container.result             # <<<<<<<<<<<<<<
  *         return self._context_node
  * 
  */
-      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1890, __pyx_L5_except_error)
+      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1893, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_10);
-      if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 1890, __pyx_L5_except_error)
+      if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 1893, __pyx_L5_except_error)
       __Pyx_GIVEREF(__pyx_t_10);
       __Pyx_GOTREF(__pyx_v_self->_context_node);
       __Pyx_DECREF(((PyObject *)__pyx_v_self->_context_node));
@@ -65450,21 +65479,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
     goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
 
-    /* "lxml/etree.pyx":1883
+    /* "lxml/etree.pyx":1886
  *         """
  *         cdef _Document doc = None
  *         try:             # <<<<<<<<<<<<<<
  *             doc = _parseDocument(source, parser, base_url)
  *             self._context_node = doc.getroot()
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L4_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -65472,7 +65499,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
     __pyx_L8_try_end:;
   }
 
-  /* "lxml/etree.pyx":1891
+  /* "lxml/etree.pyx":1894
  *             # raises a TypeError if we don't get an _Element
  *             self._context_node = result_container.result
  *         return self._context_node             # <<<<<<<<<<<<<<
@@ -65484,7 +65511,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
   __pyx_r = ((PyObject *)__pyx_v_self->_context_node);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1877
+  /* "lxml/etree.pyx":1880
  *         return 0
  * 
  *     def parse(self, source, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
@@ -65508,7 +65535,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(struct LxmlElementTr
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1893
+/* "lxml/etree.pyx":1896
  *         return self._context_node
  * 
  *     def _setroot(self, _Element root not None):             # <<<<<<<<<<<<<<
@@ -65524,7 +65551,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_3_setroot(PyObject *__pyx_
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_setroot (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_5etree__Element, 0, "root", 0))) __PYX_ERR(0, 1893, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_5etree__Element, 0, "root", 0))) __PYX_ERR(0, 1896, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_12_ElementTree_2_setroot(((struct LxmlElementTree *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_root));
 
   /* function exit code */
@@ -65543,16 +65570,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_2_setroot(struct LxmlEleme
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("_setroot", 0);
 
-  /* "lxml/etree.pyx":1898
+  /* "lxml/etree.pyx":1901
  *         Relocate the ElementTree to a new root node.
  *         """
  *         _assertValidNode(root)             # <<<<<<<<<<<<<<
  *         if root._c_node.type != tree.XML_ELEMENT_NODE:
  *             raise TypeError, u"Only elements can be the root of an ElementTree"
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_root); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1898, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_root); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1901, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1899
+  /* "lxml/etree.pyx":1902
  *         """
  *         _assertValidNode(root)
  *         if root._c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -65562,7 +65589,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_2_setroot(struct LxmlEleme
   __pyx_t_2 = ((__pyx_v_root->_c_node->type != XML_ELEMENT_NODE) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1900
+    /* "lxml/etree.pyx":1903
  *         _assertValidNode(root)
  *         if root._c_node.type != tree.XML_ELEMENT_NODE:
  *             raise TypeError, u"Only elements can be the root of an ElementTree"             # <<<<<<<<<<<<<<
@@ -65570,9 +65597,9 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_2_setroot(struct LxmlEleme
  *         self._doc = None
  */
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Only_elements_can_be_the_root_of, 0, 0);
-    __PYX_ERR(0, 1900, __pyx_L1_error)
+    __PYX_ERR(0, 1903, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":1899
+    /* "lxml/etree.pyx":1902
  *         """
  *         _assertValidNode(root)
  *         if root._c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -65581,7 +65608,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_2_setroot(struct LxmlEleme
  */
   }
 
-  /* "lxml/etree.pyx":1901
+  /* "lxml/etree.pyx":1904
  *         if root._c_node.type != tree.XML_ELEMENT_NODE:
  *             raise TypeError, u"Only elements can be the root of an ElementTree"
  *         self._context_node = root             # <<<<<<<<<<<<<<
@@ -65594,7 +65621,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_2_setroot(struct LxmlEleme
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_context_node));
   __pyx_v_self->_context_node = __pyx_v_root;
 
-  /* "lxml/etree.pyx":1902
+  /* "lxml/etree.pyx":1905
  *             raise TypeError, u"Only elements can be the root of an ElementTree"
  *         self._context_node = root
  *         self._doc = None             # <<<<<<<<<<<<<<
@@ -65607,7 +65634,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_2_setroot(struct LxmlEleme
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_doc));
   __pyx_v_self->_doc = ((struct LxmlDocument *)Py_None);
 
-  /* "lxml/etree.pyx":1893
+  /* "lxml/etree.pyx":1896
  *         return self._context_node
  * 
  *     def _setroot(self, _Element root not None):             # <<<<<<<<<<<<<<
@@ -65627,7 +65654,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_2_setroot(struct LxmlEleme
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1904
+/* "lxml/etree.pyx":1907
  *         self._doc = None
  * 
  *     def getroot(self):             # <<<<<<<<<<<<<<
@@ -65655,7 +65682,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_4getroot(struct LxmlElemen
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("getroot", 0);
 
-  /* "lxml/etree.pyx":1909
+  /* "lxml/etree.pyx":1912
  *         Gets the root element for this tree.
  *         """
  *         return self._context_node             # <<<<<<<<<<<<<<
@@ -65667,7 +65694,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_4getroot(struct LxmlElemen
   __pyx_r = ((PyObject *)__pyx_v_self->_context_node);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1904
+  /* "lxml/etree.pyx":1907
  *         self._doc = None
  * 
  *     def getroot(self):             # <<<<<<<<<<<<<<
@@ -65682,7 +65709,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_4getroot(struct LxmlElemen
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1911
+/* "lxml/etree.pyx":1914
  *         return self._context_node
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
@@ -65712,7 +65739,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6__copy__(struct LxmlEleme
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__copy__", 0);
 
-  /* "lxml/etree.pyx":1912
+  /* "lxml/etree.pyx":1915
  * 
  *     def __copy__(self):
  *         return _elementTreeFactory(self._doc, self._context_node)             # <<<<<<<<<<<<<<
@@ -65724,7 +65751,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6__copy__(struct LxmlEleme
   __Pyx_INCREF(__pyx_t_1);
   __pyx_t_2 = ((PyObject *)__pyx_v_self->_context_node);
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)__pyx_t_1), ((struct LxmlElement *)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1912, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)__pyx_t_1), ((struct LxmlElement *)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1915, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -65732,7 +65759,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6__copy__(struct LxmlEleme
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1911
+  /* "lxml/etree.pyx":1914
  *         return self._context_node
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
@@ -65753,7 +65780,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6__copy__(struct LxmlEleme
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1914
+/* "lxml/etree.pyx":1917
  *         return _elementTreeFactory(self._doc, self._context_node)
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
@@ -65789,7 +65816,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
   int __pyx_t_6;
   __Pyx_RefNannySetupContext("__deepcopy__", 0);
 
-  /* "lxml/etree.pyx":1918
+  /* "lxml/etree.pyx":1921
  *         cdef _Document doc
  *         cdef xmlDoc* c_doc
  *         if self._context_node is not None:             # <<<<<<<<<<<<<<
@@ -65800,14 +65827,14 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1919
+    /* "lxml/etree.pyx":1922
  *         cdef xmlDoc* c_doc
  *         if self._context_node is not None:
  *             root = self._context_node.__copy__()             # <<<<<<<<<<<<<<
  *             assert root is not None
  *             _assertValidNode(root)
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_context_node), __pyx_n_s_copy_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1919, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_context_node), __pyx_n_s_copy_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1922, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -65820,18 +65847,18 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
       }
     }
     if (__pyx_t_5) {
-      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1919, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1922, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     } else {
-      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1919, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1922, __pyx_L1_error)
     }
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 1919, __pyx_L1_error)
+    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 1922, __pyx_L1_error)
     __pyx_v_root = ((struct LxmlElement *)__pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":1920
+    /* "lxml/etree.pyx":1923
  *         if self._context_node is not None:
  *             root = self._context_node.__copy__()
  *             assert root is not None             # <<<<<<<<<<<<<<
@@ -65843,30 +65870,30 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
       __pyx_t_2 = (((PyObject *)__pyx_v_root) != Py_None);
       if (unlikely(!(__pyx_t_2 != 0))) {
         PyErr_SetNone(PyExc_AssertionError);
-        __PYX_ERR(0, 1920, __pyx_L1_error)
+        __PYX_ERR(0, 1923, __pyx_L1_error)
       }
     }
     #endif
 
-    /* "lxml/etree.pyx":1921
+    /* "lxml/etree.pyx":1924
  *             root = self._context_node.__copy__()
  *             assert root is not None
  *             _assertValidNode(root)             # <<<<<<<<<<<<<<
  *             _copyNonElementSiblings(self._context_node._c_node, root._c_node)
  *             return _elementTreeFactory(None, root)
  */
-    __pyx_t_6 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_root); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1921, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_root); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1924, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":1922
+    /* "lxml/etree.pyx":1925
  *             assert root is not None
  *             _assertValidNode(root)
  *             _copyNonElementSiblings(self._context_node._c_node, root._c_node)             # <<<<<<<<<<<<<<
  *             return _elementTreeFactory(None, root)
  *         elif self._doc is not None:
  */
-    __pyx_t_6 = __pyx_f_4lxml_5etree__copyNonElementSiblings(__pyx_v_self->_context_node->_c_node, __pyx_v_root->_c_node); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1922, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree__copyNonElementSiblings(__pyx_v_self->_context_node->_c_node, __pyx_v_root->_c_node); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1925, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":1923
+    /* "lxml/etree.pyx":1926
  *             _assertValidNode(root)
  *             _copyNonElementSiblings(self._context_node._c_node, root._c_node)
  *             return _elementTreeFactory(None, root)             # <<<<<<<<<<<<<<
@@ -65874,13 +65901,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
  *             _assertValidDoc(self._doc)
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)Py_None), __pyx_v_root)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1923, __pyx_L1_error)
+    __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)Py_None), __pyx_v_root)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1926, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1918
+    /* "lxml/etree.pyx":1921
  *         cdef _Document doc
  *         cdef xmlDoc* c_doc
  *         if self._context_node is not None:             # <<<<<<<<<<<<<<
@@ -65889,7 +65916,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
  */
   }
 
-  /* "lxml/etree.pyx":1924
+  /* "lxml/etree.pyx":1927
  *             _copyNonElementSiblings(self._context_node._c_node, root._c_node)
  *             return _elementTreeFactory(None, root)
  *         elif self._doc is not None:             # <<<<<<<<<<<<<<
@@ -65900,7 +65927,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":1925
+    /* "lxml/etree.pyx":1928
  *             return _elementTreeFactory(None, root)
  *         elif self._doc is not None:
  *             _assertValidDoc(self._doc)             # <<<<<<<<<<<<<<
@@ -65909,10 +65936,10 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
  */
     __pyx_t_3 = ((PyObject *)__pyx_v_self->_doc);
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_6 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_3)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1925, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_3)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1928, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":1926
+    /* "lxml/etree.pyx":1929
  *         elif self._doc is not None:
  *             _assertValidDoc(self._doc)
  *             c_doc = tree.xmlCopyDoc(self._doc._c_doc, 1)             # <<<<<<<<<<<<<<
@@ -65921,7 +65948,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
  */
     __pyx_v_c_doc = xmlCopyDoc(__pyx_v_self->_doc->_c_doc, 1);
 
-    /* "lxml/etree.pyx":1927
+    /* "lxml/etree.pyx":1930
  *             _assertValidDoc(self._doc)
  *             c_doc = tree.xmlCopyDoc(self._doc._c_doc, 1)
  *             if c_doc is NULL:             # <<<<<<<<<<<<<<
@@ -65931,16 +65958,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
     __pyx_t_1 = ((__pyx_v_c_doc == NULL) != 0);
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":1928
+      /* "lxml/etree.pyx":1931
  *             c_doc = tree.xmlCopyDoc(self._doc._c_doc, 1)
  *             if c_doc is NULL:
  *                 raise MemoryError()             # <<<<<<<<<<<<<<
  *             doc = _documentFactory(c_doc, self._doc._parser)
  *             return _elementTreeFactory(doc, None)
  */
-      PyErr_NoMemory(); __PYX_ERR(0, 1928, __pyx_L1_error)
+      PyErr_NoMemory(); __PYX_ERR(0, 1931, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":1927
+      /* "lxml/etree.pyx":1930
  *             _assertValidDoc(self._doc)
  *             c_doc = tree.xmlCopyDoc(self._doc._c_doc, 1)
  *             if c_doc is NULL:             # <<<<<<<<<<<<<<
@@ -65949,7 +65976,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
  */
     }
 
-    /* "lxml/etree.pyx":1929
+    /* "lxml/etree.pyx":1932
  *             if c_doc is NULL:
  *                 raise MemoryError()
  *             doc = _documentFactory(c_doc, self._doc._parser)             # <<<<<<<<<<<<<<
@@ -65958,13 +65985,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
  */
     __pyx_t_3 = ((PyObject *)__pyx_v_self->_doc->_parser);
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_3))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1929, __pyx_L1_error)
+    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_3))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1932, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":1930
+    /* "lxml/etree.pyx":1933
  *                 raise MemoryError()
  *             doc = _documentFactory(c_doc, self._doc._parser)
  *             return _elementTreeFactory(doc, None)             # <<<<<<<<<<<<<<
@@ -65972,13 +65999,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
  *             # so what ...
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1930, __pyx_L1_error)
+    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1933, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_r = __pyx_t_4;
     __pyx_t_4 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1924
+    /* "lxml/etree.pyx":1927
  *             _copyNonElementSiblings(self._context_node._c_node, root._c_node)
  *             return _elementTreeFactory(None, root)
  *         elif self._doc is not None:             # <<<<<<<<<<<<<<
@@ -65987,7 +66014,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
  */
   }
 
-  /* "lxml/etree.pyx":1933
+  /* "lxml/etree.pyx":1936
  *         else:
  *             # so what ...
  *             return self             # <<<<<<<<<<<<<<
@@ -66001,7 +66028,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
     goto __pyx_L0;
   }
 
-  /* "lxml/etree.pyx":1914
+  /* "lxml/etree.pyx":1917
  *         return _elementTreeFactory(self._doc, self._context_node)
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
@@ -66024,7 +66051,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_8__deepcopy__(struct LxmlE
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1938
+/* "lxml/etree.pyx":1941
  *     property docinfo:
  *         u"""Information about the document provided by parser and DTD."""
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -66053,16 +66080,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_7docinfo___get__(struct Lx
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1939
+  /* "lxml/etree.pyx":1942
  *         u"""Information about the document provided by parser and DTD."""
  *         def __get__(self):
  *             self._assertHasRoot()             # <<<<<<<<<<<<<<
  *             return DocInfo(self._context_node._doc)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1939, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1942, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1940
+  /* "lxml/etree.pyx":1943
  *         def __get__(self):
  *             self._assertHasRoot()
  *             return DocInfo(self._context_node._doc)             # <<<<<<<<<<<<<<
@@ -66070,19 +66097,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_7docinfo___get__(struct Lx
  *     # not in ElementTree, read-only
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1940, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1943, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(((PyObject *)__pyx_v_self->_context_node->_doc));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_context_node->_doc));
   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->_context_node->_doc));
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_DocInfo), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1940, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_DocInfo), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1943, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1938
+  /* "lxml/etree.pyx":1941
  *     property docinfo:
  *         u"""Information about the document provided by parser and DTD."""
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -66102,7 +66129,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_7docinfo___get__(struct Lx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1946
+/* "lxml/etree.pyx":1949
  *         u"""The parser that was used to parse the document in this ElementTree.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -66131,7 +66158,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
   int __pyx_t_3;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":1947
+  /* "lxml/etree.pyx":1950
  *         """
  *         def __get__(self):
  *             if self._context_node is not None and \             # <<<<<<<<<<<<<<
@@ -66146,7 +66173,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
     goto __pyx_L4_bool_binop_done;
   }
 
-  /* "lxml/etree.pyx":1948
+  /* "lxml/etree.pyx":1951
  *         def __get__(self):
  *             if self._context_node is not None and \
  *                    self._context_node._doc is not None:             # <<<<<<<<<<<<<<
@@ -66158,7 +66185,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
   __pyx_t_1 = __pyx_t_2;
   __pyx_L4_bool_binop_done:;
 
-  /* "lxml/etree.pyx":1947
+  /* "lxml/etree.pyx":1950
  *         """
  *         def __get__(self):
  *             if self._context_node is not None and \             # <<<<<<<<<<<<<<
@@ -66167,7 +66194,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
  */
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":1949
+    /* "lxml/etree.pyx":1952
  *             if self._context_node is not None and \
  *                    self._context_node._doc is not None:
  *                 return self._context_node._doc._parser             # <<<<<<<<<<<<<<
@@ -66179,7 +66206,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
     __pyx_r = ((PyObject *)__pyx_v_self->_context_node->_doc->_parser);
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1947
+    /* "lxml/etree.pyx":1950
  *         """
  *         def __get__(self):
  *             if self._context_node is not None and \             # <<<<<<<<<<<<<<
@@ -66188,7 +66215,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
  */
   }
 
-  /* "lxml/etree.pyx":1950
+  /* "lxml/etree.pyx":1953
  *                    self._context_node._doc is not None:
  *                 return self._context_node._doc._parser
  *             if self._doc is not None:             # <<<<<<<<<<<<<<
@@ -66199,7 +66226,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":1951
+    /* "lxml/etree.pyx":1954
  *                 return self._context_node._doc._parser
  *             if self._doc is not None:
  *                 return self._doc._parser             # <<<<<<<<<<<<<<
@@ -66211,7 +66238,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
     __pyx_r = ((PyObject *)__pyx_v_self->_doc->_parser);
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":1950
+    /* "lxml/etree.pyx":1953
  *                    self._context_node._doc is not None:
  *                 return self._context_node._doc._parser
  *             if self._doc is not None:             # <<<<<<<<<<<<<<
@@ -66220,7 +66247,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
  */
   }
 
-  /* "lxml/etree.pyx":1952
+  /* "lxml/etree.pyx":1955
  *             if self._doc is not None:
  *                 return self._doc._parser
  *             return None             # <<<<<<<<<<<<<<
@@ -66232,7 +66259,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
   __pyx_r = Py_None;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":1946
+  /* "lxml/etree.pyx":1949
  *         u"""The parser that was used to parse the document in this ElementTree.
  *         """
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -66247,7 +66274,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(struct Lxm
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":1954
+/* "lxml/etree.pyx":1957
  *             return None
  * 
  *     def write(self, file, *, encoding=None, method=u"xml",             # <<<<<<<<<<<<<<
@@ -66282,7 +66309,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_11write(PyObject *__pyx_v_
     values[1] = ((PyObject *)Py_None);
     values[2] = ((PyObject *)__pyx_n_u_xml);
 
-    /* "lxml/etree.pyx":1955
+    /* "lxml/etree.pyx":1958
  * 
  *     def write(self, file, *, encoding=None, method=u"xml",
  *               pretty_print=False, xml_declaration=None, with_tail=True,             # <<<<<<<<<<<<<<
@@ -66293,7 +66320,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_11write(PyObject *__pyx_v_
     values[4] = ((PyObject *)Py_None);
     values[5] = ((PyObject *)Py_True);
 
-    /* "lxml/etree.pyx":1956
+    /* "lxml/etree.pyx":1959
  *     def write(self, file, *, encoding=None, method=u"xml",
  *               pretty_print=False, xml_declaration=None, with_tail=True,
  *               standalone=None, doctype=None, compression=0,             # <<<<<<<<<<<<<<
@@ -66304,7 +66331,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_11write(PyObject *__pyx_v_
     values[7] = ((PyObject *)Py_None);
     values[8] = ((PyObject *)__pyx_int_0);
 
-    /* "lxml/etree.pyx":1957
+    /* "lxml/etree.pyx":1960
  *               pretty_print=False, xml_declaration=None, with_tail=True,
  *               standalone=None, doctype=None, compression=0,
  *               exclusive=False, with_comments=True, inclusive_ns_prefixes=None,             # <<<<<<<<<<<<<<
@@ -66315,7 +66342,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_11write(PyObject *__pyx_v_
     values[10] = ((PyObject *)Py_True);
     values[11] = ((PyObject *)Py_None);
 
-    /* "lxml/etree.pyx":1958
+    /* "lxml/etree.pyx":1961
  *               standalone=None, doctype=None, compression=0,
  *               exclusive=False, with_comments=True, inclusive_ns_prefixes=None,
  *               docstring=None):             # <<<<<<<<<<<<<<
@@ -66346,7 +66373,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_11write(PyObject *__pyx_v_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) __PYX_ERR(0, 1954, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) __PYX_ERR(0, 1957, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -66369,7 +66396,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_11write(PyObject *__pyx_v_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1954, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1957, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ElementTree.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -66377,7 +66404,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_11write(PyObject *__pyx_v_
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_4lxml_5etree_12_ElementTree_10write(((struct LxmlElementTree *)__pyx_v_self), __pyx_v_file, __pyx_v_encoding, __pyx_v_method, __pyx_v_pretty_print, __pyx_v_xml_declaration, __pyx_v_with_tail, __pyx_v_standalone, __pyx_v_doctype, __pyx_v_compression, __pyx_v_exclusive, __pyx_v_with_comments, __pyx_v_inclusive_ns_prefixes, __pyx_v_docstring);
 
-  /* "lxml/etree.pyx":1954
+  /* "lxml/etree.pyx":1957
  *             return None
  * 
  *     def write(self, file, *, encoding=None, method=u"xml",             # <<<<<<<<<<<<<<
@@ -66403,22 +66430,21 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
   int __pyx_t_5;
   PyObject *__pyx_t_6 = NULL;
   PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
   __Pyx_RefNannySetupContext("write", 0);
   __Pyx_INCREF(__pyx_v_encoding);
   __Pyx_INCREF(__pyx_v_doctype);
   __Pyx_INCREF(__pyx_v_compression);
 
-  /* "lxml/etree.pyx":2000
+  /* "lxml/etree.pyx":2003
  *         cdef int is_standalone
  * 
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._context_node)
  *         if compression is None or compression < 0:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2000, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2003, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2001
+  /* "lxml/etree.pyx":2004
  * 
  *         self._assertHasRoot()
  *         _assertValidNode(self._context_node)             # <<<<<<<<<<<<<<
@@ -66427,10 +66453,10 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
   __pyx_t_2 = ((PyObject *)__pyx_v_self->_context_node);
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2001, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_2)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2004, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2002
+  /* "lxml/etree.pyx":2005
  *         self._assertHasRoot()
  *         _assertValidNode(self._context_node)
  *         if compression is None or compression < 0:             # <<<<<<<<<<<<<<
@@ -66444,14 +66470,14 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     __pyx_t_3 = __pyx_t_5;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_2 = PyObject_RichCompare(__pyx_v_compression, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2002, __pyx_L1_error)
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2002, __pyx_L1_error)
+  __pyx_t_2 = PyObject_RichCompare(__pyx_v_compression, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2005, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_3 = __pyx_t_5;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2003
+    /* "lxml/etree.pyx":2006
  *         _assertValidNode(self._context_node)
  *         if compression is None or compression < 0:
  *             compression = 0             # <<<<<<<<<<<<<<
@@ -66461,7 +66487,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_DECREF_SET(__pyx_v_compression, __pyx_int_0);
 
-    /* "lxml/etree.pyx":2002
+    /* "lxml/etree.pyx":2005
  *         self._assertHasRoot()
  *         _assertValidNode(self._context_node)
  *         if compression is None or compression < 0:             # <<<<<<<<<<<<<<
@@ -66470,17 +66496,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
   }
 
-  /* "lxml/etree.pyx":2006
+  /* "lxml/etree.pyx":2009
  * 
  *         # C14N serialisation
  *         if method == 'c14n':             # <<<<<<<<<<<<<<
  *             if encoding is not None:
  *                 raise ValueError("Cannot specify encoding with C14N")
  */
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_c14n, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2006, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_c14n, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2009, __pyx_L1_error)
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2007
+    /* "lxml/etree.pyx":2010
  *         # C14N serialisation
  *         if method == 'c14n':
  *             if encoding is not None:             # <<<<<<<<<<<<<<
@@ -66491,20 +66517,20 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     __pyx_t_5 = (__pyx_t_3 != 0);
     if (__pyx_t_5) {
 
-      /* "lxml/etree.pyx":2008
+      /* "lxml/etree.pyx":2011
  *         if method == 'c14n':
  *             if encoding is not None:
  *                 raise ValueError("Cannot specify encoding with C14N")             # <<<<<<<<<<<<<<
  *             if xml_declaration:
  *                 raise ValueError("Cannot enable XML declaration in C14N")
  */
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2011, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __PYX_ERR(0, 2008, __pyx_L1_error)
+      __PYX_ERR(0, 2011, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":2007
+      /* "lxml/etree.pyx":2010
  *         # C14N serialisation
  *         if method == 'c14n':
  *             if encoding is not None:             # <<<<<<<<<<<<<<
@@ -66513,30 +66539,30 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
     }
 
-    /* "lxml/etree.pyx":2009
+    /* "lxml/etree.pyx":2012
  *             if encoding is not None:
  *                 raise ValueError("Cannot specify encoding with C14N")
  *             if xml_declaration:             # <<<<<<<<<<<<<<
  *                 raise ValueError("Cannot enable XML declaration in C14N")
  * 
  */
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2009, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2012, __pyx_L1_error)
     if (__pyx_t_5) {
 
-      /* "lxml/etree.pyx":2010
+      /* "lxml/etree.pyx":2013
  *                 raise ValueError("Cannot specify encoding with C14N")
  *             if xml_declaration:
  *                 raise ValueError("Cannot enable XML declaration in C14N")             # <<<<<<<<<<<<<<
  * 
  *             _tofilelikeC14N(file, self._context_node, exclusive, with_comments,
  */
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2010, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2013, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __PYX_ERR(0, 2010, __pyx_L1_error)
+      __PYX_ERR(0, 2013, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":2009
+      /* "lxml/etree.pyx":2012
  *             if encoding is not None:
  *                 raise ValueError("Cannot specify encoding with C14N")
  *             if xml_declaration:             # <<<<<<<<<<<<<<
@@ -66545,7 +66571,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
     }
 
-    /* "lxml/etree.pyx":2012
+    /* "lxml/etree.pyx":2015
  *                 raise ValueError("Cannot enable XML declaration in C14N")
  * 
  *             _tofilelikeC14N(file, self._context_node, exclusive, with_comments,             # <<<<<<<<<<<<<<
@@ -66554,31 +66580,31 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
     __pyx_t_2 = ((PyObject *)__pyx_v_self->_context_node);
     __Pyx_INCREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_exclusive); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L1_error)
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_with_comments); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2012, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_exclusive); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2015, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_with_comments); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2015, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2013
+    /* "lxml/etree.pyx":2016
  * 
  *             _tofilelikeC14N(file, self._context_node, exclusive, with_comments,
  *                             compression, inclusive_ns_prefixes)             # <<<<<<<<<<<<<<
  *             return
  *         if not with_comments:
  */
-    __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2013, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2016, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2012
+    /* "lxml/etree.pyx":2015
  *                 raise ValueError("Cannot enable XML declaration in C14N")
  * 
  *             _tofilelikeC14N(file, self._context_node, exclusive, with_comments,             # <<<<<<<<<<<<<<
  *                             compression, inclusive_ns_prefixes)
  *             return
  */
-    __pyx_t_6 = __pyx_f_4lxml_5etree__tofilelikeC14N(__pyx_v_file, ((struct LxmlElement *)__pyx_t_2), __pyx_t_5, __pyx_t_3, __pyx_t_1, __pyx_v_inclusive_ns_prefixes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2012, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree__tofilelikeC14N(__pyx_v_file, ((struct LxmlElement *)__pyx_t_2), __pyx_t_5, __pyx_t_3, __pyx_t_1, __pyx_v_inclusive_ns_prefixes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2015, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "lxml/etree.pyx":2014
+    /* "lxml/etree.pyx":2017
  *             _tofilelikeC14N(file, self._context_node, exclusive, with_comments,
  *                             compression, inclusive_ns_prefixes)
  *             return             # <<<<<<<<<<<<<<
@@ -66589,7 +66615,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2006
+    /* "lxml/etree.pyx":2009
  * 
  *         # C14N serialisation
  *         if method == 'c14n':             # <<<<<<<<<<<<<<
@@ -66598,31 +66624,31 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
   }
 
-  /* "lxml/etree.pyx":2015
+  /* "lxml/etree.pyx":2018
  *                             compression, inclusive_ns_prefixes)
  *             return
  *         if not with_comments:             # <<<<<<<<<<<<<<
  *             raise ValueError("Can only discard comments in C14N serialisation")
  *         # suppress decl. in default case (purely for ElementTree compatibility)
  */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_with_comments); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2015, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_with_comments); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2018, __pyx_L1_error)
   __pyx_t_5 = ((!__pyx_t_3) != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2016
+    /* "lxml/etree.pyx":2019
  *             return
  *         if not with_comments:
  *             raise ValueError("Can only discard comments in C14N serialisation")             # <<<<<<<<<<<<<<
  *         # suppress decl. in default case (purely for ElementTree compatibility)
  *         if xml_declaration is not None:
  */
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2016, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2019, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_Raise(__pyx_t_6, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __PYX_ERR(0, 2016, __pyx_L1_error)
+    __PYX_ERR(0, 2019, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2015
+    /* "lxml/etree.pyx":2018
  *                             compression, inclusive_ns_prefixes)
  *             return
  *         if not with_comments:             # <<<<<<<<<<<<<<
@@ -66631,7 +66657,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
   }
 
-  /* "lxml/etree.pyx":2018
+  /* "lxml/etree.pyx":2021
  *             raise ValueError("Can only discard comments in C14N serialisation")
  *         # suppress decl. in default case (purely for ElementTree compatibility)
  *         if xml_declaration is not None:             # <<<<<<<<<<<<<<
@@ -66642,17 +66668,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
   __pyx_t_3 = (__pyx_t_5 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2019
+    /* "lxml/etree.pyx":2022
  *         # suppress decl. in default case (purely for ElementTree compatibility)
  *         if xml_declaration is not None:
  *             write_declaration = xml_declaration             # <<<<<<<<<<<<<<
  *             if encoding is None:
  *                 encoding = u'ASCII'
  */
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2019, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L1_error)
     __pyx_v_write_declaration = __pyx_t_3;
 
-    /* "lxml/etree.pyx":2020
+    /* "lxml/etree.pyx":2023
  *         if xml_declaration is not None:
  *             write_declaration = xml_declaration
  *             if encoding is None:             # <<<<<<<<<<<<<<
@@ -66663,7 +66689,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     __pyx_t_5 = (__pyx_t_3 != 0);
     if (__pyx_t_5) {
 
-      /* "lxml/etree.pyx":2021
+      /* "lxml/etree.pyx":2024
  *             write_declaration = xml_declaration
  *             if encoding is None:
  *                 encoding = u'ASCII'             # <<<<<<<<<<<<<<
@@ -66673,7 +66699,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
       __Pyx_INCREF(__pyx_n_u_ASCII);
       __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_n_u_ASCII);
 
-      /* "lxml/etree.pyx":2020
+      /* "lxml/etree.pyx":2023
  *         if xml_declaration is not None:
  *             write_declaration = xml_declaration
  *             if encoding is None:             # <<<<<<<<<<<<<<
@@ -66683,7 +66709,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
       goto __pyx_L11;
     }
 
-    /* "lxml/etree.pyx":2023
+    /* "lxml/etree.pyx":2026
  *                 encoding = u'ASCII'
  *             else:
  *                 encoding = encoding.upper()             # <<<<<<<<<<<<<<
@@ -66691,7 +66717,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  *             encoding = u'ASCII'
  */
     /*else*/ {
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_upper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2023, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_upper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2026, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_7 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -66704,10 +66730,10 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
         }
       }
       if (__pyx_t_7) {
-        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2023, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2026, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       } else {
-        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2023, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2026, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -66716,7 +66742,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     }
     __pyx_L11:;
 
-    /* "lxml/etree.pyx":2018
+    /* "lxml/etree.pyx":2021
  *             raise ValueError("Can only discard comments in C14N serialisation")
  *         # suppress decl. in default case (purely for ElementTree compatibility)
  *         if xml_declaration is not None:             # <<<<<<<<<<<<<<
@@ -66726,7 +66752,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     goto __pyx_L10;
   }
 
-  /* "lxml/etree.pyx":2024
+  /* "lxml/etree.pyx":2027
  *             else:
  *                 encoding = encoding.upper()
  *         elif encoding is None:             # <<<<<<<<<<<<<<
@@ -66737,7 +66763,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
   __pyx_t_3 = (__pyx_t_5 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2025
+    /* "lxml/etree.pyx":2028
  *                 encoding = encoding.upper()
  *         elif encoding is None:
  *             encoding = u'ASCII'             # <<<<<<<<<<<<<<
@@ -66747,7 +66773,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     __Pyx_INCREF(__pyx_n_u_ASCII);
     __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_n_u_ASCII);
 
-    /* "lxml/etree.pyx":2026
+    /* "lxml/etree.pyx":2029
  *         elif encoding is None:
  *             encoding = u'ASCII'
  *             write_declaration = 0             # <<<<<<<<<<<<<<
@@ -66756,7 +66782,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
     __pyx_v_write_declaration = 0;
 
-    /* "lxml/etree.pyx":2024
+    /* "lxml/etree.pyx":2027
  *             else:
  *                 encoding = encoding.upper()
  *         elif encoding is None:             # <<<<<<<<<<<<<<
@@ -66766,7 +66792,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     goto __pyx_L10;
   }
 
-  /* "lxml/etree.pyx":2028
+  /* "lxml/etree.pyx":2031
  *             write_declaration = 0
  *         else:
  *             encoding = encoding.upper()             # <<<<<<<<<<<<<<
@@ -66774,7 +66800,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')
  */
   /*else*/ {
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_upper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2028, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_upper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2031, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -66787,17 +66813,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
       }
     }
     if (__pyx_t_7) {
-      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2028, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2031, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     } else {
-      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2028, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2031, __pyx_L1_error)
     }
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_6);
     __pyx_t_6 = 0;
 
-    /* "lxml/etree.pyx":2029
+    /* "lxml/etree.pyx":2032
  *         else:
  *             encoding = encoding.upper()
  *             write_declaration = encoding not in \             # <<<<<<<<<<<<<<
@@ -66806,25 +66832,25 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
     __Pyx_INCREF(__pyx_v_encoding);
     __pyx_t_6 = __pyx_v_encoding;
-    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_US_ASCII, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2029, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_US_ASCII, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2032, __pyx_L1_error)
     if (__pyx_t_5) {
     } else {
       __pyx_t_3 = __pyx_t_5;
       goto __pyx_L12_bool_binop_done;
     }
-    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_ASCII, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2029, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_ASCII, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2032, __pyx_L1_error)
     if (__pyx_t_5) {
     } else {
       __pyx_t_3 = __pyx_t_5;
       goto __pyx_L12_bool_binop_done;
     }
-    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_UTF8, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2029, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_UTF8, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2032, __pyx_L1_error)
     if (__pyx_t_5) {
     } else {
       __pyx_t_3 = __pyx_t_5;
       goto __pyx_L12_bool_binop_done;
     }
-    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_UTF_8, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2029, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_UTF_8, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2032, __pyx_L1_error)
     __pyx_t_3 = __pyx_t_5;
     __pyx_L12_bool_binop_done:;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -66832,7 +66858,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
   }
   __pyx_L10:;
 
-  /* "lxml/etree.pyx":2031
+  /* "lxml/etree.pyx":2034
  *             write_declaration = encoding not in \
  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')
  *         if standalone is None:             # <<<<<<<<<<<<<<
@@ -66843,7 +66869,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
   __pyx_t_5 = (__pyx_t_3 != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2032
+    /* "lxml/etree.pyx":2035
  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')
  *         if standalone is None:
  *             is_standalone = -1             # <<<<<<<<<<<<<<
@@ -66852,7 +66878,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
     __pyx_v_is_standalone = -1;
 
-    /* "lxml/etree.pyx":2031
+    /* "lxml/etree.pyx":2034
  *             write_declaration = encoding not in \
  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')
  *         if standalone is None:             # <<<<<<<<<<<<<<
@@ -66862,17 +66888,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     goto __pyx_L16;
   }
 
-  /* "lxml/etree.pyx":2033
+  /* "lxml/etree.pyx":2036
  *         if standalone is None:
  *             is_standalone = -1
  *         elif standalone:             # <<<<<<<<<<<<<<
  *             write_declaration = 1
  *             is_standalone = 1
  */
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_standalone); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2033, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_standalone); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2036, __pyx_L1_error)
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2034
+    /* "lxml/etree.pyx":2037
  *             is_standalone = -1
  *         elif standalone:
  *             write_declaration = 1             # <<<<<<<<<<<<<<
@@ -66881,7 +66907,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
     __pyx_v_write_declaration = 1;
 
-    /* "lxml/etree.pyx":2035
+    /* "lxml/etree.pyx":2038
  *         elif standalone:
  *             write_declaration = 1
  *             is_standalone = 1             # <<<<<<<<<<<<<<
@@ -66890,7 +66916,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
     __pyx_v_is_standalone = 1;
 
-    /* "lxml/etree.pyx":2033
+    /* "lxml/etree.pyx":2036
  *         if standalone is None:
  *             is_standalone = -1
  *         elif standalone:             # <<<<<<<<<<<<<<
@@ -66900,7 +66926,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     goto __pyx_L16;
   }
 
-  /* "lxml/etree.pyx":2037
+  /* "lxml/etree.pyx":2040
  *             is_standalone = 1
  *         else:
  *             write_declaration = 1             # <<<<<<<<<<<<<<
@@ -66910,7 +66936,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
   /*else*/ {
     __pyx_v_write_declaration = 1;
 
-    /* "lxml/etree.pyx":2038
+    /* "lxml/etree.pyx":2041
  *         else:
  *             write_declaration = 1
  *             is_standalone = 0             # <<<<<<<<<<<<<<
@@ -66921,7 +66947,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
   }
   __pyx_L16:;
 
-  /* "lxml/etree.pyx":2040
+  /* "lxml/etree.pyx":2043
  *             is_standalone = 0
  * 
  *         if docstring is not None and doctype is None:             # <<<<<<<<<<<<<<
@@ -66941,83 +66967,41 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
   __pyx_L18_bool_binop_done:;
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2041
+    /* "lxml/etree.pyx":2044
  * 
  *         if docstring is not None and doctype is None:
  *             import warnings             # <<<<<<<<<<<<<<
  *             warnings.warn(
  *                 "The 'docstring' option is deprecated. Use 'doctype' instead.",
  */
-    __pyx_t_6 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2041, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2044, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_v_warnings = __pyx_t_6;
     __pyx_t_6 = 0;
 
-    /* "lxml/etree.pyx":2042
+    /* "lxml/etree.pyx":2045
  *         if docstring is not None and doctype is None:
  *             import warnings
  *             warnings.warn(             # <<<<<<<<<<<<<<
  *                 "The 'docstring' option is deprecated. Use 'doctype' instead.",
  *                 DeprecationWarning)
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2042, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2045, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
 
-    /* "lxml/etree.pyx":2044
+    /* "lxml/etree.pyx":2047
  *             warnings.warn(
  *                 "The 'docstring' option is deprecated. Use 'doctype' instead.",
  *                 DeprecationWarning)             # <<<<<<<<<<<<<<
  *             doctype = docstring
  * 
  */
-    __pyx_t_7 = NULL;
-    __pyx_t_1 = 0;
-    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
-      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
-      if (likely(__pyx_t_7)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
-        __Pyx_INCREF(__pyx_t_7);
-        __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_2, function);
-        __pyx_t_1 = 1;
-      }
-    }
-    #if CYTHON_FAST_PYCALL
-    if (PyFunction_Check(__pyx_t_2)) {
-      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_The_docstring_option_is_deprecat, __pyx_builtin_DeprecationWarning};
-      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2042, __pyx_L1_error)
-      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_GOTREF(__pyx_t_6);
-    } else
-    #endif
-    #if CYTHON_FAST_PYCCALL
-    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
-      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_The_docstring_option_is_deprecat, __pyx_builtin_DeprecationWarning};
-      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2042, __pyx_L1_error)
-      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_GOTREF(__pyx_t_6);
-    } else
-    #endif
-    {
-      __pyx_t_8 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2042, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_8);
-      if (__pyx_t_7) {
-        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
-      }
-      __Pyx_INCREF(__pyx_kp_s_The_docstring_option_is_deprecat);
-      __Pyx_GIVEREF(__pyx_kp_s_The_docstring_option_is_deprecat);
-      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_1, __pyx_kp_s_The_docstring_option_is_deprecat);
-      __Pyx_INCREF(__pyx_builtin_DeprecationWarning);
-      __Pyx_GIVEREF(__pyx_builtin_DeprecationWarning);
-      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_1, __pyx_builtin_DeprecationWarning);
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2042, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "lxml/etree.pyx":2045
+    /* "lxml/etree.pyx":2048
  *                 "The 'docstring' option is deprecated. Use 'doctype' instead.",
  *                 DeprecationWarning)
  *             doctype = docstring             # <<<<<<<<<<<<<<
@@ -67027,7 +67011,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
     __Pyx_INCREF(__pyx_v_docstring);
     __Pyx_DECREF_SET(__pyx_v_doctype, __pyx_v_docstring);
 
-    /* "lxml/etree.pyx":2040
+    /* "lxml/etree.pyx":2043
  *             is_standalone = 0
  * 
  *         if docstring is not None and doctype is None:             # <<<<<<<<<<<<<<
@@ -67036,48 +67020,48 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
  */
   }
 
-  /* "lxml/etree.pyx":2047
+  /* "lxml/etree.pyx":2050
  *             doctype = docstring
  * 
  *         _tofilelike(file, self._context_node, encoding, doctype, method,             # <<<<<<<<<<<<<<
  *                     write_declaration, 1, pretty_print, with_tail,
  *                     is_standalone, compression)
  */
-  __pyx_t_6 = ((PyObject *)__pyx_v_self->_context_node);
-  __Pyx_INCREF(__pyx_t_6);
+  __pyx_t_2 = ((PyObject *)__pyx_v_self->_context_node);
+  __Pyx_INCREF(__pyx_t_2);
 
-  /* "lxml/etree.pyx":2048
+  /* "lxml/etree.pyx":2051
  * 
  *         _tofilelike(file, self._context_node, encoding, doctype, method,
  *                     write_declaration, 1, pretty_print, with_tail,             # <<<<<<<<<<<<<<
  *                     is_standalone, compression)
  * 
  */
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2048, __pyx_L1_error)
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_with_tail); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2048, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2051, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_with_tail); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2051, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2049
+  /* "lxml/etree.pyx":2052
  *         _tofilelike(file, self._context_node, encoding, doctype, method,
  *                     write_declaration, 1, pretty_print, with_tail,
  *                     is_standalone, compression)             # <<<<<<<<<<<<<<
  * 
  *     def getpath(self, _Element element not None):
  */
-  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2049, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2052, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2047
+  /* "lxml/etree.pyx":2050
  *             doctype = docstring
  * 
  *         _tofilelike(file, self._context_node, encoding, doctype, method,             # <<<<<<<<<<<<<<
  *                     write_declaration, 1, pretty_print, with_tail,
  *                     is_standalone, compression)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__tofilelike(__pyx_v_file, ((struct LxmlElement *)__pyx_t_6), __pyx_v_encoding, __pyx_v_doctype, __pyx_v_method, __pyx_v_write_declaration, 1, __pyx_t_5, __pyx_t_3, __pyx_v_is_standalone, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2047, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __pyx_f_4lxml_5etree__tofilelike(__pyx_v_file, ((struct LxmlElement *)__pyx_t_2), __pyx_v_encoding, __pyx_v_doctype, __pyx_v_method, __pyx_v_write_declaration, 1, __pyx_t_5, __pyx_t_3, __pyx_v_is_standalone, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2050, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":1954
+  /* "lxml/etree.pyx":1957
  *             return None
  * 
  *     def write(self, file, *, encoding=None, method=u"xml",             # <<<<<<<<<<<<<<
@@ -67092,7 +67076,6 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
   __Pyx_AddTraceback("lxml.etree._ElementTree.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -67105,7 +67088,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_10write(struct LxmlElement
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2051
+/* "lxml/etree.pyx":2054
  *                     is_standalone, compression)
  * 
  *     def getpath(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -67121,7 +67104,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_13getpath(PyObject *__pyx_
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("getpath (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 2051, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 2054, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_12_ElementTree_12getpath(((struct LxmlElementTree *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_element));
 
   /* function exit code */
@@ -67148,16 +67131,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
   xmlDoc *__pyx_t_5;
   __Pyx_RefNannySetupContext("getpath", 0);
 
-  /* "lxml/etree.pyx":2066
+  /* "lxml/etree.pyx":2069
  *         cdef _Element root
  *         cdef xmlDoc* c_doc
  *         _assertValidNode(element)             # <<<<<<<<<<<<<<
  *         if self._context_node is not None:
  *             root = self._context_node
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2066, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2069, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2067
+  /* "lxml/etree.pyx":2070
  *         cdef xmlDoc* c_doc
  *         _assertValidNode(element)
  *         if self._context_node is not None:             # <<<<<<<<<<<<<<
@@ -67168,7 +67151,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2068
+    /* "lxml/etree.pyx":2071
  *         _assertValidNode(element)
  *         if self._context_node is not None:
  *             root = self._context_node             # <<<<<<<<<<<<<<
@@ -67180,7 +67163,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
     __pyx_v_root = ((struct LxmlElement *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":2069
+    /* "lxml/etree.pyx":2072
  *         if self._context_node is not None:
  *             root = self._context_node
  *             doc = root._doc             # <<<<<<<<<<<<<<
@@ -67192,7 +67175,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":2067
+    /* "lxml/etree.pyx":2070
  *         cdef xmlDoc* c_doc
  *         _assertValidNode(element)
  *         if self._context_node is not None:             # <<<<<<<<<<<<<<
@@ -67202,7 +67185,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2070
+  /* "lxml/etree.pyx":2073
  *             root = self._context_node
  *             doc = root._doc
  *         elif self._doc is not None:             # <<<<<<<<<<<<<<
@@ -67213,7 +67196,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
   __pyx_t_2 = (__pyx_t_3 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2071
+    /* "lxml/etree.pyx":2074
  *             doc = root._doc
  *         elif self._doc is not None:
  *             doc = self._doc             # <<<<<<<<<<<<<<
@@ -67225,20 +67208,20 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":2072
+    /* "lxml/etree.pyx":2075
  *         elif self._doc is not None:
  *             doc = self._doc
  *             root = doc.getroot()             # <<<<<<<<<<<<<<
  *         else:
  *             raise ValueError, u"Element is not in this tree."
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2072, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2075, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 2072, __pyx_L1_error)
+    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 2075, __pyx_L1_error)
     __pyx_v_root = ((struct LxmlElement *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":2070
+    /* "lxml/etree.pyx":2073
  *             root = self._context_node
  *             doc = root._doc
  *         elif self._doc is not None:             # <<<<<<<<<<<<<<
@@ -67248,7 +67231,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2074
+  /* "lxml/etree.pyx":2077
  *             root = doc.getroot()
  *         else:
  *             raise ValueError, u"Element is not in this tree."             # <<<<<<<<<<<<<<
@@ -67257,29 +67240,29 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Element_is_not_in_this_tree, 0, 0);
-    __PYX_ERR(0, 2074, __pyx_L1_error)
+    __PYX_ERR(0, 2077, __pyx_L1_error)
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":2075
+  /* "lxml/etree.pyx":2078
  *         else:
  *             raise ValueError, u"Element is not in this tree."
  *         _assertValidDoc(doc)             # <<<<<<<<<<<<<<
  *         _assertValidNode(root)
  *         if element._doc is not doc:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDoc(__pyx_v_doc); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2075, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDoc(__pyx_v_doc); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2078, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2076
+  /* "lxml/etree.pyx":2079
  *             raise ValueError, u"Element is not in this tree."
  *         _assertValidDoc(doc)
  *         _assertValidNode(root)             # <<<<<<<<<<<<<<
  *         if element._doc is not doc:
  *             raise ValueError, u"Element is not in this tree."
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_root); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2076, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_root); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2079, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2077
+  /* "lxml/etree.pyx":2080
  *         _assertValidDoc(doc)
  *         _assertValidNode(root)
  *         if element._doc is not doc:             # <<<<<<<<<<<<<<
@@ -67290,7 +67273,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2078
+    /* "lxml/etree.pyx":2081
  *         _assertValidNode(root)
  *         if element._doc is not doc:
  *             raise ValueError, u"Element is not in this tree."             # <<<<<<<<<<<<<<
@@ -67298,9 +67281,9 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
  *         c_doc = _fakeRootDoc(doc._c_doc, root._c_node)
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Element_is_not_in_this_tree, 0, 0);
-    __PYX_ERR(0, 2078, __pyx_L1_error)
+    __PYX_ERR(0, 2081, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2077
+    /* "lxml/etree.pyx":2080
  *         _assertValidDoc(doc)
  *         _assertValidNode(root)
  *         if element._doc is not doc:             # <<<<<<<<<<<<<<
@@ -67309,17 +67292,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
  */
   }
 
-  /* "lxml/etree.pyx":2080
+  /* "lxml/etree.pyx":2083
  *             raise ValueError, u"Element is not in this tree."
  * 
  *         c_doc = _fakeRootDoc(doc._c_doc, root._c_node)             # <<<<<<<<<<<<<<
  *         c_path = tree.xmlGetNodePath(element._c_node)
  *         _destroyFakeDoc(doc._c_doc, c_doc)
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root->_c_node); if (unlikely(__pyx_t_5 == NULL)) __PYX_ERR(0, 2080, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root->_c_node); if (unlikely(__pyx_t_5 == ((xmlDoc *)NULL))) __PYX_ERR(0, 2083, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_5;
 
-  /* "lxml/etree.pyx":2081
+  /* "lxml/etree.pyx":2084
  * 
  *         c_doc = _fakeRootDoc(doc._c_doc, root._c_node)
  *         c_path = tree.xmlGetNodePath(element._c_node)             # <<<<<<<<<<<<<<
@@ -67328,7 +67311,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
  */
   __pyx_v_c_path = xmlGetNodePath(__pyx_v_element->_c_node);
 
-  /* "lxml/etree.pyx":2082
+  /* "lxml/etree.pyx":2085
  *         c_doc = _fakeRootDoc(doc._c_doc, root._c_node)
  *         c_path = tree.xmlGetNodePath(element._c_node)
  *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<<
@@ -67337,7 +67320,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
  */
   __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_c_doc);
 
-  /* "lxml/etree.pyx":2083
+  /* "lxml/etree.pyx":2086
  *         c_path = tree.xmlGetNodePath(element._c_node)
  *         _destroyFakeDoc(doc._c_doc, c_doc)
  *         if c_path is NULL:             # <<<<<<<<<<<<<<
@@ -67347,16 +67330,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
   __pyx_t_3 = ((__pyx_v_c_path == NULL) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2084
+    /* "lxml/etree.pyx":2087
  *         _destroyFakeDoc(doc._c_doc, c_doc)
  *         if c_path is NULL:
  *             raise MemoryError()             # <<<<<<<<<<<<<<
  *         path = funicode(c_path)
  *         tree.xmlFree(c_path)
  */
-    PyErr_NoMemory(); __PYX_ERR(0, 2084, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(0, 2087, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2083
+    /* "lxml/etree.pyx":2086
  *         c_path = tree.xmlGetNodePath(element._c_node)
  *         _destroyFakeDoc(doc._c_doc, c_doc)
  *         if c_path is NULL:             # <<<<<<<<<<<<<<
@@ -67365,19 +67348,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
  */
   }
 
-  /* "lxml/etree.pyx":2085
+  /* "lxml/etree.pyx":2088
  *         if c_path is NULL:
  *             raise MemoryError()
  *         path = funicode(c_path)             # <<<<<<<<<<<<<<
  *         tree.xmlFree(c_path)
  *         return path
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2085, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2088, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_v_path = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":2086
+  /* "lxml/etree.pyx":2089
  *             raise MemoryError()
  *         path = funicode(c_path)
  *         tree.xmlFree(c_path)             # <<<<<<<<<<<<<<
@@ -67386,7 +67369,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
  */
   xmlFree(__pyx_v_c_path);
 
-  /* "lxml/etree.pyx":2087
+  /* "lxml/etree.pyx":2090
  *         path = funicode(c_path)
  *         tree.xmlFree(c_path)
  *         return path             # <<<<<<<<<<<<<<
@@ -67398,7 +67381,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
   __pyx_r = __pyx_v_path;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2051
+  /* "lxml/etree.pyx":2054
  *                     is_standalone, compression)
  * 
  *     def getpath(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -67420,7 +67403,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_12getpath(struct LxmlEleme
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2089
+/* "lxml/etree.pyx":2092
  *         return path
  * 
  *     def getelementpath(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -67436,7 +67419,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_15getelementpath(PyObject
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("getelementpath (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 2089, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 2092, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(((struct LxmlElementTree *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_element));
 
   /* function exit code */
@@ -67469,16 +67452,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
   int __pyx_t_8;
   __Pyx_RefNannySetupContext("getelementpath", 0);
 
-  /* "lxml/etree.pyx":2103
+  /* "lxml/etree.pyx":2106
  *         cdef _Element root
  *         cdef Py_ssize_t count
  *         _assertValidNode(element)             # <<<<<<<<<<<<<<
  *         if element._c_node.type != tree.XML_ELEMENT_NODE:
  *             raise ValueError, u"input is not an Element"
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2103, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2106, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2104
+  /* "lxml/etree.pyx":2107
  *         cdef Py_ssize_t count
  *         _assertValidNode(element)
  *         if element._c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -67488,7 +67471,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
   __pyx_t_2 = ((__pyx_v_element->_c_node->type != XML_ELEMENT_NODE) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2105
+    /* "lxml/etree.pyx":2108
  *         _assertValidNode(element)
  *         if element._c_node.type != tree.XML_ELEMENT_NODE:
  *             raise ValueError, u"input is not an Element"             # <<<<<<<<<<<<<<
@@ -67496,9 +67479,9 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  *             root = self._context_node
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_input_is_not_an_Element, 0, 0);
-    __PYX_ERR(0, 2105, __pyx_L1_error)
+    __PYX_ERR(0, 2108, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2104
+    /* "lxml/etree.pyx":2107
  *         cdef Py_ssize_t count
  *         _assertValidNode(element)
  *         if element._c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -67507,7 +67490,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
   }
 
-  /* "lxml/etree.pyx":2106
+  /* "lxml/etree.pyx":2109
  *         if element._c_node.type != tree.XML_ELEMENT_NODE:
  *             raise ValueError, u"input is not an Element"
  *         if self._context_node is not None:             # <<<<<<<<<<<<<<
@@ -67518,7 +67501,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2107
+    /* "lxml/etree.pyx":2110
  *             raise ValueError, u"input is not an Element"
  *         if self._context_node is not None:
  *             root = self._context_node             # <<<<<<<<<<<<<<
@@ -67530,7 +67513,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     __pyx_v_root = ((struct LxmlElement *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":2106
+    /* "lxml/etree.pyx":2109
  *         if element._c_node.type != tree.XML_ELEMENT_NODE:
  *             raise ValueError, u"input is not an Element"
  *         if self._context_node is not None:             # <<<<<<<<<<<<<<
@@ -67540,7 +67523,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     goto __pyx_L4;
   }
 
-  /* "lxml/etree.pyx":2108
+  /* "lxml/etree.pyx":2111
  *         if self._context_node is not None:
  *             root = self._context_node
  *         elif self._doc is not None:             # <<<<<<<<<<<<<<
@@ -67551,20 +67534,20 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
   __pyx_t_2 = (__pyx_t_3 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2109
+    /* "lxml/etree.pyx":2112
  *             root = self._context_node
  *         elif self._doc is not None:
  *             root = self._doc.getroot()             # <<<<<<<<<<<<<<
  *         else:
  *             raise ValueError, u"Element is not in this tree"
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_self->_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2109, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_self->_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2112, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 2109, __pyx_L1_error)
+    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 2112, __pyx_L1_error)
     __pyx_v_root = ((struct LxmlElement *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":2108
+    /* "lxml/etree.pyx":2111
  *         if self._context_node is not None:
  *             root = self._context_node
  *         elif self._doc is not None:             # <<<<<<<<<<<<<<
@@ -67574,7 +67557,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     goto __pyx_L4;
   }
 
-  /* "lxml/etree.pyx":2111
+  /* "lxml/etree.pyx":2114
  *             root = self._doc.getroot()
  *         else:
  *             raise ValueError, u"Element is not in this tree"             # <<<<<<<<<<<<<<
@@ -67583,20 +67566,20 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Element_is_not_in_this_tree_2, 0, 0);
-    __PYX_ERR(0, 2111, __pyx_L1_error)
+    __PYX_ERR(0, 2114, __pyx_L1_error)
   }
   __pyx_L4:;
 
-  /* "lxml/etree.pyx":2112
+  /* "lxml/etree.pyx":2115
  *         else:
  *             raise ValueError, u"Element is not in this tree"
  *         _assertValidNode(root)             # <<<<<<<<<<<<<<
  *         if element._doc is not root._doc:
  *             raise ValueError, u"Element is not in this tree"
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_root); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2112, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_root); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2115, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2113
+  /* "lxml/etree.pyx":2116
  *             raise ValueError, u"Element is not in this tree"
  *         _assertValidNode(root)
  *         if element._doc is not root._doc:             # <<<<<<<<<<<<<<
@@ -67607,7 +67590,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2114
+    /* "lxml/etree.pyx":2117
  *         _assertValidNode(root)
  *         if element._doc is not root._doc:
  *             raise ValueError, u"Element is not in this tree"             # <<<<<<<<<<<<<<
@@ -67615,9 +67598,9 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  *         path = []
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Element_is_not_in_this_tree_2, 0, 0);
-    __PYX_ERR(0, 2114, __pyx_L1_error)
+    __PYX_ERR(0, 2117, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2113
+    /* "lxml/etree.pyx":2116
  *             raise ValueError, u"Element is not in this tree"
  *         _assertValidNode(root)
  *         if element._doc is not root._doc:             # <<<<<<<<<<<<<<
@@ -67626,19 +67609,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
   }
 
-  /* "lxml/etree.pyx":2116
+  /* "lxml/etree.pyx":2119
  *             raise ValueError, u"Element is not in this tree"
  * 
  *         path = []             # <<<<<<<<<<<<<<
  *         c_element = element._c_node
  *         while c_element is not root._c_node:
  */
-  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2116, __pyx_L1_error)
+  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2119, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_v_path = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":2117
+  /* "lxml/etree.pyx":2120
  * 
  *         path = []
  *         c_element = element._c_node             # <<<<<<<<<<<<<<
@@ -67648,7 +67631,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
   __pyx_t_5 = __pyx_v_element->_c_node;
   __pyx_v_c_element = __pyx_t_5;
 
-  /* "lxml/etree.pyx":2118
+  /* "lxml/etree.pyx":2121
  *         path = []
  *         c_element = element._c_node
  *         while c_element is not root._c_node:             # <<<<<<<<<<<<<<
@@ -67659,7 +67642,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     __pyx_t_3 = ((__pyx_v_c_element != __pyx_v_root->_c_node) != 0);
     if (!__pyx_t_3) break;
 
-    /* "lxml/etree.pyx":2119
+    /* "lxml/etree.pyx":2122
  *         c_element = element._c_node
  *         while c_element is not root._c_node:
  *             c_name = c_element.name             # <<<<<<<<<<<<<<
@@ -67669,7 +67652,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     __pyx_t_6 = __pyx_v_c_element->name;
     __pyx_v_c_name = __pyx_t_6;
 
-    /* "lxml/etree.pyx":2120
+    /* "lxml/etree.pyx":2123
  *         while c_element is not root._c_node:
  *             c_name = c_element.name
  *             c_href = _getNs(c_element)             # <<<<<<<<<<<<<<
@@ -67678,19 +67661,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
     __pyx_v_c_href = _getNs(__pyx_v_c_element);
 
-    /* "lxml/etree.pyx":2121
+    /* "lxml/etree.pyx":2124
  *             c_name = c_element.name
  *             c_href = _getNs(c_element)
  *             tag = _namespacedNameFromNsName(c_href, c_name)             # <<<<<<<<<<<<<<
  *             if c_href is NULL:
  *                 c_href = <const_xmlChar*>b''  # no namespace (NULL is wildcard)
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2121, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2124, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":2122
+    /* "lxml/etree.pyx":2125
  *             c_href = _getNs(c_element)
  *             tag = _namespacedNameFromNsName(c_href, c_name)
  *             if c_href is NULL:             # <<<<<<<<<<<<<<
@@ -67700,7 +67683,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     __pyx_t_3 = ((__pyx_v_c_href == NULL) != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":2123
+      /* "lxml/etree.pyx":2126
  *             tag = _namespacedNameFromNsName(c_href, c_name)
  *             if c_href is NULL:
  *                 c_href = <const_xmlChar*>b''  # no namespace (NULL is wildcard)             # <<<<<<<<<<<<<<
@@ -67709,7 +67692,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
       __pyx_v_c_href = ((const xmlChar *)((const xmlChar *)((char const *)"")));
 
-      /* "lxml/etree.pyx":2122
+      /* "lxml/etree.pyx":2125
  *             c_href = _getNs(c_element)
  *             tag = _namespacedNameFromNsName(c_href, c_name)
  *             if c_href is NULL:             # <<<<<<<<<<<<<<
@@ -67718,7 +67701,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
     }
 
-    /* "lxml/etree.pyx":2125
+    /* "lxml/etree.pyx":2128
  *                 c_href = <const_xmlChar*>b''  # no namespace (NULL is wildcard)
  *             # use tag[N] if there are preceding siblings with the same tag
  *             count = 0             # <<<<<<<<<<<<<<
@@ -67727,7 +67710,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
     __pyx_v_count = 0;
 
-    /* "lxml/etree.pyx":2126
+    /* "lxml/etree.pyx":2129
  *             # use tag[N] if there are preceding siblings with the same tag
  *             count = 0
  *             c_node = c_element.prev             # <<<<<<<<<<<<<<
@@ -67737,7 +67720,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     __pyx_t_5 = __pyx_v_c_element->prev;
     __pyx_v_c_node = __pyx_t_5;
 
-    /* "lxml/etree.pyx":2127
+    /* "lxml/etree.pyx":2130
  *             count = 0
  *             c_node = c_element.prev
  *             while c_node is not NULL:             # <<<<<<<<<<<<<<
@@ -67748,7 +67731,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
       __pyx_t_3 = ((__pyx_v_c_node != NULL) != 0);
       if (!__pyx_t_3) break;
 
-      /* "lxml/etree.pyx":2128
+      /* "lxml/etree.pyx":2131
  *             c_node = c_element.prev
  *             while c_node is not NULL:
  *                 if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -67758,7 +67741,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
       __pyx_t_3 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
       if (__pyx_t_3) {
 
-        /* "lxml/etree.pyx":2129
+        /* "lxml/etree.pyx":2132
  *             while c_node is not NULL:
  *                 if c_node.type == tree.XML_ELEMENT_NODE:
  *                     if _tagMatches(c_node, c_href, c_name):             # <<<<<<<<<<<<<<
@@ -67768,7 +67751,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
         __pyx_t_3 = (__pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_name) != 0);
         if (__pyx_t_3) {
 
-          /* "lxml/etree.pyx":2130
+          /* "lxml/etree.pyx":2133
  *                 if c_node.type == tree.XML_ELEMENT_NODE:
  *                     if _tagMatches(c_node, c_href, c_name):
  *                         count += 1             # <<<<<<<<<<<<<<
@@ -67777,7 +67760,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
           __pyx_v_count = (__pyx_v_count + 1);
 
-          /* "lxml/etree.pyx":2129
+          /* "lxml/etree.pyx":2132
  *             while c_node is not NULL:
  *                 if c_node.type == tree.XML_ELEMENT_NODE:
  *                     if _tagMatches(c_node, c_href, c_name):             # <<<<<<<<<<<<<<
@@ -67786,7 +67769,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
         }
 
-        /* "lxml/etree.pyx":2128
+        /* "lxml/etree.pyx":2131
  *             c_node = c_element.prev
  *             while c_node is not NULL:
  *                 if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -67795,7 +67778,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
       }
 
-      /* "lxml/etree.pyx":2131
+      /* "lxml/etree.pyx":2134
  *                     if _tagMatches(c_node, c_href, c_name):
  *                         count += 1
  *                 c_node = c_node.prev             # <<<<<<<<<<<<<<
@@ -67806,7 +67789,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
       __pyx_v_c_node = __pyx_t_5;
     }
 
-    /* "lxml/etree.pyx":2132
+    /* "lxml/etree.pyx":2135
  *                         count += 1
  *                 c_node = c_node.prev
  *             if count:             # <<<<<<<<<<<<<<
@@ -67816,16 +67799,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     __pyx_t_3 = (__pyx_v_count != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":2133
+      /* "lxml/etree.pyx":2136
  *                 c_node = c_node.prev
  *             if count:
  *                 tag = '%s[%d]' % (tag, count+1)             # <<<<<<<<<<<<<<
  *             else:
  *                 # use tag[1] if there are following siblings with the same tag
  */
-      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_count + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2133, __pyx_L1_error)
+      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_count + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2136, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2133, __pyx_L1_error)
+      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2136, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_INCREF(__pyx_v_tag);
       __Pyx_GIVEREF(__pyx_v_tag);
@@ -67833,13 +67816,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
       __Pyx_GIVEREF(__pyx_t_4);
       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
       __pyx_t_4 = 0;
-      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_d, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2133, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_d, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2136, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_4);
       __pyx_t_4 = 0;
 
-      /* "lxml/etree.pyx":2132
+      /* "lxml/etree.pyx":2135
  *                         count += 1
  *                 c_node = c_node.prev
  *             if count:             # <<<<<<<<<<<<<<
@@ -67849,7 +67832,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
       goto __pyx_L13;
     }
 
-    /* "lxml/etree.pyx":2136
+    /* "lxml/etree.pyx":2139
  *             else:
  *                 # use tag[1] if there are following siblings with the same tag
  *                 c_node = c_element.next             # <<<<<<<<<<<<<<
@@ -67860,7 +67843,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
       __pyx_t_5 = __pyx_v_c_element->next;
       __pyx_v_c_node = __pyx_t_5;
 
-      /* "lxml/etree.pyx":2137
+      /* "lxml/etree.pyx":2140
  *                 # use tag[1] if there are following siblings with the same tag
  *                 c_node = c_element.next
  *                 while c_node is not NULL:             # <<<<<<<<<<<<<<
@@ -67871,7 +67854,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
         __pyx_t_3 = ((__pyx_v_c_node != NULL) != 0);
         if (!__pyx_t_3) break;
 
-        /* "lxml/etree.pyx":2138
+        /* "lxml/etree.pyx":2141
  *                 c_node = c_element.next
  *                 while c_node is not NULL:
  *                     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -67881,7 +67864,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
         __pyx_t_3 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
         if (__pyx_t_3) {
 
-          /* "lxml/etree.pyx":2139
+          /* "lxml/etree.pyx":2142
  *                 while c_node is not NULL:
  *                     if c_node.type == tree.XML_ELEMENT_NODE:
  *                         if _tagMatches(c_node, c_href, c_name):             # <<<<<<<<<<<<<<
@@ -67891,19 +67874,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
           __pyx_t_3 = (__pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_name) != 0);
           if (__pyx_t_3) {
 
-            /* "lxml/etree.pyx":2140
+            /* "lxml/etree.pyx":2143
  *                     if c_node.type == tree.XML_ELEMENT_NODE:
  *                         if _tagMatches(c_node, c_href, c_name):
  *                             tag += '[1]'             # <<<<<<<<<<<<<<
  *                             break
  *                     c_node = c_node.next
  */
-            __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tag, __pyx_kp_s_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2140, __pyx_L1_error)
+            __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_tag, __pyx_kp_s_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2143, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_4);
             __pyx_t_4 = 0;
 
-            /* "lxml/etree.pyx":2141
+            /* "lxml/etree.pyx":2144
  *                         if _tagMatches(c_node, c_href, c_name):
  *                             tag += '[1]'
  *                             break             # <<<<<<<<<<<<<<
@@ -67912,7 +67895,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
             goto __pyx_L15_break;
 
-            /* "lxml/etree.pyx":2139
+            /* "lxml/etree.pyx":2142
  *                 while c_node is not NULL:
  *                     if c_node.type == tree.XML_ELEMENT_NODE:
  *                         if _tagMatches(c_node, c_href, c_name):             # <<<<<<<<<<<<<<
@@ -67921,7 +67904,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
           }
 
-          /* "lxml/etree.pyx":2138
+          /* "lxml/etree.pyx":2141
  *                 c_node = c_element.next
  *                 while c_node is not NULL:
  *                     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -67930,7 +67913,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
         }
 
-        /* "lxml/etree.pyx":2142
+        /* "lxml/etree.pyx":2145
  *                             tag += '[1]'
  *                             break
  *                     c_node = c_node.next             # <<<<<<<<<<<<<<
@@ -67944,16 +67927,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     }
     __pyx_L13:;
 
-    /* "lxml/etree.pyx":2144
+    /* "lxml/etree.pyx":2147
  *                     c_node = c_node.next
  * 
  *             path.append(tag)             # <<<<<<<<<<<<<<
  *             c_element = c_element.parent
  *             if c_element is NULL or c_element.type != tree.XML_ELEMENT_NODE:
  */
-    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_path, __pyx_v_tag); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 2144, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_path, __pyx_v_tag); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 2147, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2145
+    /* "lxml/etree.pyx":2148
  * 
  *             path.append(tag)
  *             c_element = c_element.parent             # <<<<<<<<<<<<<<
@@ -67963,7 +67946,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     __pyx_t_5 = __pyx_v_c_element->parent;
     __pyx_v_c_element = __pyx_t_5;
 
-    /* "lxml/etree.pyx":2146
+    /* "lxml/etree.pyx":2149
  *             path.append(tag)
  *             c_element = c_element.parent
  *             if c_element is NULL or c_element.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -67981,7 +67964,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     __pyx_L19_bool_binop_done:;
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":2147
+      /* "lxml/etree.pyx":2150
  *             c_element = c_element.parent
  *             if c_element is NULL or c_element.type != tree.XML_ELEMENT_NODE:
  *                 raise ValueError, u"Element is not in this tree."             # <<<<<<<<<<<<<<
@@ -67989,9 +67972,9 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  *             return '.'
  */
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Element_is_not_in_this_tree, 0, 0);
-      __PYX_ERR(0, 2147, __pyx_L1_error)
+      __PYX_ERR(0, 2150, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":2146
+      /* "lxml/etree.pyx":2149
  *             path.append(tag)
  *             c_element = c_element.parent
  *             if c_element is NULL or c_element.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -68001,7 +67984,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     }
   }
 
-  /* "lxml/etree.pyx":2148
+  /* "lxml/etree.pyx":2151
  *             if c_element is NULL or c_element.type != tree.XML_ELEMENT_NODE:
  *                 raise ValueError, u"Element is not in this tree."
  *         if not path:             # <<<<<<<<<<<<<<
@@ -68012,7 +67995,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
   __pyx_t_2 = ((!__pyx_t_3) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2149
+    /* "lxml/etree.pyx":2152
  *                 raise ValueError, u"Element is not in this tree."
  *         if not path:
  *             return '.'             # <<<<<<<<<<<<<<
@@ -68024,7 +68007,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
     __pyx_r = __pyx_kp_s__4;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2148
+    /* "lxml/etree.pyx":2151
  *             if c_element is NULL or c_element.type != tree.XML_ELEMENT_NODE:
  *                 raise ValueError, u"Element is not in this tree."
  *         if not path:             # <<<<<<<<<<<<<<
@@ -68033,16 +68016,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  */
   }
 
-  /* "lxml/etree.pyx":2150
+  /* "lxml/etree.pyx":2153
  *         if not path:
  *             return '.'
  *         path.reverse()             # <<<<<<<<<<<<<<
  *         return '/'.join(path)
  * 
  */
-  __pyx_t_8 = PyList_Reverse(__pyx_v_path); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 2150, __pyx_L1_error)
+  __pyx_t_8 = PyList_Reverse(__pyx_v_path); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 2153, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2151
+  /* "lxml/etree.pyx":2154
  *             return '.'
  *         path.reverse()
  *         return '/'.join(path)             # <<<<<<<<<<<<<<
@@ -68050,13 +68033,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
  *     def getiterator(self, tag=None, *tags):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__37, __pyx_v_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2151, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__39, __pyx_v_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2154, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_r = __pyx_t_4;
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2089
+  /* "lxml/etree.pyx":2092
  *         return path
  * 
  *     def getelementpath(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -68079,7 +68062,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_14getelementpath(struct Lx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2153
+/* "lxml/etree.pyx":2156
  *         return '/'.join(path)
  * 
  *     def getiterator(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -68130,7 +68113,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_17getiterator(PyObject *__
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "getiterator") < 0)) __PYX_ERR(0, 2153, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "getiterator") < 0)) __PYX_ERR(0, 2156, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -68169,14 +68152,14 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_16getiterator(struct LxmlE
   __Pyx_RefNannySetupContext("getiterator", 0);
   __Pyx_INCREF(__pyx_v_tags);
 
-  /* "lxml/etree.pyx":2170
+  /* "lxml/etree.pyx":2173
  *           with older versions of lxml or ElementTree.
  *         """
  *         root = self.getroot()             # <<<<<<<<<<<<<<
  *         if root is None:
  *             return ITER_EMPTY
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2170, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2173, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -68189,17 +68172,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_16getiterator(struct LxmlE
     }
   }
   if (__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2170, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2173, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else {
-    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2170, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2173, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_root = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2171
+  /* "lxml/etree.pyx":2174
  *         """
  *         root = self.getroot()
  *         if root is None:             # <<<<<<<<<<<<<<
@@ -68210,7 +68193,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_16getiterator(struct LxmlE
   __pyx_t_5 = (__pyx_t_4 != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2172
+    /* "lxml/etree.pyx":2175
  *         root = self.getroot()
  *         if root is None:
  *             return ITER_EMPTY             # <<<<<<<<<<<<<<
@@ -68222,7 +68205,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_16getiterator(struct LxmlE
     __pyx_r = __pyx_v_4lxml_5etree_ITER_EMPTY;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2171
+    /* "lxml/etree.pyx":2174
  *         """
  *         root = self.getroot()
  *         if root is None:             # <<<<<<<<<<<<<<
@@ -68231,7 +68214,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_16getiterator(struct LxmlE
  */
   }
 
-  /* "lxml/etree.pyx":2173
+  /* "lxml/etree.pyx":2176
  *         if root is None:
  *             return ITER_EMPTY
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -68242,25 +68225,25 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_16getiterator(struct LxmlE
   __pyx_t_4 = (__pyx_t_5 != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":2174
+    /* "lxml/etree.pyx":2177
  *             return ITER_EMPTY
  *         if tag is not None:
  *             tags += (tag,)             # <<<<<<<<<<<<<<
  *         return root.getiterator(*tags)
  * 
  */
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2174, __pyx_L1_error)
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2177, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tag);
-    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2174, __pyx_L1_error)
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2177, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF_SET(__pyx_v_tags, ((PyObject*)__pyx_t_2));
     __pyx_t_2 = 0;
 
-    /* "lxml/etree.pyx":2173
+    /* "lxml/etree.pyx":2176
  *         if root is None:
  *             return ITER_EMPTY
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -68269,7 +68252,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_16getiterator(struct LxmlE
  */
   }
 
-  /* "lxml/etree.pyx":2175
+  /* "lxml/etree.pyx":2178
  *         if tag is not None:
  *             tags += (tag,)
  *         return root.getiterator(*tags)             # <<<<<<<<<<<<<<
@@ -68277,16 +68260,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_16getiterator(struct LxmlE
  *     def iter(self, tag=None, *tags):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_getiterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2175, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_getiterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2178, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_tags, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2175, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_tags, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2178, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2153
+  /* "lxml/etree.pyx":2156
  *         return '/'.join(path)
  * 
  *     def getiterator(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -68309,7 +68292,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_16getiterator(struct LxmlE
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2177
+/* "lxml/etree.pyx":2180
  *         return root.getiterator(*tags)
  * 
  *     def iter(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -68360,7 +68343,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_19iter(PyObject *__pyx_v_s
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "iter") < 0)) __PYX_ERR(0, 2177, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "iter") < 0)) __PYX_ERR(0, 2180, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -68399,14 +68382,14 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_18iter(struct LxmlElementT
   __Pyx_RefNannySetupContext("iter", 0);
   __Pyx_INCREF(__pyx_v_tags);
 
-  /* "lxml/etree.pyx":2188
+  /* "lxml/etree.pyx":2191
  *         see `_Element.iter`.
  *         """
  *         root = self.getroot()             # <<<<<<<<<<<<<<
  *         if root is None:
  *             return ITER_EMPTY
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2188, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2191, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -68419,17 +68402,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_18iter(struct LxmlElementT
     }
   }
   if (__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2191, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else {
-    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2191, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_root = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2189
+  /* "lxml/etree.pyx":2192
  *         """
  *         root = self.getroot()
  *         if root is None:             # <<<<<<<<<<<<<<
@@ -68440,7 +68423,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_18iter(struct LxmlElementT
   __pyx_t_5 = (__pyx_t_4 != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2190
+    /* "lxml/etree.pyx":2193
  *         root = self.getroot()
  *         if root is None:
  *             return ITER_EMPTY             # <<<<<<<<<<<<<<
@@ -68452,7 +68435,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_18iter(struct LxmlElementT
     __pyx_r = __pyx_v_4lxml_5etree_ITER_EMPTY;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2189
+    /* "lxml/etree.pyx":2192
  *         """
  *         root = self.getroot()
  *         if root is None:             # <<<<<<<<<<<<<<
@@ -68461,7 +68444,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_18iter(struct LxmlElementT
  */
   }
 
-  /* "lxml/etree.pyx":2191
+  /* "lxml/etree.pyx":2194
  *         if root is None:
  *             return ITER_EMPTY
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -68472,25 +68455,25 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_18iter(struct LxmlElementT
   __pyx_t_4 = (__pyx_t_5 != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":2192
+    /* "lxml/etree.pyx":2195
  *             return ITER_EMPTY
  *         if tag is not None:
  *             tags += (tag,)             # <<<<<<<<<<<<<<
  *         return root.iter(*tags)
  * 
  */
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2192, __pyx_L1_error)
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2195, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tag);
-    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2192, __pyx_L1_error)
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_tags, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2195, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF_SET(__pyx_v_tags, ((PyObject*)__pyx_t_2));
     __pyx_t_2 = 0;
 
-    /* "lxml/etree.pyx":2191
+    /* "lxml/etree.pyx":2194
  *         if root is None:
  *             return ITER_EMPTY
  *         if tag is not None:             # <<<<<<<<<<<<<<
@@ -68499,7 +68482,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_18iter(struct LxmlElementT
  */
   }
 
-  /* "lxml/etree.pyx":2193
+  /* "lxml/etree.pyx":2196
  *         if tag is not None:
  *             tags += (tag,)
  *         return root.iter(*tags)             # <<<<<<<<<<<<<<
@@ -68507,16 +68490,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_18iter(struct LxmlElementT
  *     def find(self, path, namespaces=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2196, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_tags, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2193, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_tags, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2196, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2177
+  /* "lxml/etree.pyx":2180
  *         return root.getiterator(*tags)
  * 
  *     def iter(self, tag=None, *tags):             # <<<<<<<<<<<<<<
@@ -68539,7 +68522,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_18iter(struct LxmlElementT
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2195
+/* "lxml/etree.pyx":2198
  *         return root.iter(*tags)
  * 
  *     def find(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -68585,7 +68568,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_21find(PyObject *__pyx_v_s
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find") < 0)) __PYX_ERR(0, 2195, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find") < 0)) __PYX_ERR(0, 2198, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -68601,7 +68584,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_21find(PyObject *__pyx_v_s
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("find", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2195, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("find", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2198, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ElementTree.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -68627,23 +68610,23 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
   __Pyx_RefNannySetupContext("find", 0);
   __Pyx_INCREF(__pyx_v_path);
 
-  /* "lxml/etree.pyx":2205
+  /* "lxml/etree.pyx":2208
  *         prefixes in the path expression.
  *         """
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         root = self.getroot()
  *         if _isString(path):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2205, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2208, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2206
+  /* "lxml/etree.pyx":2209
  *         """
  *         self._assertHasRoot()
  *         root = self.getroot()             # <<<<<<<<<<<<<<
  *         if _isString(path):
  *             if path[:1] == "/":
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2206, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2209, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -68656,17 +68639,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
     }
   }
   if (__pyx_t_4) {
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2206, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2209, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   } else {
-    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2206, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2209, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_root = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2207
+  /* "lxml/etree.pyx":2210
  *         self._assertHasRoot()
  *         root = self.getroot()
  *         if _isString(path):             # <<<<<<<<<<<<<<
@@ -68676,32 +68659,32 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
   __pyx_t_5 = (_isString(__pyx_v_path) != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2208
+    /* "lxml/etree.pyx":2211
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
  *                 path = "." + path
  *         return root.find(path, namespaces)
  */
-    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 1, NULL, NULL, &__pyx_slice__38, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2208, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 1, NULL, NULL, &__pyx_slice__40, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2211, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__37, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2208, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__39, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2211, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (__pyx_t_5) {
 
-      /* "lxml/etree.pyx":2209
+      /* "lxml/etree.pyx":2212
  *         if _isString(path):
  *             if path[:1] == "/":
  *                 path = "." + path             # <<<<<<<<<<<<<<
  *         return root.find(path, namespaces)
  * 
  */
-      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__4, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2209, __pyx_L1_error)
+      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__4, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2212, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_2);
       __pyx_t_2 = 0;
 
-      /* "lxml/etree.pyx":2208
+      /* "lxml/etree.pyx":2211
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
@@ -68710,7 +68693,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
  */
     }
 
-    /* "lxml/etree.pyx":2207
+    /* "lxml/etree.pyx":2210
  *         self._assertHasRoot()
  *         root = self.getroot()
  *         if _isString(path):             # <<<<<<<<<<<<<<
@@ -68719,7 +68702,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
  */
   }
 
-  /* "lxml/etree.pyx":2210
+  /* "lxml/etree.pyx":2213
  *             if path[:1] == "/":
  *                 path = "." + path
  *         return root.find(path, namespaces)             # <<<<<<<<<<<<<<
@@ -68727,7 +68710,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
  *     def findtext(self, path, default=None, namespaces=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_find); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2210, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_find); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2213, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   __pyx_t_1 = 0;
@@ -68744,7 +68727,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2210, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2213, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -68752,13 +68735,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2210, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2213, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2210, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2213, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -68769,7 +68752,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_1, __pyx_v_namespaces);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2210, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2213, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -68778,7 +68761,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2195
+  /* "lxml/etree.pyx":2198
  *         return root.iter(*tags)
  * 
  *     def find(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -68802,7 +68785,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_20find(struct LxmlElementT
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2212
+/* "lxml/etree.pyx":2215
  *         return root.find(path, namespaces)
  * 
  *     def findtext(self, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
@@ -68858,7 +68841,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_23findtext(PyObject *__pyx
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findtext") < 0)) __PYX_ERR(0, 2212, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findtext") < 0)) __PYX_ERR(0, 2215, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -68877,7 +68860,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_23findtext(PyObject *__pyx
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("findtext", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2212, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("findtext", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2215, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ElementTree.findtext", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -68903,23 +68886,23 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
   __Pyx_RefNannySetupContext("findtext", 0);
   __Pyx_INCREF(__pyx_v_path);
 
-  /* "lxml/etree.pyx":2222
+  /* "lxml/etree.pyx":2225
  *         prefixes in the path expression.
  *         """
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         root = self.getroot()
  *         if _isString(path):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2222, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2225, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2223
+  /* "lxml/etree.pyx":2226
  *         """
  *         self._assertHasRoot()
  *         root = self.getroot()             # <<<<<<<<<<<<<<
  *         if _isString(path):
  *             if path[:1] == "/":
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2223, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2226, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -68932,17 +68915,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
     }
   }
   if (__pyx_t_4) {
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2223, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2226, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   } else {
-    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2223, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2226, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_root = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2224
+  /* "lxml/etree.pyx":2227
  *         self._assertHasRoot()
  *         root = self.getroot()
  *         if _isString(path):             # <<<<<<<<<<<<<<
@@ -68952,32 +68935,32 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
   __pyx_t_5 = (_isString(__pyx_v_path) != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2225
+    /* "lxml/etree.pyx":2228
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
  *                 path = "." + path
  *         return root.findtext(path, default, namespaces)
  */
-    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 1, NULL, NULL, &__pyx_slice__39, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2225, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 1, NULL, NULL, &__pyx_slice__41, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2228, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__37, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2225, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__39, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2228, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (__pyx_t_5) {
 
-      /* "lxml/etree.pyx":2226
+      /* "lxml/etree.pyx":2229
  *         if _isString(path):
  *             if path[:1] == "/":
  *                 path = "." + path             # <<<<<<<<<<<<<<
  *         return root.findtext(path, default, namespaces)
  * 
  */
-      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__4, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2226, __pyx_L1_error)
+      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__4, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2229, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_2);
       __pyx_t_2 = 0;
 
-      /* "lxml/etree.pyx":2225
+      /* "lxml/etree.pyx":2228
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
@@ -68986,7 +68969,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
  */
     }
 
-    /* "lxml/etree.pyx":2224
+    /* "lxml/etree.pyx":2227
  *         self._assertHasRoot()
  *         root = self.getroot()
  *         if _isString(path):             # <<<<<<<<<<<<<<
@@ -68995,7 +68978,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
  */
   }
 
-  /* "lxml/etree.pyx":2227
+  /* "lxml/etree.pyx":2230
  *             if path[:1] == "/":
  *                 path = "." + path
  *         return root.findtext(path, default, namespaces)             # <<<<<<<<<<<<<<
@@ -69003,7 +68986,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
  *     def findall(self, path, namespaces=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_findtext); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2227, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_findtext); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2230, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   __pyx_t_1 = 0;
@@ -69020,7 +69003,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_path, __pyx_v_default, __pyx_v_namespaces};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2227, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2230, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -69028,13 +69011,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_path, __pyx_v_default, __pyx_v_namespaces};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2227, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2230, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2227, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2230, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -69048,7 +69031,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_1, __pyx_v_namespaces);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2227, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2230, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -69057,7 +69040,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2212
+  /* "lxml/etree.pyx":2215
  *         return root.find(path, namespaces)
  * 
  *     def findtext(self, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
@@ -69081,7 +69064,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_22findtext(struct LxmlElem
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2229
+/* "lxml/etree.pyx":2232
  *         return root.findtext(path, default, namespaces)
  * 
  *     def findall(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -69127,7 +69110,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_25findall(PyObject *__pyx_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findall") < 0)) __PYX_ERR(0, 2229, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findall") < 0)) __PYX_ERR(0, 2232, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -69143,7 +69126,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_25findall(PyObject *__pyx_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("findall", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2229, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("findall", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2232, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ElementTree.findall", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -69169,23 +69152,23 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
   __Pyx_RefNannySetupContext("findall", 0);
   __Pyx_INCREF(__pyx_v_path);
 
-  /* "lxml/etree.pyx":2239
+  /* "lxml/etree.pyx":2242
  *         prefixes in the path expression.
  *         """
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         root = self.getroot()
  *         if _isString(path):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2239, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2242, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2240
+  /* "lxml/etree.pyx":2243
  *         """
  *         self._assertHasRoot()
  *         root = self.getroot()             # <<<<<<<<<<<<<<
  *         if _isString(path):
  *             if path[:1] == "/":
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2240, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2243, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -69198,17 +69181,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
     }
   }
   if (__pyx_t_4) {
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2240, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2243, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   } else {
-    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2240, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2243, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_root = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2241
+  /* "lxml/etree.pyx":2244
  *         self._assertHasRoot()
  *         root = self.getroot()
  *         if _isString(path):             # <<<<<<<<<<<<<<
@@ -69218,32 +69201,32 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
   __pyx_t_5 = (_isString(__pyx_v_path) != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2242
+    /* "lxml/etree.pyx":2245
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
  *                 path = "." + path
  *         return root.findall(path, namespaces)
  */
-    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 1, NULL, NULL, &__pyx_slice__40, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2242, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 1, NULL, NULL, &__pyx_slice__42, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2245, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__37, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2242, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__39, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2245, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (__pyx_t_5) {
 
-      /* "lxml/etree.pyx":2243
+      /* "lxml/etree.pyx":2246
  *         if _isString(path):
  *             if path[:1] == "/":
  *                 path = "." + path             # <<<<<<<<<<<<<<
  *         return root.findall(path, namespaces)
  * 
  */
-      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__4, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2243, __pyx_L1_error)
+      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__4, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2246, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_2);
       __pyx_t_2 = 0;
 
-      /* "lxml/etree.pyx":2242
+      /* "lxml/etree.pyx":2245
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
@@ -69252,7 +69235,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
  */
     }
 
-    /* "lxml/etree.pyx":2241
+    /* "lxml/etree.pyx":2244
  *         self._assertHasRoot()
  *         root = self.getroot()
  *         if _isString(path):             # <<<<<<<<<<<<<<
@@ -69261,7 +69244,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
  */
   }
 
-  /* "lxml/etree.pyx":2244
+  /* "lxml/etree.pyx":2247
  *             if path[:1] == "/":
  *                 path = "." + path
  *         return root.findall(path, namespaces)             # <<<<<<<<<<<<<<
@@ -69269,7 +69252,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
  *     def iterfind(self, path, namespaces=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_findall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2244, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_findall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2247, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   __pyx_t_1 = 0;
@@ -69286,7 +69269,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2247, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -69294,13 +69277,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2247, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2244, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2247, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -69311,7 +69294,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_1, __pyx_v_namespaces);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2247, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -69320,7 +69303,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2229
+  /* "lxml/etree.pyx":2232
  *         return root.findtext(path, default, namespaces)
  * 
  *     def findall(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -69344,7 +69327,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_24findall(struct LxmlEleme
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2246
+/* "lxml/etree.pyx":2249
  *         return root.findall(path, namespaces)
  * 
  *     def iterfind(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -69390,7 +69373,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_27iterfind(PyObject *__pyx
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterfind") < 0)) __PYX_ERR(0, 2246, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterfind") < 0)) __PYX_ERR(0, 2249, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -69406,7 +69389,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_27iterfind(PyObject *__pyx
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("iterfind", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2246, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("iterfind", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2249, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ElementTree.iterfind", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -69432,23 +69415,23 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
   __Pyx_RefNannySetupContext("iterfind", 0);
   __Pyx_INCREF(__pyx_v_path);
 
-  /* "lxml/etree.pyx":2256
+  /* "lxml/etree.pyx":2259
  *         prefixes in the path expression.
  *         """
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         root = self.getroot()
  *         if _isString(path):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2256, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2259, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2257
+  /* "lxml/etree.pyx":2260
  *         """
  *         self._assertHasRoot()
  *         root = self.getroot()             # <<<<<<<<<<<<<<
  *         if _isString(path):
  *             if path[:1] == "/":
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2257, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getroot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2260, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -69461,17 +69444,17 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
     }
   }
   if (__pyx_t_4) {
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2257, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2260, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   } else {
-    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2257, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2260, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_root = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2258
+  /* "lxml/etree.pyx":2261
  *         self._assertHasRoot()
  *         root = self.getroot()
  *         if _isString(path):             # <<<<<<<<<<<<<<
@@ -69481,32 +69464,32 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
   __pyx_t_5 = (_isString(__pyx_v_path) != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2259
+    /* "lxml/etree.pyx":2262
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
  *                 path = "." + path
  *         return root.iterfind(path, namespaces)
  */
-    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 1, NULL, NULL, &__pyx_slice__41, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2259, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_path, 0, 1, NULL, NULL, &__pyx_slice__43, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2262, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__37, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2259, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__39, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2262, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (__pyx_t_5) {
 
-      /* "lxml/etree.pyx":2260
+      /* "lxml/etree.pyx":2263
  *         if _isString(path):
  *             if path[:1] == "/":
  *                 path = "." + path             # <<<<<<<<<<<<<<
  *         return root.iterfind(path, namespaces)
  * 
  */
-      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__4, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2260, __pyx_L1_error)
+      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__4, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2263, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_2);
       __pyx_t_2 = 0;
 
-      /* "lxml/etree.pyx":2259
+      /* "lxml/etree.pyx":2262
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
@@ -69515,7 +69498,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
  */
     }
 
-    /* "lxml/etree.pyx":2258
+    /* "lxml/etree.pyx":2261
  *         self._assertHasRoot()
  *         root = self.getroot()
  *         if _isString(path):             # <<<<<<<<<<<<<<
@@ -69524,7 +69507,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
  */
   }
 
-  /* "lxml/etree.pyx":2261
+  /* "lxml/etree.pyx":2264
  *             if path[:1] == "/":
  *                 path = "." + path
  *         return root.iterfind(path, namespaces)             # <<<<<<<<<<<<<<
@@ -69532,7 +69515,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
  *     def xpath(self, _path, *, namespaces=None, extensions=None,
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_iterfind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2261, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_root, __pyx_n_s_iterfind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2264, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   __pyx_t_1 = 0;
@@ -69549,7 +69532,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2261, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2264, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -69557,13 +69540,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_path, __pyx_v_namespaces};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2261, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2264, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2261, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2264, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -69574,7 +69557,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
     __Pyx_INCREF(__pyx_v_namespaces);
     __Pyx_GIVEREF(__pyx_v_namespaces);
     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_1, __pyx_v_namespaces);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2261, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2264, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -69583,7 +69566,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2246
+  /* "lxml/etree.pyx":2249
  *         return root.findall(path, namespaces)
  * 
  *     def iterfind(self, path, namespaces=None):             # <<<<<<<<<<<<<<
@@ -69607,7 +69590,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_26iterfind(struct LxmlElem
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2263
+/* "lxml/etree.pyx":2266
  *         return root.iterfind(path, namespaces)
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
@@ -69636,7 +69619,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_29xpath(PyObject *__pyx_v_
     values[1] = ((PyObject *)Py_None);
     values[2] = ((PyObject *)Py_None);
 
-    /* "lxml/etree.pyx":2264
+    /* "lxml/etree.pyx":2267
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,
  *               smart_strings=True, **_variables):             # <<<<<<<<<<<<<<
@@ -69667,7 +69650,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_29xpath(PyObject *__pyx_v_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__variables, values, pos_args, "xpath") < 0)) __PYX_ERR(0, 2263, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__variables, values, pos_args, "xpath") < 0)) __PYX_ERR(0, 2266, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -69681,7 +69664,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_29xpath(PyObject *__pyx_v_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("xpath", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2263, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("xpath", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2266, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v__variables); __pyx_v__variables = 0;
   __Pyx_AddTraceback("lxml.etree._ElementTree.xpath", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -69690,7 +69673,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_29xpath(PyObject *__pyx_v_
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_4lxml_5etree_12_ElementTree_28xpath(((struct LxmlElementTree *)__pyx_v_self), __pyx_v__path, __pyx_v_namespaces, __pyx_v_extensions, __pyx_v_smart_strings, __pyx_v__variables);
 
-  /* "lxml/etree.pyx":2263
+  /* "lxml/etree.pyx":2266
  *         return root.iterfind(path, namespaces)
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
@@ -69714,64 +69697,64 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_28xpath(struct LxmlElement
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("xpath", 0);
 
-  /* "lxml/etree.pyx":2282
+  /* "lxml/etree.pyx":2285
  *         XPathEvaluator directly.
  *         """
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
  *                                            extensions=extensions,
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2282, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2285, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2283
+  /* "lxml/etree.pyx":2286
  *         """
  *         self._assertHasRoot()
  *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,             # <<<<<<<<<<<<<<
  *                                            extensions=extensions,
  *                                            smart_strings=smart_strings)
  */
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2283, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2286, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2283, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2286, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_namespaces, __pyx_v_namespaces) < 0) __PYX_ERR(0, 2283, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_namespaces, __pyx_v_namespaces) < 0) __PYX_ERR(0, 2286, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2284
+  /* "lxml/etree.pyx":2287
  *         self._assertHasRoot()
  *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
  *                                            extensions=extensions,             # <<<<<<<<<<<<<<
  *                                            smart_strings=smart_strings)
  *         return evaluator(_path, **_variables)
  */
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extensions, __pyx_v_extensions) < 0) __PYX_ERR(0, 2283, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extensions, __pyx_v_extensions) < 0) __PYX_ERR(0, 2286, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2285
+  /* "lxml/etree.pyx":2288
  *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
  *                                            extensions=extensions,
  *                                            smart_strings=smart_strings)             # <<<<<<<<<<<<<<
  *         return evaluator(_path, **_variables)
  * 
  */
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_smart_strings, __pyx_v_smart_strings) < 0) __PYX_ERR(0, 2283, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_smart_strings, __pyx_v_smart_strings) < 0) __PYX_ERR(0, 2286, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2283
+  /* "lxml/etree.pyx":2286
  *         """
  *         self._assertHasRoot()
  *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,             # <<<<<<<<<<<<<<
  *                                            extensions=extensions,
  *                                            smart_strings=smart_strings)
  */
-  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPathDocumentEvaluator), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2283, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPathDocumentEvaluator), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2286, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_evaluator = ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":2286
+  /* "lxml/etree.pyx":2289
  *                                            extensions=extensions,
  *                                            smart_strings=smart_strings)
  *         return evaluator(_path, **_variables)             # <<<<<<<<<<<<<<
@@ -69779,19 +69762,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_28xpath(struct LxmlElement
  *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2286, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2289, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(__pyx_v__path);
   __Pyx_GIVEREF(__pyx_v__path);
   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__path);
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_evaluator), __pyx_t_4, __pyx_v__variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2286, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_evaluator), __pyx_t_4, __pyx_v__variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2289, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2263
+  /* "lxml/etree.pyx":2266
  *         return root.iterfind(path, namespaces)
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
@@ -69813,7 +69796,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_28xpath(struct LxmlElement
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2288
+/* "lxml/etree.pyx":2291
  *         return evaluator(_path, **_variables)
  * 
  *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):             # <<<<<<<<<<<<<<
@@ -69872,7 +69855,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_31xslt(PyObject *__pyx_v_s
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__kw, values, pos_args, "xslt") < 0)) __PYX_ERR(0, 2288, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__kw, values, pos_args, "xslt") < 0)) __PYX_ERR(0, 2291, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -69891,7 +69874,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_31xslt(PyObject *__pyx_v_s
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("xslt", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2288, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("xslt", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2291, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v__kw); __pyx_v__kw = 0;
   __Pyx_AddTraceback("lxml.etree._ElementTree.xslt", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -69916,55 +69899,55 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_30xslt(struct LxmlElementT
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("xslt", 0);
 
-  /* "lxml/etree.pyx":2302
+  /* "lxml/etree.pyx":2305
  *         class directly.
  *         """
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         style = XSLT(_xslt, extensions=extensions,
  *                      access_control=access_control)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2302, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2305, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2303
+  /* "lxml/etree.pyx":2306
  *         """
  *         self._assertHasRoot()
  *         style = XSLT(_xslt, extensions=extensions,             # <<<<<<<<<<<<<<
  *                      access_control=access_control)
  *         return style(self, **_kw)
  */
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2303, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2306, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v__xslt);
   __Pyx_GIVEREF(__pyx_v__xslt);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__xslt);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2303, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2306, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extensions, __pyx_v_extensions) < 0) __PYX_ERR(0, 2303, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extensions, __pyx_v_extensions) < 0) __PYX_ERR(0, 2306, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2304
+  /* "lxml/etree.pyx":2307
  *         self._assertHasRoot()
  *         style = XSLT(_xslt, extensions=extensions,
  *                      access_control=access_control)             # <<<<<<<<<<<<<<
  *         return style(self, **_kw)
  * 
  */
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_access_control, __pyx_v_access_control) < 0) __PYX_ERR(0, 2303, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_access_control, __pyx_v_access_control) < 0) __PYX_ERR(0, 2306, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2303
+  /* "lxml/etree.pyx":2306
  *         """
  *         self._assertHasRoot()
  *         style = XSLT(_xslt, extensions=extensions,             # <<<<<<<<<<<<<<
  *                      access_control=access_control)
  *         return style(self, **_kw)
  */
-  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLT), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2303, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLT), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2306, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_style = ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":2305
+  /* "lxml/etree.pyx":2308
  *         style = XSLT(_xslt, extensions=extensions,
  *                      access_control=access_control)
  *         return style(self, **_kw)             # <<<<<<<<<<<<<<
@@ -69972,19 +69955,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_30xslt(struct LxmlElementT
  *     def relaxng(self, relaxng):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2305, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2308, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_style), __pyx_t_4, __pyx_v__kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2305, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_style), __pyx_t_4, __pyx_v__kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2308, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2288
+  /* "lxml/etree.pyx":2291
  *         return evaluator(_path, **_variables)
  * 
  *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):             # <<<<<<<<<<<<<<
@@ -70006,7 +69989,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_30xslt(struct LxmlElementT
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2307
+/* "lxml/etree.pyx":2310
  *         return style(self, **_kw)
  * 
  *     def relaxng(self, relaxng):             # <<<<<<<<<<<<<<
@@ -70040,34 +70023,34 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_32relaxng(struct LxmlEleme
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("relaxng", 0);
 
-  /* "lxml/etree.pyx":2321
+  /* "lxml/etree.pyx":2324
  *         class directly.
  *         """
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         schema = RelaxNG(relaxng)
  *         return schema.validate(self)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2321, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2324, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2322
+  /* "lxml/etree.pyx":2325
  *         """
  *         self._assertHasRoot()
  *         schema = RelaxNG(relaxng)             # <<<<<<<<<<<<<<
  *         return schema.validate(self)
  * 
  */
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2322, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2325, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_relaxng);
   __Pyx_GIVEREF(__pyx_v_relaxng);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_relaxng);
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_RelaxNG), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2322, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_RelaxNG), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2325, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_schema = ((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "lxml/etree.pyx":2323
+  /* "lxml/etree.pyx":2326
  *         self._assertHasRoot()
  *         schema = RelaxNG(relaxng)
  *         return schema.validate(self)             # <<<<<<<<<<<<<<
@@ -70075,7 +70058,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_32relaxng(struct LxmlEleme
  *     def xmlschema(self, xmlschema):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_schema), __pyx_n_s_validate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2323, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_schema), __pyx_n_s_validate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2326, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -70088,13 +70071,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_32relaxng(struct LxmlEleme
     }
   }
   if (!__pyx_t_4) {
-    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2323, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2326, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)};
-      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2323, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2326, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_3);
     } else
@@ -70102,19 +70085,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_32relaxng(struct LxmlEleme
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)};
-      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2323, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2326, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_3);
     } else
     #endif
     {
-      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2323, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2326, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
       __Pyx_INCREF(((PyObject *)__pyx_v_self));
       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
       PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_self));
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2323, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2326, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
@@ -70124,7 +70107,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_32relaxng(struct LxmlEleme
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2307
+  /* "lxml/etree.pyx":2310
  *         return style(self, **_kw)
  * 
  *     def relaxng(self, relaxng):             # <<<<<<<<<<<<<<
@@ -70147,7 +70130,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_32relaxng(struct LxmlEleme
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2325
+/* "lxml/etree.pyx":2328
  *         return schema.validate(self)
  * 
  *     def xmlschema(self, xmlschema):             # <<<<<<<<<<<<<<
@@ -70181,34 +70164,34 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_34xmlschema(struct LxmlEle
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("xmlschema", 0);
 
-  /* "lxml/etree.pyx":2339
+  /* "lxml/etree.pyx":2342
  *         class directly.
  *         """
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         schema = XMLSchema(xmlschema)
  *         return schema.validate(self)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2339, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2342, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2340
+  /* "lxml/etree.pyx":2343
  *         """
  *         self._assertHasRoot()
  *         schema = XMLSchema(xmlschema)             # <<<<<<<<<<<<<<
  *         return schema.validate(self)
  * 
  */
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2340, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2343, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_xmlschema);
   __Pyx_GIVEREF(__pyx_v_xmlschema);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xmlschema);
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XMLSchema), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2340, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XMLSchema), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2343, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "lxml/etree.pyx":2341
+  /* "lxml/etree.pyx":2344
  *         self._assertHasRoot()
  *         schema = XMLSchema(xmlschema)
  *         return schema.validate(self)             # <<<<<<<<<<<<<<
@@ -70216,7 +70199,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_34xmlschema(struct LxmlEle
  *     def xinclude(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_schema), __pyx_n_s_validate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2341, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_schema), __pyx_n_s_validate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2344, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_4 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -70229,13 +70212,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_34xmlschema(struct LxmlEle
     }
   }
   if (!__pyx_t_4) {
-    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2341, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)};
-      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2341, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_3);
     } else
@@ -70243,19 +70226,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_34xmlschema(struct LxmlEle
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self)};
-      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2341, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_3);
     } else
     #endif
     {
-      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2341, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2344, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
       __Pyx_INCREF(((PyObject *)__pyx_v_self));
       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
       PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_self));
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2341, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
@@ -70265,7 +70248,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_34xmlschema(struct LxmlEle
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2325
+  /* "lxml/etree.pyx":2328
  *         return schema.validate(self)
  * 
  *     def xmlschema(self, xmlschema):             # <<<<<<<<<<<<<<
@@ -70288,7 +70271,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_34xmlschema(struct LxmlEle
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2343
+/* "lxml/etree.pyx":2346
  *         return schema.validate(self)
  * 
  *     def xinclude(self):             # <<<<<<<<<<<<<<
@@ -70321,23 +70304,23 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_36xinclude(struct LxmlElem
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("xinclude", 0);
 
-  /* "lxml/etree.pyx":2355
+  /* "lxml/etree.pyx":2358
  *         due to restrictions of libxml2 <= 2.6.29.
  *         """
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         XInclude()(self._context_node)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2355, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2358, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2356
+  /* "lxml/etree.pyx":2359
  *         """
  *         self._assertHasRoot()
  *         XInclude()(self._context_node)             # <<<<<<<<<<<<<<
  * 
  *     def write_c14n(self, file, *, exclusive=False, with_comments=True,
  */
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XInclude), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2356, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XInclude), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2359, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -70350,13 +70333,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_36xinclude(struct LxmlElem
     }
   }
   if (!__pyx_t_4) {
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->_context_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->_context_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2359, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_3)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self->_context_node)};
-      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2359, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_2);
     } else
@@ -70364,19 +70347,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_36xinclude(struct LxmlElem
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_self->_context_node)};
-      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2359, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_2);
     } else
     #endif
     {
-      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2356, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2359, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
       __Pyx_INCREF(((PyObject *)__pyx_v_self->_context_node));
       __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_context_node));
       PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_self->_context_node));
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2359, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
@@ -70384,7 +70367,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_36xinclude(struct LxmlElem
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2343
+  /* "lxml/etree.pyx":2346
  *         return schema.validate(self)
  * 
  *     def xinclude(self):             # <<<<<<<<<<<<<<
@@ -70408,7 +70391,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_36xinclude(struct LxmlElem
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2358
+/* "lxml/etree.pyx":2361
  *         XInclude()(self._context_node)
  * 
  *     def write_c14n(self, file, *, exclusive=False, with_comments=True,             # <<<<<<<<<<<<<<
@@ -70436,7 +70419,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_39write_c14n(PyObject *__p
     values[2] = ((PyObject *)Py_True);
     values[3] = ((PyObject *)__pyx_int_0);
 
-    /* "lxml/etree.pyx":2359
+    /* "lxml/etree.pyx":2362
  * 
  *     def write_c14n(self, file, *, exclusive=False, with_comments=True,
  *                    compression=0, inclusive_ns_prefixes=None):             # <<<<<<<<<<<<<<
@@ -70467,7 +70450,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_39write_c14n(PyObject *__p
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_c14n") < 0)) __PYX_ERR(0, 2358, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_c14n") < 0)) __PYX_ERR(0, 2361, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -70482,7 +70465,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_39write_c14n(PyObject *__p
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write_c14n", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2358, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("write_c14n", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2361, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ElementTree.write_c14n", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -70490,7 +70473,7 @@ static PyObject *__pyx_pw_4lxml_5etree_12_ElementTree_39write_c14n(PyObject *__p
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_4lxml_5etree_12_ElementTree_38write_c14n(((struct LxmlElementTree *)__pyx_v_self), __pyx_v_file, __pyx_v_exclusive, __pyx_v_with_comments, __pyx_v_compression, __pyx_v_inclusive_ns_prefixes);
 
-  /* "lxml/etree.pyx":2358
+  /* "lxml/etree.pyx":2361
  *         XInclude()(self._context_node)
  * 
  *     def write_c14n(self, file, *, exclusive=False, with_comments=True,             # <<<<<<<<<<<<<<
@@ -70515,16 +70498,16 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_38write_c14n(struct LxmlEl
   __Pyx_RefNannySetupContext("write_c14n", 0);
   __Pyx_INCREF(__pyx_v_compression);
 
-  /* "lxml/etree.pyx":2377
+  /* "lxml/etree.pyx":2380
  *         of the namespace node's parent element.
  *         """
  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._context_node)
  *         if compression is None or compression < 0:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2377, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2380, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2378
+  /* "lxml/etree.pyx":2381
  *         """
  *         self._assertHasRoot()
  *         _assertValidNode(self._context_node)             # <<<<<<<<<<<<<<
@@ -70533,10 +70516,10 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_38write_c14n(struct LxmlEl
  */
   __pyx_t_2 = ((PyObject *)__pyx_v_self->_context_node);
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2378, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_2)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2381, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2379
+  /* "lxml/etree.pyx":2382
  *         self._assertHasRoot()
  *         _assertValidNode(self._context_node)
  *         if compression is None or compression < 0:             # <<<<<<<<<<<<<<
@@ -70550,14 +70533,14 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_38write_c14n(struct LxmlEl
     __pyx_t_3 = __pyx_t_5;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_2 = PyObject_RichCompare(__pyx_v_compression, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2379, __pyx_L1_error)
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2379, __pyx_L1_error)
+  __pyx_t_2 = PyObject_RichCompare(__pyx_v_compression, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2382, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2382, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_3 = __pyx_t_5;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2380
+    /* "lxml/etree.pyx":2383
  *         _assertValidNode(self._context_node)
  *         if compression is None or compression < 0:
  *             compression = 0             # <<<<<<<<<<<<<<
@@ -70567,7 +70550,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_38write_c14n(struct LxmlEl
     __Pyx_INCREF(__pyx_int_0);
     __Pyx_DECREF_SET(__pyx_v_compression, __pyx_int_0);
 
-    /* "lxml/etree.pyx":2379
+    /* "lxml/etree.pyx":2382
  *         self._assertHasRoot()
  *         _assertValidNode(self._context_node)
  *         if compression is None or compression < 0:             # <<<<<<<<<<<<<<
@@ -70576,7 +70559,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_38write_c14n(struct LxmlEl
  */
   }
 
-  /* "lxml/etree.pyx":2382
+  /* "lxml/etree.pyx":2385
  *             compression = 0
  * 
  *         _tofilelikeC14N(file, self._context_node, exclusive, with_comments,             # <<<<<<<<<<<<<<
@@ -70585,31 +70568,31 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_38write_c14n(struct LxmlEl
  */
   __pyx_t_2 = ((PyObject *)__pyx_v_self->_context_node);
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_exclusive); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2382, __pyx_L1_error)
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_with_comments); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2382, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_exclusive); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2385, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_with_comments); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2385, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2383
+  /* "lxml/etree.pyx":2386
  * 
  *         _tofilelikeC14N(file, self._context_node, exclusive, with_comments,
  *                         compression, inclusive_ns_prefixes)             # <<<<<<<<<<<<<<
  * 
  * cdef _ElementTree _elementTreeFactory(_Document doc, _Element context_node):
  */
-  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2386, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2382
+  /* "lxml/etree.pyx":2385
  *             compression = 0
  * 
  *         _tofilelikeC14N(file, self._context_node, exclusive, with_comments,             # <<<<<<<<<<<<<<
  *                         compression, inclusive_ns_prefixes)
  * 
  */
-  __pyx_t_6 = __pyx_f_4lxml_5etree__tofilelikeC14N(__pyx_v_file, ((struct LxmlElement *)__pyx_t_2), __pyx_t_3, __pyx_t_5, __pyx_t_1, __pyx_v_inclusive_ns_prefixes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2382, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__tofilelikeC14N(__pyx_v_file, ((struct LxmlElement *)__pyx_t_2), __pyx_t_3, __pyx_t_5, __pyx_t_1, __pyx_v_inclusive_ns_prefixes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2385, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":2358
+  /* "lxml/etree.pyx":2361
  *         XInclude()(self._context_node)
  * 
  *     def write_c14n(self, file, *, exclusive=False, with_comments=True,             # <<<<<<<<<<<<<<
@@ -70632,7 +70615,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_38write_c14n(struct LxmlEl
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2385
+/* "lxml/etree.pyx":2388
  *                         compression, inclusive_ns_prefixes)
  * 
  * cdef _ElementTree _elementTreeFactory(_Document doc, _Element context_node):             # <<<<<<<<<<<<<<
@@ -70646,7 +70629,7 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__elementTreeFactory(struct L
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("_elementTreeFactory", 0);
 
-  /* "lxml/etree.pyx":2386
+  /* "lxml/etree.pyx":2389
  * 
  * cdef _ElementTree _elementTreeFactory(_Document doc, _Element context_node):
  *     return _newElementTree(doc, context_node, _ElementTree)             # <<<<<<<<<<<<<<
@@ -70654,13 +70637,13 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__elementTreeFactory(struct L
  * cdef _ElementTree _newElementTree(_Document doc, _Element context_node,
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newElementTree(__pyx_v_doc, __pyx_v_context_node, ((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2386, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newElementTree(__pyx_v_doc, __pyx_v_context_node, ((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2389, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = ((struct LxmlElementTree *)__pyx_t_1);
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2385
+  /* "lxml/etree.pyx":2388
  *                         compression, inclusive_ns_prefixes)
  * 
  * cdef _ElementTree _elementTreeFactory(_Document doc, _Element context_node):             # <<<<<<<<<<<<<<
@@ -70679,7 +70662,7 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__elementTreeFactory(struct L
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2388
+/* "lxml/etree.pyx":2391
  *     return _newElementTree(doc, context_node, _ElementTree)
  * 
  * cdef _ElementTree _newElementTree(_Document doc, _Element context_node,             # <<<<<<<<<<<<<<
@@ -70701,7 +70684,7 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
   __Pyx_RefNannySetupContext("_newElementTree", 0);
   __Pyx_INCREF((PyObject *)__pyx_v_context_node);
 
-  /* "lxml/etree.pyx":2391
+  /* "lxml/etree.pyx":2394
  *                                   object baseclass):
  *     cdef _ElementTree result
  *     result = baseclass()             # <<<<<<<<<<<<<<
@@ -70720,18 +70703,18 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
     }
   }
   if (__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2391, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2394, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else {
-    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2391, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2394, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ElementTree))))) __PYX_ERR(0, 2391, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ElementTree))))) __PYX_ERR(0, 2394, __pyx_L1_error)
   __pyx_v_result = ((struct LxmlElementTree *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2392
+  /* "lxml/etree.pyx":2395
  *     cdef _ElementTree result
  *     result = baseclass()
  *     if context_node is None and doc is not None:             # <<<<<<<<<<<<<<
@@ -70751,20 +70734,20 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":2393
+    /* "lxml/etree.pyx":2396
  *     result = baseclass()
  *     if context_node is None and doc is not None:
  *         context_node = doc.getroot()             # <<<<<<<<<<<<<<
  *     if context_node is None:
  *         _assertValidDoc(doc)
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2393, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2396, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 2393, __pyx_L1_error)
+    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 2396, __pyx_L1_error)
     __Pyx_DECREF_SET(__pyx_v_context_node, ((struct LxmlElement *)__pyx_t_1));
     __pyx_t_1 = 0;
 
-    /* "lxml/etree.pyx":2392
+    /* "lxml/etree.pyx":2395
  *     cdef _ElementTree result
  *     result = baseclass()
  *     if context_node is None and doc is not None:             # <<<<<<<<<<<<<<
@@ -70773,7 +70756,7 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
  */
   }
 
-  /* "lxml/etree.pyx":2394
+  /* "lxml/etree.pyx":2397
  *     if context_node is None and doc is not None:
  *         context_node = doc.getroot()
  *     if context_node is None:             # <<<<<<<<<<<<<<
@@ -70784,16 +70767,16 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
   __pyx_t_5 = (__pyx_t_4 != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2395
+    /* "lxml/etree.pyx":2398
  *         context_node = doc.getroot()
  *     if context_node is None:
  *         _assertValidDoc(doc)             # <<<<<<<<<<<<<<
  *         result._doc = doc
  *     else:
  */
-    __pyx_t_7 = __pyx_f_4lxml_5etree__assertValidDoc(__pyx_v_doc); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 2395, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__assertValidDoc(__pyx_v_doc); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2398, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2396
+    /* "lxml/etree.pyx":2399
  *     if context_node is None:
  *         _assertValidDoc(doc)
  *         result._doc = doc             # <<<<<<<<<<<<<<
@@ -70806,7 +70789,7 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
     __Pyx_DECREF(((PyObject *)__pyx_v_result->_doc));
     __pyx_v_result->_doc = __pyx_v_doc;
 
-    /* "lxml/etree.pyx":2394
+    /* "lxml/etree.pyx":2397
  *     if context_node is None and doc is not None:
  *         context_node = doc.getroot()
  *     if context_node is None:             # <<<<<<<<<<<<<<
@@ -70816,7 +70799,7 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
     goto __pyx_L6;
   }
 
-  /* "lxml/etree.pyx":2398
+  /* "lxml/etree.pyx":2401
  *         result._doc = doc
  *     else:
  *         _assertValidNode(context_node)             # <<<<<<<<<<<<<<
@@ -70824,11 +70807,11 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
  *     return result
  */
   /*else*/ {
-    __pyx_t_7 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_context_node); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 2398, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_context_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2401, __pyx_L1_error)
   }
   __pyx_L6:;
 
-  /* "lxml/etree.pyx":2399
+  /* "lxml/etree.pyx":2402
  *     else:
  *         _assertValidNode(context_node)
  *     result._context_node = context_node             # <<<<<<<<<<<<<<
@@ -70841,7 +70824,7 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
   __Pyx_DECREF(((PyObject *)__pyx_v_result->_context_node));
   __pyx_v_result->_context_node = __pyx_v_context_node;
 
-  /* "lxml/etree.pyx":2400
+  /* "lxml/etree.pyx":2403
  *         _assertValidNode(context_node)
  *     result._context_node = context_node
  *     return result             # <<<<<<<<<<<<<<
@@ -70853,7 +70836,7 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2388
+  /* "lxml/etree.pyx":2391
  *     return _newElementTree(doc, context_node, _ElementTree)
  * 
  * cdef _ElementTree _newElementTree(_Document doc, _Element context_node,             # <<<<<<<<<<<<<<
@@ -70876,7 +70859,7 @@ static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlD
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2409
+/* "lxml/etree.pyx":2412
  *     """
  *     cdef _Element _element
  *     def __cinit__(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -70910,7 +70893,7 @@ static int __pyx_pw_4lxml_5etree_7_Attrib_1__cinit__(PyObject *__pyx_v_self, PyO
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2409, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2412, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -70921,13 +70904,13 @@ static int __pyx_pw_4lxml_5etree_7_Attrib_1__cinit__(PyObject *__pyx_v_self, PyO
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2409, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2412, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Attrib.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 2409, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 2412, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_7_Attrib___cinit__(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self), __pyx_v_element);
 
   /* function exit code */
@@ -70945,16 +70928,16 @@ static int __pyx_pf_4lxml_5etree_7_Attrib___cinit__(struct __pyx_obj_4lxml_5etre
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "lxml/etree.pyx":2410
+  /* "lxml/etree.pyx":2413
  *     cdef _Element _element
  *     def __cinit__(self, _Element element not None):
  *         _assertValidNode(element)             # <<<<<<<<<<<<<<
  *         self._element = element
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2410, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2413, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2411
+  /* "lxml/etree.pyx":2414
  *     def __cinit__(self, _Element element not None):
  *         _assertValidNode(element)
  *         self._element = element             # <<<<<<<<<<<<<<
@@ -70967,7 +70950,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib___cinit__(struct __pyx_obj_4lxml_5etre
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_element));
   __pyx_v_self->_element = __pyx_v_element;
 
-  /* "lxml/etree.pyx":2409
+  /* "lxml/etree.pyx":2412
  *     """
  *     cdef _Element _element
  *     def __cinit__(self, _Element element not None):             # <<<<<<<<<<<<<<
@@ -70986,7 +70969,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib___cinit__(struct __pyx_obj_4lxml_5etre
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2414
+/* "lxml/etree.pyx":2417
  * 
  *     # MANIPULATORS
  *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
@@ -71014,7 +70997,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_2__setitem__(struct __pyx_obj_4lxml_5e
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("__setitem__", 0);
 
-  /* "lxml/etree.pyx":2415
+  /* "lxml/etree.pyx":2418
  *     # MANIPULATORS
  *     def __setitem__(self, key, value):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -71023,10 +71006,10 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_2__setitem__(struct __pyx_obj_4lxml_5e
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2415, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2418, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2416
+  /* "lxml/etree.pyx":2419
  *     def __setitem__(self, key, value):
  *         _assertValidNode(self._element)
  *         _setAttributeValue(self._element, key, value)             # <<<<<<<<<<<<<<
@@ -71035,10 +71018,10 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_2__setitem__(struct __pyx_obj_4lxml_5e
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__setAttributeValue(((struct LxmlElement *)__pyx_t_1), __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2416, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__setAttributeValue(((struct LxmlElement *)__pyx_t_1), __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2419, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2414
+  /* "lxml/etree.pyx":2417
  * 
  *     # MANIPULATORS
  *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
@@ -71058,7 +71041,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_2__setitem__(struct __pyx_obj_4lxml_5e
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2418
+/* "lxml/etree.pyx":2421
  *         _setAttributeValue(self._element, key, value)
  * 
  *     def __delitem__(self, key):             # <<<<<<<<<<<<<<
@@ -71086,7 +71069,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_4__delitem__(struct __pyx_obj_4lxml_5e
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("__delitem__", 0);
 
-  /* "lxml/etree.pyx":2419
+  /* "lxml/etree.pyx":2422
  * 
  *     def __delitem__(self, key):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -71095,10 +71078,10 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_4__delitem__(struct __pyx_obj_4lxml_5e
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2419, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2422, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2420
+  /* "lxml/etree.pyx":2423
  *     def __delitem__(self, key):
  *         _assertValidNode(self._element)
  *         _delAttribute(self._element, key)             # <<<<<<<<<<<<<<
@@ -71107,10 +71090,10 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_4__delitem__(struct __pyx_obj_4lxml_5e
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__delAttribute(((struct LxmlElement *)__pyx_t_1), __pyx_v_key); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2420, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__delAttribute(((struct LxmlElement *)__pyx_t_1), __pyx_v_key); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2423, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2418
+  /* "lxml/etree.pyx":2421
  *         _setAttributeValue(self._element, key, value)
  * 
  *     def __delitem__(self, key):             # <<<<<<<<<<<<<<
@@ -71130,7 +71113,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_4__delitem__(struct __pyx_obj_4lxml_5e
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2422
+/* "lxml/etree.pyx":2425
  *         _delAttribute(self._element, key)
  * 
  *     def update(self, sequence_or_dict):             # <<<<<<<<<<<<<<
@@ -71172,7 +71155,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
   __Pyx_RefNannySetupContext("update", 0);
   __Pyx_INCREF(__pyx_v_sequence_or_dict);
 
-  /* "lxml/etree.pyx":2423
+  /* "lxml/etree.pyx":2426
  * 
  *     def update(self, sequence_or_dict):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -71181,10 +71164,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2423, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2426, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2424
+  /* "lxml/etree.pyx":2427
  *     def update(self, sequence_or_dict):
  *         _assertValidNode(self._element)
  *         if isinstance(sequence_or_dict, (dict, _Attrib)):             # <<<<<<<<<<<<<<
@@ -71205,14 +71188,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
   __pyx_t_4 = (__pyx_t_3 != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":2425
+    /* "lxml/etree.pyx":2428
  *         _assertValidNode(self._element)
  *         if isinstance(sequence_or_dict, (dict, _Attrib)):
  *             sequence_or_dict = sequence_or_dict.items()             # <<<<<<<<<<<<<<
  *         for key, value in sequence_or_dict:
  *             _setAttributeValue(self._element, key, value)
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sequence_or_dict, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2425, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sequence_or_dict, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2428, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -71225,17 +71208,17 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
       }
     }
     if (__pyx_t_7) {
-      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2425, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2428, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     } else {
-      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2425, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2428, __pyx_L1_error)
     }
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF_SET(__pyx_v_sequence_or_dict, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/etree.pyx":2424
+    /* "lxml/etree.pyx":2427
  *     def update(self, sequence_or_dict):
  *         _assertValidNode(self._element)
  *         if isinstance(sequence_or_dict, (dict, _Attrib)):             # <<<<<<<<<<<<<<
@@ -71244,7 +71227,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
  */
   }
 
-  /* "lxml/etree.pyx":2426
+  /* "lxml/etree.pyx":2429
  *         if isinstance(sequence_or_dict, (dict, _Attrib)):
  *             sequence_or_dict = sequence_or_dict.items()
  *         for key, value in sequence_or_dict:             # <<<<<<<<<<<<<<
@@ -71255,26 +71238,26 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
     __pyx_t_1 = __pyx_v_sequence_or_dict; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
     __pyx_t_9 = NULL;
   } else {
-    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sequence_or_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2426, __pyx_L1_error)
+    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sequence_or_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2429, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2426, __pyx_L1_error)
+    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2429, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_9)) {
       if (likely(PyList_CheckExact(__pyx_t_1))) {
         if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2426, __pyx_L1_error)
+        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2429, __pyx_L1_error)
         #else
-        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2426, __pyx_L1_error)
+        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2429, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         #endif
       } else {
         if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2426, __pyx_L1_error)
+        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2429, __pyx_L1_error)
         #else
-        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2426, __pyx_L1_error)
+        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2429, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         #endif
       }
@@ -71283,8 +71266,8 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
       if (unlikely(!__pyx_t_6)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 2426, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 2429, __pyx_L1_error)
         }
         break;
       }
@@ -71300,7 +71283,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        __PYX_ERR(0, 2426, __pyx_L1_error)
+        __PYX_ERR(0, 2429, __pyx_L1_error)
       }
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
       if (likely(PyTuple_CheckExact(sequence))) {
@@ -71313,15 +71296,15 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
       __Pyx_INCREF(__pyx_t_7);
       __Pyx_INCREF(__pyx_t_10);
       #else
-      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2426, __pyx_L1_error)
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2429, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2426, __pyx_L1_error)
+      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2429, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_10);
       #endif
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     } else {
       Py_ssize_t index = -1;
-      __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2426, __pyx_L1_error)
+      __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2429, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_11);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -71329,7 +71312,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
       __Pyx_GOTREF(__pyx_t_7);
       index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_10);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 2426, __pyx_L1_error)
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 2429, __pyx_L1_error)
       __pyx_t_12 = NULL;
       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
       goto __pyx_L9_unpacking_done;
@@ -71337,7 +71320,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
       __pyx_t_12 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      __PYX_ERR(0, 2426, __pyx_L1_error)
+      __PYX_ERR(0, 2429, __pyx_L1_error)
       __pyx_L9_unpacking_done:;
     }
     __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_7);
@@ -71345,7 +71328,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
     __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
     __pyx_t_10 = 0;
 
-    /* "lxml/etree.pyx":2427
+    /* "lxml/etree.pyx":2430
  *             sequence_or_dict = sequence_or_dict.items()
  *         for key, value in sequence_or_dict:
  *             _setAttributeValue(self._element, key, value)             # <<<<<<<<<<<<<<
@@ -71354,10 +71337,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
  */
     __pyx_t_6 = ((PyObject *)__pyx_v_self->_element);
     __Pyx_INCREF(__pyx_t_6);
-    __pyx_t_2 = __pyx_f_4lxml_5etree__setAttributeValue(((struct LxmlElement *)__pyx_t_6), __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2427, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__setAttributeValue(((struct LxmlElement *)__pyx_t_6), __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2430, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "lxml/etree.pyx":2426
+    /* "lxml/etree.pyx":2429
  *         if isinstance(sequence_or_dict, (dict, _Attrib)):
  *             sequence_or_dict = sequence_or_dict.items()
  *         for key, value in sequence_or_dict:             # <<<<<<<<<<<<<<
@@ -71367,7 +71350,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2422
+  /* "lxml/etree.pyx":2425
  *         _delAttribute(self._element, key)
  * 
  *     def update(self, sequence_or_dict):             # <<<<<<<<<<<<<<
@@ -71395,7 +71378,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_6update(struct __pyx_obj_4lxml_5
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2429
+/* "lxml/etree.pyx":2432
  *             _setAttributeValue(self._element, key, value)
  * 
  *     def pop(self, key, *default):             # <<<<<<<<<<<<<<
@@ -71442,7 +71425,7 @@ static PyObject *__pyx_pw_4lxml_5etree_7_Attrib_9pop(PyObject *__pyx_v_self, PyO
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "pop") < 0)) __PYX_ERR(0, 2429, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "pop") < 0)) __PYX_ERR(0, 2432, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
       goto __pyx_L5_argtuple_error;
@@ -71453,7 +71436,7 @@ static PyObject *__pyx_pw_4lxml_5etree_7_Attrib_9pop(PyObject *__pyx_v_self, PyO
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("pop", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2429, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("pop", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2432, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_default); __pyx_v_default = 0;
   __Pyx_AddTraceback("lxml.etree._Attrib.pop", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -71480,43 +71463,43 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
   int __pyx_t_6;
   __Pyx_RefNannySetupContext("pop", 0);
 
-  /* "lxml/etree.pyx":2430
+  /* "lxml/etree.pyx":2433
  * 
  *     def pop(self, key, *default):
  *         if len(default) > 1:             # <<<<<<<<<<<<<<
  *             raise TypeError, u"pop expected at most 2 arguments, got %d" % (
  *                 len(default)+1)
  */
-  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_default); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2430, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_default); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2433, __pyx_L1_error)
   __pyx_t_2 = ((__pyx_t_1 > 1) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2432
+    /* "lxml/etree.pyx":2435
  *         if len(default) > 1:
  *             raise TypeError, u"pop expected at most 2 arguments, got %d" % (
  *                 len(default)+1)             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         result = _getAttributeValue(self._element, key, None)
  */
-    __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_default); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2432, __pyx_L1_error)
-    __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_1 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2432, __pyx_L1_error)
+    __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_default); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2435, __pyx_L1_error)
+    __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_1 + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2435, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
 
-    /* "lxml/etree.pyx":2431
+    /* "lxml/etree.pyx":2434
  *     def pop(self, key, *default):
  *         if len(default) > 1:
  *             raise TypeError, u"pop expected at most 2 arguments, got %d" % (             # <<<<<<<<<<<<<<
  *                 len(default)+1)
  *         _assertValidNode(self._element)
  */
-    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_pop_expected_at_most_2_arguments, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2431, __pyx_L1_error)
+    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_pop_expected_at_most_2_arguments, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2434, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_4, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(0, 2431, __pyx_L1_error)
+    __PYX_ERR(0, 2434, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2430
+    /* "lxml/etree.pyx":2433
  * 
  *     def pop(self, key, *default):
  *         if len(default) > 1:             # <<<<<<<<<<<<<<
@@ -71525,7 +71508,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
  */
   }
 
-  /* "lxml/etree.pyx":2433
+  /* "lxml/etree.pyx":2436
  *             raise TypeError, u"pop expected at most 2 arguments, got %d" % (
  *                 len(default)+1)
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -71534,10 +71517,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
  */
   __pyx_t_4 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_5 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_4)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 2433, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_4)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2436, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":2434
+  /* "lxml/etree.pyx":2437
  *                 len(default)+1)
  *         _assertValidNode(self._element)
  *         result = _getAttributeValue(self._element, key, None)             # <<<<<<<<<<<<<<
@@ -71546,13 +71529,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
  */
   __pyx_t_4 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_3 = __pyx_f_4lxml_5etree__getAttributeValue(((struct LxmlElement *)__pyx_t_4), __pyx_v_key, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2434, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__getAttributeValue(((struct LxmlElement *)__pyx_t_4), __pyx_v_key, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2437, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_v_result = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "lxml/etree.pyx":2435
+  /* "lxml/etree.pyx":2438
  *         _assertValidNode(self._element)
  *         result = _getAttributeValue(self._element, key, None)
  *         if result is None:             # <<<<<<<<<<<<<<
@@ -71563,7 +71546,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
   __pyx_t_6 = (__pyx_t_2 != 0);
   if (__pyx_t_6) {
 
-    /* "lxml/etree.pyx":2436
+    /* "lxml/etree.pyx":2439
  *         result = _getAttributeValue(self._element, key, None)
  *         if result is None:
  *             if not default:             # <<<<<<<<<<<<<<
@@ -71574,7 +71557,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
     __pyx_t_2 = ((!__pyx_t_6) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":2437
+      /* "lxml/etree.pyx":2440
  *         if result is None:
  *             if not default:
  *                 raise KeyError, key             # <<<<<<<<<<<<<<
@@ -71582,9 +71565,9 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
  *         else:
  */
       __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0, 0);
-      __PYX_ERR(0, 2437, __pyx_L1_error)
+      __PYX_ERR(0, 2440, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":2436
+      /* "lxml/etree.pyx":2439
  *         result = _getAttributeValue(self._element, key, None)
  *         if result is None:
  *             if not default:             # <<<<<<<<<<<<<<
@@ -71593,19 +71576,19 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
  */
     }
 
-    /* "lxml/etree.pyx":2438
+    /* "lxml/etree.pyx":2441
  *             if not default:
  *                 raise KeyError, key
  *             result = default[0]             # <<<<<<<<<<<<<<
  *         else:
  *             _delAttribute(self._element, key)
  */
-    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_default, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2438, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_default, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2441, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":2435
+    /* "lxml/etree.pyx":2438
  *         _assertValidNode(self._element)
  *         result = _getAttributeValue(self._element, key, None)
  *         if result is None:             # <<<<<<<<<<<<<<
@@ -71615,7 +71598,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
     goto __pyx_L4;
   }
 
-  /* "lxml/etree.pyx":2440
+  /* "lxml/etree.pyx":2443
  *             result = default[0]
  *         else:
  *             _delAttribute(self._element, key)             # <<<<<<<<<<<<<<
@@ -71625,12 +71608,12 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
   /*else*/ {
     __pyx_t_3 = ((PyObject *)__pyx_v_self->_element);
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_5 = __pyx_f_4lxml_5etree__delAttribute(((struct LxmlElement *)__pyx_t_3), __pyx_v_key); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 2440, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__delAttribute(((struct LxmlElement *)__pyx_t_3), __pyx_v_key); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2443, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   }
   __pyx_L4:;
 
-  /* "lxml/etree.pyx":2441
+  /* "lxml/etree.pyx":2444
  *         else:
  *             _delAttribute(self._element, key)
  *         return result             # <<<<<<<<<<<<<<
@@ -71642,7 +71625,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2429
+  /* "lxml/etree.pyx":2432
  *             _setAttributeValue(self._element, key, value)
  * 
  *     def pop(self, key, *default):             # <<<<<<<<<<<<<<
@@ -71663,7 +71646,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_8pop(struct __pyx_obj_4lxml_5etr
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2443
+/* "lxml/etree.pyx":2446
  *         return result
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
@@ -71695,7 +71678,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_10clear(struct __pyx_obj_4lxml_5
   int __pyx_t_4;
   __Pyx_RefNannySetupContext("clear", 0);
 
-  /* "lxml/etree.pyx":2444
+  /* "lxml/etree.pyx":2447
  * 
  *     def clear(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -71704,10 +71687,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_10clear(struct __pyx_obj_4lxml_5
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2444, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2447, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2445
+  /* "lxml/etree.pyx":2448
  *     def clear(self):
  *         _assertValidNode(self._element)
  *         cdef xmlNode* c_node = self._element._c_node             # <<<<<<<<<<<<<<
@@ -71717,7 +71700,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_10clear(struct __pyx_obj_4lxml_5
   __pyx_t_3 = __pyx_v_self->_element->_c_node;
   __pyx_v_c_node = __pyx_t_3;
 
-  /* "lxml/etree.pyx":2446
+  /* "lxml/etree.pyx":2449
  *         _assertValidNode(self._element)
  *         cdef xmlNode* c_node = self._element._c_node
  *         while c_node.properties is not NULL:             # <<<<<<<<<<<<<<
@@ -71728,7 +71711,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_10clear(struct __pyx_obj_4lxml_5
     __pyx_t_4 = ((__pyx_v_c_node->properties != NULL) != 0);
     if (!__pyx_t_4) break;
 
-    /* "lxml/etree.pyx":2447
+    /* "lxml/etree.pyx":2450
  *         cdef xmlNode* c_node = self._element._c_node
  *         while c_node.properties is not NULL:
  *             tree.xmlRemoveProp(c_node.properties)             # <<<<<<<<<<<<<<
@@ -71738,7 +71721,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_10clear(struct __pyx_obj_4lxml_5
     xmlRemoveProp(__pyx_v_c_node->properties);
   }
 
-  /* "lxml/etree.pyx":2443
+  /* "lxml/etree.pyx":2446
  *         return result
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
@@ -71759,7 +71742,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_10clear(struct __pyx_obj_4lxml_5
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2450
+/* "lxml/etree.pyx":2453
  * 
  *     # ACCESSORS
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -71788,7 +71771,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_12__repr__(struct __pyx_obj_4lxm
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "lxml/etree.pyx":2451
+  /* "lxml/etree.pyx":2454
  *     # ACCESSORS
  *     def __repr__(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -71797,10 +71780,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_12__repr__(struct __pyx_obj_4lxm
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2451, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2454, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2452
+  /* "lxml/etree.pyx":2455
  *     def __repr__(self):
  *         _assertValidNode(self._element)
  *         return repr(dict( _collectAttributes(self._element._c_node, 3) ))             # <<<<<<<<<<<<<<
@@ -71808,24 +71791,24 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_12__repr__(struct __pyx_obj_4lxm
  *     def __copy__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2452, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2455, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2452, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2455, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2452, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2455, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2452, __pyx_L1_error)
+  __pyx_t_3 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2455, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2450
+  /* "lxml/etree.pyx":2453
  * 
  *     # ACCESSORS
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -71845,7 +71828,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_12__repr__(struct __pyx_obj_4lxm
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2454
+/* "lxml/etree.pyx":2457
  *         return repr(dict( _collectAttributes(self._element._c_node, 3) ))
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
@@ -71875,7 +71858,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_14__copy__(struct __pyx_obj_4lxm
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__copy__", 0);
 
-  /* "lxml/etree.pyx":2455
+  /* "lxml/etree.pyx":2458
  * 
  *     def __copy__(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -71884,10 +71867,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_14__copy__(struct __pyx_obj_4lxm
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2455, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2458, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2456
+  /* "lxml/etree.pyx":2459
  *     def __copy__(self):
  *         _assertValidNode(self._element)
  *         return dict(_collectAttributes(self._element._c_node, 3))             # <<<<<<<<<<<<<<
@@ -71895,21 +71878,21 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_14__copy__(struct __pyx_obj_4lxm
  *     def __deepcopy__(self, memo):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2456, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2459, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2456, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2459, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2456, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2459, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2454
+  /* "lxml/etree.pyx":2457
  *         return repr(dict( _collectAttributes(self._element._c_node, 3) ))
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
@@ -71929,7 +71912,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_14__copy__(struct __pyx_obj_4lxm
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2458
+/* "lxml/etree.pyx":2461
  *         return dict(_collectAttributes(self._element._c_node, 3))
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
@@ -71959,7 +71942,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_16__deepcopy__(struct __pyx_obj_
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__deepcopy__", 0);
 
-  /* "lxml/etree.pyx":2459
+  /* "lxml/etree.pyx":2462
  * 
  *     def __deepcopy__(self, memo):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -71968,10 +71951,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_16__deepcopy__(struct __pyx_obj_
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2459, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2462, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2460
+  /* "lxml/etree.pyx":2463
  *     def __deepcopy__(self, memo):
  *         _assertValidNode(self._element)
  *         return dict(_collectAttributes(self._element._c_node, 3))             # <<<<<<<<<<<<<<
@@ -71979,21 +71962,21 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_16__deepcopy__(struct __pyx_obj_
  *     def __getitem__(self, key):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2460, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2463, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2460, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2463, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2460, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2463, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2458
+  /* "lxml/etree.pyx":2461
  *         return dict(_collectAttributes(self._element._c_node, 3))
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
@@ -72013,7 +71996,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_16__deepcopy__(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2462
+/* "lxml/etree.pyx":2465
  *         return dict(_collectAttributes(self._element._c_node, 3))
  * 
  *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
@@ -72045,7 +72028,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_18__getitem__(struct __pyx_obj_4
   int __pyx_t_5;
   __Pyx_RefNannySetupContext("__getitem__", 0);
 
-  /* "lxml/etree.pyx":2463
+  /* "lxml/etree.pyx":2466
  * 
  *     def __getitem__(self, key):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -72054,10 +72037,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_18__getitem__(struct __pyx_obj_4
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2463, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2466, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2464
+  /* "lxml/etree.pyx":2467
  *     def __getitem__(self, key):
  *         _assertValidNode(self._element)
  *         result = _getAttributeValue(self._element, key, None)             # <<<<<<<<<<<<<<
@@ -72066,13 +72049,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_18__getitem__(struct __pyx_obj_4
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_3 = __pyx_f_4lxml_5etree__getAttributeValue(((struct LxmlElement *)__pyx_t_1), __pyx_v_key, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2464, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__getAttributeValue(((struct LxmlElement *)__pyx_t_1), __pyx_v_key, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2467, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_result = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "lxml/etree.pyx":2465
+  /* "lxml/etree.pyx":2468
  *         _assertValidNode(self._element)
  *         result = _getAttributeValue(self._element, key, None)
  *         if result is None:             # <<<<<<<<<<<<<<
@@ -72083,7 +72066,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_18__getitem__(struct __pyx_obj_4
   __pyx_t_5 = (__pyx_t_4 != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":2466
+    /* "lxml/etree.pyx":2469
  *         result = _getAttributeValue(self._element, key, None)
  *         if result is None:
  *             raise KeyError, key             # <<<<<<<<<<<<<<
@@ -72091,9 +72074,9 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_18__getitem__(struct __pyx_obj_4
  * 
  */
     __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0, 0);
-    __PYX_ERR(0, 2466, __pyx_L1_error)
+    __PYX_ERR(0, 2469, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2465
+    /* "lxml/etree.pyx":2468
  *         _assertValidNode(self._element)
  *         result = _getAttributeValue(self._element, key, None)
  *         if result is None:             # <<<<<<<<<<<<<<
@@ -72102,7 +72085,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_18__getitem__(struct __pyx_obj_4
  */
   }
 
-  /* "lxml/etree.pyx":2467
+  /* "lxml/etree.pyx":2470
  *         if result is None:
  *             raise KeyError, key
  *         return result             # <<<<<<<<<<<<<<
@@ -72114,7 +72097,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_18__getitem__(struct __pyx_obj_4
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2462
+  /* "lxml/etree.pyx":2465
  *         return dict(_collectAttributes(self._element._c_node, 3))
  * 
  *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
@@ -72135,7 +72118,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_18__getitem__(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2469
+/* "lxml/etree.pyx":2472
  *         return result
  * 
  *     def __bool__(self):             # <<<<<<<<<<<<<<
@@ -72166,7 +72149,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_20__bool__(struct __pyx_obj_4lxml_5etr
   int __pyx_t_4;
   __Pyx_RefNannySetupContext("__bool__", 0);
 
-  /* "lxml/etree.pyx":2470
+  /* "lxml/etree.pyx":2473
  * 
  *     def __bool__(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -72175,10 +72158,10 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_20__bool__(struct __pyx_obj_4lxml_5etr
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2470, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2473, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2471
+  /* "lxml/etree.pyx":2474
  *     def __bool__(self):
  *         _assertValidNode(self._element)
  *         cdef xmlAttr* c_attr = self._element._c_node.properties             # <<<<<<<<<<<<<<
@@ -72188,7 +72171,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_20__bool__(struct __pyx_obj_4lxml_5etr
   __pyx_t_3 = __pyx_v_self->_element->_c_node->properties;
   __pyx_v_c_attr = __pyx_t_3;
 
-  /* "lxml/etree.pyx":2472
+  /* "lxml/etree.pyx":2475
  *         _assertValidNode(self._element)
  *         cdef xmlAttr* c_attr = self._element._c_node.properties
  *         while c_attr is not NULL:             # <<<<<<<<<<<<<<
@@ -72199,7 +72182,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_20__bool__(struct __pyx_obj_4lxml_5etr
     __pyx_t_4 = ((__pyx_v_c_attr != NULL) != 0);
     if (!__pyx_t_4) break;
 
-    /* "lxml/etree.pyx":2473
+    /* "lxml/etree.pyx":2476
  *         cdef xmlAttr* c_attr = self._element._c_node.properties
  *         while c_attr is not NULL:
  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
@@ -72209,7 +72192,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_20__bool__(struct __pyx_obj_4lxml_5etr
     __pyx_t_4 = ((__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE) != 0);
     if (__pyx_t_4) {
 
-      /* "lxml/etree.pyx":2474
+      /* "lxml/etree.pyx":2477
  *         while c_attr is not NULL:
  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
  *                 return 1             # <<<<<<<<<<<<<<
@@ -72219,7 +72202,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_20__bool__(struct __pyx_obj_4lxml_5etr
       __pyx_r = 1;
       goto __pyx_L0;
 
-      /* "lxml/etree.pyx":2473
+      /* "lxml/etree.pyx":2476
  *         cdef xmlAttr* c_attr = self._element._c_node.properties
  *         while c_attr is not NULL:
  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
@@ -72228,7 +72211,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_20__bool__(struct __pyx_obj_4lxml_5etr
  */
     }
 
-    /* "lxml/etree.pyx":2475
+    /* "lxml/etree.pyx":2478
  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
  *                 return 1
  *             c_attr = c_attr.next             # <<<<<<<<<<<<<<
@@ -72239,7 +72222,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_20__bool__(struct __pyx_obj_4lxml_5etr
     __pyx_v_c_attr = __pyx_t_3;
   }
 
-  /* "lxml/etree.pyx":2476
+  /* "lxml/etree.pyx":2479
  *                 return 1
  *             c_attr = c_attr.next
  *         return 0             # <<<<<<<<<<<<<<
@@ -72249,7 +72232,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_20__bool__(struct __pyx_obj_4lxml_5etr
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2469
+  /* "lxml/etree.pyx":2472
  *         return result
  * 
  *     def __bool__(self):             # <<<<<<<<<<<<<<
@@ -72267,7 +72250,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_20__bool__(struct __pyx_obj_4lxml_5etr
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2478
+/* "lxml/etree.pyx":2481
  *         return 0
  * 
  *     def __len__(self):             # <<<<<<<<<<<<<<
@@ -72299,7 +72282,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
   int __pyx_t_4;
   __Pyx_RefNannySetupContext("__len__", 0);
 
-  /* "lxml/etree.pyx":2479
+  /* "lxml/etree.pyx":2482
  * 
  *     def __len__(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -72308,10 +72291,10 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2479, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2482, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2480
+  /* "lxml/etree.pyx":2483
  *     def __len__(self):
  *         _assertValidNode(self._element)
  *         cdef xmlAttr* c_attr = self._element._c_node.properties             # <<<<<<<<<<<<<<
@@ -72321,7 +72304,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
   __pyx_t_3 = __pyx_v_self->_element->_c_node->properties;
   __pyx_v_c_attr = __pyx_t_3;
 
-  /* "lxml/etree.pyx":2481
+  /* "lxml/etree.pyx":2484
  *         _assertValidNode(self._element)
  *         cdef xmlAttr* c_attr = self._element._c_node.properties
  *         cdef Py_ssize_t c = 0             # <<<<<<<<<<<<<<
@@ -72330,7 +72313,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
  */
   __pyx_v_c = 0;
 
-  /* "lxml/etree.pyx":2482
+  /* "lxml/etree.pyx":2485
  *         cdef xmlAttr* c_attr = self._element._c_node.properties
  *         cdef Py_ssize_t c = 0
  *         while c_attr is not NULL:             # <<<<<<<<<<<<<<
@@ -72341,7 +72324,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
     __pyx_t_4 = ((__pyx_v_c_attr != NULL) != 0);
     if (!__pyx_t_4) break;
 
-    /* "lxml/etree.pyx":2483
+    /* "lxml/etree.pyx":2486
  *         cdef Py_ssize_t c = 0
  *         while c_attr is not NULL:
  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
@@ -72351,7 +72334,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
     __pyx_t_4 = ((__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE) != 0);
     if (__pyx_t_4) {
 
-      /* "lxml/etree.pyx":2484
+      /* "lxml/etree.pyx":2487
  *         while c_attr is not NULL:
  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
  *                 c += 1             # <<<<<<<<<<<<<<
@@ -72360,7 +72343,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
  */
       __pyx_v_c = (__pyx_v_c + 1);
 
-      /* "lxml/etree.pyx":2483
+      /* "lxml/etree.pyx":2486
  *         cdef Py_ssize_t c = 0
  *         while c_attr is not NULL:
  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
@@ -72369,7 +72352,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
  */
     }
 
-    /* "lxml/etree.pyx":2485
+    /* "lxml/etree.pyx":2488
  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
  *                 c += 1
  *             c_attr = c_attr.next             # <<<<<<<<<<<<<<
@@ -72380,7 +72363,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
     __pyx_v_c_attr = __pyx_t_3;
   }
 
-  /* "lxml/etree.pyx":2486
+  /* "lxml/etree.pyx":2489
  *                 c += 1
  *             c_attr = c_attr.next
  *         return c             # <<<<<<<<<<<<<<
@@ -72390,7 +72373,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
   __pyx_r = __pyx_v_c;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2478
+  /* "lxml/etree.pyx":2481
  *         return 0
  * 
  *     def __len__(self):             # <<<<<<<<<<<<<<
@@ -72408,7 +72391,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib_22__len__(struct __pyx_obj_4lxm
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2488
+/* "lxml/etree.pyx":2491
  *         return c
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
@@ -72453,7 +72436,7 @@ static PyObject *__pyx_pw_4lxml_5etree_7_Attrib_25get(PyObject *__pyx_v_self, Py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 2488, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 2491, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -72469,7 +72452,7 @@ static PyObject *__pyx_pw_4lxml_5etree_7_Attrib_25get(PyObject *__pyx_v_self, Py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2488, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2491, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Attrib.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -72490,7 +72473,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_24get(struct __pyx_obj_4lxml_5et
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("get", 0);
 
-  /* "lxml/etree.pyx":2489
+  /* "lxml/etree.pyx":2492
  * 
  *     def get(self, key, default=None):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -72499,10 +72482,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_24get(struct __pyx_obj_4lxml_5et
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2489, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2492, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2490
+  /* "lxml/etree.pyx":2493
  *     def get(self, key, default=None):
  *         _assertValidNode(self._element)
  *         return _getAttributeValue(self._element, key, default)             # <<<<<<<<<<<<<<
@@ -72512,14 +72495,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_24get(struct __pyx_obj_4lxml_5et
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_3 = __pyx_f_4lxml_5etree__getAttributeValue(((struct LxmlElement *)__pyx_t_1), __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2490, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__getAttributeValue(((struct LxmlElement *)__pyx_t_1), __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2493, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2488
+  /* "lxml/etree.pyx":2491
  *         return c
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
@@ -72539,7 +72522,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_24get(struct __pyx_obj_4lxml_5et
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2492
+/* "lxml/etree.pyx":2495
  *         return _getAttributeValue(self._element, key, default)
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
@@ -72568,7 +72551,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_26keys(struct __pyx_obj_4lxml_5e
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("keys", 0);
 
-  /* "lxml/etree.pyx":2493
+  /* "lxml/etree.pyx":2496
  * 
  *     def keys(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -72577,10 +72560,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_26keys(struct __pyx_obj_4lxml_5e
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2493, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2496, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2494
+  /* "lxml/etree.pyx":2497
  *     def keys(self):
  *         _assertValidNode(self._element)
  *         return _collectAttributes(self._element._c_node, 1)             # <<<<<<<<<<<<<<
@@ -72588,13 +72571,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_26keys(struct __pyx_obj_4lxml_5e
  *     def __iter__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2494, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2497, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2492
+  /* "lxml/etree.pyx":2495
  *         return _getAttributeValue(self._element, key, default)
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
@@ -72613,7 +72596,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_26keys(struct __pyx_obj_4lxml_5e
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2496
+/* "lxml/etree.pyx":2499
  *         return _collectAttributes(self._element._c_node, 1)
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -72642,7 +72625,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_28__iter__(struct __pyx_obj_4lxm
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "lxml/etree.pyx":2497
+  /* "lxml/etree.pyx":2500
  * 
  *     def __iter__(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -72651,10 +72634,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_28__iter__(struct __pyx_obj_4lxm
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2497, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2500, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2498
+  /* "lxml/etree.pyx":2501
  *     def __iter__(self):
  *         _assertValidNode(self._element)
  *         return iter(_collectAttributes(self._element._c_node, 1))             # <<<<<<<<<<<<<<
@@ -72662,16 +72645,16 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_28__iter__(struct __pyx_obj_4lxm
  *     def iterkeys(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2501, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error)
+  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2501, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2496
+  /* "lxml/etree.pyx":2499
  *         return _collectAttributes(self._element._c_node, 1)
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -72691,7 +72674,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_28__iter__(struct __pyx_obj_4lxm
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2500
+/* "lxml/etree.pyx":2503
  *         return iter(_collectAttributes(self._element._c_node, 1))
  * 
  *     def iterkeys(self):             # <<<<<<<<<<<<<<
@@ -72721,7 +72704,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_30iterkeys(struct __pyx_obj_4lxm
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("iterkeys", 0);
 
-  /* "lxml/etree.pyx":2501
+  /* "lxml/etree.pyx":2504
  * 
  *     def iterkeys(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -72730,10 +72713,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_30iterkeys(struct __pyx_obj_4lxm
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2501, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2504, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2502
+  /* "lxml/etree.pyx":2505
  *     def iterkeys(self):
  *         _assertValidNode(self._element)
  *         return iter(_collectAttributes(self._element._c_node, 1))             # <<<<<<<<<<<<<<
@@ -72741,16 +72724,16 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_30iterkeys(struct __pyx_obj_4lxm
  *     def values(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2502, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2502, __pyx_L1_error)
+  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2500
+  /* "lxml/etree.pyx":2503
  *         return iter(_collectAttributes(self._element._c_node, 1))
  * 
  *     def iterkeys(self):             # <<<<<<<<<<<<<<
@@ -72770,7 +72753,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_30iterkeys(struct __pyx_obj_4lxm
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2504
+/* "lxml/etree.pyx":2507
  *         return iter(_collectAttributes(self._element._c_node, 1))
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
@@ -72799,7 +72782,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_32values(struct __pyx_obj_4lxml_
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("values", 0);
 
-  /* "lxml/etree.pyx":2505
+  /* "lxml/etree.pyx":2508
  * 
  *     def values(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -72808,10 +72791,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_32values(struct __pyx_obj_4lxml_
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2505, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2508, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2506
+  /* "lxml/etree.pyx":2509
  *     def values(self):
  *         _assertValidNode(self._element)
  *         return _collectAttributes(self._element._c_node, 2)             # <<<<<<<<<<<<<<
@@ -72819,13 +72802,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_32values(struct __pyx_obj_4lxml_
  *     def itervalues(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2506, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2509, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2504
+  /* "lxml/etree.pyx":2507
  *         return iter(_collectAttributes(self._element._c_node, 1))
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
@@ -72844,7 +72827,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_32values(struct __pyx_obj_4lxml_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2508
+/* "lxml/etree.pyx":2511
  *         return _collectAttributes(self._element._c_node, 2)
  * 
  *     def itervalues(self):             # <<<<<<<<<<<<<<
@@ -72874,7 +72857,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_34itervalues(struct __pyx_obj_4l
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("itervalues", 0);
 
-  /* "lxml/etree.pyx":2509
+  /* "lxml/etree.pyx":2512
  * 
  *     def itervalues(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -72883,10 +72866,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_34itervalues(struct __pyx_obj_4l
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2509, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2512, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2510
+  /* "lxml/etree.pyx":2513
  *     def itervalues(self):
  *         _assertValidNode(self._element)
  *         return iter(_collectAttributes(self._element._c_node, 2))             # <<<<<<<<<<<<<<
@@ -72894,16 +72877,16 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_34itervalues(struct __pyx_obj_4l
  *     def items(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2510, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2513, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2510, __pyx_L1_error)
+  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2513, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2508
+  /* "lxml/etree.pyx":2511
  *         return _collectAttributes(self._element._c_node, 2)
  * 
  *     def itervalues(self):             # <<<<<<<<<<<<<<
@@ -72923,7 +72906,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_34itervalues(struct __pyx_obj_4l
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2512
+/* "lxml/etree.pyx":2515
  *         return iter(_collectAttributes(self._element._c_node, 2))
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
@@ -72952,7 +72935,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_36items(struct __pyx_obj_4lxml_5
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("items", 0);
 
-  /* "lxml/etree.pyx":2513
+  /* "lxml/etree.pyx":2516
  * 
  *     def items(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -72961,10 +72944,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_36items(struct __pyx_obj_4lxml_5
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2513, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2516, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2514
+  /* "lxml/etree.pyx":2517
  *     def items(self):
  *         _assertValidNode(self._element)
  *         return _collectAttributes(self._element._c_node, 3)             # <<<<<<<<<<<<<<
@@ -72972,13 +72955,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_36items(struct __pyx_obj_4lxml_5
  *     def iteritems(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2514, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2512
+  /* "lxml/etree.pyx":2515
  *         return iter(_collectAttributes(self._element._c_node, 2))
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
@@ -72997,7 +72980,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_36items(struct __pyx_obj_4lxml_5
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2516
+/* "lxml/etree.pyx":2519
  *         return _collectAttributes(self._element._c_node, 3)
  * 
  *     def iteritems(self):             # <<<<<<<<<<<<<<
@@ -73027,7 +73010,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_38iteritems(struct __pyx_obj_4lx
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("iteritems", 0);
 
-  /* "lxml/etree.pyx":2517
+  /* "lxml/etree.pyx":2520
  * 
  *     def iteritems(self):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -73036,10 +73019,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_38iteritems(struct __pyx_obj_4lx
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2517, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2520, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2518
+  /* "lxml/etree.pyx":2521
  *     def iteritems(self):
  *         _assertValidNode(self._element)
  *         return iter(_collectAttributes(self._element._c_node, 3))             # <<<<<<<<<<<<<<
@@ -73047,16 +73030,16 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_38iteritems(struct __pyx_obj_4lx
  *     def has_key(self, key):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2518, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2521, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2518, __pyx_L1_error)
+  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2521, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2516
+  /* "lxml/etree.pyx":2519
  *         return _collectAttributes(self._element._c_node, 3)
  * 
  *     def iteritems(self):             # <<<<<<<<<<<<<<
@@ -73076,7 +73059,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_38iteritems(struct __pyx_obj_4lx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2520
+/* "lxml/etree.pyx":2523
  *         return iter(_collectAttributes(self._element._c_node, 3))
  * 
  *     def has_key(self, key):             # <<<<<<<<<<<<<<
@@ -73106,7 +73089,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_40has_key(struct __pyx_obj_4lxml
   int __pyx_t_3;
   __Pyx_RefNannySetupContext("has_key", 0);
 
-  /* "lxml/etree.pyx":2521
+  /* "lxml/etree.pyx":2524
  * 
  *     def has_key(self, key):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -73115,10 +73098,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_40has_key(struct __pyx_obj_4lxml
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2521, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2524, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2522
+  /* "lxml/etree.pyx":2525
  *     def has_key(self, key):
  *         _assertValidNode(self._element)
  *         return key in self             # <<<<<<<<<<<<<<
@@ -73126,14 +73109,14 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_40has_key(struct __pyx_obj_4lxml
  *     def __contains__(self, key):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, ((PyObject *)__pyx_v_self), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2522, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2522, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, ((PyObject *)__pyx_v_self), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2525, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2525, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2520
+  /* "lxml/etree.pyx":2523
  *         return iter(_collectAttributes(self._element._c_node, 3))
  * 
  *     def has_key(self, key):             # <<<<<<<<<<<<<<
@@ -73152,7 +73135,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_40has_key(struct __pyx_obj_4lxml
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2524
+/* "lxml/etree.pyx":2527
  *         return key in self
  * 
  *     def __contains__(self, key):             # <<<<<<<<<<<<<<
@@ -73189,7 +73172,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_42__contains__(struct __pyx_obj_4lxml_
   int __pyx_t_7;
   __Pyx_RefNannySetupContext("__contains__", 0);
 
-  /* "lxml/etree.pyx":2525
+  /* "lxml/etree.pyx":2528
  * 
  *     def __contains__(self, key):
  *         _assertValidNode(self._element)             # <<<<<<<<<<<<<<
@@ -73198,17 +73181,17 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_42__contains__(struct __pyx_obj_4lxml_
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_element);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2525, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2528, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2527
+  /* "lxml/etree.pyx":2530
  *         _assertValidNode(self._element)
  *         cdef xmlNode* c_node
  *         ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<<
  *         c_node = self._element._c_node
  *         c_href = <const_xmlChar*>NULL if ns is None else _xcstr(ns)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2527, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2530, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (likely(__pyx_t_1 != Py_None)) {
     PyObject* sequence = __pyx_t_1;
@@ -73220,7 +73203,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_42__contains__(struct __pyx_obj_4lxml_
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 2527, __pyx_L1_error)
+      __PYX_ERR(0, 2530, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
@@ -73228,21 +73211,21 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_42__contains__(struct __pyx_obj_4lxml_
     __Pyx_INCREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_t_4);
     #else
-    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2527, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2530, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2527, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2530, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 2527, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 2530, __pyx_L1_error)
   }
   __pyx_v_ns = __pyx_t_3;
   __pyx_t_3 = 0;
   __pyx_v_tag = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":2528
+  /* "lxml/etree.pyx":2531
  *         cdef xmlNode* c_node
  *         ns, tag = _getNsTag(key)
  *         c_node = self._element._c_node             # <<<<<<<<<<<<<<
@@ -73252,7 +73235,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_42__contains__(struct __pyx_obj_4lxml_
   __pyx_t_5 = __pyx_v_self->_element->_c_node;
   __pyx_v_c_node = __pyx_t_5;
 
-  /* "lxml/etree.pyx":2529
+  /* "lxml/etree.pyx":2532
  *         ns, tag = _getNsTag(key)
  *         c_node = self._element._c_node
  *         c_href = <const_xmlChar*>NULL if ns is None else _xcstr(ns)             # <<<<<<<<<<<<<<
@@ -73267,7 +73250,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_42__contains__(struct __pyx_obj_4lxml_
   }
   __pyx_v_c_href = __pyx_t_6;
 
-  /* "lxml/etree.pyx":2530
+  /* "lxml/etree.pyx":2533
  *         c_node = self._element._c_node
  *         c_href = <const_xmlChar*>NULL if ns is None else _xcstr(ns)
  *         return 1 if tree.xmlHasNsProp(c_node, _xcstr(tag), c_href) else 0             # <<<<<<<<<<<<<<
@@ -73282,7 +73265,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_42__contains__(struct __pyx_obj_4lxml_
   __pyx_r = __pyx_t_2;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2524
+  /* "lxml/etree.pyx":2527
  *         return key in self
  * 
  *     def __contains__(self, key):             # <<<<<<<<<<<<<<
@@ -73304,7 +73287,7 @@ static int __pyx_pf_4lxml_5etree_7_Attrib_42__contains__(struct __pyx_obj_4lxml_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2532
+/* "lxml/etree.pyx":2535
  *         return 1 if tree.xmlHasNsProp(c_node, _xcstr(tag), c_href) else 0
  * 
  *     def __richcmp__(one, other, int op):             # <<<<<<<<<<<<<<
@@ -73341,7 +73324,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
   __Pyx_INCREF(__pyx_v_one);
   __Pyx_INCREF(__pyx_v_other);
 
-  /* "lxml/etree.pyx":2533
+  /* "lxml/etree.pyx":2536
  * 
  *     def __richcmp__(one, other, int op):
  *         try:             # <<<<<<<<<<<<<<
@@ -73357,7 +73340,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
     __Pyx_XGOTREF(__pyx_t_3);
     /*try:*/ {
 
-      /* "lxml/etree.pyx":2534
+      /* "lxml/etree.pyx":2537
  *     def __richcmp__(one, other, int op):
  *         try:
  *             if not isinstance(one, dict):             # <<<<<<<<<<<<<<
@@ -73368,25 +73351,25 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
       __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
       if (__pyx_t_5) {
 
-        /* "lxml/etree.pyx":2535
+        /* "lxml/etree.pyx":2538
  *         try:
  *             if not isinstance(one, dict):
  *                 one = dict(one)             # <<<<<<<<<<<<<<
  *             if not isinstance(other, dict):
  *                 other = dict(other)
  */
-        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2535, __pyx_L3_error)
+        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2538, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_INCREF(__pyx_v_one);
         __Pyx_GIVEREF(__pyx_v_one);
         PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_one);
-        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2535, __pyx_L3_error)
+        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2538, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_DECREF_SET(__pyx_v_one, __pyx_t_7);
         __pyx_t_7 = 0;
 
-        /* "lxml/etree.pyx":2534
+        /* "lxml/etree.pyx":2537
  *     def __richcmp__(one, other, int op):
  *         try:
  *             if not isinstance(one, dict):             # <<<<<<<<<<<<<<
@@ -73395,7 +73378,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
  */
       }
 
-      /* "lxml/etree.pyx":2536
+      /* "lxml/etree.pyx":2539
  *             if not isinstance(one, dict):
  *                 one = dict(one)
  *             if not isinstance(other, dict):             # <<<<<<<<<<<<<<
@@ -73406,25 +73389,25 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
       __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0);
       if (__pyx_t_4) {
 
-        /* "lxml/etree.pyx":2537
+        /* "lxml/etree.pyx":2540
  *                 one = dict(one)
  *             if not isinstance(other, dict):
  *                 other = dict(other)             # <<<<<<<<<<<<<<
  *         except (TypeError, ValueError):
  *             return NotImplemented
  */
-        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2537, __pyx_L3_error)
+        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2540, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_INCREF(__pyx_v_other);
         __Pyx_GIVEREF(__pyx_v_other);
         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_other);
-        __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2537, __pyx_L3_error)
+        __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2540, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_6);
         __pyx_t_6 = 0;
 
-        /* "lxml/etree.pyx":2536
+        /* "lxml/etree.pyx":2539
  *             if not isinstance(one, dict):
  *                 one = dict(one)
  *             if not isinstance(other, dict):             # <<<<<<<<<<<<<<
@@ -73433,7 +73416,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
  */
       }
 
-      /* "lxml/etree.pyx":2533
+      /* "lxml/etree.pyx":2536
  * 
  *     def __richcmp__(one, other, int op):
  *         try:             # <<<<<<<<<<<<<<
@@ -73446,11 +73429,10 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "lxml/etree.pyx":2538
+    /* "lxml/etree.pyx":2541
  *             if not isinstance(other, dict):
  *                 other = dict(other)
  *         except (TypeError, ValueError):             # <<<<<<<<<<<<<<
@@ -73460,12 +73442,12 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
     __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
     if (__pyx_t_8) {
       __Pyx_AddTraceback("lxml.etree._Attrib.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 2538, __pyx_L5_except_error)
+      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 2541, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GOTREF(__pyx_t_9);
 
-      /* "lxml/etree.pyx":2539
+      /* "lxml/etree.pyx":2542
  *                 other = dict(other)
  *         except (TypeError, ValueError):
  *             return NotImplemented             # <<<<<<<<<<<<<<
@@ -73483,21 +73465,19 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
     goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
 
-    /* "lxml/etree.pyx":2533
+    /* "lxml/etree.pyx":2536
  * 
  *     def __richcmp__(one, other, int op):
  *         try:             # <<<<<<<<<<<<<<
  *             if not isinstance(one, dict):
  *                 one = dict(one)
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L6_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -73506,7 +73486,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
     __pyx_L8_try_end:;
   }
 
-  /* "lxml/etree.pyx":2540
+  /* "lxml/etree.pyx":2543
  *         except (TypeError, ValueError):
  *             return NotImplemented
  *         return python.PyObject_RichCompare(one, other, op)             # <<<<<<<<<<<<<<
@@ -73514,13 +73494,13 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_9 = PyObject_RichCompare(__pyx_v_one, __pyx_v_other, __pyx_v_op); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2540, __pyx_L1_error)
+  __pyx_t_9 = PyObject_RichCompare(__pyx_v_one, __pyx_v_other, __pyx_v_op); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2543, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __pyx_r = __pyx_t_9;
   __pyx_t_9 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2532
+  /* "lxml/etree.pyx":2535
  *         return 1 if tree.xmlHasNsProp(c_node, _xcstr(tag), c_href) else 0
  * 
  *     def __richcmp__(one, other, int op):             # <<<<<<<<<<<<<<
@@ -73543,7 +73523,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_44__richcmp__(PyObject *__pyx_v_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2552
+/* "lxml/etree.pyx":2555
  *     cdef xmlAttr* _c_attr
  *     cdef int _keysvalues # 1 - keys, 2 - values, 3 - items (key, value)
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -73569,7 +73549,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___iter__(struct __pyx_o
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "lxml/etree.pyx":2553
+  /* "lxml/etree.pyx":2556
  *     cdef int _keysvalues # 1 - keys, 2 - values, 3 - items (key, value)
  *     def __iter__(self):
  *         return self             # <<<<<<<<<<<<<<
@@ -73581,7 +73561,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___iter__(struct __pyx_o
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2552
+  /* "lxml/etree.pyx":2555
  *     cdef xmlAttr* _c_attr
  *     cdef int _keysvalues # 1 - keys, 2 - values, 3 - items (key, value)
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -73596,7 +73576,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___iter__(struct __pyx_o
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2555
+/* "lxml/etree.pyx":2558
  *         return self
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -73629,7 +73609,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
   PyObject *__pyx_t_6 = NULL;
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "lxml/etree.pyx":2557
+  /* "lxml/etree.pyx":2560
  *     def __next__(self):
  *         cdef xmlAttr* c_attr
  *         if self._node is None:             # <<<<<<<<<<<<<<
@@ -73640,7 +73620,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2558
+    /* "lxml/etree.pyx":2561
  *         cdef xmlAttr* c_attr
  *         if self._node is None:
  *             raise StopIteration             # <<<<<<<<<<<<<<
@@ -73648,9 +73628,9 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
  *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    __PYX_ERR(0, 2558, __pyx_L1_error)
+    __PYX_ERR(0, 2561, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2557
+    /* "lxml/etree.pyx":2560
  *     def __next__(self):
  *         cdef xmlAttr* c_attr
  *         if self._node is None:             # <<<<<<<<<<<<<<
@@ -73659,7 +73639,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
  */
   }
 
-  /* "lxml/etree.pyx":2559
+  /* "lxml/etree.pyx":2562
  *         if self._node is None:
  *             raise StopIteration
  *         c_attr = self._c_attr             # <<<<<<<<<<<<<<
@@ -73669,7 +73649,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
   __pyx_t_3 = __pyx_v_self->_c_attr;
   __pyx_v_c_attr = __pyx_t_3;
 
-  /* "lxml/etree.pyx":2560
+  /* "lxml/etree.pyx":2563
  *             raise StopIteration
  *         c_attr = self._c_attr
  *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
@@ -73688,7 +73668,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
     __pyx_L6_bool_binop_done:;
     if (!__pyx_t_2) break;
 
-    /* "lxml/etree.pyx":2561
+    /* "lxml/etree.pyx":2564
  *         c_attr = self._c_attr
  *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
  *             c_attr = c_attr.next             # <<<<<<<<<<<<<<
@@ -73699,7 +73679,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
     __pyx_v_c_attr = __pyx_t_3;
   }
 
-  /* "lxml/etree.pyx":2562
+  /* "lxml/etree.pyx":2565
  *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
  *             c_attr = c_attr.next
  *         if c_attr is NULL:             # <<<<<<<<<<<<<<
@@ -73709,7 +73689,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
   __pyx_t_2 = ((__pyx_v_c_attr == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2563
+    /* "lxml/etree.pyx":2566
  *             c_attr = c_attr.next
  *         if c_attr is NULL:
  *             self._node = None             # <<<<<<<<<<<<<<
@@ -73722,7 +73702,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
     __Pyx_DECREF(((PyObject *)__pyx_v_self->_node));
     __pyx_v_self->_node = ((struct LxmlElement *)Py_None);
 
-    /* "lxml/etree.pyx":2564
+    /* "lxml/etree.pyx":2567
  *         if c_attr is NULL:
  *             self._node = None
  *             raise StopIteration             # <<<<<<<<<<<<<<
@@ -73730,9 +73710,9 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
  *         self._c_attr = c_attr.next
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    __PYX_ERR(0, 2564, __pyx_L1_error)
+    __PYX_ERR(0, 2567, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2562
+    /* "lxml/etree.pyx":2565
  *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
  *             c_attr = c_attr.next
  *         if c_attr is NULL:             # <<<<<<<<<<<<<<
@@ -73741,7 +73721,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
  */
   }
 
-  /* "lxml/etree.pyx":2566
+  /* "lxml/etree.pyx":2569
  *             raise StopIteration
  * 
  *         self._c_attr = c_attr.next             # <<<<<<<<<<<<<<
@@ -73751,7 +73731,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
   __pyx_t_3 = __pyx_v_c_attr->next;
   __pyx_v_self->_c_attr = __pyx_t_3;
 
-  /* "lxml/etree.pyx":2567
+  /* "lxml/etree.pyx":2570
  * 
  *         self._c_attr = c_attr.next
  *         if self._keysvalues == 1:             # <<<<<<<<<<<<<<
@@ -73761,7 +73741,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
   switch (__pyx_v_self->_keysvalues) {
     case 1:
 
-    /* "lxml/etree.pyx":2568
+    /* "lxml/etree.pyx":2571
  *         self._c_attr = c_attr.next
  *         if self._keysvalues == 1:
  *             return _namespacedName(<xmlNode*>c_attr)             # <<<<<<<<<<<<<<
@@ -73769,13 +73749,13 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
  *             return _attributeValue(self._node._c_node, c_attr)
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2568, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2571, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_r = __pyx_t_4;
     __pyx_t_4 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2567
+    /* "lxml/etree.pyx":2570
  * 
  *         self._c_attr = c_attr.next
  *         if self._keysvalues == 1:             # <<<<<<<<<<<<<<
@@ -73784,7 +73764,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
  */
     break;
 
-    /* "lxml/etree.pyx":2569
+    /* "lxml/etree.pyx":2572
  *         if self._keysvalues == 1:
  *             return _namespacedName(<xmlNode*>c_attr)
  *         elif self._keysvalues == 2:             # <<<<<<<<<<<<<<
@@ -73793,7 +73773,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
  */
     case 2:
 
-    /* "lxml/etree.pyx":2570
+    /* "lxml/etree.pyx":2573
  *             return _namespacedName(<xmlNode*>c_attr)
  *         elif self._keysvalues == 2:
  *             return _attributeValue(self._node._c_node, c_attr)             # <<<<<<<<<<<<<<
@@ -73801,13 +73781,13 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
  *             return (_namespacedName(<xmlNode*>c_attr),
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_self->_node->_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2570, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_self->_node->_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2573, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_r = __pyx_t_4;
     __pyx_t_4 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2569
+    /* "lxml/etree.pyx":2572
  *         if self._keysvalues == 1:
  *             return _namespacedName(<xmlNode*>c_attr)
  *         elif self._keysvalues == 2:             # <<<<<<<<<<<<<<
@@ -73817,7 +73797,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
     break;
     default:
 
-    /* "lxml/etree.pyx":2572
+    /* "lxml/etree.pyx":2575
  *             return _attributeValue(self._node._c_node, c_attr)
  *         else:
  *             return (_namespacedName(<xmlNode*>c_attr),             # <<<<<<<<<<<<<<
@@ -73825,27 +73805,27 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
  * 
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2572, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2575, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
 
-    /* "lxml/etree.pyx":2573
+    /* "lxml/etree.pyx":2576
  *         else:
  *             return (_namespacedName(<xmlNode*>c_attr),
  *                     _attributeValue(self._node._c_node, c_attr))             # <<<<<<<<<<<<<<
  * 
  * cdef object _attributeIteratorFactory(_Element element, int keysvalues):
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_self->_node->_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2573, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_self->_node->_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2576, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
 
-    /* "lxml/etree.pyx":2572
+    /* "lxml/etree.pyx":2575
  *             return _attributeValue(self._node._c_node, c_attr)
  *         else:
  *             return (_namespacedName(<xmlNode*>c_attr),             # <<<<<<<<<<<<<<
  *                     _attributeValue(self._node._c_node, c_attr))
  * 
  */
-    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2572, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2575, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_GIVEREF(__pyx_t_4);
     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
@@ -73859,7 +73839,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
     break;
   }
 
-  /* "lxml/etree.pyx":2555
+  /* "lxml/etree.pyx":2558
  *         return self
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -73880,7 +73860,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator_2__next__(struct __pyx_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2575
+/* "lxml/etree.pyx":2578
  *                     _attributeValue(self._node._c_node, c_attr))
  * 
  * cdef object _attributeIteratorFactory(_Element element, int keysvalues):             # <<<<<<<<<<<<<<
@@ -73897,7 +73877,7 @@ static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlEleme
   xmlAttr *__pyx_t_3;
   __Pyx_RefNannySetupContext("_attributeIteratorFactory", 0);
 
-  /* "lxml/etree.pyx":2577
+  /* "lxml/etree.pyx":2580
  * cdef object _attributeIteratorFactory(_Element element, int keysvalues):
  *     cdef _AttribIterator attribs
  *     if element._c_node.properties is NULL:             # <<<<<<<<<<<<<<
@@ -73907,7 +73887,7 @@ static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlEleme
   __pyx_t_1 = ((__pyx_v_element->_c_node->properties == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2578
+    /* "lxml/etree.pyx":2581
  *     cdef _AttribIterator attribs
  *     if element._c_node.properties is NULL:
  *         return ITER_EMPTY             # <<<<<<<<<<<<<<
@@ -73919,7 +73899,7 @@ static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlEleme
     __pyx_r = __pyx_v_4lxml_5etree_ITER_EMPTY;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2577
+    /* "lxml/etree.pyx":2580
  * cdef object _attributeIteratorFactory(_Element element, int keysvalues):
  *     cdef _AttribIterator attribs
  *     if element._c_node.properties is NULL:             # <<<<<<<<<<<<<<
@@ -73928,19 +73908,19 @@ static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlEleme
  */
   }
 
-  /* "lxml/etree.pyx":2579
+  /* "lxml/etree.pyx":2582
  *     if element._c_node.properties is NULL:
  *         return ITER_EMPTY
  *     attribs = _AttribIterator()             # <<<<<<<<<<<<<<
  *     attribs._node = element
  *     attribs._c_attr = element._c_node.properties
  */
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__AttribIterator), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2579, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__AttribIterator), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2582, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_v_attribs = ((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2580
+  /* "lxml/etree.pyx":2583
  *         return ITER_EMPTY
  *     attribs = _AttribIterator()
  *     attribs._node = element             # <<<<<<<<<<<<<<
@@ -73953,7 +73933,7 @@ static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlEleme
   __Pyx_DECREF(((PyObject *)__pyx_v_attribs->_node));
   __pyx_v_attribs->_node = __pyx_v_element;
 
-  /* "lxml/etree.pyx":2581
+  /* "lxml/etree.pyx":2584
  *     attribs = _AttribIterator()
  *     attribs._node = element
  *     attribs._c_attr = element._c_node.properties             # <<<<<<<<<<<<<<
@@ -73963,7 +73943,7 @@ static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlEleme
   __pyx_t_3 = __pyx_v_element->_c_node->properties;
   __pyx_v_attribs->_c_attr = __pyx_t_3;
 
-  /* "lxml/etree.pyx":2582
+  /* "lxml/etree.pyx":2585
  *     attribs._node = element
  *     attribs._c_attr = element._c_node.properties
  *     attribs._keysvalues = keysvalues             # <<<<<<<<<<<<<<
@@ -73972,7 +73952,7 @@ static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlEleme
  */
   __pyx_v_attribs->_keysvalues = __pyx_v_keysvalues;
 
-  /* "lxml/etree.pyx":2583
+  /* "lxml/etree.pyx":2586
  *     attribs._c_attr = element._c_node.properties
  *     attribs._keysvalues = keysvalues
  *     return attribs             # <<<<<<<<<<<<<<
@@ -73984,7 +73964,7 @@ static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlEleme
   __pyx_r = ((PyObject *)__pyx_v_attribs);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2575
+  /* "lxml/etree.pyx":2578
  *                     _attributeValue(self._node._c_node, c_attr))
  * 
  * cdef object _attributeIteratorFactory(_Element element, int keysvalues):             # <<<<<<<<<<<<<<
@@ -74004,7 +73984,7 @@ static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlEleme
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2595
+/* "lxml/etree.pyx":2598
  *     cdef char* _href
  *     cdef char* _name
  *     cdef _initTagMatch(self, tag):             # <<<<<<<<<<<<<<
@@ -74020,7 +74000,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("_initTagMatch", 0);
 
-  /* "lxml/etree.pyx":2596
+  /* "lxml/etree.pyx":2599
  *     cdef char* _name
  *     cdef _initTagMatch(self, tag):
  *         self._href = NULL             # <<<<<<<<<<<<<<
@@ -74029,7 +74009,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
  */
   __pyx_v_self->_href = NULL;
 
-  /* "lxml/etree.pyx":2597
+  /* "lxml/etree.pyx":2600
  *     cdef _initTagMatch(self, tag):
  *         self._href = NULL
  *         self._name = NULL             # <<<<<<<<<<<<<<
@@ -74038,7 +74018,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
  */
   __pyx_v_self->_name = NULL;
 
-  /* "lxml/etree.pyx":2598
+  /* "lxml/etree.pyx":2601
  *         self._href = NULL
  *         self._name = NULL
  *         if tag is None:             # <<<<<<<<<<<<<<
@@ -74049,7 +74029,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2599
+    /* "lxml/etree.pyx":2602
  *         self._name = NULL
  *         if tag is None:
  *             self._node_type = 0             # <<<<<<<<<<<<<<
@@ -74058,7 +74038,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
  */
     __pyx_v_self->_node_type = 0;
 
-    /* "lxml/etree.pyx":2598
+    /* "lxml/etree.pyx":2601
  *         self._href = NULL
  *         self._name = NULL
  *         if tag is None:             # <<<<<<<<<<<<<<
@@ -74068,21 +74048,21 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2600
+  /* "lxml/etree.pyx":2603
  *         if tag is None:
  *             self._node_type = 0
  *         elif tag is Comment:             # <<<<<<<<<<<<<<
  *             self._node_type = tree.XML_COMMENT_NODE
  *         elif tag is ProcessingInstruction:
  */
-  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Comment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2600, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Comment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2603, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_2 = (__pyx_v_tag == __pyx_t_3);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2601
+    /* "lxml/etree.pyx":2604
  *             self._node_type = 0
  *         elif tag is Comment:
  *             self._node_type = tree.XML_COMMENT_NODE             # <<<<<<<<<<<<<<
@@ -74091,7 +74071,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
  */
     __pyx_v_self->_node_type = XML_COMMENT_NODE;
 
-    /* "lxml/etree.pyx":2600
+    /* "lxml/etree.pyx":2603
  *         if tag is None:
  *             self._node_type = 0
  *         elif tag is Comment:             # <<<<<<<<<<<<<<
@@ -74101,21 +74081,21 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2602
+  /* "lxml/etree.pyx":2605
  *         elif tag is Comment:
  *             self._node_type = tree.XML_COMMENT_NODE
  *         elif tag is ProcessingInstruction:             # <<<<<<<<<<<<<<
  *             self._node_type = tree.XML_PI_NODE
  *         elif tag is Entity:
  */
-  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2602, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2605, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_1 = (__pyx_v_tag == __pyx_t_3);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2603
+    /* "lxml/etree.pyx":2606
  *             self._node_type = tree.XML_COMMENT_NODE
  *         elif tag is ProcessingInstruction:
  *             self._node_type = tree.XML_PI_NODE             # <<<<<<<<<<<<<<
@@ -74124,7 +74104,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
  */
     __pyx_v_self->_node_type = XML_PI_NODE;
 
-    /* "lxml/etree.pyx":2602
+    /* "lxml/etree.pyx":2605
  *         elif tag is Comment:
  *             self._node_type = tree.XML_COMMENT_NODE
  *         elif tag is ProcessingInstruction:             # <<<<<<<<<<<<<<
@@ -74134,21 +74114,21 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2604
+  /* "lxml/etree.pyx":2607
  *         elif tag is ProcessingInstruction:
  *             self._node_type = tree.XML_PI_NODE
  *         elif tag is Entity:             # <<<<<<<<<<<<<<
  *             self._node_type = tree.XML_ENTITY_REF_NODE
  *         elif tag is Element:
  */
-  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2604, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2607, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_2 = (__pyx_v_tag == __pyx_t_3);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2605
+    /* "lxml/etree.pyx":2608
  *             self._node_type = tree.XML_PI_NODE
  *         elif tag is Entity:
  *             self._node_type = tree.XML_ENTITY_REF_NODE             # <<<<<<<<<<<<<<
@@ -74157,7 +74137,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
  */
     __pyx_v_self->_node_type = XML_ENTITY_REF_NODE;
 
-    /* "lxml/etree.pyx":2604
+    /* "lxml/etree.pyx":2607
  *         elif tag is ProcessingInstruction:
  *             self._node_type = tree.XML_PI_NODE
  *         elif tag is Entity:             # <<<<<<<<<<<<<<
@@ -74167,21 +74147,21 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2606
+  /* "lxml/etree.pyx":2609
  *         elif tag is Entity:
  *             self._node_type = tree.XML_ENTITY_REF_NODE
  *         elif tag is Element:             # <<<<<<<<<<<<<<
  *             self._node_type = tree.XML_ELEMENT_NODE
  *         else:
  */
-  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Element); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Element); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2609, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_1 = (__pyx_v_tag == __pyx_t_3);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2607
+    /* "lxml/etree.pyx":2610
  *             self._node_type = tree.XML_ENTITY_REF_NODE
  *         elif tag is Element:
  *             self._node_type = tree.XML_ELEMENT_NODE             # <<<<<<<<<<<<<<
@@ -74190,7 +74170,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
  */
     __pyx_v_self->_node_type = XML_ELEMENT_NODE;
 
-    /* "lxml/etree.pyx":2606
+    /* "lxml/etree.pyx":2609
  *         elif tag is Entity:
  *             self._node_type = tree.XML_ENTITY_REF_NODE
  *         elif tag is Element:             # <<<<<<<<<<<<<<
@@ -74200,7 +74180,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2609
+  /* "lxml/etree.pyx":2612
  *             self._node_type = tree.XML_ELEMENT_NODE
  *         else:
  *             self._node_type = tree.XML_ELEMENT_NODE             # <<<<<<<<<<<<<<
@@ -74210,14 +74190,14 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
   /*else*/ {
     __pyx_v_self->_node_type = XML_ELEMENT_NODE;
 
-    /* "lxml/etree.pyx":2610
+    /* "lxml/etree.pyx":2613
  *         else:
  *             self._node_type = tree.XML_ELEMENT_NODE
  *             self._pystrings = _getNsTag(tag)             # <<<<<<<<<<<<<<
  *             if self._pystrings[0] is not None:
  *                 self._href = _cstr(self._pystrings[0])
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2610, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2613, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_3);
     __Pyx_GOTREF(__pyx_v_self->_pystrings);
@@ -74225,33 +74205,33 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
     __pyx_v_self->_pystrings = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":2611
+    /* "lxml/etree.pyx":2614
  *             self._node_type = tree.XML_ELEMENT_NODE
  *             self._pystrings = _getNsTag(tag)
  *             if self._pystrings[0] is not None:             # <<<<<<<<<<<<<<
  *                 self._href = _cstr(self._pystrings[0])
  *             self._name = _cstr(self._pystrings[1])
  */
-    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->_pystrings, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2611, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->_pystrings, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2614, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_2 = (__pyx_t_3 != Py_None);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_t_1 = (__pyx_t_2 != 0);
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":2612
+      /* "lxml/etree.pyx":2615
  *             self._pystrings = _getNsTag(tag)
  *             if self._pystrings[0] is not None:
  *                 self._href = _cstr(self._pystrings[0])             # <<<<<<<<<<<<<<
  *             self._name = _cstr(self._pystrings[1])
  *             if self._name[0] == c'*' and self._name[1] == c'\0':
  */
-      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->_pystrings, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2612, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->_pystrings, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2615, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_v_self->_href = PyBytes_AS_STRING(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":2611
+      /* "lxml/etree.pyx":2614
  *             self._node_type = tree.XML_ELEMENT_NODE
  *             self._pystrings = _getNsTag(tag)
  *             if self._pystrings[0] is not None:             # <<<<<<<<<<<<<<
@@ -74260,19 +74240,19 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
  */
     }
 
-    /* "lxml/etree.pyx":2613
+    /* "lxml/etree.pyx":2616
  *             if self._pystrings[0] is not None:
  *                 self._href = _cstr(self._pystrings[0])
  *             self._name = _cstr(self._pystrings[1])             # <<<<<<<<<<<<<<
  *             if self._name[0] == c'*' and self._name[1] == c'\0':
  *                 self._name = NULL
  */
-    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->_pystrings, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2613, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->_pystrings, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2616, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_v_self->_name = PyBytes_AS_STRING(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":2614
+    /* "lxml/etree.pyx":2617
  *                 self._href = _cstr(self._pystrings[0])
  *             self._name = _cstr(self._pystrings[1])
  *             if self._name[0] == c'*' and self._name[1] == c'\0':             # <<<<<<<<<<<<<<
@@ -74290,7 +74270,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
     __pyx_L6_bool_binop_done:;
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":2615
+      /* "lxml/etree.pyx":2618
  *             self._name = _cstr(self._pystrings[1])
  *             if self._name[0] == c'*' and self._name[1] == c'\0':
  *                 self._name = NULL             # <<<<<<<<<<<<<<
@@ -74299,7 +74279,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
  */
       __pyx_v_self->_name = NULL;
 
-      /* "lxml/etree.pyx":2614
+      /* "lxml/etree.pyx":2617
  *                 self._href = _cstr(self._pystrings[0])
  *             self._name = _cstr(self._pystrings[1])
  *             if self._name[0] == c'*' and self._name[1] == c'\0':             # <<<<<<<<<<<<<<
@@ -74310,7 +74290,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":2595
+  /* "lxml/etree.pyx":2598
  *     cdef char* _href
  *     cdef char* _name
  *     cdef _initTagMatch(self, tag):             # <<<<<<<<<<<<<<
@@ -74331,7 +74311,7 @@ static PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2625
+/* "lxml/etree.pyx":2628
  *     cdef _Element _node
  *     cdef _node_to_node_function _next_element
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -74357,7 +74337,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___iter__(struct LxmlEl
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "lxml/etree.pyx":2626
+  /* "lxml/etree.pyx":2629
  *     cdef _node_to_node_function _next_element
  *     def __iter__(self):
  *         return self             # <<<<<<<<<<<<<<
@@ -74369,7 +74349,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___iter__(struct LxmlEl
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2625
+  /* "lxml/etree.pyx":2628
  *     cdef _Element _node
  *     cdef _node_to_node_function _next_element
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -74384,7 +74364,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___iter__(struct LxmlEl
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2628
+/* "lxml/etree.pyx":2631
  *         return self
  * 
  *     cdef void _storeNext(self, _Element node):             # <<<<<<<<<<<<<<
@@ -74401,7 +74381,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("_storeNext", 0);
 
-  /* "lxml/etree.pyx":2630
+  /* "lxml/etree.pyx":2633
  *     cdef void _storeNext(self, _Element node):
  *         cdef xmlNode* c_node
  *         c_node = self._next_element(node._c_node)             # <<<<<<<<<<<<<<
@@ -74410,7 +74390,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
  */
   __pyx_v_c_node = __pyx_v_self->_next_element(__pyx_v_node->_c_node);
 
-  /* "lxml/etree.pyx":2631
+  /* "lxml/etree.pyx":2634
  *         cdef xmlNode* c_node
  *         c_node = self._next_element(node._c_node)
  *         while c_node is not NULL and \             # <<<<<<<<<<<<<<
@@ -74425,7 +74405,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
       goto __pyx_L5_bool_binop_done;
     }
 
-    /* "lxml/etree.pyx":2632
+    /* "lxml/etree.pyx":2635
  *         c_node = self._next_element(node._c_node)
  *         while c_node is not NULL and \
  *                   self._node_type != 0 and \             # <<<<<<<<<<<<<<
@@ -74439,7 +74419,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
       goto __pyx_L5_bool_binop_done;
     }
 
-    /* "lxml/etree.pyx":2633
+    /* "lxml/etree.pyx":2636
  *         while c_node is not NULL and \
  *                   self._node_type != 0 and \
  *                   (<tree.xmlElementType>self._node_type != c_node.type or             # <<<<<<<<<<<<<<
@@ -74453,7 +74433,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
       goto __pyx_L5_bool_binop_done;
     }
 
-    /* "lxml/etree.pyx":2634
+    /* "lxml/etree.pyx":2637
  *                   self._node_type != 0 and \
  *                   (<tree.xmlElementType>self._node_type != c_node.type or
  *                    not _tagMatches(c_node, <const_xmlChar*>self._href, <const_xmlChar*>self._name)):             # <<<<<<<<<<<<<<
@@ -74465,7 +74445,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
     __pyx_L5_bool_binop_done:;
     if (!__pyx_t_1) break;
 
-    /* "lxml/etree.pyx":2635
+    /* "lxml/etree.pyx":2638
  *                   (<tree.xmlElementType>self._node_type != c_node.type or
  *                    not _tagMatches(c_node, <const_xmlChar*>self._href, <const_xmlChar*>self._name)):
  *             c_node = self._next_element(c_node)             # <<<<<<<<<<<<<<
@@ -74475,7 +74455,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
     __pyx_v_c_node = __pyx_v_self->_next_element(__pyx_v_c_node);
   }
 
-  /* "lxml/etree.pyx":2636
+  /* "lxml/etree.pyx":2639
  *                    not _tagMatches(c_node, <const_xmlChar*>self._href, <const_xmlChar*>self._name)):
  *             c_node = self._next_element(c_node)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -74485,7 +74465,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
   __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2637
+    /* "lxml/etree.pyx":2640
  *             c_node = self._next_element(c_node)
  *         if c_node is NULL:
  *             self._node = None             # <<<<<<<<<<<<<<
@@ -74498,7 +74478,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
     __Pyx_DECREF(((PyObject *)__pyx_v_self->_node));
     __pyx_v_self->_node = ((struct LxmlElement *)Py_None);
 
-    /* "lxml/etree.pyx":2636
+    /* "lxml/etree.pyx":2639
  *                    not _tagMatches(c_node, <const_xmlChar*>self._href, <const_xmlChar*>self._name)):
  *             c_node = self._next_element(c_node)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -74508,7 +74488,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
     goto __pyx_L9;
   }
 
-  /* "lxml/etree.pyx":2640
+  /* "lxml/etree.pyx":2643
  *         else:
  *             # Python ref:
  *             self._node = _elementFactory(node._doc, c_node)             # <<<<<<<<<<<<<<
@@ -74518,7 +74498,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
   /*else*/ {
     __pyx_t_3 = ((PyObject *)__pyx_v_node->_doc);
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_3), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2640, __pyx_L1_error)
+    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_3), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2643, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GIVEREF(__pyx_t_4);
@@ -74529,7 +74509,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
   }
   __pyx_L9:;
 
-  /* "lxml/etree.pyx":2628
+  /* "lxml/etree.pyx":2631
  *         return self
  * 
  *     cdef void _storeNext(self, _Element node):             # <<<<<<<<<<<<<<
@@ -74547,7 +74527,7 @@ static void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElemen
   __Pyx_RefNannyFinishContext();
 }
 
-/* "lxml/etree.pyx":2642
+/* "lxml/etree.pyx":2645
  *             self._node = _elementFactory(node._doc, c_node)
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -74577,7 +74557,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator_2__next__(struct LxmlE
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "lxml/etree.pyx":2645
+  /* "lxml/etree.pyx":2648
  *         cdef xmlNode* c_node
  *         cdef _Element current_node
  *         if self._node is None:             # <<<<<<<<<<<<<<
@@ -74588,7 +74568,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator_2__next__(struct LxmlE
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2646
+    /* "lxml/etree.pyx":2649
  *         cdef _Element current_node
  *         if self._node is None:
  *             raise StopIteration             # <<<<<<<<<<<<<<
@@ -74596,9 +74576,9 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator_2__next__(struct LxmlE
  *         current_node = self._node
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    __PYX_ERR(0, 2646, __pyx_L1_error)
+    __PYX_ERR(0, 2649, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2645
+    /* "lxml/etree.pyx":2648
  *         cdef xmlNode* c_node
  *         cdef _Element current_node
  *         if self._node is None:             # <<<<<<<<<<<<<<
@@ -74607,7 +74587,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator_2__next__(struct LxmlE
  */
   }
 
-  /* "lxml/etree.pyx":2648
+  /* "lxml/etree.pyx":2651
  *             raise StopIteration
  *         # Python ref:
  *         current_node = self._node             # <<<<<<<<<<<<<<
@@ -74619,7 +74599,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator_2__next__(struct LxmlE
   __pyx_v_current_node = ((struct LxmlElement *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "lxml/etree.pyx":2649
+  /* "lxml/etree.pyx":2652
  *         # Python ref:
  *         current_node = self._node
  *         self._storeNext(current_node)             # <<<<<<<<<<<<<<
@@ -74628,7 +74608,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator_2__next__(struct LxmlE
  */
   ((struct __pyx_vtabstruct_4lxml_5etree__ElementIterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->_storeNext(__pyx_v_self, __pyx_v_current_node);
 
-  /* "lxml/etree.pyx":2650
+  /* "lxml/etree.pyx":2653
  *         current_node = self._node
  *         self._storeNext(current_node)
  *         return current_node             # <<<<<<<<<<<<<<
@@ -74640,7 +74620,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator_2__next__(struct LxmlE
   __pyx_r = ((PyObject *)__pyx_v_current_node);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2642
+  /* "lxml/etree.pyx":2645
  *             self._node = _elementFactory(node._doc, c_node)
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -74660,7 +74640,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator_2__next__(struct LxmlE
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2665
+/* "lxml/etree.pyx":2668
  *     cdef int _node_types
  * 
  *     def __cinit__(self, tags):             # <<<<<<<<<<<<<<
@@ -74694,7 +74674,7 @@ static int __pyx_pw_4lxml_5etree_16_MultiTagMatcher_1__cinit__(PyObject *__pyx_v
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2665, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2668, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -74705,7 +74685,7 @@ static int __pyx_pw_4lxml_5etree_16_MultiTagMatcher_1__cinit__(PyObject *__pyx_v
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2665, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2668, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._MultiTagMatcher.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -74724,7 +74704,7 @@ static int __pyx_pf_4lxml_5etree_16_MultiTagMatcher___cinit__(struct __pyx_obj_4
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "lxml/etree.pyx":2666
+  /* "lxml/etree.pyx":2669
  * 
  *     def __cinit__(self, tags):
  *         self._cached_tags = NULL             # <<<<<<<<<<<<<<
@@ -74733,7 +74713,7 @@ static int __pyx_pf_4lxml_5etree_16_MultiTagMatcher___cinit__(struct __pyx_obj_4
  */
   __pyx_v_self->_cached_tags = NULL;
 
-  /* "lxml/etree.pyx":2667
+  /* "lxml/etree.pyx":2670
  *     def __cinit__(self, tags):
  *         self._cached_tags = NULL
  *         self._cached_size = 0             # <<<<<<<<<<<<<<
@@ -74742,7 +74722,7 @@ static int __pyx_pf_4lxml_5etree_16_MultiTagMatcher___cinit__(struct __pyx_obj_4
  */
   __pyx_v_self->_cached_size = 0;
 
-  /* "lxml/etree.pyx":2668
+  /* "lxml/etree.pyx":2671
  *         self._cached_tags = NULL
  *         self._cached_size = 0
  *         self._tag_count = 0             # <<<<<<<<<<<<<<
@@ -74751,7 +74731,7 @@ static int __pyx_pf_4lxml_5etree_16_MultiTagMatcher___cinit__(struct __pyx_obj_4
  */
   __pyx_v_self->_tag_count = 0;
 
-  /* "lxml/etree.pyx":2669
+  /* "lxml/etree.pyx":2672
  *         self._cached_size = 0
  *         self._tag_count = 0
  *         self._node_types = 0             # <<<<<<<<<<<<<<
@@ -74760,14 +74740,14 @@ static int __pyx_pf_4lxml_5etree_16_MultiTagMatcher___cinit__(struct __pyx_obj_4
  */
   __pyx_v_self->_node_types = 0;
 
-  /* "lxml/etree.pyx":2670
+  /* "lxml/etree.pyx":2673
  *         self._tag_count = 0
  *         self._node_types = 0
  *         self._py_tags = []             # <<<<<<<<<<<<<<
  *         self.initTagMatch(tags)
  * 
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2670, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2673, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_py_tags);
@@ -74775,18 +74755,18 @@ static int __pyx_pf_4lxml_5etree_16_MultiTagMatcher___cinit__(struct __pyx_obj_4
   __pyx_v_self->_py_tags = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2671
+  /* "lxml/etree.pyx":2674
  *         self._node_types = 0
  *         self._py_tags = []
  *         self.initTagMatch(tags)             # <<<<<<<<<<<<<<
  * 
  *     def __dealloc__(self):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(__pyx_v_self, __pyx_v_tags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2671, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(__pyx_v_self, __pyx_v_tags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2674, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2665
+  /* "lxml/etree.pyx":2668
  *     cdef int _node_types
  * 
  *     def __cinit__(self, tags):             # <<<<<<<<<<<<<<
@@ -74806,7 +74786,7 @@ static int __pyx_pf_4lxml_5etree_16_MultiTagMatcher___cinit__(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2673
+/* "lxml/etree.pyx":2676
  *         self.initTagMatch(tags)
  * 
  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
@@ -74829,7 +74809,7 @@ static void __pyx_pf_4lxml_5etree_16_MultiTagMatcher_2__dealloc__(struct __pyx_o
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__dealloc__", 0);
 
-  /* "lxml/etree.pyx":2674
+  /* "lxml/etree.pyx":2677
  * 
  *     def __dealloc__(self):
  *         self._clear()             # <<<<<<<<<<<<<<
@@ -74838,7 +74818,7 @@ static void __pyx_pf_4lxml_5etree_16_MultiTagMatcher_2__dealloc__(struct __pyx_o
  */
   __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(__pyx_v_self);
 
-  /* "lxml/etree.pyx":2673
+  /* "lxml/etree.pyx":2676
  *         self.initTagMatch(tags)
  * 
  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
@@ -74850,7 +74830,7 @@ static void __pyx_pf_4lxml_5etree_16_MultiTagMatcher_2__dealloc__(struct __pyx_o
   __Pyx_RefNannyFinishContext();
 }
 
-/* "lxml/etree.pyx":2676
+/* "lxml/etree.pyx":2679
  *         self._clear()
  * 
  *     cdef bint rejectsAll(self):             # <<<<<<<<<<<<<<
@@ -74865,7 +74845,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_rejectsAll(struct __pyx_obj_4
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("rejectsAll", 0);
 
-  /* "lxml/etree.pyx":2677
+  /* "lxml/etree.pyx":2680
  * 
  *     cdef bint rejectsAll(self):
  *         return not self._tag_count and not self._node_types             # <<<<<<<<<<<<<<
@@ -74884,7 +74864,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_rejectsAll(struct __pyx_obj_4
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2676
+  /* "lxml/etree.pyx":2679
  *         self._clear()
  * 
  *     cdef bint rejectsAll(self):             # <<<<<<<<<<<<<<
@@ -74898,7 +74878,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_rejectsAll(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2679
+/* "lxml/etree.pyx":2682
  *         return not self._tag_count and not self._node_types
  * 
  *     cdef bint rejectsAllAttributes(self):             # <<<<<<<<<<<<<<
@@ -74911,7 +74891,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_rejectsAllAttributes(struct _
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("rejectsAllAttributes", 0);
 
-  /* "lxml/etree.pyx":2680
+  /* "lxml/etree.pyx":2683
  * 
  *     cdef bint rejectsAllAttributes(self):
  *         return not self._tag_count             # <<<<<<<<<<<<<<
@@ -74921,7 +74901,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_rejectsAllAttributes(struct _
   __pyx_r = (!(__pyx_v_self->_tag_count != 0));
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2679
+  /* "lxml/etree.pyx":2682
  *         return not self._tag_count and not self._node_types
  * 
  *     cdef bint rejectsAllAttributes(self):             # <<<<<<<<<<<<<<
@@ -74935,7 +74915,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_rejectsAllAttributes(struct _
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2682
+/* "lxml/etree.pyx":2685
  *         return not self._tag_count
  * 
  *     cdef bint matchesType(self, int node_type):             # <<<<<<<<<<<<<<
@@ -74950,7 +74930,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesType(struct __pyx_obj_
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("matchesType", 0);
 
-  /* "lxml/etree.pyx":2683
+  /* "lxml/etree.pyx":2686
  * 
  *     cdef bint matchesType(self, int node_type):
  *         if node_type == tree.XML_ELEMENT_NODE and self._tag_count:             # <<<<<<<<<<<<<<
@@ -74968,7 +74948,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesType(struct __pyx_obj_
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2684
+    /* "lxml/etree.pyx":2687
  *     cdef bint matchesType(self, int node_type):
  *         if node_type == tree.XML_ELEMENT_NODE and self._tag_count:
  *             return True             # <<<<<<<<<<<<<<
@@ -74978,7 +74958,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesType(struct __pyx_obj_
     __pyx_r = 1;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2683
+    /* "lxml/etree.pyx":2686
  * 
  *     cdef bint matchesType(self, int node_type):
  *         if node_type == tree.XML_ELEMENT_NODE and self._tag_count:             # <<<<<<<<<<<<<<
@@ -74987,7 +74967,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesType(struct __pyx_obj_
  */
   }
 
-  /* "lxml/etree.pyx":2685
+  /* "lxml/etree.pyx":2688
  *         if node_type == tree.XML_ELEMENT_NODE and self._tag_count:
  *             return True
  *         return self._node_types & (1 << node_type)             # <<<<<<<<<<<<<<
@@ -74997,7 +74977,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesType(struct __pyx_obj_
   __pyx_r = (__pyx_v_self->_node_types & (1 << __pyx_v_node_type));
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2682
+  /* "lxml/etree.pyx":2685
  *         return not self._tag_count
  * 
  *     cdef bint matchesType(self, int node_type):             # <<<<<<<<<<<<<<
@@ -75011,7 +74991,7 @@ static int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesType(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2687
+/* "lxml/etree.pyx":2690
  *         return self._node_types & (1 << node_type)
  * 
  *     cdef void _clear(self):             # <<<<<<<<<<<<<<
@@ -75028,7 +75008,7 @@ static void __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(struct __pyx_obj_4lxm
   size_t __pyx_t_3;
   __Pyx_RefNannySetupContext("_clear", 0);
 
-  /* "lxml/etree.pyx":2689
+  /* "lxml/etree.pyx":2692
  *     cdef void _clear(self):
  *         cdef size_t i, count
  *         count = self._tag_count             # <<<<<<<<<<<<<<
@@ -75038,7 +75018,7 @@ static void __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(struct __pyx_obj_4lxm
   __pyx_t_1 = __pyx_v_self->_tag_count;
   __pyx_v_count = __pyx_t_1;
 
-  /* "lxml/etree.pyx":2690
+  /* "lxml/etree.pyx":2693
  *         cdef size_t i, count
  *         count = self._tag_count
  *         self._tag_count = 0             # <<<<<<<<<<<<<<
@@ -75047,7 +75027,7 @@ static void __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(struct __pyx_obj_4lxm
  */
   __pyx_v_self->_tag_count = 0;
 
-  /* "lxml/etree.pyx":2691
+  /* "lxml/etree.pyx":2694
  *         count = self._tag_count
  *         self._tag_count = 0
  *         if self._cached_tags:             # <<<<<<<<<<<<<<
@@ -75057,7 +75037,7 @@ static void __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(struct __pyx_obj_4lxm
   __pyx_t_2 = (__pyx_v_self->_cached_tags != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2692
+    /* "lxml/etree.pyx":2695
  *         self._tag_count = 0
  *         if self._cached_tags:
  *             for i in xrange(count):             # <<<<<<<<<<<<<<
@@ -75068,7 +75048,7 @@ static void __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(struct __pyx_obj_4lxm
     for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
       __pyx_v_i = __pyx_t_3;
 
-      /* "lxml/etree.pyx":2693
+      /* "lxml/etree.pyx":2696
  *         if self._cached_tags:
  *             for i in xrange(count):
  *                 cpython.ref.Py_XDECREF(self._cached_tags[i].href)             # <<<<<<<<<<<<<<
@@ -75078,7 +75058,7 @@ static void __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(struct __pyx_obj_4lxm
       Py_XDECREF((__pyx_v_self->_cached_tags[__pyx_v_i]).href);
     }
 
-    /* "lxml/etree.pyx":2694
+    /* "lxml/etree.pyx":2697
  *             for i in xrange(count):
  *                 cpython.ref.Py_XDECREF(self._cached_tags[i].href)
  *             python.lxml_free(self._cached_tags)             # <<<<<<<<<<<<<<
@@ -75087,7 +75067,7 @@ static void __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(struct __pyx_obj_4lxm
  */
     lxml_free(__pyx_v_self->_cached_tags);
 
-    /* "lxml/etree.pyx":2695
+    /* "lxml/etree.pyx":2698
  *                 cpython.ref.Py_XDECREF(self._cached_tags[i].href)
  *             python.lxml_free(self._cached_tags)
  *             self._cached_tags = NULL             # <<<<<<<<<<<<<<
@@ -75096,7 +75076,7 @@ static void __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(struct __pyx_obj_4lxm
  */
     __pyx_v_self->_cached_tags = NULL;
 
-    /* "lxml/etree.pyx":2691
+    /* "lxml/etree.pyx":2694
  *         count = self._tag_count
  *         self._tag_count = 0
  *         if self._cached_tags:             # <<<<<<<<<<<<<<
@@ -75105,7 +75085,7 @@ static void __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(struct __pyx_obj_4lxm
  */
   }
 
-  /* "lxml/etree.pyx":2687
+  /* "lxml/etree.pyx":2690
  *         return self._node_types & (1 << node_type)
  * 
  *     cdef void _clear(self):             # <<<<<<<<<<<<<<
@@ -75117,7 +75097,7 @@ static void __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(struct __pyx_obj_4lxm
   __Pyx_RefNannyFinishContext();
 }
 
-/* "lxml/etree.pyx":2697
+/* "lxml/etree.pyx":2700
  *             self._cached_tags = NULL
  * 
  *     cdef initTagMatch(self, tags):             # <<<<<<<<<<<<<<
@@ -75135,7 +75115,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(struct __p
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("initTagMatch", 0);
 
-  /* "lxml/etree.pyx":2698
+  /* "lxml/etree.pyx":2701
  * 
  *     cdef initTagMatch(self, tags):
  *         self._cached_doc = None             # <<<<<<<<<<<<<<
@@ -75148,7 +75128,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(struct __p
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_cached_doc));
   __pyx_v_self->_cached_doc = ((struct LxmlDocument *)Py_None);
 
-  /* "lxml/etree.pyx":2699
+  /* "lxml/etree.pyx":2702
  *     cdef initTagMatch(self, tags):
  *         self._cached_doc = None
  *         del self._py_tags[:]             # <<<<<<<<<<<<<<
@@ -75157,11 +75137,11 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(struct __p
  */
   if (unlikely(__pyx_v_self->_py_tags == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(0, 2699, __pyx_L1_error)
+    __PYX_ERR(0, 2702, __pyx_L1_error)
   }
-  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_py_tags, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 2699, __pyx_L1_error)
+  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_py_tags, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 2702, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2700
+  /* "lxml/etree.pyx":2703
  *         self._cached_doc = None
  *         del self._py_tags[:]
  *         self._clear()             # <<<<<<<<<<<<<<
@@ -75170,7 +75150,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(struct __p
  */
   __pyx_f_4lxml_5etree_16_MultiTagMatcher__clear(__pyx_v_self);
 
-  /* "lxml/etree.pyx":2701
+  /* "lxml/etree.pyx":2704
  *         del self._py_tags[:]
  *         self._clear()
  *         if tags is None or tags == ():             # <<<<<<<<<<<<<<
@@ -75184,14 +75164,14 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(struct __p
     __pyx_t_1 = __pyx_t_3;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_4 = PyObject_RichCompare(__pyx_v_tags, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2701, __pyx_L1_error)
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2701, __pyx_L1_error)
+  __pyx_t_4 = PyObject_RichCompare(__pyx_v_tags, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2704, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2704, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_1 = __pyx_t_3;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2703
+    /* "lxml/etree.pyx":2706
  *         if tags is None or tags == ():
  *             # no selection in tags argument => match anything
  *             self._node_types = (             # <<<<<<<<<<<<<<
@@ -75200,7 +75180,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(struct __p
  */
     __pyx_v_self->_node_types = ((((1 << XML_COMMENT_NODE) | (1 << XML_PI_NODE)) | (1 << XML_ENTITY_REF_NODE)) | (1 << XML_ELEMENT_NODE));
 
-    /* "lxml/etree.pyx":2701
+    /* "lxml/etree.pyx":2704
  *         del self._py_tags[:]
  *         self._clear()
  *         if tags is None or tags == ():             # <<<<<<<<<<<<<<
@@ -75210,7 +75190,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(struct __p
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2709
+  /* "lxml/etree.pyx":2712
  *                 1 << tree.XML_ELEMENT_NODE)
  *         else:
  *             self._node_types = 0             # <<<<<<<<<<<<<<
@@ -75220,23 +75200,23 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(struct __p
   /*else*/ {
     __pyx_v_self->_node_types = 0;
 
-    /* "lxml/etree.pyx":2710
+    /* "lxml/etree.pyx":2713
  *         else:
  *             self._node_types = 0
  *             self._storeTags(tags, set())             # <<<<<<<<<<<<<<
  * 
  *     cdef _storeTags(self, tag, set seen):
  */
-    __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2710, __pyx_L1_error)
+    __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2713, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(__pyx_v_self, __pyx_v_tags, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2710, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(__pyx_v_self, __pyx_v_tags, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2713, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":2697
+  /* "lxml/etree.pyx":2700
  *             self._cached_tags = NULL
  * 
  *     cdef initTagMatch(self, tags):             # <<<<<<<<<<<<<<
@@ -75258,7 +75238,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher_initTagMatch(struct __p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2712
+/* "lxml/etree.pyx":2715
  *             self._storeTags(tags, set())
  * 
  *     cdef _storeTags(self, tag, set seen):             # <<<<<<<<<<<<<<
@@ -75282,21 +75262,21 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
   PyObject *(*__pyx_t_8)(PyObject *);
   __Pyx_RefNannySetupContext("_storeTags", 0);
 
-  /* "lxml/etree.pyx":2713
+  /* "lxml/etree.pyx":2716
  * 
  *     cdef _storeTags(self, tag, set seen):
  *         if tag is Comment:             # <<<<<<<<<<<<<<
  *             self._node_types |= 1 << tree.XML_COMMENT_NODE
  *         elif tag is ProcessingInstruction:
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2713, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2716, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = (__pyx_v_tag == __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2714
+    /* "lxml/etree.pyx":2717
  *     cdef _storeTags(self, tag, set seen):
  *         if tag is Comment:
  *             self._node_types |= 1 << tree.XML_COMMENT_NODE             # <<<<<<<<<<<<<<
@@ -75305,7 +75285,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  */
     __pyx_v_self->_node_types = (__pyx_v_self->_node_types | (1 << XML_COMMENT_NODE));
 
-    /* "lxml/etree.pyx":2713
+    /* "lxml/etree.pyx":2716
  * 
  *     cdef _storeTags(self, tag, set seen):
  *         if tag is Comment:             # <<<<<<<<<<<<<<
@@ -75315,21 +75295,21 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2715
+  /* "lxml/etree.pyx":2718
  *         if tag is Comment:
  *             self._node_types |= 1 << tree.XML_COMMENT_NODE
  *         elif tag is ProcessingInstruction:             # <<<<<<<<<<<<<<
  *             self._node_types |= 1 << tree.XML_PI_NODE
  *         elif tag is Entity:
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2715, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2718, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = (__pyx_v_tag == __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_2 = (__pyx_t_3 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2716
+    /* "lxml/etree.pyx":2719
  *             self._node_types |= 1 << tree.XML_COMMENT_NODE
  *         elif tag is ProcessingInstruction:
  *             self._node_types |= 1 << tree.XML_PI_NODE             # <<<<<<<<<<<<<<
@@ -75338,7 +75318,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  */
     __pyx_v_self->_node_types = (__pyx_v_self->_node_types | (1 << XML_PI_NODE));
 
-    /* "lxml/etree.pyx":2715
+    /* "lxml/etree.pyx":2718
  *         if tag is Comment:
  *             self._node_types |= 1 << tree.XML_COMMENT_NODE
  *         elif tag is ProcessingInstruction:             # <<<<<<<<<<<<<<
@@ -75348,21 +75328,21 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2717
+  /* "lxml/etree.pyx":2720
  *         elif tag is ProcessingInstruction:
  *             self._node_types |= 1 << tree.XML_PI_NODE
  *         elif tag is Entity:             # <<<<<<<<<<<<<<
  *             self._node_types |= 1 << tree.XML_ENTITY_REF_NODE
  *         elif tag is Element:
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2717, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2720, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = (__pyx_v_tag == __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2718
+    /* "lxml/etree.pyx":2721
  *             self._node_types |= 1 << tree.XML_PI_NODE
  *         elif tag is Entity:
  *             self._node_types |= 1 << tree.XML_ENTITY_REF_NODE             # <<<<<<<<<<<<<<
@@ -75371,7 +75351,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  */
     __pyx_v_self->_node_types = (__pyx_v_self->_node_types | (1 << XML_ENTITY_REF_NODE));
 
-    /* "lxml/etree.pyx":2717
+    /* "lxml/etree.pyx":2720
  *         elif tag is ProcessingInstruction:
  *             self._node_types |= 1 << tree.XML_PI_NODE
  *         elif tag is Entity:             # <<<<<<<<<<<<<<
@@ -75381,21 +75361,21 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2719
+  /* "lxml/etree.pyx":2722
  *         elif tag is Entity:
  *             self._node_types |= 1 << tree.XML_ENTITY_REF_NODE
  *         elif tag is Element:             # <<<<<<<<<<<<<<
  *             self._node_types |= 1 << tree.XML_ELEMENT_NODE
  *         elif python._isString(tag):
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Element); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2719, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Element); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2722, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = (__pyx_v_tag == __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_2 = (__pyx_t_3 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2720
+    /* "lxml/etree.pyx":2723
  *             self._node_types |= 1 << tree.XML_ENTITY_REF_NODE
  *         elif tag is Element:
  *             self._node_types |= 1 << tree.XML_ELEMENT_NODE             # <<<<<<<<<<<<<<
@@ -75404,7 +75384,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  */
     __pyx_v_self->_node_types = (__pyx_v_self->_node_types | (1 << XML_ELEMENT_NODE));
 
-    /* "lxml/etree.pyx":2719
+    /* "lxml/etree.pyx":2722
  *         elif tag is Entity:
  *             self._node_types |= 1 << tree.XML_ENTITY_REF_NODE
  *         elif tag is Element:             # <<<<<<<<<<<<<<
@@ -75414,7 +75394,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2721
+  /* "lxml/etree.pyx":2724
  *         elif tag is Element:
  *             self._node_types |= 1 << tree.XML_ELEMENT_NODE
  *         elif python._isString(tag):             # <<<<<<<<<<<<<<
@@ -75424,18 +75404,18 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
   __pyx_t_2 = (_isString(__pyx_v_tag) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2722
+    /* "lxml/etree.pyx":2725
  *             self._node_types |= 1 << tree.XML_ELEMENT_NODE
  *         elif python._isString(tag):
  *             if tag in seen:             # <<<<<<<<<<<<<<
  *                 return
  *             seen.add(tag)
  */
-    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_tag, __pyx_v_seen, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2722, __pyx_L1_error)
+    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_tag, __pyx_v_seen, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2725, __pyx_L1_error)
     __pyx_t_3 = (__pyx_t_2 != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":2723
+      /* "lxml/etree.pyx":2726
  *         elif python._isString(tag):
  *             if tag in seen:
  *                 return             # <<<<<<<<<<<<<<
@@ -75446,7 +75426,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
       __pyx_r = Py_None; __Pyx_INCREF(Py_None);
       goto __pyx_L0;
 
-      /* "lxml/etree.pyx":2722
+      /* "lxml/etree.pyx":2725
  *             self._node_types |= 1 << tree.XML_ELEMENT_NODE
  *         elif python._isString(tag):
  *             if tag in seen:             # <<<<<<<<<<<<<<
@@ -75455,7 +75435,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  */
     }
 
-    /* "lxml/etree.pyx":2724
+    /* "lxml/etree.pyx":2727
  *             if tag in seen:
  *                 return
  *             seen.add(tag)             # <<<<<<<<<<<<<<
@@ -75463,12 +75443,12 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  *                 self._node_types |= 1 << tree.XML_ELEMENT_NODE
  */
     if (unlikely(__pyx_v_seen == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
-      __PYX_ERR(0, 2724, __pyx_L1_error)
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
+      __PYX_ERR(0, 2727, __pyx_L1_error)
     }
-    __pyx_t_4 = PySet_Add(__pyx_v_seen, __pyx_v_tag); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2724, __pyx_L1_error)
+    __pyx_t_4 = PySet_Add(__pyx_v_seen, __pyx_v_tag); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2727, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2725
+    /* "lxml/etree.pyx":2728
  *                 return
  *             seen.add(tag)
  *             if tag in ('*', '{*}*'):             # <<<<<<<<<<<<<<
@@ -75477,20 +75457,20 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  */
     __Pyx_INCREF(__pyx_v_tag);
     __pyx_t_1 = __pyx_v_tag;
-    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__42, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2725, __pyx_L1_error)
+    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__44, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2728, __pyx_L1_error)
     if (!__pyx_t_2) {
     } else {
       __pyx_t_3 = __pyx_t_2;
       goto __pyx_L6_bool_binop_done;
     }
-    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__43, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2725, __pyx_L1_error)
+    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s__45, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2728, __pyx_L1_error)
     __pyx_t_3 = __pyx_t_2;
     __pyx_L6_bool_binop_done:;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_2 = (__pyx_t_3 != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":2726
+      /* "lxml/etree.pyx":2729
  *             seen.add(tag)
  *             if tag in ('*', '{*}*'):
  *                 self._node_types |= 1 << tree.XML_ELEMENT_NODE             # <<<<<<<<<<<<<<
@@ -75499,7 +75479,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  */
       __pyx_v_self->_node_types = (__pyx_v_self->_node_types | (1 << XML_ELEMENT_NODE));
 
-      /* "lxml/etree.pyx":2725
+      /* "lxml/etree.pyx":2728
  *                 return
  *             seen.add(tag)
  *             if tag in ('*', '{*}*'):             # <<<<<<<<<<<<<<
@@ -75509,7 +75489,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
       goto __pyx_L5;
     }
 
-    /* "lxml/etree.pyx":2728
+    /* "lxml/etree.pyx":2731
  *                 self._node_types |= 1 << tree.XML_ELEMENT_NODE
  *             else:
  *                 href, name = _getNsTag(tag)             # <<<<<<<<<<<<<<
@@ -75517,7 +75497,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  *                     name = None
  */
     /*else*/ {
-      __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2728, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       if (likely(__pyx_t_1 != Py_None)) {
         PyObject* sequence = __pyx_t_1;
@@ -75529,7 +75509,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(0, 2728, __pyx_L1_error)
+          __PYX_ERR(0, 2731, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
@@ -75537,31 +75517,31 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
         __Pyx_INCREF(__pyx_t_5);
         __Pyx_INCREF(__pyx_t_6);
         #else
-        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2728, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2731, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2728, __pyx_L1_error)
+        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2731, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         #endif
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       } else {
-        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 2728, __pyx_L1_error)
+        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 2731, __pyx_L1_error)
       }
       __pyx_v_href = __pyx_t_5;
       __pyx_t_5 = 0;
       __pyx_v_name = __pyx_t_6;
       __pyx_t_6 = 0;
 
-      /* "lxml/etree.pyx":2729
+      /* "lxml/etree.pyx":2732
  *             else:
  *                 href, name = _getNsTag(tag)
  *                 if name == b'*':             # <<<<<<<<<<<<<<
  *                     name = None
  *                 if href is None:
  */
-      __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_name, __pyx_kp_b__42, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2729, __pyx_L1_error)
+      __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_name, __pyx_kp_b__44, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2732, __pyx_L1_error)
       if (__pyx_t_2) {
 
-        /* "lxml/etree.pyx":2730
+        /* "lxml/etree.pyx":2733
  *                 href, name = _getNsTag(tag)
  *                 if name == b'*':
  *                     name = None             # <<<<<<<<<<<<<<
@@ -75571,7 +75551,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
         __Pyx_INCREF(Py_None);
         __Pyx_DECREF_SET(__pyx_v_name, Py_None);
 
-        /* "lxml/etree.pyx":2729
+        /* "lxml/etree.pyx":2732
  *             else:
  *                 href, name = _getNsTag(tag)
  *                 if name == b'*':             # <<<<<<<<<<<<<<
@@ -75580,7 +75560,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  */
       }
 
-      /* "lxml/etree.pyx":2731
+      /* "lxml/etree.pyx":2734
  *                 if name == b'*':
  *                     name = None
  *                 if href is None:             # <<<<<<<<<<<<<<
@@ -75591,7 +75571,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
       __pyx_t_3 = (__pyx_t_2 != 0);
       if (__pyx_t_3) {
 
-        /* "lxml/etree.pyx":2732
+        /* "lxml/etree.pyx":2735
  *                     name = None
  *                 if href is None:
  *                     href = b''  # no namespace             # <<<<<<<<<<<<<<
@@ -75601,7 +75581,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
         __Pyx_INCREF(__pyx_kp_b__16);
         __Pyx_DECREF_SET(__pyx_v_href, __pyx_kp_b__16);
 
-        /* "lxml/etree.pyx":2731
+        /* "lxml/etree.pyx":2734
  *                 if name == b'*':
  *                     name = None
  *                 if href is None:             # <<<<<<<<<<<<<<
@@ -75611,17 +75591,17 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
         goto __pyx_L9;
       }
 
-      /* "lxml/etree.pyx":2733
+      /* "lxml/etree.pyx":2736
  *                 if href is None:
  *                     href = b''  # no namespace
  *                 elif href == b'*':             # <<<<<<<<<<<<<<
  *                     href = None  # wildcard: any namespace, including none
  *                 self._py_tags.append((href, name))
  */
-      __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_href, __pyx_kp_b__42, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2733, __pyx_L1_error)
+      __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_v_href, __pyx_kp_b__44, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2736, __pyx_L1_error)
       if (__pyx_t_3) {
 
-        /* "lxml/etree.pyx":2734
+        /* "lxml/etree.pyx":2737
  *                     href = b''  # no namespace
  *                 elif href == b'*':
  *                     href = None  # wildcard: any namespace, including none             # <<<<<<<<<<<<<<
@@ -75631,7 +75611,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
         __Pyx_INCREF(Py_None);
         __Pyx_DECREF_SET(__pyx_v_href, Py_None);
 
-        /* "lxml/etree.pyx":2733
+        /* "lxml/etree.pyx":2736
  *                 if href is None:
  *                     href = b''  # no namespace
  *                 elif href == b'*':             # <<<<<<<<<<<<<<
@@ -75641,7 +75621,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
       }
       __pyx_L9:;
 
-      /* "lxml/etree.pyx":2735
+      /* "lxml/etree.pyx":2738
  *                 elif href == b'*':
  *                     href = None  # wildcard: any namespace, including none
  *                 self._py_tags.append((href, name))             # <<<<<<<<<<<<<<
@@ -75649,10 +75629,10 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
  *             # support a sequence of tags
  */
       if (unlikely(__pyx_v_self->_py_tags == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
-        __PYX_ERR(0, 2735, __pyx_L1_error)
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
+        __PYX_ERR(0, 2738, __pyx_L1_error)
       }
-      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2735, __pyx_L1_error)
+      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2738, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_INCREF(__pyx_v_href);
       __Pyx_GIVEREF(__pyx_v_href);
@@ -75660,12 +75640,12 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
       __Pyx_INCREF(__pyx_v_name);
       __Pyx_GIVEREF(__pyx_v_name);
       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_name);
-      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_self->_py_tags, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2735, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_self->_py_tags, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2738, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     }
     __pyx_L5:;
 
-    /* "lxml/etree.pyx":2721
+    /* "lxml/etree.pyx":2724
  *         elif tag is Element:
  *             self._node_types |= 1 << tree.XML_ELEMENT_NODE
  *         elif python._isString(tag):             # <<<<<<<<<<<<<<
@@ -75675,7 +75655,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2738
+  /* "lxml/etree.pyx":2741
  *         else:
  *             # support a sequence of tags
  *             for item in tag:             # <<<<<<<<<<<<<<
@@ -75687,26 +75667,26 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
       __pyx_t_1 = __pyx_v_tag; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
       __pyx_t_8 = NULL;
     } else {
-      __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2738, __pyx_L1_error)
+      __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2741, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2738, __pyx_L1_error)
+      __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2741, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_8)) {
         if (likely(PyList_CheckExact(__pyx_t_1))) {
           if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2738, __pyx_L1_error)
+          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2741, __pyx_L1_error)
           #else
-          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2738, __pyx_L1_error)
+          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2741, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           #endif
         } else {
           if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2738, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2741, __pyx_L1_error)
           #else
-          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2738, __pyx_L1_error)
+          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2741, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           #endif
         }
@@ -75715,8 +75695,8 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
         if (unlikely(!__pyx_t_6)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 2738, __pyx_L1_error)
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            else __PYX_ERR(0, 2741, __pyx_L1_error)
           }
           break;
         }
@@ -75725,18 +75705,18 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
       __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
       __pyx_t_6 = 0;
 
-      /* "lxml/etree.pyx":2739
+      /* "lxml/etree.pyx":2742
  *             # support a sequence of tags
  *             for item in tag:
  *                 self._storeTags(item, seen)             # <<<<<<<<<<<<<<
  * 
  *     cdef inline int cacheTags(self, _Document doc, bint force_into_dict=False) except -1:
  */
-      __pyx_t_6 = __pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(__pyx_v_self, __pyx_v_item, __pyx_v_seen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2739, __pyx_L1_error)
+      __pyx_t_6 = __pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(__pyx_v_self, __pyx_v_item, __pyx_v_seen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2742, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-      /* "lxml/etree.pyx":2738
+      /* "lxml/etree.pyx":2741
  *         else:
  *             # support a sequence of tags
  *             for item in tag:             # <<<<<<<<<<<<<<
@@ -75748,7 +75728,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":2712
+  /* "lxml/etree.pyx":2715
  *             self._storeTags(tags, set())
  * 
  *     cdef _storeTags(self, tag, set seen):             # <<<<<<<<<<<<<<
@@ -75774,7 +75754,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_MultiTagMatcher__storeTags(struct __pyx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2741
+/* "lxml/etree.pyx":2744
  *                 self._storeTags(item, seen)
  * 
  *     cdef inline int cacheTags(self, _Document doc, bint force_into_dict=False) except -1:             # <<<<<<<<<<<<<<
@@ -75799,7 +75779,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
     }
   }
 
-  /* "lxml/etree.pyx":2745
+  /* "lxml/etree.pyx":2748
  *         Look up the tag names in the doc dict to enable string pointer comparisons.
  *         """
  *         cdef size_t dict_size = tree.xmlDictSize(doc._c_doc.dict)             # <<<<<<<<<<<<<<
@@ -75808,7 +75788,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
  */
   __pyx_v_dict_size = xmlDictSize(__pyx_v_doc->_c_doc->dict);
 
-  /* "lxml/etree.pyx":2746
+  /* "lxml/etree.pyx":2749
  *         """
  *         cdef size_t dict_size = tree.xmlDictSize(doc._c_doc.dict)
  *         if doc is self._cached_doc and dict_size == self._cached_size:             # <<<<<<<<<<<<<<
@@ -75827,7 +75807,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2748
+    /* "lxml/etree.pyx":2751
  *         if doc is self._cached_doc and dict_size == self._cached_size:
  *             # doc and dict didn't change => names already cached
  *             return 0             # <<<<<<<<<<<<<<
@@ -75837,7 +75817,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
     __pyx_r = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2746
+    /* "lxml/etree.pyx":2749
  *         """
  *         cdef size_t dict_size = tree.xmlDictSize(doc._c_doc.dict)
  *         if doc is self._cached_doc and dict_size == self._cached_size:             # <<<<<<<<<<<<<<
@@ -75846,7 +75826,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
  */
   }
 
-  /* "lxml/etree.pyx":2749
+  /* "lxml/etree.pyx":2752
  *             # doc and dict didn't change => names already cached
  *             return 0
  *         self._tag_count = 0             # <<<<<<<<<<<<<<
@@ -75855,7 +75835,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
  */
   __pyx_v_self->_tag_count = 0;
 
-  /* "lxml/etree.pyx":2750
+  /* "lxml/etree.pyx":2753
  *             return 0
  *         self._tag_count = 0
  *         if not self._py_tags:             # <<<<<<<<<<<<<<
@@ -75866,7 +75846,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
   __pyx_t_3 = ((!__pyx_t_1) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2751
+    /* "lxml/etree.pyx":2754
  *         self._tag_count = 0
  *         if not self._py_tags:
  *             self._cached_doc = doc             # <<<<<<<<<<<<<<
@@ -75879,7 +75859,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
     __Pyx_DECREF(((PyObject *)__pyx_v_self->_cached_doc));
     __pyx_v_self->_cached_doc = __pyx_v_doc;
 
-    /* "lxml/etree.pyx":2752
+    /* "lxml/etree.pyx":2755
  *         if not self._py_tags:
  *             self._cached_doc = doc
  *             self._cached_size = dict_size             # <<<<<<<<<<<<<<
@@ -75888,7 +75868,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
  */
     __pyx_v_self->_cached_size = __pyx_v_dict_size;
 
-    /* "lxml/etree.pyx":2753
+    /* "lxml/etree.pyx":2756
  *             self._cached_doc = doc
  *             self._cached_size = dict_size
  *             return 0             # <<<<<<<<<<<<<<
@@ -75898,7 +75878,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
     __pyx_r = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2750
+    /* "lxml/etree.pyx":2753
  *             return 0
  *         self._tag_count = 0
  *         if not self._py_tags:             # <<<<<<<<<<<<<<
@@ -75907,7 +75887,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
  */
   }
 
-  /* "lxml/etree.pyx":2754
+  /* "lxml/etree.pyx":2757
  *             self._cached_size = dict_size
  *             return 0
  *         if not self._cached_tags:             # <<<<<<<<<<<<<<
@@ -75917,7 +75897,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
   __pyx_t_3 = ((!(__pyx_v_self->_cached_tags != 0)) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2755
+    /* "lxml/etree.pyx":2758
  *             return 0
  *         if not self._cached_tags:
  *             self._cached_tags = <qname*>python.lxml_malloc(len(self._py_tags), sizeof(qname))             # <<<<<<<<<<<<<<
@@ -75928,13 +75908,13 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
     __Pyx_INCREF(__pyx_t_4);
     if (unlikely(__pyx_t_4 == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-      __PYX_ERR(0, 2755, __pyx_L1_error)
+      __PYX_ERR(0, 2758, __pyx_L1_error)
     }
-    __pyx_t_5 = PyList_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 2755, __pyx_L1_error)
+    __pyx_t_5 = PyList_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2758, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_v_self->_cached_tags = ((struct __pyx_t_4lxml_5etree_qname *)lxml_malloc(__pyx_t_5, (sizeof(struct __pyx_t_4lxml_5etree_qname))));
 
-    /* "lxml/etree.pyx":2756
+    /* "lxml/etree.pyx":2759
  *         if not self._cached_tags:
  *             self._cached_tags = <qname*>python.lxml_malloc(len(self._py_tags), sizeof(qname))
  *             if not self._cached_tags:             # <<<<<<<<<<<<<<
@@ -75944,7 +75924,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
     __pyx_t_3 = ((!(__pyx_v_self->_cached_tags != 0)) != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/etree.pyx":2757
+      /* "lxml/etree.pyx":2760
  *             self._cached_tags = <qname*>python.lxml_malloc(len(self._py_tags), sizeof(qname))
  *             if not self._cached_tags:
  *                 self._cached_doc = None             # <<<<<<<<<<<<<<
@@ -75957,16 +75937,16 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
       __Pyx_DECREF(((PyObject *)__pyx_v_self->_cached_doc));
       __pyx_v_self->_cached_doc = ((struct LxmlDocument *)Py_None);
 
-      /* "lxml/etree.pyx":2758
+      /* "lxml/etree.pyx":2761
  *             if not self._cached_tags:
  *                 self._cached_doc = None
  *                 raise MemoryError()             # <<<<<<<<<<<<<<
  *         self._tag_count = <size_t>_mapTagsToQnameMatchArray(
  *             doc._c_doc, self._py_tags, self._cached_tags, force_into_dict)
  */
-      PyErr_NoMemory(); __PYX_ERR(0, 2758, __pyx_L1_error)
+      PyErr_NoMemory(); __PYX_ERR(0, 2761, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":2756
+      /* "lxml/etree.pyx":2759
  *         if not self._cached_tags:
  *             self._cached_tags = <qname*>python.lxml_malloc(len(self._py_tags), sizeof(qname))
  *             if not self._cached_tags:             # <<<<<<<<<<<<<<
@@ -75975,7 +75955,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
  */
     }
 
-    /* "lxml/etree.pyx":2754
+    /* "lxml/etree.pyx":2757
  *             self._cached_size = dict_size
  *             return 0
  *         if not self._cached_tags:             # <<<<<<<<<<<<<<
@@ -75984,7 +75964,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
  */
   }
 
-  /* "lxml/etree.pyx":2760
+  /* "lxml/etree.pyx":2763
  *                 raise MemoryError()
  *         self._tag_count = <size_t>_mapTagsToQnameMatchArray(
  *             doc._c_doc, self._py_tags, self._cached_tags, force_into_dict)             # <<<<<<<<<<<<<<
@@ -75994,18 +75974,18 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
   __pyx_t_4 = __pyx_v_self->_py_tags;
   __Pyx_INCREF(__pyx_t_4);
 
-  /* "lxml/etree.pyx":2759
+  /* "lxml/etree.pyx":2762
  *                 self._cached_doc = None
  *                 raise MemoryError()
  *         self._tag_count = <size_t>_mapTagsToQnameMatchArray(             # <<<<<<<<<<<<<<
  *             doc._c_doc, self._py_tags, self._cached_tags, force_into_dict)
  *         self._cached_doc = doc
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(__pyx_v_doc->_c_doc, ((PyObject*)__pyx_t_4), __pyx_v_self->_cached_tags, __pyx_v_force_into_dict); if (unlikely(__pyx_t_5 == -1L)) __PYX_ERR(0, 2759, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(__pyx_v_doc->_c_doc, ((PyObject*)__pyx_t_4), __pyx_v_self->_cached_tags, __pyx_v_force_into_dict); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1L))) __PYX_ERR(0, 2762, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_v_self->_tag_count = ((size_t)__pyx_t_5);
 
-  /* "lxml/etree.pyx":2761
+  /* "lxml/etree.pyx":2764
  *         self._tag_count = <size_t>_mapTagsToQnameMatchArray(
  *             doc._c_doc, self._py_tags, self._cached_tags, force_into_dict)
  *         self._cached_doc = doc             # <<<<<<<<<<<<<<
@@ -76018,7 +75998,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_cached_doc));
   __pyx_v_self->_cached_doc = __pyx_v_doc;
 
-  /* "lxml/etree.pyx":2762
+  /* "lxml/etree.pyx":2765
  *             doc._c_doc, self._py_tags, self._cached_tags, force_into_dict)
  *         self._cached_doc = doc
  *         self._cached_size = dict_size             # <<<<<<<<<<<<<<
@@ -76027,7 +76007,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
  */
   __pyx_v_self->_cached_size = __pyx_v_dict_size;
 
-  /* "lxml/etree.pyx":2763
+  /* "lxml/etree.pyx":2766
  *         self._cached_doc = doc
  *         self._cached_size = dict_size
  *         return 0             # <<<<<<<<<<<<<<
@@ -76037,7 +76017,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2741
+  /* "lxml/etree.pyx":2744
  *                 self._storeTags(item, seen)
  * 
  *     cdef inline int cacheTags(self, _Document doc, bint force_into_dict=False) except -1:             # <<<<<<<<<<<<<<
@@ -76055,7 +76035,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(struc
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2765
+/* "lxml/etree.pyx":2768
  *         return 0
  * 
  *     cdef inline bint matches(self, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -76073,7 +76053,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
   struct __pyx_t_4lxml_5etree_qname *__pyx_t_4;
   __Pyx_RefNannySetupContext("matches", 0);
 
-  /* "lxml/etree.pyx":2767
+  /* "lxml/etree.pyx":2770
  *     cdef inline bint matches(self, xmlNode* c_node):
  *         cdef qname* c_qname
  *         if self._node_types & (1 << c_node.type):             # <<<<<<<<<<<<<<
@@ -76083,7 +76063,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
   __pyx_t_1 = ((__pyx_v_self->_node_types & (1 << __pyx_v_c_node->type)) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2768
+    /* "lxml/etree.pyx":2771
  *         cdef qname* c_qname
  *         if self._node_types & (1 << c_node.type):
  *             return True             # <<<<<<<<<<<<<<
@@ -76093,7 +76073,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
     __pyx_r = 1;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2767
+    /* "lxml/etree.pyx":2770
  *     cdef inline bint matches(self, xmlNode* c_node):
  *         cdef qname* c_qname
  *         if self._node_types & (1 << c_node.type):             # <<<<<<<<<<<<<<
@@ -76102,7 +76082,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
  */
   }
 
-  /* "lxml/etree.pyx":2769
+  /* "lxml/etree.pyx":2772
  *         if self._node_types & (1 << c_node.type):
  *             return True
  *         elif c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -76112,7 +76092,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
   __pyx_t_1 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2770
+    /* "lxml/etree.pyx":2773
  *             return True
  *         elif c_node.type == tree.XML_ELEMENT_NODE:
  *             for c_qname in self._cached_tags[:self._tag_count]:             # <<<<<<<<<<<<<<
@@ -76124,7 +76104,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
       __pyx_t_2 = __pyx_t_4;
       __pyx_v_c_qname = __pyx_t_2;
 
-      /* "lxml/etree.pyx":2771
+      /* "lxml/etree.pyx":2774
  *         elif c_node.type == tree.XML_ELEMENT_NODE:
  *             for c_qname in self._cached_tags[:self._tag_count]:
  *                 if _tagMatchesExactly(c_node, c_qname):             # <<<<<<<<<<<<<<
@@ -76134,7 +76114,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
       __pyx_t_1 = (__pyx_f_4lxml_5etree__tagMatchesExactly(__pyx_v_c_node, __pyx_v_c_qname) != 0);
       if (__pyx_t_1) {
 
-        /* "lxml/etree.pyx":2772
+        /* "lxml/etree.pyx":2775
  *             for c_qname in self._cached_tags[:self._tag_count]:
  *                 if _tagMatchesExactly(c_node, c_qname):
  *                     return True             # <<<<<<<<<<<<<<
@@ -76144,7 +76124,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
         __pyx_r = 1;
         goto __pyx_L0;
 
-        /* "lxml/etree.pyx":2771
+        /* "lxml/etree.pyx":2774
  *         elif c_node.type == tree.XML_ELEMENT_NODE:
  *             for c_qname in self._cached_tags[:self._tag_count]:
  *                 if _tagMatchesExactly(c_node, c_qname):             # <<<<<<<<<<<<<<
@@ -76154,7 +76134,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
       }
     }
 
-    /* "lxml/etree.pyx":2769
+    /* "lxml/etree.pyx":2772
  *         if self._node_types & (1 << c_node.type):
  *             return True
  *         elif c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -76163,7 +76143,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
  */
   }
 
-  /* "lxml/etree.pyx":2773
+  /* "lxml/etree.pyx":2776
  *                 if _tagMatchesExactly(c_node, c_qname):
  *                     return True
  *         return False             # <<<<<<<<<<<<<<
@@ -76173,7 +76153,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2765
+  /* "lxml/etree.pyx":2768
  *         return 0
  * 
  *     cdef inline bint matches(self, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -76187,7 +76167,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(struct
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2775
+/* "lxml/etree.pyx":2778
  *         return False
  * 
  *     cdef inline bint matchesNsTag(self, const_xmlChar* c_href,             # <<<<<<<<<<<<<<
@@ -76205,7 +76185,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
   struct __pyx_t_4lxml_5etree_qname *__pyx_t_4;
   __Pyx_RefNannySetupContext("matchesNsTag", 0);
 
-  /* "lxml/etree.pyx":2778
+  /* "lxml/etree.pyx":2781
  *                                   const_xmlChar* c_name):
  *         cdef qname* c_qname
  *         if self._node_types & (1 << tree.XML_ELEMENT_NODE):             # <<<<<<<<<<<<<<
@@ -76215,7 +76195,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
   __pyx_t_1 = ((__pyx_v_self->_node_types & (1 << XML_ELEMENT_NODE)) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2779
+    /* "lxml/etree.pyx":2782
  *         cdef qname* c_qname
  *         if self._node_types & (1 << tree.XML_ELEMENT_NODE):
  *             return True             # <<<<<<<<<<<<<<
@@ -76225,7 +76205,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
     __pyx_r = 1;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2778
+    /* "lxml/etree.pyx":2781
  *                                   const_xmlChar* c_name):
  *         cdef qname* c_qname
  *         if self._node_types & (1 << tree.XML_ELEMENT_NODE):             # <<<<<<<<<<<<<<
@@ -76234,7 +76214,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
  */
   }
 
-  /* "lxml/etree.pyx":2780
+  /* "lxml/etree.pyx":2783
  *         if self._node_types & (1 << tree.XML_ELEMENT_NODE):
  *             return True
  *         for c_qname in self._cached_tags[:self._tag_count]:             # <<<<<<<<<<<<<<
@@ -76246,7 +76226,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
     __pyx_t_2 = __pyx_t_4;
     __pyx_v_c_qname = __pyx_t_2;
 
-    /* "lxml/etree.pyx":2781
+    /* "lxml/etree.pyx":2784
  *             return True
  *         for c_qname in self._cached_tags[:self._tag_count]:
  *             if _nsTagMatchesExactly(c_href, c_name, c_qname):             # <<<<<<<<<<<<<<
@@ -76256,7 +76236,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
     __pyx_t_1 = (__pyx_f_4lxml_5etree__nsTagMatchesExactly(__pyx_v_c_href, __pyx_v_c_name, __pyx_v_c_qname) != 0);
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":2782
+      /* "lxml/etree.pyx":2785
  *         for c_qname in self._cached_tags[:self._tag_count]:
  *             if _nsTagMatchesExactly(c_href, c_name, c_qname):
  *                 return True             # <<<<<<<<<<<<<<
@@ -76266,7 +76246,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
       __pyx_r = 1;
       goto __pyx_L0;
 
-      /* "lxml/etree.pyx":2781
+      /* "lxml/etree.pyx":2784
  *             return True
  *         for c_qname in self._cached_tags[:self._tag_count]:
  *             if _nsTagMatchesExactly(c_href, c_name, c_qname):             # <<<<<<<<<<<<<<
@@ -76276,7 +76256,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
     }
   }
 
-  /* "lxml/etree.pyx":2783
+  /* "lxml/etree.pyx":2786
  *             if _nsTagMatchesExactly(c_href, c_name, c_qname):
  *                 return True
  *         return False             # <<<<<<<<<<<<<<
@@ -76286,7 +76266,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2775
+  /* "lxml/etree.pyx":2778
  *         return False
  * 
  *     cdef inline bint matchesNsTag(self, const_xmlChar* c_href,             # <<<<<<<<<<<<<<
@@ -76300,7 +76280,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag(st
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2785
+/* "lxml/etree.pyx":2788
  *         return False
  * 
  *     cdef inline bint matchesAttribute(self, xmlAttr* c_attr):             # <<<<<<<<<<<<<<
@@ -76318,7 +76298,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesAttribut
   int __pyx_t_4;
   __Pyx_RefNannySetupContext("matchesAttribute", 0);
 
-  /* "lxml/etree.pyx":2790
+  /* "lxml/etree.pyx":2793
  *         """
  *         cdef qname* c_qname
  *         for c_qname in self._cached_tags[:self._tag_count]:             # <<<<<<<<<<<<<<
@@ -76330,7 +76310,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesAttribut
     __pyx_t_1 = __pyx_t_3;
     __pyx_v_c_qname = __pyx_t_1;
 
-    /* "lxml/etree.pyx":2791
+    /* "lxml/etree.pyx":2794
  *         cdef qname* c_qname
  *         for c_qname in self._cached_tags[:self._tag_count]:
  *             if _tagMatchesExactly(<xmlNode*>c_attr, c_qname):             # <<<<<<<<<<<<<<
@@ -76340,7 +76320,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesAttribut
     __pyx_t_4 = (__pyx_f_4lxml_5etree__tagMatchesExactly(((xmlNode *)__pyx_v_c_attr), __pyx_v_c_qname) != 0);
     if (__pyx_t_4) {
 
-      /* "lxml/etree.pyx":2792
+      /* "lxml/etree.pyx":2795
  *         for c_qname in self._cached_tags[:self._tag_count]:
  *             if _tagMatchesExactly(<xmlNode*>c_attr, c_qname):
  *                 return True             # <<<<<<<<<<<<<<
@@ -76350,7 +76330,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesAttribut
       __pyx_r = 1;
       goto __pyx_L0;
 
-      /* "lxml/etree.pyx":2791
+      /* "lxml/etree.pyx":2794
  *         cdef qname* c_qname
  *         for c_qname in self._cached_tags[:self._tag_count]:
  *             if _tagMatchesExactly(<xmlNode*>c_attr, c_qname):             # <<<<<<<<<<<<<<
@@ -76360,7 +76340,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesAttribut
     }
   }
 
-  /* "lxml/etree.pyx":2793
+  /* "lxml/etree.pyx":2796
  *             if _tagMatchesExactly(<xmlNode*>c_attr, c_qname):
  *                 return True
  *         return False             # <<<<<<<<<<<<<<
@@ -76370,7 +76350,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesAttribut
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2785
+  /* "lxml/etree.pyx":2788
  *         return False
  * 
  *     cdef inline bint matchesAttribute(self, xmlAttr* c_attr):             # <<<<<<<<<<<<<<
@@ -76384,7 +76364,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesAttribut
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2801
+/* "lxml/etree.pyx":2804
  * 
  *     @cython.final
  *     cdef _initTagMatcher(self, tags):             # <<<<<<<<<<<<<<
@@ -76399,19 +76379,19 @@ static PyObject *__pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher(st
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("_initTagMatcher", 0);
 
-  /* "lxml/etree.pyx":2802
+  /* "lxml/etree.pyx":2805
  *     @cython.final
  *     cdef _initTagMatcher(self, tags):
  *         self._matcher = _MultiTagMatcher(tags)             # <<<<<<<<<<<<<<
  * 
  *     def __iter__(self):
  */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2802, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2805, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_tags);
   __Pyx_GIVEREF(__pyx_v_tags);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tags);
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__MultiTagMatcher), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2802, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__MultiTagMatcher), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2805, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_GIVEREF(__pyx_t_2);
@@ -76420,7 +76400,7 @@ static PyObject *__pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher(st
   __pyx_v_self->_matcher = ((struct __pyx_obj_4lxml_5etree__MultiTagMatcher *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2801
+  /* "lxml/etree.pyx":2804
  * 
  *     @cython.final
  *     cdef _initTagMatcher(self, tags):             # <<<<<<<<<<<<<<
@@ -76442,7 +76422,7 @@ static PyObject *__pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher(st
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2804
+/* "lxml/etree.pyx":2807
  *         self._matcher = _MultiTagMatcher(tags)
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -76468,7 +76448,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ElementMatchIterator___iter__(struct _
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "lxml/etree.pyx":2805
+  /* "lxml/etree.pyx":2808
  * 
  *     def __iter__(self):
  *         return self             # <<<<<<<<<<<<<<
@@ -76480,7 +76460,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ElementMatchIterator___iter__(struct _
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2804
+  /* "lxml/etree.pyx":2807
  *         self._matcher = _MultiTagMatcher(tags)
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -76495,7 +76475,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ElementMatchIterator___iter__(struct _
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2808
+/* "lxml/etree.pyx":2811
  * 
  *     @cython.final
  *     cdef int _storeNext(self, _Element node) except -1:             # <<<<<<<<<<<<<<
@@ -76515,7 +76495,7 @@ static int __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(struct __pyx_
   PyObject *__pyx_t_6 = NULL;
   __Pyx_RefNannySetupContext("_storeNext", 0);
 
-  /* "lxml/etree.pyx":2809
+  /* "lxml/etree.pyx":2812
  *     @cython.final
  *     cdef int _storeNext(self, _Element node) except -1:
  *         self._matcher.cacheTags(node._doc)             # <<<<<<<<<<<<<<
@@ -76524,10 +76504,10 @@ static int __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(struct __pyx_
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_node->_doc);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_1), NULL); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2809, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_1), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2812, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2810
+  /* "lxml/etree.pyx":2813
  *     cdef int _storeNext(self, _Element node) except -1:
  *         self._matcher.cacheTags(node._doc)
  *         c_node = self._next_element(node._c_node)             # <<<<<<<<<<<<<<
@@ -76536,7 +76516,7 @@ static int __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(struct __pyx_
  */
   __pyx_v_c_node = __pyx_v_self->_next_element(__pyx_v_node->_c_node);
 
-  /* "lxml/etree.pyx":2811
+  /* "lxml/etree.pyx":2814
  *         self._matcher.cacheTags(node._doc)
  *         c_node = self._next_element(node._c_node)
  *         while c_node is not NULL and not self._matcher.matches(c_node):             # <<<<<<<<<<<<<<
@@ -76555,7 +76535,7 @@ static int __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(struct __pyx_
     __pyx_L5_bool_binop_done:;
     if (!__pyx_t_3) break;
 
-    /* "lxml/etree.pyx":2812
+    /* "lxml/etree.pyx":2815
  *         c_node = self._next_element(node._c_node)
  *         while c_node is not NULL and not self._matcher.matches(c_node):
  *             c_node = self._next_element(c_node)             # <<<<<<<<<<<<<<
@@ -76565,7 +76545,7 @@ static int __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(struct __pyx_
     __pyx_v_c_node = __pyx_v_self->_next_element(__pyx_v_c_node);
   }
 
-  /* "lxml/etree.pyx":2814
+  /* "lxml/etree.pyx":2817
  *             c_node = self._next_element(c_node)
  *         # store Python ref to next node to make sure it's kept alive
  *         self._node = _elementFactory(node._doc, c_node) if c_node is not NULL else None             # <<<<<<<<<<<<<<
@@ -76575,7 +76555,7 @@ static int __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(struct __pyx_
   if (((__pyx_v_c_node != NULL) != 0)) {
     __pyx_t_5 = ((PyObject *)__pyx_v_node->_doc);
     __Pyx_INCREF(__pyx_t_5);
-    __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2814, __pyx_L1_error)
+    __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2817, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_1 = __pyx_t_6;
@@ -76590,7 +76570,7 @@ static int __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(struct __pyx_
   __pyx_v_self->_node = ((struct LxmlElement *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2815
+  /* "lxml/etree.pyx":2818
  *         # store Python ref to next node to make sure it's kept alive
  *         self._node = _elementFactory(node._doc, c_node) if c_node is not NULL else None
  *         return 0             # <<<<<<<<<<<<<<
@@ -76600,7 +76580,7 @@ static int __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(struct __pyx_
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2808
+  /* "lxml/etree.pyx":2811
  * 
  *     @cython.final
  *     cdef int _storeNext(self, _Element node) except -1:             # <<<<<<<<<<<<<<
@@ -76620,7 +76600,7 @@ static int __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(struct __pyx_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2817
+/* "lxml/etree.pyx":2820
  *         return 0
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -76651,7 +76631,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ElementMatchIterator_2__next__(struct
   int __pyx_t_4;
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "lxml/etree.pyx":2818
+  /* "lxml/etree.pyx":2821
  * 
  *     def __next__(self):
  *         cdef _Element current_node = self._node             # <<<<<<<<<<<<<<
@@ -76663,7 +76643,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ElementMatchIterator_2__next__(struct
   __pyx_v_current_node = ((struct LxmlElement *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2819
+  /* "lxml/etree.pyx":2822
  *     def __next__(self):
  *         cdef _Element current_node = self._node
  *         if current_node is None:             # <<<<<<<<<<<<<<
@@ -76674,7 +76654,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ElementMatchIterator_2__next__(struct
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2820
+    /* "lxml/etree.pyx":2823
  *         cdef _Element current_node = self._node
  *         if current_node is None:
  *             raise StopIteration             # <<<<<<<<<<<<<<
@@ -76682,9 +76662,9 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ElementMatchIterator_2__next__(struct
  *         return current_node
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    __PYX_ERR(0, 2820, __pyx_L1_error)
+    __PYX_ERR(0, 2823, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2819
+    /* "lxml/etree.pyx":2822
  *     def __next__(self):
  *         cdef _Element current_node = self._node
  *         if current_node is None:             # <<<<<<<<<<<<<<
@@ -76693,16 +76673,16 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ElementMatchIterator_2__next__(struct
  */
   }
 
-  /* "lxml/etree.pyx":2821
+  /* "lxml/etree.pyx":2824
  *         if current_node is None:
  *             raise StopIteration
  *         self._storeNext(current_node)             # <<<<<<<<<<<<<<
  *         return current_node
  * 
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(__pyx_v_self, __pyx_v_current_node); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2821, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(__pyx_v_self, __pyx_v_current_node); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2824, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2822
+  /* "lxml/etree.pyx":2825
  *             raise StopIteration
  *         self._storeNext(current_node)
  *         return current_node             # <<<<<<<<<<<<<<
@@ -76714,7 +76694,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ElementMatchIterator_2__next__(struct
   __pyx_r = ((PyObject *)__pyx_v_current_node);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2817
+  /* "lxml/etree.pyx":2820
  *         return 0
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -76734,7 +76714,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ElementMatchIterator_2__next__(struct
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2828
+/* "lxml/etree.pyx":2831
  *     Iterates over the children of an element.
  *     """
  *     def __cinit__(self, _Element node not None, tag=None, *, bint reversed=False):             # <<<<<<<<<<<<<<
@@ -76784,7 +76764,7 @@ static int __pyx_pw_4lxml_5etree_20ElementChildIterator_1__cinit__(PyObject *__p
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2828, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2831, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -76798,20 +76778,20 @@ static int __pyx_pw_4lxml_5etree_20ElementChildIterator_1__cinit__(PyObject *__p
     __pyx_v_node = ((struct LxmlElement *)values[0]);
     __pyx_v_tag = values[1];
     if (values[2]) {
-      __pyx_v_reversed = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_reversed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2828, __pyx_L3_error)
+      __pyx_v_reversed = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_reversed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2831, __pyx_L3_error)
     } else {
       __pyx_v_reversed = ((int)0);
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2828, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2831, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.ElementChildIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) __PYX_ERR(0, 2828, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) __PYX_ERR(0, 2831, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self), __pyx_v_node, __pyx_v_tag, __pyx_v_reversed);
 
   /* function exit code */
@@ -76835,27 +76815,27 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
   PyObject *__pyx_t_6 = NULL;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "lxml/etree.pyx":2830
+  /* "lxml/etree.pyx":2833
  *     def __cinit__(self, _Element node not None, tag=None, *, bint reversed=False):
  *         cdef xmlNode* c_node
  *         _assertValidNode(node)             # <<<<<<<<<<<<<<
  *         self._initTagMatcher(tag)
  *         if reversed:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2830, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2833, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2831
+  /* "lxml/etree.pyx":2834
  *         cdef xmlNode* c_node
  *         _assertValidNode(node)
  *         self._initTagMatcher(tag)             # <<<<<<<<<<<<<<
  *         if reversed:
  *             c_node = _findChildBackwards(node._c_node, 0)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher(((struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2831, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher(((struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2834, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2832
+  /* "lxml/etree.pyx":2835
  *         _assertValidNode(node)
  *         self._initTagMatcher(tag)
  *         if reversed:             # <<<<<<<<<<<<<<
@@ -76865,7 +76845,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
   __pyx_t_3 = (__pyx_v_reversed != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2833
+    /* "lxml/etree.pyx":2836
  *         self._initTagMatcher(tag)
  *         if reversed:
  *             c_node = _findChildBackwards(node._c_node, 0)             # <<<<<<<<<<<<<<
@@ -76874,7 +76854,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
  */
     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChildBackwards(__pyx_v_node->_c_node, 0);
 
-    /* "lxml/etree.pyx":2834
+    /* "lxml/etree.pyx":2837
  *         if reversed:
  *             c_node = _findChildBackwards(node._c_node, 0)
  *             self._next_element = _previousElement             # <<<<<<<<<<<<<<
@@ -76883,7 +76863,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
  */
     __pyx_v_self->__pyx_base._next_element = __pyx_f_4lxml_5etree__previousElement;
 
-    /* "lxml/etree.pyx":2832
+    /* "lxml/etree.pyx":2835
  *         _assertValidNode(node)
  *         self._initTagMatcher(tag)
  *         if reversed:             # <<<<<<<<<<<<<<
@@ -76893,7 +76873,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2836
+  /* "lxml/etree.pyx":2839
  *             self._next_element = _previousElement
  *         else:
  *             c_node = _findChildForwards(node._c_node, 0)             # <<<<<<<<<<<<<<
@@ -76903,7 +76883,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
   /*else*/ {
     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_node->_c_node, 0);
 
-    /* "lxml/etree.pyx":2837
+    /* "lxml/etree.pyx":2840
  *         else:
  *             c_node = _findChildForwards(node._c_node, 0)
  *             self._next_element = _nextElement             # <<<<<<<<<<<<<<
@@ -76914,7 +76894,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":2838
+  /* "lxml/etree.pyx":2841
  *             c_node = _findChildForwards(node._c_node, 0)
  *             self._next_element = _nextElement
  *         self._matcher.cacheTags(node._doc)             # <<<<<<<<<<<<<<
@@ -76923,10 +76903,10 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
  */
   __pyx_t_2 = ((PyObject *)__pyx_v_node->_doc);
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->__pyx_base._matcher, ((struct LxmlDocument *)__pyx_t_2), NULL); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2838, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->__pyx_base._matcher, ((struct LxmlDocument *)__pyx_t_2), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2841, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2839
+  /* "lxml/etree.pyx":2842
  *             self._next_element = _nextElement
  *         self._matcher.cacheTags(node._doc)
  *         while c_node is not NULL and not self._matcher.matches(c_node):             # <<<<<<<<<<<<<<
@@ -76945,7 +76925,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
     __pyx_L6_bool_binop_done:;
     if (!__pyx_t_3) break;
 
-    /* "lxml/etree.pyx":2840
+    /* "lxml/etree.pyx":2843
  *         self._matcher.cacheTags(node._doc)
  *         while c_node is not NULL and not self._matcher.matches(c_node):
  *             c_node = self._next_element(c_node)             # <<<<<<<<<<<<<<
@@ -76955,7 +76935,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
     __pyx_v_c_node = __pyx_v_self->__pyx_base._next_element(__pyx_v_c_node);
   }
 
-  /* "lxml/etree.pyx":2842
+  /* "lxml/etree.pyx":2845
  *             c_node = self._next_element(c_node)
  *         # store Python ref to next node to make sure it's kept alive
  *         self._node = _elementFactory(node._doc, c_node) if c_node is not NULL else None             # <<<<<<<<<<<<<<
@@ -76965,7 +76945,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
   if (((__pyx_v_c_node != NULL) != 0)) {
     __pyx_t_5 = ((PyObject *)__pyx_v_node->_doc);
     __Pyx_INCREF(__pyx_t_5);
-    __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2842, __pyx_L1_error)
+    __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2845, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_2 = __pyx_t_6;
@@ -76980,7 +76960,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
   __pyx_v_self->__pyx_base._node = ((struct LxmlElement *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2828
+  /* "lxml/etree.pyx":2831
  *     Iterates over the children of an element.
  *     """
  *     def __cinit__(self, _Element node not None, tag=None, *, bint reversed=False):             # <<<<<<<<<<<<<<
@@ -77002,7 +76982,7 @@ static int __pyx_pf_4lxml_5etree_20ElementChildIterator___cinit__(struct __pyx_o
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2850
+/* "lxml/etree.pyx":2853
  *     You can pass the boolean keyword ``preceding`` to specify the direction.
  *     """
  *     def __cinit__(self, _Element node not None, tag=None, *, bint preceding=False):             # <<<<<<<<<<<<<<
@@ -77052,7 +77032,7 @@ static int __pyx_pw_4lxml_5etree_16SiblingsIterator_1__cinit__(PyObject *__pyx_v
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2850, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2853, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -77066,20 +77046,20 @@ static int __pyx_pw_4lxml_5etree_16SiblingsIterator_1__cinit__(PyObject *__pyx_v
     __pyx_v_node = ((struct LxmlElement *)values[0]);
     __pyx_v_tag = values[1];
     if (values[2]) {
-      __pyx_v_preceding = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_preceding == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2850, __pyx_L3_error)
+      __pyx_v_preceding = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_preceding == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2853, __pyx_L3_error)
     } else {
       __pyx_v_preceding = ((int)0);
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2850, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2853, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.SiblingsIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) __PYX_ERR(0, 2850, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) __PYX_ERR(0, 2853, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_16SiblingsIterator___cinit__(((struct __pyx_obj_4lxml_5etree_SiblingsIterator *)__pyx_v_self), __pyx_v_node, __pyx_v_tag, __pyx_v_preceding);
 
   /* function exit code */
@@ -77099,27 +77079,27 @@ static int __pyx_pf_4lxml_5etree_16SiblingsIterator___cinit__(struct __pyx_obj_4
   int __pyx_t_3;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "lxml/etree.pyx":2851
+  /* "lxml/etree.pyx":2854
  *     """
  *     def __cinit__(self, _Element node not None, tag=None, *, bint preceding=False):
  *         _assertValidNode(node)             # <<<<<<<<<<<<<<
  *         self._initTagMatcher(tag)
  *         if preceding:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2851, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2854, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2852
+  /* "lxml/etree.pyx":2855
  *     def __cinit__(self, _Element node not None, tag=None, *, bint preceding=False):
  *         _assertValidNode(node)
  *         self._initTagMatcher(tag)             # <<<<<<<<<<<<<<
  *         if preceding:
  *             self._next_element = _previousElement
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher(((struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2852, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher(((struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2855, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2853
+  /* "lxml/etree.pyx":2856
  *         _assertValidNode(node)
  *         self._initTagMatcher(tag)
  *         if preceding:             # <<<<<<<<<<<<<<
@@ -77129,7 +77109,7 @@ static int __pyx_pf_4lxml_5etree_16SiblingsIterator___cinit__(struct __pyx_obj_4
   __pyx_t_3 = (__pyx_v_preceding != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2854
+    /* "lxml/etree.pyx":2857
  *         self._initTagMatcher(tag)
  *         if preceding:
  *             self._next_element = _previousElement             # <<<<<<<<<<<<<<
@@ -77138,7 +77118,7 @@ static int __pyx_pf_4lxml_5etree_16SiblingsIterator___cinit__(struct __pyx_obj_4
  */
     __pyx_v_self->__pyx_base._next_element = __pyx_f_4lxml_5etree__previousElement;
 
-    /* "lxml/etree.pyx":2853
+    /* "lxml/etree.pyx":2856
  *         _assertValidNode(node)
  *         self._initTagMatcher(tag)
  *         if preceding:             # <<<<<<<<<<<<<<
@@ -77148,7 +77128,7 @@ static int __pyx_pf_4lxml_5etree_16SiblingsIterator___cinit__(struct __pyx_obj_4
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2856
+  /* "lxml/etree.pyx":2859
  *             self._next_element = _previousElement
  *         else:
  *             self._next_element = _nextElement             # <<<<<<<<<<<<<<
@@ -77160,16 +77140,16 @@ static int __pyx_pf_4lxml_5etree_16SiblingsIterator___cinit__(struct __pyx_obj_4
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":2857
+  /* "lxml/etree.pyx":2860
  *         else:
  *             self._next_element = _nextElement
  *         self._storeNext(node)             # <<<<<<<<<<<<<<
  * 
  * cdef class AncestorsIterator(_ElementMatchIterator):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(((struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)__pyx_v_self), __pyx_v_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2857, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(((struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)__pyx_v_self), __pyx_v_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2860, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2850
+  /* "lxml/etree.pyx":2853
  *     You can pass the boolean keyword ``preceding`` to specify the direction.
  *     """
  *     def __cinit__(self, _Element node not None, tag=None, *, bint preceding=False):             # <<<<<<<<<<<<<<
@@ -77189,7 +77169,7 @@ static int __pyx_pf_4lxml_5etree_16SiblingsIterator___cinit__(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2863
+/* "lxml/etree.pyx":2866
  *     Iterates over the ancestors of an element (from parent to parent).
  *     """
  *     def __cinit__(self, _Element node not None, tag=None):             # <<<<<<<<<<<<<<
@@ -77233,7 +77213,7 @@ static int __pyx_pw_4lxml_5etree_17AncestorsIterator_1__cinit__(PyObject *__pyx_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2863, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2866, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -77249,13 +77229,13 @@ static int __pyx_pw_4lxml_5etree_17AncestorsIterator_1__cinit__(PyObject *__pyx_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2863, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2866, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.AncestorsIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) __PYX_ERR(0, 2863, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) __PYX_ERR(0, 2866, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_17AncestorsIterator___cinit__(((struct __pyx_obj_4lxml_5etree_AncestorsIterator *)__pyx_v_self), __pyx_v_node, __pyx_v_tag);
 
   /* function exit code */
@@ -77274,27 +77254,27 @@ static int __pyx_pf_4lxml_5etree_17AncestorsIterator___cinit__(struct __pyx_obj_
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "lxml/etree.pyx":2864
+  /* "lxml/etree.pyx":2867
  *     """
  *     def __cinit__(self, _Element node not None, tag=None):
  *         _assertValidNode(node)             # <<<<<<<<<<<<<<
  *         self._initTagMatcher(tag)
  *         self._next_element = _parentElement
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2864, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2867, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2865
+  /* "lxml/etree.pyx":2868
  *     def __cinit__(self, _Element node not None, tag=None):
  *         _assertValidNode(node)
  *         self._initTagMatcher(tag)             # <<<<<<<<<<<<<<
  *         self._next_element = _parentElement
  *         self._storeNext(node)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher(((struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2865, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher(((struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2868, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":2866
+  /* "lxml/etree.pyx":2869
  *         _assertValidNode(node)
  *         self._initTagMatcher(tag)
  *         self._next_element = _parentElement             # <<<<<<<<<<<<<<
@@ -77303,16 +77283,16 @@ static int __pyx_pf_4lxml_5etree_17AncestorsIterator___cinit__(struct __pyx_obj_
  */
   __pyx_v_self->__pyx_base._next_element = __pyx_f_4lxml_5etree__parentElement;
 
-  /* "lxml/etree.pyx":2867
+  /* "lxml/etree.pyx":2870
  *         self._initTagMatcher(tag)
  *         self._next_element = _parentElement
  *         self._storeNext(node)             # <<<<<<<<<<<<<<
  * 
  * cdef class ElementDepthFirstIterator:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(((struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)__pyx_v_self), __pyx_v_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2867, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext(((struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)__pyx_v_self), __pyx_v_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2870, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2863
+  /* "lxml/etree.pyx":2866
  *     Iterates over the ancestors of an element (from parent to parent).
  *     """
  *     def __cinit__(self, _Element node not None, tag=None):             # <<<<<<<<<<<<<<
@@ -77332,7 +77312,7 @@ static int __pyx_pf_4lxml_5etree_17AncestorsIterator___cinit__(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2894
+/* "lxml/etree.pyx":2897
  *     cdef _Element _top_node
  *     cdef _MultiTagMatcher _matcher
  *     def __cinit__(self, _Element node not None, tag=None, *, bint inclusive=True):             # <<<<<<<<<<<<<<
@@ -77382,7 +77362,7 @@ static int __pyx_pw_4lxml_5etree_25ElementDepthFirstIterator_1__cinit__(PyObject
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2894, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2897, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -77396,20 +77376,20 @@ static int __pyx_pw_4lxml_5etree_25ElementDepthFirstIterator_1__cinit__(PyObject
     __pyx_v_node = ((struct LxmlElement *)values[0]);
     __pyx_v_tag = values[1];
     if (values[2]) {
-      __pyx_v_inclusive = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_inclusive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2894, __pyx_L3_error)
+      __pyx_v_inclusive = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_inclusive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2897, __pyx_L3_error)
     } else {
       __pyx_v_inclusive = ((int)1);
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2894, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2897, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.ElementDepthFirstIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) __PYX_ERR(0, 2894, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) __PYX_ERR(0, 2897, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___cinit__(((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self), __pyx_v_node, __pyx_v_tag, __pyx_v_inclusive);
 
   /* function exit code */
@@ -77431,16 +77411,16 @@ static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___cinit__(struct __
   int __pyx_t_5;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "lxml/etree.pyx":2895
+  /* "lxml/etree.pyx":2898
  *     cdef _MultiTagMatcher _matcher
  *     def __cinit__(self, _Element node not None, tag=None, *, bint inclusive=True):
  *         _assertValidNode(node)             # <<<<<<<<<<<<<<
  *         self._top_node  = node
  *         self._next_node = node
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2895, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2898, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2896
+  /* "lxml/etree.pyx":2899
  *     def __cinit__(self, _Element node not None, tag=None, *, bint inclusive=True):
  *         _assertValidNode(node)
  *         self._top_node  = node             # <<<<<<<<<<<<<<
@@ -77453,7 +77433,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___cinit__(struct __
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_top_node));
   __pyx_v_self->_top_node = __pyx_v_node;
 
-  /* "lxml/etree.pyx":2897
+  /* "lxml/etree.pyx":2900
  *         _assertValidNode(node)
  *         self._top_node  = node
  *         self._next_node = node             # <<<<<<<<<<<<<<
@@ -77466,19 +77446,19 @@ static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___cinit__(struct __
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_next_node));
   __pyx_v_self->_next_node = __pyx_v_node;
 
-  /* "lxml/etree.pyx":2898
+  /* "lxml/etree.pyx":2901
  *         self._top_node  = node
  *         self._next_node = node
  *         self._matcher = _MultiTagMatcher(tag)             # <<<<<<<<<<<<<<
  *         self._matcher.cacheTags(node._doc)
  *         if not inclusive or not self._matcher.matches(node._c_node):
  */
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2898, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2901, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_tag);
   __Pyx_GIVEREF(__pyx_v_tag);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tag);
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__MultiTagMatcher), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2898, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__MultiTagMatcher), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2901, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_GIVEREF(__pyx_t_3);
@@ -77487,7 +77467,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___cinit__(struct __
   __pyx_v_self->_matcher = ((struct __pyx_obj_4lxml_5etree__MultiTagMatcher *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "lxml/etree.pyx":2899
+  /* "lxml/etree.pyx":2902
  *         self._next_node = node
  *         self._matcher = _MultiTagMatcher(tag)
  *         self._matcher.cacheTags(node._doc)             # <<<<<<<<<<<<<<
@@ -77496,10 +77476,10 @@ static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___cinit__(struct __
  */
   __pyx_t_3 = ((PyObject *)__pyx_v_node->_doc);
   __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_3), NULL); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2899, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_3), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2902, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "lxml/etree.pyx":2900
+  /* "lxml/etree.pyx":2903
  *         self._matcher = _MultiTagMatcher(tag)
  *         self._matcher.cacheTags(node._doc)
  *         if not inclusive or not self._matcher.matches(node._c_node):             # <<<<<<<<<<<<<<
@@ -77517,18 +77497,18 @@ static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___cinit__(struct __
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_4) {
 
-    /* "lxml/etree.pyx":2902
+    /* "lxml/etree.pyx":2905
  *         if not inclusive or not self._matcher.matches(node._c_node):
  *             # find start node (this cannot raise StopIteration, self._next_node != None)
  *             next(self)             # <<<<<<<<<<<<<<
  * 
  *     def __iter__(self):
  */
-    __pyx_t_3 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2902, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2905, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":2900
+    /* "lxml/etree.pyx":2903
  *         self._matcher = _MultiTagMatcher(tag)
  *         self._matcher.cacheTags(node._doc)
  *         if not inclusive or not self._matcher.matches(node._c_node):             # <<<<<<<<<<<<<<
@@ -77537,7 +77517,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___cinit__(struct __
  */
   }
 
-  /* "lxml/etree.pyx":2894
+  /* "lxml/etree.pyx":2897
  *     cdef _Element _top_node
  *     cdef _MultiTagMatcher _matcher
  *     def __cinit__(self, _Element node not None, tag=None, *, bint inclusive=True):             # <<<<<<<<<<<<<<
@@ -77558,7 +77538,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___cinit__(struct __
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2904
+/* "lxml/etree.pyx":2907
  *             next(self)
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -77584,7 +77564,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_2__iter__(str
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "lxml/etree.pyx":2905
+  /* "lxml/etree.pyx":2908
  * 
  *     def __iter__(self):
  *         return self             # <<<<<<<<<<<<<<
@@ -77596,7 +77576,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_2__iter__(str
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2904
+  /* "lxml/etree.pyx":2907
  *             next(self)
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -77611,7 +77591,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_2__iter__(str
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2907
+/* "lxml/etree.pyx":2910
  *         return self
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -77645,7 +77625,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   PyObject *__pyx_t_6 = NULL;
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "lxml/etree.pyx":2909
+  /* "lxml/etree.pyx":2912
  *     def __next__(self):
  *         cdef xmlNode* c_node
  *         cdef _Element current_node = self._next_node             # <<<<<<<<<<<<<<
@@ -77657,7 +77637,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   __pyx_v_current_node = ((struct LxmlElement *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2910
+  /* "lxml/etree.pyx":2913
  *         cdef xmlNode* c_node
  *         cdef _Element current_node = self._next_node
  *         if current_node is None:             # <<<<<<<<<<<<<<
@@ -77668,7 +77648,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2911
+    /* "lxml/etree.pyx":2914
  *         cdef _Element current_node = self._next_node
  *         if current_node is None:
  *             raise StopIteration             # <<<<<<<<<<<<<<
@@ -77676,9 +77656,9 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
  *         self._matcher.cacheTags(current_node._doc)
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    __PYX_ERR(0, 2911, __pyx_L1_error)
+    __PYX_ERR(0, 2914, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":2910
+    /* "lxml/etree.pyx":2913
  *         cdef xmlNode* c_node
  *         cdef _Element current_node = self._next_node
  *         if current_node is None:             # <<<<<<<<<<<<<<
@@ -77687,7 +77667,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
  */
   }
 
-  /* "lxml/etree.pyx":2912
+  /* "lxml/etree.pyx":2915
  *         if current_node is None:
  *             raise StopIteration
  *         c_node = current_node._c_node             # <<<<<<<<<<<<<<
@@ -77697,7 +77677,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   __pyx_t_4 = __pyx_v_current_node->_c_node;
   __pyx_v_c_node = __pyx_t_4;
 
-  /* "lxml/etree.pyx":2913
+  /* "lxml/etree.pyx":2916
  *             raise StopIteration
  *         c_node = current_node._c_node
  *         self._matcher.cacheTags(current_node._doc)             # <<<<<<<<<<<<<<
@@ -77706,10 +77686,10 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_current_node->_doc);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_5 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_1), NULL); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 2913, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_1), NULL); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2916, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":2914
+  /* "lxml/etree.pyx":2917
  *         c_node = current_node._c_node
  *         self._matcher.cacheTags(current_node._doc)
  *         if not self._matcher._tag_count:             # <<<<<<<<<<<<<<
@@ -77719,7 +77699,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   __pyx_t_3 = ((!(__pyx_v_self->_matcher->_tag_count != 0)) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2917
+    /* "lxml/etree.pyx":2920
  *             # no tag name was found in the dict => not in document either
  *             # try to match by node type
  *             c_node = self._nextNodeAnyTag(c_node)             # <<<<<<<<<<<<<<
@@ -77728,7 +77708,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
  */
     __pyx_v_c_node = __pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag(__pyx_v_self, __pyx_v_c_node);
 
-    /* "lxml/etree.pyx":2914
+    /* "lxml/etree.pyx":2917
  *         c_node = current_node._c_node
  *         self._matcher.cacheTags(current_node._doc)
  *         if not self._matcher._tag_count:             # <<<<<<<<<<<<<<
@@ -77738,7 +77718,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
     goto __pyx_L4;
   }
 
-  /* "lxml/etree.pyx":2919
+  /* "lxml/etree.pyx":2922
  *             c_node = self._nextNodeAnyTag(c_node)
  *         else:
  *             c_node = self._nextNodeMatchTag(c_node)             # <<<<<<<<<<<<<<
@@ -77750,7 +77730,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   }
   __pyx_L4:;
 
-  /* "lxml/etree.pyx":2920
+  /* "lxml/etree.pyx":2923
  *         else:
  *             c_node = self._nextNodeMatchTag(c_node)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -77760,7 +77740,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   __pyx_t_3 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":2921
+    /* "lxml/etree.pyx":2924
  *             c_node = self._nextNodeMatchTag(c_node)
  *         if c_node is NULL:
  *             self._next_node = None             # <<<<<<<<<<<<<<
@@ -77773,7 +77753,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
     __Pyx_DECREF(((PyObject *)__pyx_v_self->_next_node));
     __pyx_v_self->_next_node = ((struct LxmlElement *)Py_None);
 
-    /* "lxml/etree.pyx":2920
+    /* "lxml/etree.pyx":2923
  *         else:
  *             c_node = self._nextNodeMatchTag(c_node)
  *         if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -77783,7 +77763,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
     goto __pyx_L5;
   }
 
-  /* "lxml/etree.pyx":2923
+  /* "lxml/etree.pyx":2926
  *             self._next_node = None
  *         else:
  *             self._next_node = _elementFactory(current_node._doc, c_node)             # <<<<<<<<<<<<<<
@@ -77793,7 +77773,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   /*else*/ {
     __pyx_t_1 = ((PyObject *)__pyx_v_current_node->_doc);
     __Pyx_INCREF(__pyx_t_1);
-    __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_1), __pyx_v_c_node)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2923, __pyx_L1_error)
+    __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_1), __pyx_v_c_node)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2926, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GIVEREF(__pyx_t_6);
@@ -77804,7 +77784,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   }
   __pyx_L5:;
 
-  /* "lxml/etree.pyx":2924
+  /* "lxml/etree.pyx":2927
  *         else:
  *             self._next_node = _elementFactory(current_node._doc, c_node)
  *         return current_node             # <<<<<<<<<<<<<<
@@ -77816,7 +77796,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   __pyx_r = ((PyObject *)__pyx_v_current_node);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2907
+  /* "lxml/etree.pyx":2910
  *         return self
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -77837,7 +77817,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator_4__next__(str
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2927
+/* "lxml/etree.pyx":2930
  * 
  *     @cython.final
  *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -77853,7 +77833,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("_nextNodeAnyTag", 0);
 
-  /* "lxml/etree.pyx":2928
+  /* "lxml/etree.pyx":2931
  *     @cython.final
  *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):
  *         cdef int node_types = self._matcher._node_types             # <<<<<<<<<<<<<<
@@ -77863,7 +77843,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
   __pyx_t_1 = __pyx_v_self->_matcher->_node_types;
   __pyx_v_node_types = __pyx_t_1;
 
-  /* "lxml/etree.pyx":2929
+  /* "lxml/etree.pyx":2932
  *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):
  *         cdef int node_types = self._matcher._node_types
  *         if not node_types:             # <<<<<<<<<<<<<<
@@ -77873,7 +77853,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
   __pyx_t_2 = ((!(__pyx_v_node_types != 0)) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2930
+    /* "lxml/etree.pyx":2933
  *         cdef int node_types = self._matcher._node_types
  *         if not node_types:
  *             return NULL             # <<<<<<<<<<<<<<
@@ -77883,7 +77863,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
     __pyx_r = NULL;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2929
+    /* "lxml/etree.pyx":2932
  *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):
  *         cdef int node_types = self._matcher._node_types
  *         if not node_types:             # <<<<<<<<<<<<<<
@@ -77892,7 +77872,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
  */
   }
 
-  /* "lxml/etree.pyx":2931
+  /* "lxml/etree.pyx":2934
  *         if not node_types:
  *             return NULL
  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)             # <<<<<<<<<<<<<<
@@ -77901,7 +77881,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
  */
   BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_self->_top_node->_c_node, __pyx_v_c_node, 0);
 
-  /* "lxml/etree.pyx":2932
+  /* "lxml/etree.pyx":2935
  *             return NULL
  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
  *         if node_types & (1 << c_node.type):             # <<<<<<<<<<<<<<
@@ -77911,7 +77891,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
   __pyx_t_2 = ((__pyx_v_node_types & (1 << __pyx_v_c_node->type)) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2933
+    /* "lxml/etree.pyx":2936
  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
  *         if node_types & (1 << c_node.type):
  *             return c_node             # <<<<<<<<<<<<<<
@@ -77921,7 +77901,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
     __pyx_r = __pyx_v_c_node;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2932
+    /* "lxml/etree.pyx":2935
  *             return NULL
  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
  *         if node_types & (1 << c_node.type):             # <<<<<<<<<<<<<<
@@ -77930,7 +77910,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
  */
   }
 
-  /* "lxml/etree.pyx":2934
+  /* "lxml/etree.pyx":2937
  *         if node_types & (1 << c_node.type):
  *             return c_node
  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<<
@@ -77939,7 +77919,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
  */
   END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
 
-  /* "lxml/etree.pyx":2935
+  /* "lxml/etree.pyx":2938
  *             return c_node
  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
  *         return NULL             # <<<<<<<<<<<<<<
@@ -77949,7 +77929,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
   __pyx_r = NULL;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2927
+  /* "lxml/etree.pyx":2930
  * 
  *     @cython.final
  *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -77963,7 +77943,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2938
+/* "lxml/etree.pyx":2941
  * 
  *     @cython.final
  *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -77977,7 +77957,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchT
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("_nextNodeMatchTag", 0);
 
-  /* "lxml/etree.pyx":2939
+  /* "lxml/etree.pyx":2942
  *     @cython.final
  *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):
  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)             # <<<<<<<<<<<<<<
@@ -77986,7 +77966,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchT
  */
   BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_self->_top_node->_c_node, __pyx_v_c_node, 0);
 
-  /* "lxml/etree.pyx":2940
+  /* "lxml/etree.pyx":2943
  *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):
  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
  *         if self._matcher.matches(c_node):             # <<<<<<<<<<<<<<
@@ -77996,7 +77976,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchT
   __pyx_t_1 = (__pyx_f_4lxml_5etree_16_MultiTagMatcher_matches(__pyx_v_self->_matcher, __pyx_v_c_node) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":2941
+    /* "lxml/etree.pyx":2944
  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
  *         if self._matcher.matches(c_node):
  *             return c_node             # <<<<<<<<<<<<<<
@@ -78006,7 +77986,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchT
     __pyx_r = __pyx_v_c_node;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":2940
+    /* "lxml/etree.pyx":2943
  *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):
  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
  *         if self._matcher.matches(c_node):             # <<<<<<<<<<<<<<
@@ -78015,7 +77995,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchT
  */
   }
 
-  /* "lxml/etree.pyx":2942
+  /* "lxml/etree.pyx":2945
  *         if self._matcher.matches(c_node):
  *             return c_node
  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<<
@@ -78024,7 +78004,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchT
  */
   END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
 
-  /* "lxml/etree.pyx":2943
+  /* "lxml/etree.pyx":2946
  *             return c_node
  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
  *         return NULL             # <<<<<<<<<<<<<<
@@ -78034,7 +78014,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchT
   __pyx_r = NULL;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2938
+  /* "lxml/etree.pyx":2941
  * 
  *     @cython.final
  *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -78048,7 +78028,7 @@ static xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchT
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2957
+/* "lxml/etree.pyx":2960
  *     cdef object _nextEvent
  *     cdef _Element _start_element
  *     def __cinit__(self, _Element element not None, tag=None, *, bint with_tail=True):             # <<<<<<<<<<<<<<
@@ -78098,7 +78078,7 @@ static int __pyx_pw_4lxml_5etree_19ElementTextIterator_1__cinit__(PyObject *__py
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2957, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 2960, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -78112,20 +78092,20 @@ static int __pyx_pw_4lxml_5etree_19ElementTextIterator_1__cinit__(PyObject *__py
     __pyx_v_element = ((struct LxmlElement *)values[0]);
     __pyx_v_tag = values[1];
     if (values[2]) {
-      __pyx_v_with_tail = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_with_tail == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2957, __pyx_L3_error)
+      __pyx_v_with_tail = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_with_tail == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2960, __pyx_L3_error)
     } else {
       __pyx_v_with_tail = ((int)1);
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2957, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2960, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.ElementTextIterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 2957, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) __PYX_ERR(0, 2960, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_19ElementTextIterator___cinit__(((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self), __pyx_v_element, __pyx_v_tag, __pyx_v_with_tail);
 
   /* function exit code */
@@ -78148,16 +78128,16 @@ static int __pyx_pf_4lxml_5etree_19ElementTextIterator___cinit__(struct __pyx_ob
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "lxml/etree.pyx":2958
+  /* "lxml/etree.pyx":2961
  *     cdef _Element _start_element
  *     def __cinit__(self, _Element element not None, tag=None, *, bint with_tail=True):
  *         _assertValidNode(element)             # <<<<<<<<<<<<<<
  *         if with_tail:
  *             events = (u"start", u"end")
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2958, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2961, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2959
+  /* "lxml/etree.pyx":2962
  *     def __cinit__(self, _Element element not None, tag=None, *, bint with_tail=True):
  *         _assertValidNode(element)
  *         if with_tail:             # <<<<<<<<<<<<<<
@@ -78167,17 +78147,17 @@ static int __pyx_pf_4lxml_5etree_19ElementTextIterator___cinit__(struct __pyx_ob
   __pyx_t_2 = (__pyx_v_with_tail != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":2960
+    /* "lxml/etree.pyx":2963
  *         _assertValidNode(element)
  *         if with_tail:
  *             events = (u"start", u"end")             # <<<<<<<<<<<<<<
  *         else:
  *             events = (u"start",)
  */
-    __Pyx_INCREF(__pyx_tuple__44);
-    __pyx_v_events = __pyx_tuple__44;
+    __Pyx_INCREF(__pyx_tuple__46);
+    __pyx_v_events = __pyx_tuple__46;
 
-    /* "lxml/etree.pyx":2959
+    /* "lxml/etree.pyx":2962
  *     def __cinit__(self, _Element element not None, tag=None, *, bint with_tail=True):
  *         _assertValidNode(element)
  *         if with_tail:             # <<<<<<<<<<<<<<
@@ -78187,7 +78167,7 @@ static int __pyx_pf_4lxml_5etree_19ElementTextIterator___cinit__(struct __pyx_ob
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":2962
+  /* "lxml/etree.pyx":2965
  *             events = (u"start", u"end")
  *         else:
  *             events = (u"start",)             # <<<<<<<<<<<<<<
@@ -78195,12 +78175,12 @@ static int __pyx_pf_4lxml_5etree_19ElementTextIterator___cinit__(struct __pyx_ob
  *         self._nextEvent = iterwalk(element, events=events, tag=tag).__next__
  */
   /*else*/ {
-    __Pyx_INCREF(__pyx_tuple__45);
-    __pyx_v_events = __pyx_tuple__45;
+    __Pyx_INCREF(__pyx_tuple__47);
+    __pyx_v_events = __pyx_tuple__47;
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":2963
+  /* "lxml/etree.pyx":2966
  *         else:
  *             events = (u"start",)
  *         self._start_element = element             # <<<<<<<<<<<<<<
@@ -78213,27 +78193,27 @@ static int __pyx_pf_4lxml_5etree_19ElementTextIterator___cinit__(struct __pyx_ob
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_start_element));
   __pyx_v_self->_start_element = __pyx_v_element;
 
-  /* "lxml/etree.pyx":2964
+  /* "lxml/etree.pyx":2967
  *             events = (u"start",)
  *         self._start_element = element
  *         self._nextEvent = iterwalk(element, events=events, tag=tag).__next__             # <<<<<<<<<<<<<<
  * 
  *     def __iter__(self):
  */
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2964, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2967, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(((PyObject *)__pyx_v_element));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_element));
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2964, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_events, __pyx_v_events) < 0) __PYX_ERR(0, 2964, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(0, 2964, __pyx_L1_error)
-  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_iterwalk), __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2964, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_events, __pyx_v_events) < 0) __PYX_ERR(0, 2967, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(0, 2967, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_iterwalk), __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2967, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_next); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2964, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_next); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_GIVEREF(__pyx_t_4);
@@ -78242,7 +78222,7 @@ static int __pyx_pf_4lxml_5etree_19ElementTextIterator___cinit__(struct __pyx_ob
   __pyx_v_self->_nextEvent = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":2957
+  /* "lxml/etree.pyx":2960
  *     cdef object _nextEvent
  *     cdef _Element _start_element
  *     def __cinit__(self, _Element element not None, tag=None, *, bint with_tail=True):             # <<<<<<<<<<<<<<
@@ -78265,7 +78245,7 @@ static int __pyx_pf_4lxml_5etree_19ElementTextIterator___cinit__(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2966
+/* "lxml/etree.pyx":2969
  *         self._nextEvent = iterwalk(element, events=events, tag=tag).__next__
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -78291,7 +78271,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_2__iter__(struct __
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "lxml/etree.pyx":2967
+  /* "lxml/etree.pyx":2970
  * 
  *     def __iter__(self):
  *         return self             # <<<<<<<<<<<<<<
@@ -78303,7 +78283,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_2__iter__(struct __
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2966
+  /* "lxml/etree.pyx":2969
  *         self._nextEvent = iterwalk(element, events=events, tag=tag).__next__
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -78318,7 +78298,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_2__iter__(struct __
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2969
+/* "lxml/etree.pyx":2972
  *         return self
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -78354,7 +78334,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
   PyObject *(*__pyx_t_7)(PyObject *);
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "lxml/etree.pyx":2971
+  /* "lxml/etree.pyx":2974
  *     def __next__(self):
  *         cdef _Element element
  *         result = None             # <<<<<<<<<<<<<<
@@ -78364,7 +78344,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
   __Pyx_INCREF(Py_None);
   __pyx_v_result = Py_None;
 
-  /* "lxml/etree.pyx":2972
+  /* "lxml/etree.pyx":2975
  *         cdef _Element element
  *         result = None
  *         while result is None:             # <<<<<<<<<<<<<<
@@ -78376,7 +78356,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
     __pyx_t_2 = (__pyx_t_1 != 0);
     if (!__pyx_t_2) break;
 
-    /* "lxml/etree.pyx":2973
+    /* "lxml/etree.pyx":2976
  *         result = None
  *         while result is None:
  *             event, element = self._nextEvent() # raises StopIteration             # <<<<<<<<<<<<<<
@@ -78395,10 +78375,10 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
       }
     }
     if (__pyx_t_5) {
-      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2973, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2976, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     } else {
-      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2973, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2976, __pyx_L1_error)
     }
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -78412,7 +78392,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        __PYX_ERR(0, 2973, __pyx_L1_error)
+        __PYX_ERR(0, 2976, __pyx_L1_error)
       }
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
       if (likely(PyTuple_CheckExact(sequence))) {
@@ -78425,15 +78405,15 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
       __Pyx_INCREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_t_5);
       #else
-      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2973, __pyx_L1_error)
+      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2976, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2973, __pyx_L1_error)
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2976, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       #endif
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     } else {
       Py_ssize_t index = -1;
-      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2973, __pyx_L1_error)
+      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2976, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
@@ -78441,7 +78421,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
       __Pyx_GOTREF(__pyx_t_4);
       index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_5);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 2973, __pyx_L1_error)
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 2976, __pyx_L1_error)
       __pyx_t_7 = NULL;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L6_unpacking_done;
@@ -78449,38 +78429,38 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __pyx_t_7 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      __PYX_ERR(0, 2973, __pyx_L1_error)
+      __PYX_ERR(0, 2976, __pyx_L1_error)
       __pyx_L6_unpacking_done:;
     }
-    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 2973, __pyx_L1_error)
+    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(0, 2976, __pyx_L1_error)
     __Pyx_XDECREF_SET(__pyx_v_event, __pyx_t_4);
     __pyx_t_4 = 0;
     __Pyx_XDECREF_SET(__pyx_v_element, ((struct LxmlElement *)__pyx_t_5));
     __pyx_t_5 = 0;
 
-    /* "lxml/etree.pyx":2974
+    /* "lxml/etree.pyx":2977
  *         while result is None:
  *             event, element = self._nextEvent() # raises StopIteration
  *             if event == u"start":             # <<<<<<<<<<<<<<
  *                 result = element.text
  *             elif element is not self._start_element:
  */
-    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_event, __pyx_n_u_start, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2974, __pyx_L1_error)
+    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_event, __pyx_n_u_start, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2977, __pyx_L1_error)
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":2975
+      /* "lxml/etree.pyx":2978
  *             event, element = self._nextEvent() # raises StopIteration
  *             if event == u"start":
  *                 result = element.text             # <<<<<<<<<<<<<<
  *             elif element is not self._start_element:
  *                 result = element.tail
  */
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2975, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2978, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":2974
+      /* "lxml/etree.pyx":2977
  *         while result is None:
  *             event, element = self._nextEvent() # raises StopIteration
  *             if event == u"start":             # <<<<<<<<<<<<<<
@@ -78490,7 +78470,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
       goto __pyx_L7;
     }
 
-    /* "lxml/etree.pyx":2976
+    /* "lxml/etree.pyx":2979
  *             if event == u"start":
  *                 result = element.text
  *             elif element is not self._start_element:             # <<<<<<<<<<<<<<
@@ -78501,19 +78481,19 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
     __pyx_t_1 = (__pyx_t_2 != 0);
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":2977
+      /* "lxml/etree.pyx":2980
  *                 result = element.text
  *             elif element is not self._start_element:
  *                 result = element.tail             # <<<<<<<<<<<<<<
  *         return result
  * 
  */
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_tail); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2977, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_tail); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2980, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":2976
+      /* "lxml/etree.pyx":2979
  *             if event == u"start":
  *                 result = element.text
  *             elif element is not self._start_element:             # <<<<<<<<<<<<<<
@@ -78524,7 +78504,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
     __pyx_L7:;
   }
 
-  /* "lxml/etree.pyx":2978
+  /* "lxml/etree.pyx":2981
  *             elif element is not self._start_element:
  *                 result = element.tail
  *         return result             # <<<<<<<<<<<<<<
@@ -78536,7 +78516,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2969
+  /* "lxml/etree.pyx":2972
  *         return self
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -78561,7 +78541,7 @@ static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator_4__next__(struct __
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2980
+/* "lxml/etree.pyx":2983
  *         return result
  * 
  * cdef xmlNode* _createElement(xmlDoc* c_doc, object name_utf) except NULL:             # <<<<<<<<<<<<<<
@@ -78575,7 +78555,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createElement(xmlDoc *__pyx_v_c_doc, PyObj
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_createElement", 0);
 
-  /* "lxml/etree.pyx":2982
+  /* "lxml/etree.pyx":2985
  * cdef xmlNode* _createElement(xmlDoc* c_doc, object name_utf) except NULL:
  *     cdef xmlNode* c_node
  *     c_node = tree.xmlNewDocNode(c_doc, NULL, _xcstr(name_utf), NULL)             # <<<<<<<<<<<<<<
@@ -78584,7 +78564,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createElement(xmlDoc *__pyx_v_c_doc, PyObj
  */
   __pyx_v_c_node = xmlNewDocNode(__pyx_v_c_doc, NULL, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_name_utf), NULL);
 
-  /* "lxml/etree.pyx":2983
+  /* "lxml/etree.pyx":2986
  *     cdef xmlNode* c_node
  *     c_node = tree.xmlNewDocNode(c_doc, NULL, _xcstr(name_utf), NULL)
  *     return c_node             # <<<<<<<<<<<<<<
@@ -78594,7 +78574,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createElement(xmlDoc *__pyx_v_c_doc, PyObj
   __pyx_r = __pyx_v_c_node;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2980
+  /* "lxml/etree.pyx":2983
  *         return result
  * 
  * cdef xmlNode* _createElement(xmlDoc* c_doc, object name_utf) except NULL:             # <<<<<<<<<<<<<<
@@ -78608,7 +78588,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createElement(xmlDoc *__pyx_v_c_doc, PyObj
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2985
+/* "lxml/etree.pyx":2988
  *     return c_node
  * 
  * cdef xmlNode* _createComment(xmlDoc* c_doc, const_xmlChar* text):             # <<<<<<<<<<<<<<
@@ -78622,7 +78602,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createComment(xmlDoc *__pyx_v_c_doc, const
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_createComment", 0);
 
-  /* "lxml/etree.pyx":2987
+  /* "lxml/etree.pyx":2990
  * cdef xmlNode* _createComment(xmlDoc* c_doc, const_xmlChar* text):
  *     cdef xmlNode* c_node
  *     c_node = tree.xmlNewDocComment(c_doc, text)             # <<<<<<<<<<<<<<
@@ -78631,7 +78611,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createComment(xmlDoc *__pyx_v_c_doc, const
  */
   __pyx_v_c_node = xmlNewDocComment(__pyx_v_c_doc, __pyx_v_text);
 
-  /* "lxml/etree.pyx":2988
+  /* "lxml/etree.pyx":2991
  *     cdef xmlNode* c_node
  *     c_node = tree.xmlNewDocComment(c_doc, text)
  *     return c_node             # <<<<<<<<<<<<<<
@@ -78641,7 +78621,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createComment(xmlDoc *__pyx_v_c_doc, const
   __pyx_r = __pyx_v_c_node;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2985
+  /* "lxml/etree.pyx":2988
  *     return c_node
  * 
  * cdef xmlNode* _createComment(xmlDoc* c_doc, const_xmlChar* text):             # <<<<<<<<<<<<<<
@@ -78655,7 +78635,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createComment(xmlDoc *__pyx_v_c_doc, const
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2990
+/* "lxml/etree.pyx":2993
  *     return c_node
  * 
  * cdef xmlNode* _createPI(xmlDoc* c_doc, const_xmlChar* target, const_xmlChar* text):             # <<<<<<<<<<<<<<
@@ -78669,7 +78649,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createPI(xmlDoc *__pyx_v_c_doc, const xmlC
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_createPI", 0);
 
-  /* "lxml/etree.pyx":2992
+  /* "lxml/etree.pyx":2995
  * cdef xmlNode* _createPI(xmlDoc* c_doc, const_xmlChar* target, const_xmlChar* text):
  *     cdef xmlNode* c_node
  *     c_node = tree.xmlNewDocPI(c_doc, target, text)             # <<<<<<<<<<<<<<
@@ -78678,7 +78658,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createPI(xmlDoc *__pyx_v_c_doc, const xmlC
  */
   __pyx_v_c_node = xmlNewDocPI(__pyx_v_c_doc, __pyx_v_target, __pyx_v_text);
 
-  /* "lxml/etree.pyx":2993
+  /* "lxml/etree.pyx":2996
  *     cdef xmlNode* c_node
  *     c_node = tree.xmlNewDocPI(c_doc, target, text)
  *     return c_node             # <<<<<<<<<<<<<<
@@ -78688,7 +78668,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createPI(xmlDoc *__pyx_v_c_doc, const xmlC
   __pyx_r = __pyx_v_c_node;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2990
+  /* "lxml/etree.pyx":2993
  *     return c_node
  * 
  * cdef xmlNode* _createPI(xmlDoc* c_doc, const_xmlChar* target, const_xmlChar* text):             # <<<<<<<<<<<<<<
@@ -78702,7 +78682,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createPI(xmlDoc *__pyx_v_c_doc, const xmlC
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":2995
+/* "lxml/etree.pyx":2998
  *     return c_node
  * 
  * cdef xmlNode* _createEntity(xmlDoc* c_doc, const_xmlChar* name):             # <<<<<<<<<<<<<<
@@ -78716,7 +78696,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createEntity(xmlDoc *__pyx_v_c_doc, const
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_createEntity", 0);
 
-  /* "lxml/etree.pyx":2997
+  /* "lxml/etree.pyx":3000
  * cdef xmlNode* _createEntity(xmlDoc* c_doc, const_xmlChar* name):
  *     cdef xmlNode* c_node
  *     c_node = tree.xmlNewReference(c_doc, name)             # <<<<<<<<<<<<<<
@@ -78725,7 +78705,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createEntity(xmlDoc *__pyx_v_c_doc, const
  */
   __pyx_v_c_node = xmlNewReference(__pyx_v_c_doc, __pyx_v_name);
 
-  /* "lxml/etree.pyx":2998
+  /* "lxml/etree.pyx":3001
  *     cdef xmlNode* c_node
  *     c_node = tree.xmlNewReference(c_doc, name)
  *     return c_node             # <<<<<<<<<<<<<<
@@ -78735,7 +78715,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createEntity(xmlDoc *__pyx_v_c_doc, const
   __pyx_r = __pyx_v_c_node;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":2995
+  /* "lxml/etree.pyx":2998
  *     return c_node
  * 
  * cdef xmlNode* _createEntity(xmlDoc* c_doc, const_xmlChar* name):             # <<<<<<<<<<<<<<
@@ -78749,7 +78729,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createEntity(xmlDoc *__pyx_v_c_doc, const
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3002
+/* "lxml/etree.pyx":3005
  * # module-level API for ElementTree
  * 
  * def Element(_tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
@@ -78808,7 +78788,7 @@ static PyObject *__pyx_pw_4lxml_5etree_7Element(PyObject *__pyx_self, PyObject *
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, pos_args, "Element") < 0)) __PYX_ERR(0, 3002, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, pos_args, "Element") < 0)) __PYX_ERR(0, 3005, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -78827,7 +78807,7 @@ static PyObject *__pyx_pw_4lxml_5etree_7Element(PyObject *__pyx_self, PyObject *
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("Element", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3002, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("Element", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3005, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v__extra); __pyx_v__extra = 0;
   __Pyx_AddTraceback("lxml.etree.Element", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -78848,7 +78828,7 @@ static PyObject *__pyx_pf_4lxml_5etree_6Element(CYTHON_UNUSED PyObject *__pyx_se
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("Element", 0);
 
-  /* "lxml/etree.pyx":3012
+  /* "lxml/etree.pyx":3015
  *     create an Element within a specific document or parser context.
  *     """
  *     return _makeElement(_tag, NULL, None, None, None, None,             # <<<<<<<<<<<<<<
@@ -78857,20 +78837,20 @@ static PyObject *__pyx_pf_4lxml_5etree_6Element(CYTHON_UNUSED PyObject *__pyx_se
  */
   __Pyx_XDECREF(__pyx_r);
 
-  /* "lxml/etree.pyx":3013
+  /* "lxml/etree.pyx":3016
  *     """
  *     return _makeElement(_tag, NULL, None, None, None, None,
  *                         attrib, nsmap, _extra)             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v__tag, NULL, ((struct LxmlDocument *)Py_None), ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None), Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v__tag, NULL, ((struct LxmlDocument *)Py_None), ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None), Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3015, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3002
+  /* "lxml/etree.pyx":3005
  * # module-level API for ElementTree
  * 
  * def Element(_tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
@@ -78889,7 +78869,7 @@ static PyObject *__pyx_pf_4lxml_5etree_6Element(CYTHON_UNUSED PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3016
+/* "lxml/etree.pyx":3019
  * 
  * 
  * def Comment(text=None):             # <<<<<<<<<<<<<<
@@ -78928,7 +78908,7 @@ static PyObject *__pyx_pw_4lxml_5etree_9Comment(PyObject *__pyx_self, PyObject *
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Comment") < 0)) __PYX_ERR(0, 3016, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Comment") < 0)) __PYX_ERR(0, 3019, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -78942,7 +78922,7 @@ static PyObject *__pyx_pw_4lxml_5etree_9Comment(PyObject *__pyx_self, PyObject *
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("Comment", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3016, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("Comment", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3019, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.Comment", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -78970,7 +78950,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8Comment(CYTHON_UNUSED PyObject *__pyx_se
   __Pyx_RefNannySetupContext("Comment", 0);
   __Pyx_INCREF(__pyx_v_text);
 
-  /* "lxml/etree.pyx":3026
+  /* "lxml/etree.pyx":3029
  *     cdef xmlDoc*   c_doc
  * 
  *     if text is None:             # <<<<<<<<<<<<<<
@@ -78981,7 +78961,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8Comment(CYTHON_UNUSED PyObject *__pyx_se
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3027
+    /* "lxml/etree.pyx":3030
  * 
  *     if text is None:
  *         text = b''             # <<<<<<<<<<<<<<
@@ -78991,7 +78971,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8Comment(CYTHON_UNUSED PyObject *__pyx_se
     __Pyx_INCREF(__pyx_kp_b__16);
     __Pyx_DECREF_SET(__pyx_v_text, __pyx_kp_b__16);
 
-    /* "lxml/etree.pyx":3026
+    /* "lxml/etree.pyx":3029
  *     cdef xmlDoc*   c_doc
  * 
  *     if text is None:             # <<<<<<<<<<<<<<
@@ -79001,7 +78981,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8Comment(CYTHON_UNUSED PyObject *__pyx_se
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":3029
+  /* "lxml/etree.pyx":3032
  *         text = b''
  *     else:
  *         text = _utf8(text)             # <<<<<<<<<<<<<<
@@ -79009,50 +78989,50 @@ static PyObject *__pyx_pf_4lxml_5etree_8Comment(CYTHON_UNUSED PyObject *__pyx_se
  *             raise ValueError("Comment may not contain '--' or end with '-'")
  */
   /*else*/ {
-    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3029, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3032, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":3030
+    /* "lxml/etree.pyx":3033
  *     else:
  *         text = _utf8(text)
  *         if b'--' in text or text.endswith(b'-'):             # <<<<<<<<<<<<<<
  *             raise ValueError("Comment may not contain '--' or end with '-'")
  * 
  */
-    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__46, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3030, __pyx_L1_error)
+    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__48, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3033, __pyx_L1_error)
     __pyx_t_4 = (__pyx_t_1 != 0);
     if (!__pyx_t_4) {
     } else {
       __pyx_t_2 = __pyx_t_4;
       goto __pyx_L5_bool_binop_done;
     }
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3030, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3033, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3030, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3033, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3030, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3033, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_2 = __pyx_t_4;
     __pyx_L5_bool_binop_done:;
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":3031
+      /* "lxml/etree.pyx":3034
  *         text = _utf8(text)
  *         if b'--' in text or text.endswith(b'-'):
  *             raise ValueError("Comment may not contain '--' or end with '-'")             # <<<<<<<<<<<<<<
  * 
  *     c_doc = _newXMLDoc()
  */
-      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3031, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3034, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __PYX_ERR(0, 3031, __pyx_L1_error)
+      __PYX_ERR(0, 3034, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":3030
+      /* "lxml/etree.pyx":3033
  *     else:
  *         text = _utf8(text)
  *         if b'--' in text or text.endswith(b'-'):             # <<<<<<<<<<<<<<
@@ -79063,29 +79043,29 @@ static PyObject *__pyx_pf_4lxml_5etree_8Comment(CYTHON_UNUSED PyObject *__pyx_se
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":3033
+  /* "lxml/etree.pyx":3036
  *             raise ValueError("Comment may not contain '--' or end with '-'")
  * 
  *     c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
  *     doc = _documentFactory(c_doc, None)
  *     c_node = _createComment(c_doc, _xcstr(text))
  */
-  __pyx_t_6 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(0, 3033, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_6 == ((xmlDoc *)NULL))) __PYX_ERR(0, 3036, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_6;
 
-  /* "lxml/etree.pyx":3034
+  /* "lxml/etree.pyx":3037
  * 
  *     c_doc = _newXMLDoc()
  *     doc = _documentFactory(c_doc, None)             # <<<<<<<<<<<<<<
  *     c_node = _createComment(c_doc, _xcstr(text))
  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
  */
-  __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3034, __pyx_L1_error)
+  __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3037, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_5);
   __pyx_t_5 = 0;
 
-  /* "lxml/etree.pyx":3035
+  /* "lxml/etree.pyx":3038
  *     c_doc = _newXMLDoc()
  *     doc = _documentFactory(c_doc, None)
  *     c_node = _createComment(c_doc, _xcstr(text))             # <<<<<<<<<<<<<<
@@ -79094,7 +79074,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8Comment(CYTHON_UNUSED PyObject *__pyx_se
  */
   __pyx_v_c_node = __pyx_f_4lxml_5etree__createComment(__pyx_v_c_doc, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_text));
 
-  /* "lxml/etree.pyx":3036
+  /* "lxml/etree.pyx":3039
  *     doc = _documentFactory(c_doc, None)
  *     c_node = _createComment(c_doc, _xcstr(text))
  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)             # <<<<<<<<<<<<<<
@@ -79103,7 +79083,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8Comment(CYTHON_UNUSED PyObject *__pyx_se
  */
   xmlAddChild(((xmlNode *)__pyx_v_c_doc), __pyx_v_c_node);
 
-  /* "lxml/etree.pyx":3037
+  /* "lxml/etree.pyx":3040
  *     c_node = _createComment(c_doc, _xcstr(text))
  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
  *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<<
@@ -79111,13 +79091,13 @@ static PyObject *__pyx_pf_4lxml_5etree_8Comment(CYTHON_UNUSED PyObject *__pyx_se
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3037, __pyx_L1_error)
+  __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3040, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_r = __pyx_t_5;
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3016
+  /* "lxml/etree.pyx":3019
  * 
  * 
  * def Comment(text=None):             # <<<<<<<<<<<<<<
@@ -79139,7 +79119,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8Comment(CYTHON_UNUSED PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3040
+/* "lxml/etree.pyx":3043
  * 
  * 
  * def ProcessingInstruction(target, text=None):             # <<<<<<<<<<<<<<
@@ -79185,7 +79165,7 @@ static PyObject *__pyx_pw_4lxml_5etree_11ProcessingInstruction(PyObject *__pyx_s
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ProcessingInstruction") < 0)) __PYX_ERR(0, 3040, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ProcessingInstruction") < 0)) __PYX_ERR(0, 3043, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -79201,7 +79181,7 @@ static PyObject *__pyx_pw_4lxml_5etree_11ProcessingInstruction(PyObject *__pyx_s
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("ProcessingInstruction", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3040, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("ProcessingInstruction", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3043, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.ProcessingInstruction", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -79231,35 +79211,35 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
   __Pyx_INCREF(__pyx_v_target);
   __Pyx_INCREF(__pyx_v_text);
 
-  /* "lxml/etree.pyx":3050
+  /* "lxml/etree.pyx":3053
  *     cdef xmlDoc*   c_doc
  * 
  *     target = _utf8(target)             # <<<<<<<<<<<<<<
  *     _tagValidOrRaise(target)
  *     if target.lower() == b'xml':
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3050, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3053, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF_SET(__pyx_v_target, __pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":3051
+  /* "lxml/etree.pyx":3054
  * 
  *     target = _utf8(target)
  *     _tagValidOrRaise(target)             # <<<<<<<<<<<<<<
  *     if target.lower() == b'xml':
  *         raise ValueError("Invalid PI name '%s'" % target)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_target); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 3051, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_target); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 3054, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3052
+  /* "lxml/etree.pyx":3055
  *     target = _utf8(target)
  *     _tagValidOrRaise(target)
  *     if target.lower() == b'xml':             # <<<<<<<<<<<<<<
  *         raise ValueError("Invalid PI name '%s'" % target)
  * 
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_target, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3052, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_target, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3055, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -79272,39 +79252,39 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
     }
   }
   if (__pyx_t_4) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3052, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3055, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   } else {
-    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3052, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3055, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_n_b_xml, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3052, __pyx_L1_error)
+  __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_n_b_xml, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3055, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":3053
+    /* "lxml/etree.pyx":3056
  *     _tagValidOrRaise(target)
  *     if target.lower() == b'xml':
  *         raise ValueError("Invalid PI name '%s'" % target)             # <<<<<<<<<<<<<<
  * 
  *     if text is None:
  */
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_PI_name_s, __pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3053, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_PI_name_s, __pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3056, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3053, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3056, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_1);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3053, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3056, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3053, __pyx_L1_error)
+    __PYX_ERR(0, 3056, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":3052
+    /* "lxml/etree.pyx":3055
  *     target = _utf8(target)
  *     _tagValidOrRaise(target)
  *     if target.lower() == b'xml':             # <<<<<<<<<<<<<<
@@ -79313,7 +79293,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
  */
   }
 
-  /* "lxml/etree.pyx":3055
+  /* "lxml/etree.pyx":3058
  *         raise ValueError("Invalid PI name '%s'" % target)
  * 
  *     if text is None:             # <<<<<<<<<<<<<<
@@ -79324,7 +79304,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
   __pyx_t_6 = (__pyx_t_5 != 0);
   if (__pyx_t_6) {
 
-    /* "lxml/etree.pyx":3056
+    /* "lxml/etree.pyx":3059
  * 
  *     if text is None:
  *         text = b''             # <<<<<<<<<<<<<<
@@ -79334,7 +79314,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
     __Pyx_INCREF(__pyx_kp_b__16);
     __Pyx_DECREF_SET(__pyx_v_text, __pyx_kp_b__16);
 
-    /* "lxml/etree.pyx":3055
+    /* "lxml/etree.pyx":3058
  *         raise ValueError("Invalid PI name '%s'" % target)
  * 
  *     if text is None:             # <<<<<<<<<<<<<<
@@ -79344,7 +79324,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
     goto __pyx_L4;
   }
 
-  /* "lxml/etree.pyx":3058
+  /* "lxml/etree.pyx":3061
  *         text = b''
  *     else:
  *         text = _utf8(text)             # <<<<<<<<<<<<<<
@@ -79352,36 +79332,36 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
  *             raise ValueError("PI text must not contain '?>'")
  */
   /*else*/ {
-    __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3058, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3061, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/etree.pyx":3059
+    /* "lxml/etree.pyx":3062
  *     else:
  *         text = _utf8(text)
  *         if b'?>' in text:             # <<<<<<<<<<<<<<
  *             raise ValueError("PI text must not contain '?>'")
  * 
  */
-    __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__49, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3059, __pyx_L1_error)
+    __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__51, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 3062, __pyx_L1_error)
     __pyx_t_5 = (__pyx_t_6 != 0);
     if (__pyx_t_5) {
 
-      /* "lxml/etree.pyx":3060
+      /* "lxml/etree.pyx":3063
  *         text = _utf8(text)
  *         if b'?>' in text:
  *             raise ValueError("PI text must not contain '?>'")             # <<<<<<<<<<<<<<
  * 
  *     c_doc = _newXMLDoc()
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3060, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3063, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 3060, __pyx_L1_error)
+      __PYX_ERR(0, 3063, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":3059
+      /* "lxml/etree.pyx":3062
  *     else:
  *         text = _utf8(text)
  *         if b'?>' in text:             # <<<<<<<<<<<<<<
@@ -79392,29 +79372,29 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
   }
   __pyx_L4:;
 
-  /* "lxml/etree.pyx":3062
+  /* "lxml/etree.pyx":3065
  *             raise ValueError("PI text must not contain '?>'")
  * 
  *     c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
  *     doc = _documentFactory(c_doc, None)
  *     c_node = _createPI(c_doc, _xcstr(target), _xcstr(text))
  */
-  __pyx_t_7 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(0, 3062, __pyx_L1_error)
+  __pyx_t_7 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(0, 3065, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_7;
 
-  /* "lxml/etree.pyx":3063
+  /* "lxml/etree.pyx":3066
  * 
  *     c_doc = _newXMLDoc()
  *     doc = _documentFactory(c_doc, None)             # <<<<<<<<<<<<<<
  *     c_node = _createPI(c_doc, _xcstr(target), _xcstr(text))
  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3063, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3066, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":3064
+  /* "lxml/etree.pyx":3067
  *     c_doc = _newXMLDoc()
  *     doc = _documentFactory(c_doc, None)
  *     c_node = _createPI(c_doc, _xcstr(target), _xcstr(text))             # <<<<<<<<<<<<<<
@@ -79423,7 +79403,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
  */
   __pyx_v_c_node = __pyx_f_4lxml_5etree__createPI(__pyx_v_c_doc, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_target), (const xmlChar*)PyBytes_AS_STRING(__pyx_v_text));
 
-  /* "lxml/etree.pyx":3065
+  /* "lxml/etree.pyx":3068
  *     doc = _documentFactory(c_doc, None)
  *     c_node = _createPI(c_doc, _xcstr(target), _xcstr(text))
  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)             # <<<<<<<<<<<<<<
@@ -79432,7 +79412,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
  */
   xmlAddChild(((xmlNode *)__pyx_v_c_doc), __pyx_v_c_node);
 
-  /* "lxml/etree.pyx":3066
+  /* "lxml/etree.pyx":3069
  *     c_node = _createPI(c_doc, _xcstr(target), _xcstr(text))
  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
  *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<<
@@ -79440,13 +79420,13 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
  * PI = ProcessingInstruction
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3066, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3069, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3040
+  /* "lxml/etree.pyx":3043
  * 
  * 
  * def ProcessingInstruction(target, text=None):             # <<<<<<<<<<<<<<
@@ -79470,7 +79450,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10ProcessingInstruction(CYTHON_UNUSED PyO
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3086
+/* "lxml/etree.pyx":3089
  *     """
  *     cdef bytes _utf8_data
  *     def __cinit__(self, data):             # <<<<<<<<<<<<<<
@@ -79504,7 +79484,7 @@ static int __pyx_pw_4lxml_5etree_5CDATA_1__cinit__(PyObject *__pyx_v_self, PyObj
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 3086, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 3089, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -79515,7 +79495,7 @@ static int __pyx_pw_4lxml_5etree_5CDATA_1__cinit__(PyObject *__pyx_v_self, PyObj
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3086, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3089, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.CDATA.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -79537,43 +79517,43 @@ static int __pyx_pf_4lxml_5etree_5CDATA___cinit__(struct __pyx_obj_4lxml_5etree_
   int __pyx_t_3;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "lxml/etree.pyx":3087
+  /* "lxml/etree.pyx":3090
  *     cdef bytes _utf8_data
  *     def __cinit__(self, data):
  *         _utf8_data = _utf8(data)             # <<<<<<<<<<<<<<
  *         if b']]>' in _utf8_data:
  *             raise ValueError("']]>' not allowed inside CDATA")
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3087, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3090, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v__utf8_data = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":3088
+  /* "lxml/etree.pyx":3091
  *     def __cinit__(self, data):
  *         _utf8_data = _utf8(data)
  *         if b']]>' in _utf8_data:             # <<<<<<<<<<<<<<
  *             raise ValueError("']]>' not allowed inside CDATA")
  *         self._utf8_data = _utf8_data
  */
-  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__51, __pyx_v__utf8_data, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3088, __pyx_L1_error)
+  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__53, __pyx_v__utf8_data, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3091, __pyx_L1_error)
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/etree.pyx":3089
+    /* "lxml/etree.pyx":3092
  *         _utf8_data = _utf8(data)
  *         if b']]>' in _utf8_data:
  *             raise ValueError("']]>' not allowed inside CDATA")             # <<<<<<<<<<<<<<
  *         self._utf8_data = _utf8_data
  * 
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3089, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3092, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3089, __pyx_L1_error)
+    __PYX_ERR(0, 3092, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":3088
+    /* "lxml/etree.pyx":3091
  *     def __cinit__(self, data):
  *         _utf8_data = _utf8(data)
  *         if b']]>' in _utf8_data:             # <<<<<<<<<<<<<<
@@ -79582,7 +79562,7 @@ static int __pyx_pf_4lxml_5etree_5CDATA___cinit__(struct __pyx_obj_4lxml_5etree_
  */
   }
 
-  /* "lxml/etree.pyx":3090
+  /* "lxml/etree.pyx":3093
  *         if b']]>' in _utf8_data:
  *             raise ValueError("']]>' not allowed inside CDATA")
  *         self._utf8_data = _utf8_data             # <<<<<<<<<<<<<<
@@ -79595,7 +79575,7 @@ static int __pyx_pf_4lxml_5etree_5CDATA___cinit__(struct __pyx_obj_4lxml_5etree_
   __Pyx_DECREF(__pyx_v_self->_utf8_data);
   __pyx_v_self->_utf8_data = __pyx_v__utf8_data;
 
-  /* "lxml/etree.pyx":3086
+  /* "lxml/etree.pyx":3089
  *     """
  *     cdef bytes _utf8_data
  *     def __cinit__(self, data):             # <<<<<<<<<<<<<<
@@ -79616,7 +79596,7 @@ static int __pyx_pf_4lxml_5etree_5CDATA___cinit__(struct __pyx_obj_4lxml_5etree_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3093
+/* "lxml/etree.pyx":3096
  * 
  * 
  * def Entity(name):             # <<<<<<<<<<<<<<
@@ -79652,19 +79632,19 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
   xmlDoc *__pyx_t_3;
   __Pyx_RefNannySetupContext("Entity", 0);
 
-  /* "lxml/etree.pyx":3105
+  /* "lxml/etree.pyx":3108
  *     cdef xmlNode*  c_node
  *     cdef xmlDoc*   c_doc
  *     name_utf = _utf8(name)             # <<<<<<<<<<<<<<
  *     c_name = _xcstr(name_utf)
  *     if c_name[0] == c'#':
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3105, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3108, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_name_utf = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":3106
+  /* "lxml/etree.pyx":3109
  *     cdef xmlDoc*   c_doc
  *     name_utf = _utf8(name)
  *     c_name = _xcstr(name_utf)             # <<<<<<<<<<<<<<
@@ -79673,7 +79653,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
  */
   __pyx_v_c_name = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_name_utf);
 
-  /* "lxml/etree.pyx":3107
+  /* "lxml/etree.pyx":3110
  *     name_utf = _utf8(name)
  *     c_name = _xcstr(name_utf)
  *     if c_name[0] == c'#':             # <<<<<<<<<<<<<<
@@ -79683,7 +79663,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
   __pyx_t_2 = (((__pyx_v_c_name[0]) == '#') != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3108
+    /* "lxml/etree.pyx":3111
  *     c_name = _xcstr(name_utf)
  *     if c_name[0] == c'#':
  *         if not _characterReferenceIsValid(c_name + 1):             # <<<<<<<<<<<<<<
@@ -79693,20 +79673,20 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
     __pyx_t_2 = ((!(__pyx_f_4lxml_5etree__characterReferenceIsValid((__pyx_v_c_name + 1)) != 0)) != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":3109
+      /* "lxml/etree.pyx":3112
  *     if c_name[0] == c'#':
  *         if not _characterReferenceIsValid(c_name + 1):
  *             raise ValueError, u"Invalid character reference: '%s'" % name             # <<<<<<<<<<<<<<
  *     elif not _xmlNameIsValid(c_name):
  *         raise ValueError, u"Invalid entity reference: '%s'" % name
  */
-      __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Invalid_character_reference_s, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3109, __pyx_L1_error)
+      __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Invalid_character_reference_s, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3112, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_1, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 3109, __pyx_L1_error)
+      __PYX_ERR(0, 3112, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":3108
+      /* "lxml/etree.pyx":3111
  *     c_name = _xcstr(name_utf)
  *     if c_name[0] == c'#':
  *         if not _characterReferenceIsValid(c_name + 1):             # <<<<<<<<<<<<<<
@@ -79715,7 +79695,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
  */
     }
 
-    /* "lxml/etree.pyx":3107
+    /* "lxml/etree.pyx":3110
  *     name_utf = _utf8(name)
  *     c_name = _xcstr(name_utf)
  *     if c_name[0] == c'#':             # <<<<<<<<<<<<<<
@@ -79725,7 +79705,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":3110
+  /* "lxml/etree.pyx":3113
  *         if not _characterReferenceIsValid(c_name + 1):
  *             raise ValueError, u"Invalid character reference: '%s'" % name
  *     elif not _xmlNameIsValid(c_name):             # <<<<<<<<<<<<<<
@@ -79735,20 +79715,20 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
   __pyx_t_2 = ((!(__pyx_f_4lxml_5etree__xmlNameIsValid(__pyx_v_c_name) != 0)) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3111
+    /* "lxml/etree.pyx":3114
  *             raise ValueError, u"Invalid character reference: '%s'" % name
  *     elif not _xmlNameIsValid(c_name):
  *         raise ValueError, u"Invalid entity reference: '%s'" % name             # <<<<<<<<<<<<<<
  *     c_doc = _newXMLDoc()
  *     doc = _documentFactory(c_doc, None)
  */
-    __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Invalid_entity_reference_s, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3111, __pyx_L1_error)
+    __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Invalid_entity_reference_s, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3114, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_1, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3111, __pyx_L1_error)
+    __PYX_ERR(0, 3114, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":3110
+    /* "lxml/etree.pyx":3113
  *         if not _characterReferenceIsValid(c_name + 1):
  *             raise ValueError, u"Invalid character reference: '%s'" % name
  *     elif not _xmlNameIsValid(c_name):             # <<<<<<<<<<<<<<
@@ -79758,29 +79738,29 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":3112
+  /* "lxml/etree.pyx":3115
  *     elif not _xmlNameIsValid(c_name):
  *         raise ValueError, u"Invalid entity reference: '%s'" % name
  *     c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
  *     doc = _documentFactory(c_doc, None)
  *     c_node = _createEntity(c_doc, c_name)
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(0, 3112, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(0, 3115, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_3;
 
-  /* "lxml/etree.pyx":3113
+  /* "lxml/etree.pyx":3116
  *         raise ValueError, u"Invalid entity reference: '%s'" % name
  *     c_doc = _newXMLDoc()
  *     doc = _documentFactory(c_doc, None)             # <<<<<<<<<<<<<<
  *     c_node = _createEntity(c_doc, c_name)
  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3113, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3116, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":3114
+  /* "lxml/etree.pyx":3117
  *     c_doc = _newXMLDoc()
  *     doc = _documentFactory(c_doc, None)
  *     c_node = _createEntity(c_doc, c_name)             # <<<<<<<<<<<<<<
@@ -79789,7 +79769,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
  */
   __pyx_v_c_node = __pyx_f_4lxml_5etree__createEntity(__pyx_v_c_doc, __pyx_v_c_name);
 
-  /* "lxml/etree.pyx":3115
+  /* "lxml/etree.pyx":3118
  *     doc = _documentFactory(c_doc, None)
  *     c_node = _createEntity(c_doc, c_name)
  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)             # <<<<<<<<<<<<<<
@@ -79798,7 +79778,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
  */
   xmlAddChild(((xmlNode *)__pyx_v_c_doc), __pyx_v_c_node);
 
-  /* "lxml/etree.pyx":3116
+  /* "lxml/etree.pyx":3119
  *     c_node = _createEntity(c_doc, c_name)
  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
  *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<<
@@ -79806,13 +79786,13 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3116, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3119, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3093
+  /* "lxml/etree.pyx":3096
  * 
  * 
  * def Entity(name):             # <<<<<<<<<<<<<<
@@ -79833,7 +79813,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12Entity(CYTHON_UNUSED PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3119
+/* "lxml/etree.pyx":3122
  * 
  * 
  * def SubElement(_Element _parent not None, _tag,             # <<<<<<<<<<<<<<
@@ -79860,7 +79840,7 @@ static PyObject *__pyx_pw_4lxml_5etree_15SubElement(PyObject *__pyx_self, PyObje
     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parent,&__pyx_n_s_tag_2,&__pyx_n_s_attrib,&__pyx_n_s_nsmap,0};
     PyObject* values[4] = {0,0,0,0};
 
-    /* "lxml/etree.pyx":3120
+    /* "lxml/etree.pyx":3123
  * 
  * def SubElement(_Element _parent not None, _tag,
  *                attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
@@ -79893,7 +79873,7 @@ static PyObject *__pyx_pw_4lxml_5etree_15SubElement(PyObject *__pyx_self, PyObje
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tag_2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("SubElement", 0, 2, 4, 1); __PYX_ERR(0, 3119, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("SubElement", 0, 2, 4, 1); __PYX_ERR(0, 3122, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -79909,7 +79889,7 @@ static PyObject *__pyx_pw_4lxml_5etree_15SubElement(PyObject *__pyx_self, PyObje
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, pos_args, "SubElement") < 0)) __PYX_ERR(0, 3119, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, pos_args, "SubElement") < 0)) __PYX_ERR(0, 3122, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -79930,17 +79910,17 @@ static PyObject *__pyx_pw_4lxml_5etree_15SubElement(PyObject *__pyx_self, PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("SubElement", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3119, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("SubElement", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3122, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v__extra); __pyx_v__extra = 0;
   __Pyx_AddTraceback("lxml.etree.SubElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v__parent), __pyx_ptype_4lxml_5etree__Element, 0, "_parent", 0))) __PYX_ERR(0, 3119, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v__parent), __pyx_ptype_4lxml_5etree__Element, 0, "_parent", 0))) __PYX_ERR(0, 3122, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_14SubElement(__pyx_self, __pyx_v__parent, __pyx_v__tag, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra);
 
-  /* "lxml/etree.pyx":3119
+  /* "lxml/etree.pyx":3122
  * 
  * 
  * def SubElement(_Element _parent not None, _tag,             # <<<<<<<<<<<<<<
@@ -79964,7 +79944,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14SubElement(CYTHON_UNUSED PyObject *__py
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("SubElement", 0);
 
-  /* "lxml/etree.pyx":3126
+  /* "lxml/etree.pyx":3129
  *     appends it to an existing element.
  *     """
  *     return _makeSubElement(_parent, _tag, None, None, attrib, nsmap, _extra)             # <<<<<<<<<<<<<<
@@ -79972,13 +79952,13 @@ static PyObject *__pyx_pf_4lxml_5etree_14SubElement(CYTHON_UNUSED PyObject *__py
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__makeSubElement(__pyx_v__parent, __pyx_v__tag, Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3126, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__makeSubElement(__pyx_v__parent, __pyx_v__tag, Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3129, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3119
+  /* "lxml/etree.pyx":3122
  * 
  * 
  * def SubElement(_Element _parent not None, _tag,             # <<<<<<<<<<<<<<
@@ -79997,7 +79977,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14SubElement(CYTHON_UNUSED PyObject *__py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3129
+/* "lxml/etree.pyx":3132
  * 
  * 
  * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):             # <<<<<<<<<<<<<<
@@ -80047,7 +80027,7 @@ static PyObject *__pyx_pw_4lxml_5etree_17ElementTree(PyObject *__pyx_self, PyObj
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ElementTree") < 0)) __PYX_ERR(0, 3129, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ElementTree") < 0)) __PYX_ERR(0, 3132, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -80063,14 +80043,14 @@ static PyObject *__pyx_pw_4lxml_5etree_17ElementTree(PyObject *__pyx_self, PyObj
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("ElementTree", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3129, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("ElementTree", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3132, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.ElementTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 1, "element", 0))) __PYX_ERR(0, 3129, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3129, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 1, "element", 0))) __PYX_ERR(0, 3132, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3132, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_16ElementTree(__pyx_self, __pyx_v_element, __pyx_v_file, __pyx_v_parser);
 
   /* function exit code */
@@ -80101,7 +80081,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
   xmlDoc *__pyx_t_11;
   __Pyx_RefNannySetupContext("ElementTree", 0);
 
-  /* "lxml/etree.pyx":3141
+  /* "lxml/etree.pyx":3144
  *     cdef _Document doc
  * 
  *     if element is not None:             # <<<<<<<<<<<<<<
@@ -80112,7 +80092,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3142
+    /* "lxml/etree.pyx":3145
  * 
  *     if element is not None:
  *         doc  = element._doc             # <<<<<<<<<<<<<<
@@ -80124,7 +80104,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":3141
+    /* "lxml/etree.pyx":3144
  *     cdef _Document doc
  * 
  *     if element is not None:             # <<<<<<<<<<<<<<
@@ -80134,7 +80114,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":3143
+  /* "lxml/etree.pyx":3146
  *     if element is not None:
  *         doc  = element._doc
  *     elif file is not None:             # <<<<<<<<<<<<<<
@@ -80145,7 +80125,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":3144
+    /* "lxml/etree.pyx":3147
  *         doc  = element._doc
  *     elif file is not None:
  *         try:             # <<<<<<<<<<<<<<
@@ -80161,19 +80141,19 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "lxml/etree.pyx":3145
+        /* "lxml/etree.pyx":3148
  *     elif file is not None:
  *         try:
  *             doc = _parseDocument(file, parser, None)             # <<<<<<<<<<<<<<
  *         except _TargetParserResult as result_container:
  *             return result_container.result
  */
-        __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_file, __pyx_v_parser, Py_None)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3145, __pyx_L4_error)
+        __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_file, __pyx_v_parser, Py_None)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3148, __pyx_L4_error)
         __Pyx_GOTREF(__pyx_t_3);
         __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
         __pyx_t_3 = 0;
 
-        /* "lxml/etree.pyx":3144
+        /* "lxml/etree.pyx":3147
  *         doc  = element._doc
  *     elif file is not None:
  *         try:             # <<<<<<<<<<<<<<
@@ -80186,30 +80166,29 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L9_try_end;
       __pyx_L4_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":3146
+      /* "lxml/etree.pyx":3149
  *         try:
  *             doc = _parseDocument(file, parser, None)
  *         except _TargetParserResult as result_container:             # <<<<<<<<<<<<<<
  *             return result_container.result
  *     else:
  */
-      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3146, __pyx_L6_except_error)
+      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3149, __pyx_L6_except_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       if (__pyx_t_7) {
         __Pyx_AddTraceback("lxml.etree.ElementTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 3146, __pyx_L6_except_error)
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 3149, __pyx_L6_except_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_INCREF(__pyx_t_8);
         __pyx_v_result_container = __pyx_t_8;
 
-        /* "lxml/etree.pyx":3147
+        /* "lxml/etree.pyx":3150
  *             doc = _parseDocument(file, parser, None)
  *         except _TargetParserResult as result_container:
  *             return result_container.result             # <<<<<<<<<<<<<<
@@ -80217,7 +80196,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
  *         c_doc = _newXMLDoc()
  */
         __Pyx_XDECREF(__pyx_r);
-        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3147, __pyx_L6_except_error)
+        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3150, __pyx_L6_except_error)
         __Pyx_GOTREF(__pyx_t_10);
         __pyx_r = __pyx_t_10;
         __pyx_t_10 = 0;
@@ -80229,21 +80208,19 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
       goto __pyx_L6_except_error;
       __pyx_L6_except_error:;
 
-      /* "lxml/etree.pyx":3144
+      /* "lxml/etree.pyx":3147
  *         doc  = element._doc
  *     elif file is not None:
  *         try:             # <<<<<<<<<<<<<<
  *             doc = _parseDocument(file, parser, None)
  *         except _TargetParserResult as result_container:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L1_error;
       __pyx_L7_except_return:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -80252,7 +80229,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
       __pyx_L9_try_end:;
     }
 
-    /* "lxml/etree.pyx":3143
+    /* "lxml/etree.pyx":3146
  *     if element is not None:
  *         doc  = element._doc
  *     elif file is not None:             # <<<<<<<<<<<<<<
@@ -80262,7 +80239,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
     goto __pyx_L3;
   }
 
-  /* "lxml/etree.pyx":3149
+  /* "lxml/etree.pyx":3152
  *             return result_container.result
  *     else:
  *         c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
@@ -80270,24 +80247,24 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
  * 
  */
   /*else*/ {
-    __pyx_t_11 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_11 == NULL)) __PYX_ERR(0, 3149, __pyx_L1_error)
+    __pyx_t_11 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_11 == ((xmlDoc *)NULL))) __PYX_ERR(0, 3152, __pyx_L1_error)
     __pyx_v_c_doc = __pyx_t_11;
 
-    /* "lxml/etree.pyx":3150
+    /* "lxml/etree.pyx":3153
  *     else:
  *         c_doc = _newXMLDoc()
  *         doc = _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<<
  * 
  *     return _elementTreeFactory(doc, element)
  */
-    __pyx_t_9 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3150, __pyx_L1_error)
+    __pyx_t_9 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3153, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_9);
     __pyx_t_9 = 0;
   }
   __pyx_L3:;
 
-  /* "lxml/etree.pyx":3152
+  /* "lxml/etree.pyx":3155
  *         doc = _documentFactory(c_doc, parser)
  * 
  *     return _elementTreeFactory(doc, element)             # <<<<<<<<<<<<<<
@@ -80295,13 +80272,13 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_9 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, __pyx_v_element)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3152, __pyx_L1_error)
+  __pyx_t_9 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, __pyx_v_element)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3155, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __pyx_r = __pyx_t_9;
   __pyx_t_9 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3129
+  /* "lxml/etree.pyx":3132
  * 
  * 
  * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):             # <<<<<<<<<<<<<<
@@ -80325,7 +80302,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16ElementTree(CYTHON_UNUSED PyObject *__p
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3155
+/* "lxml/etree.pyx":3158
  * 
  * 
  * def HTML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
@@ -80378,7 +80355,7 @@ static PyObject *__pyx_pw_4lxml_5etree_19HTML(PyObject *__pyx_self, PyObject *__
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "HTML") < 0)) __PYX_ERR(0, 3155, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "HTML") < 0)) __PYX_ERR(0, 3158, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -80395,13 +80372,13 @@ static PyObject *__pyx_pw_4lxml_5etree_19HTML(PyObject *__pyx_self, PyObject *__
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("HTML", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3155, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("HTML", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3158, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.HTML", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3155, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3158, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_18HTML(__pyx_self, __pyx_v_text, __pyx_v_parser, __pyx_v_base_url);
 
   /* function exit code */
@@ -80431,7 +80408,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
   __Pyx_RefNannySetupContext("HTML", 0);
   __Pyx_INCREF((PyObject *)__pyx_v_parser);
 
-  /* "lxml/etree.pyx":3170
+  /* "lxml/etree.pyx":3173
  *     """
  *     cdef _Document doc
  *     if parser is None:             # <<<<<<<<<<<<<<
@@ -80442,19 +80419,19 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3171
+    /* "lxml/etree.pyx":3174
  *     cdef _Document doc
  *     if parser is None:
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
  *         if not isinstance(parser, HTMLParser):
  *             parser = __DEFAULT_HTML_PARSER
  */
-    __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3171, __pyx_L1_error)
+    __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3174, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF_SET(__pyx_v_parser, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_3));
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":3172
+    /* "lxml/etree.pyx":3175
  *     if parser is None:
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *         if not isinstance(parser, HTMLParser):             # <<<<<<<<<<<<<<
@@ -80465,7 +80442,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
     __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":3173
+      /* "lxml/etree.pyx":3176
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *         if not isinstance(parser, HTMLParser):
  *             parser = __DEFAULT_HTML_PARSER             # <<<<<<<<<<<<<<
@@ -80475,7 +80452,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
       __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER));
       __Pyx_DECREF_SET(__pyx_v_parser, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER));
 
-      /* "lxml/etree.pyx":3172
+      /* "lxml/etree.pyx":3175
  *     if parser is None:
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *         if not isinstance(parser, HTMLParser):             # <<<<<<<<<<<<<<
@@ -80484,7 +80461,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
  */
     }
 
-    /* "lxml/etree.pyx":3170
+    /* "lxml/etree.pyx":3173
  *     """
  *     cdef _Document doc
  *     if parser is None:             # <<<<<<<<<<<<<<
@@ -80493,7 +80470,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
  */
   }
 
-  /* "lxml/etree.pyx":3174
+  /* "lxml/etree.pyx":3177
  *         if not isinstance(parser, HTMLParser):
  *             parser = __DEFAULT_HTML_PARSER
  *     try:             # <<<<<<<<<<<<<<
@@ -80509,19 +80486,19 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
     __Pyx_XGOTREF(__pyx_t_6);
     /*try:*/ {
 
-      /* "lxml/etree.pyx":3175
+      /* "lxml/etree.pyx":3178
  *             parser = __DEFAULT_HTML_PARSER
  *     try:
  *         doc = _parseMemoryDocument(text, base_url, parser)             # <<<<<<<<<<<<<<
  *         return doc.getroot()
  *     except _TargetParserResult as result_container:
  */
-      __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text, __pyx_v_base_url, __pyx_v_parser)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3175, __pyx_L5_error)
+      __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text, __pyx_v_base_url, __pyx_v_parser)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3178, __pyx_L5_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":3176
+      /* "lxml/etree.pyx":3179
  *     try:
  *         doc = _parseMemoryDocument(text, base_url, parser)
  *         return doc.getroot()             # <<<<<<<<<<<<<<
@@ -80529,13 +80506,13 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
  *         return result_container.result
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3176, __pyx_L5_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3179, __pyx_L5_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_r = __pyx_t_3;
       __pyx_t_3 = 0;
       goto __pyx_L9_try_return;
 
-      /* "lxml/etree.pyx":3174
+      /* "lxml/etree.pyx":3177
  *         if not isinstance(parser, HTMLParser):
  *             parser = __DEFAULT_HTML_PARSER
  *     try:             # <<<<<<<<<<<<<<
@@ -80544,30 +80521,29 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
  */
     }
     __pyx_L5_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":3177
+    /* "lxml/etree.pyx":3180
  *         doc = _parseMemoryDocument(text, base_url, parser)
  *         return doc.getroot()
  *     except _TargetParserResult as result_container:             # <<<<<<<<<<<<<<
  *         return result_container.result
  * 
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3177, __pyx_L7_except_error)
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3180, __pyx_L7_except_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (__pyx_t_7) {
       __Pyx_AddTraceback("lxml.etree.HTML", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 3177, __pyx_L7_except_error)
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 3180, __pyx_L7_except_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_GOTREF(__pyx_t_9);
       __Pyx_INCREF(__pyx_t_8);
       __pyx_v_result_container = __pyx_t_8;
 
-      /* "lxml/etree.pyx":3178
+      /* "lxml/etree.pyx":3181
  *         return doc.getroot()
  *     except _TargetParserResult as result_container:
  *         return result_container.result             # <<<<<<<<<<<<<<
@@ -80575,7 +80551,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
  * 
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3178, __pyx_L7_except_error)
+      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3181, __pyx_L7_except_error)
       __Pyx_GOTREF(__pyx_t_10);
       __pyx_r = __pyx_t_10;
       __pyx_t_10 = 0;
@@ -80587,28 +80563,25 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
     goto __pyx_L7_except_error;
     __pyx_L7_except_error:;
 
-    /* "lxml/etree.pyx":3174
+    /* "lxml/etree.pyx":3177
  *         if not isinstance(parser, HTMLParser):
  *             parser = __DEFAULT_HTML_PARSER
  *     try:             # <<<<<<<<<<<<<<
  *         doc = _parseMemoryDocument(text, base_url, parser)
  *         return doc.getroot()
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L1_error;
     __pyx_L9_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L0;
     __pyx_L8_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
@@ -80616,7 +80589,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
     goto __pyx_L0;
   }
 
-  /* "lxml/etree.pyx":3155
+  /* "lxml/etree.pyx":3158
  * 
  * 
  * def HTML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
@@ -80641,7 +80614,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18HTML(CYTHON_UNUSED PyObject *__pyx_self
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3181
+/* "lxml/etree.pyx":3184
  * 
  * 
  * def XML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
@@ -80694,7 +80667,7 @@ static PyObject *__pyx_pw_4lxml_5etree_21XML(PyObject *__pyx_self, PyObject *__p
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "XML") < 0)) __PYX_ERR(0, 3181, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "XML") < 0)) __PYX_ERR(0, 3184, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -80711,13 +80684,13 @@ static PyObject *__pyx_pw_4lxml_5etree_21XML(PyObject *__pyx_self, PyObject *__p
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("XML", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3181, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("XML", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3184, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.XML", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3181, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3184, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_20XML(__pyx_self, __pyx_v_text, __pyx_v_parser, __pyx_v_base_url);
 
   /* function exit code */
@@ -80747,7 +80720,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
   __Pyx_RefNannySetupContext("XML", 0);
   __Pyx_INCREF((PyObject *)__pyx_v_parser);
 
-  /* "lxml/etree.pyx":3201
+  /* "lxml/etree.pyx":3204
  *     """
  *     cdef _Document doc
  *     if parser is None:             # <<<<<<<<<<<<<<
@@ -80758,19 +80731,19 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3202
+    /* "lxml/etree.pyx":3205
  *     cdef _Document doc
  *     if parser is None:
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
  *         if not isinstance(parser, XMLParser):
  *             parser = __DEFAULT_XML_PARSER
  */
-    __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3202, __pyx_L1_error)
+    __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3205, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF_SET(__pyx_v_parser, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_3));
     __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":3203
+    /* "lxml/etree.pyx":3206
  *     if parser is None:
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *         if not isinstance(parser, XMLParser):             # <<<<<<<<<<<<<<
@@ -80781,7 +80754,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
     __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
     if (__pyx_t_1) {
 
-      /* "lxml/etree.pyx":3204
+      /* "lxml/etree.pyx":3207
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *         if not isinstance(parser, XMLParser):
  *             parser = __DEFAULT_XML_PARSER             # <<<<<<<<<<<<<<
@@ -80791,7 +80764,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
       __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER));
       __Pyx_DECREF_SET(__pyx_v_parser, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER));
 
-      /* "lxml/etree.pyx":3203
+      /* "lxml/etree.pyx":3206
  *     if parser is None:
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *         if not isinstance(parser, XMLParser):             # <<<<<<<<<<<<<<
@@ -80800,7 +80773,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
  */
     }
 
-    /* "lxml/etree.pyx":3201
+    /* "lxml/etree.pyx":3204
  *     """
  *     cdef _Document doc
  *     if parser is None:             # <<<<<<<<<<<<<<
@@ -80809,7 +80782,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
  */
   }
 
-  /* "lxml/etree.pyx":3205
+  /* "lxml/etree.pyx":3208
  *         if not isinstance(parser, XMLParser):
  *             parser = __DEFAULT_XML_PARSER
  *     try:             # <<<<<<<<<<<<<<
@@ -80825,19 +80798,19 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
     __Pyx_XGOTREF(__pyx_t_6);
     /*try:*/ {
 
-      /* "lxml/etree.pyx":3206
+      /* "lxml/etree.pyx":3209
  *             parser = __DEFAULT_XML_PARSER
  *     try:
  *         doc = _parseMemoryDocument(text, base_url, parser)             # <<<<<<<<<<<<<<
  *         return doc.getroot()
  *     except _TargetParserResult as result_container:
  */
-      __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text, __pyx_v_base_url, __pyx_v_parser)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3206, __pyx_L5_error)
+      __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text, __pyx_v_base_url, __pyx_v_parser)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3209, __pyx_L5_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/etree.pyx":3207
+      /* "lxml/etree.pyx":3210
  *     try:
  *         doc = _parseMemoryDocument(text, base_url, parser)
  *         return doc.getroot()             # <<<<<<<<<<<<<<
@@ -80845,13 +80818,13 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
  *         return result_container.result
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3207, __pyx_L5_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3210, __pyx_L5_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_r = __pyx_t_3;
       __pyx_t_3 = 0;
       goto __pyx_L9_try_return;
 
-      /* "lxml/etree.pyx":3205
+      /* "lxml/etree.pyx":3208
  *         if not isinstance(parser, XMLParser):
  *             parser = __DEFAULT_XML_PARSER
  *     try:             # <<<<<<<<<<<<<<
@@ -80860,30 +80833,29 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
  */
     }
     __pyx_L5_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "lxml/etree.pyx":3208
+    /* "lxml/etree.pyx":3211
  *         doc = _parseMemoryDocument(text, base_url, parser)
  *         return doc.getroot()
  *     except _TargetParserResult as result_container:             # <<<<<<<<<<<<<<
  *         return result_container.result
  * 
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3208, __pyx_L7_except_error)
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3211, __pyx_L7_except_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (__pyx_t_7) {
       __Pyx_AddTraceback("lxml.etree.XML", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 3208, __pyx_L7_except_error)
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 3211, __pyx_L7_except_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_GOTREF(__pyx_t_9);
       __Pyx_INCREF(__pyx_t_8);
       __pyx_v_result_container = __pyx_t_8;
 
-      /* "lxml/etree.pyx":3209
+      /* "lxml/etree.pyx":3212
  *         return doc.getroot()
  *     except _TargetParserResult as result_container:
  *         return result_container.result             # <<<<<<<<<<<<<<
@@ -80891,7 +80863,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
  * 
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3209, __pyx_L7_except_error)
+      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3212, __pyx_L7_except_error)
       __Pyx_GOTREF(__pyx_t_10);
       __pyx_r = __pyx_t_10;
       __pyx_t_10 = 0;
@@ -80903,28 +80875,25 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
     goto __pyx_L7_except_error;
     __pyx_L7_except_error:;
 
-    /* "lxml/etree.pyx":3205
+    /* "lxml/etree.pyx":3208
  *         if not isinstance(parser, XMLParser):
  *             parser = __DEFAULT_XML_PARSER
  *     try:             # <<<<<<<<<<<<<<
  *         doc = _parseMemoryDocument(text, base_url, parser)
  *         return doc.getroot()
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L1_error;
     __pyx_L9_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L0;
     __pyx_L8_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
@@ -80932,7 +80901,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
     goto __pyx_L0;
   }
 
-  /* "lxml/etree.pyx":3181
+  /* "lxml/etree.pyx":3184
  * 
  * 
  * def XML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
@@ -80957,7 +80926,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20XML(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3212
+/* "lxml/etree.pyx":3215
  * 
  * 
  * def fromstring(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
@@ -81010,7 +80979,7 @@ static PyObject *__pyx_pw_4lxml_5etree_23fromstring(PyObject *__pyx_self, PyObje
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fromstring") < 0)) __PYX_ERR(0, 3212, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fromstring") < 0)) __PYX_ERR(0, 3215, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -81027,13 +80996,13 @@ static PyObject *__pyx_pw_4lxml_5etree_23fromstring(PyObject *__pyx_self, PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("fromstring", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3212, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("fromstring", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3215, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3212, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3215, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_22fromstring(__pyx_self, __pyx_v_text, __pyx_v_parser, __pyx_v_base_url);
 
   /* function exit code */
@@ -81060,7 +81029,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22fromstring(CYTHON_UNUSED PyObject *__py
   PyObject *__pyx_t_8 = NULL;
   __Pyx_RefNannySetupContext("fromstring", 0);
 
-  /* "lxml/etree.pyx":3226
+  /* "lxml/etree.pyx":3229
  *     """
  *     cdef _Document doc
  *     try:             # <<<<<<<<<<<<<<
@@ -81076,19 +81045,19 @@ static PyObject *__pyx_pf_4lxml_5etree_22fromstring(CYTHON_UNUSED PyObject *__py
     __Pyx_XGOTREF(__pyx_t_3);
     /*try:*/ {
 
-      /* "lxml/etree.pyx":3227
+      /* "lxml/etree.pyx":3230
  *     cdef _Document doc
  *     try:
  *         doc = _parseMemoryDocument(text, base_url, parser)             # <<<<<<<<<<<<<<
  *         return doc.getroot()
  *     except _TargetParserResult as result_container:
  */
-      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text, __pyx_v_base_url, __pyx_v_parser)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3227, __pyx_L3_error)
+      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text, __pyx_v_base_url, __pyx_v_parser)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3230, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_4);
       __pyx_t_4 = 0;
 
-      /* "lxml/etree.pyx":3228
+      /* "lxml/etree.pyx":3231
  *     try:
  *         doc = _parseMemoryDocument(text, base_url, parser)
  *         return doc.getroot()             # <<<<<<<<<<<<<<
@@ -81096,13 +81065,13 @@ static PyObject *__pyx_pf_4lxml_5etree_22fromstring(CYTHON_UNUSED PyObject *__py
  *         return result_container.result
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3228, __pyx_L3_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3231, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_r = __pyx_t_4;
       __pyx_t_4 = 0;
       goto __pyx_L7_try_return;
 
-      /* "lxml/etree.pyx":3226
+      /* "lxml/etree.pyx":3229
  *     """
  *     cdef _Document doc
  *     try:             # <<<<<<<<<<<<<<
@@ -81111,30 +81080,29 @@ static PyObject *__pyx_pf_4lxml_5etree_22fromstring(CYTHON_UNUSED PyObject *__py
  */
     }
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":3229
+    /* "lxml/etree.pyx":3232
  *         doc = _parseMemoryDocument(text, base_url, parser)
  *         return doc.getroot()
  *     except _TargetParserResult as result_container:             # <<<<<<<<<<<<<<
  *         return result_container.result
  * 
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3229, __pyx_L5_except_error)
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3232, __pyx_L5_except_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     if (__pyx_t_5) {
       __Pyx_AddTraceback("lxml.etree.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 3229, __pyx_L5_except_error)
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 3232, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_INCREF(__pyx_t_6);
       __pyx_v_result_container = __pyx_t_6;
 
-      /* "lxml/etree.pyx":3230
+      /* "lxml/etree.pyx":3233
  *         return doc.getroot()
  *     except _TargetParserResult as result_container:
  *         return result_container.result             # <<<<<<<<<<<<<<
@@ -81142,7 +81110,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22fromstring(CYTHON_UNUSED PyObject *__py
  * 
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3230, __pyx_L5_except_error)
+      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3233, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_8);
       __pyx_r = __pyx_t_8;
       __pyx_t_8 = 0;
@@ -81154,28 +81122,25 @@ static PyObject *__pyx_pf_4lxml_5etree_22fromstring(CYTHON_UNUSED PyObject *__py
     goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
 
-    /* "lxml/etree.pyx":3226
+    /* "lxml/etree.pyx":3229
  *     """
  *     cdef _Document doc
  *     try:             # <<<<<<<<<<<<<<
  *         doc = _parseMemoryDocument(text, base_url, parser)
  *         return doc.getroot()
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L7_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L0;
     __pyx_L6_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -81183,7 +81148,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22fromstring(CYTHON_UNUSED PyObject *__py
     goto __pyx_L0;
   }
 
-  /* "lxml/etree.pyx":3212
+  /* "lxml/etree.pyx":3215
  * 
  * 
  * def fromstring(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
@@ -81207,7 +81172,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22fromstring(CYTHON_UNUSED PyObject *__py
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3233
+/* "lxml/etree.pyx":3236
  * 
  * 
  * def fromstringlist(strings, _BaseParser parser=None):             # <<<<<<<<<<<<<<
@@ -81253,7 +81218,7 @@ static PyObject *__pyx_pw_4lxml_5etree_25fromstringlist(PyObject *__pyx_self, Py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fromstringlist") < 0)) __PYX_ERR(0, 3233, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fromstringlist") < 0)) __PYX_ERR(0, 3236, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -81269,13 +81234,13 @@ static PyObject *__pyx_pw_4lxml_5etree_25fromstringlist(PyObject *__pyx_self, Py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("fromstringlist", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3233, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("fromstringlist", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3236, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.fromstringlist", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3233, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3236, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_24fromstringlist(__pyx_self, __pyx_v_strings, __pyx_v_parser);
 
   /* function exit code */
@@ -81305,7 +81270,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
   __Pyx_RefNannySetupContext("fromstringlist", 0);
   __Pyx_INCREF((PyObject *)__pyx_v_parser);
 
-  /* "lxml/etree.pyx":3243
+  /* "lxml/etree.pyx":3246
  *     """
  *     cdef _Document doc
  *     if isinstance(strings, (bytes, unicode)):             # <<<<<<<<<<<<<<
@@ -81326,20 +81291,20 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3244
+    /* "lxml/etree.pyx":3247
  *     cdef _Document doc
  *     if isinstance(strings, (bytes, unicode)):
  *         raise ValueError("passing a single string into fromstringlist() is not"             # <<<<<<<<<<<<<<
  *                          " efficient, use fromstring() instead")
  *     if parser is None:
  */
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3244, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3247, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(0, 3244, __pyx_L1_error)
+    __PYX_ERR(0, 3247, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":3243
+    /* "lxml/etree.pyx":3246
  *     """
  *     cdef _Document doc
  *     if isinstance(strings, (bytes, unicode)):             # <<<<<<<<<<<<<<
@@ -81348,7 +81313,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
  */
   }
 
-  /* "lxml/etree.pyx":3246
+  /* "lxml/etree.pyx":3249
  *         raise ValueError("passing a single string into fromstringlist() is not"
  *                          " efficient, use fromstring() instead")
  *     if parser is None:             # <<<<<<<<<<<<<<
@@ -81359,19 +81324,19 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":3247
+    /* "lxml/etree.pyx":3250
  *                          " efficient, use fromstring() instead")
  *     if parser is None:
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
  *     feed = parser.feed
  *     for data in strings:
  */
-    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3247, __pyx_L1_error)
+    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3250, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF_SET(__pyx_v_parser, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_4));
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":3246
+    /* "lxml/etree.pyx":3249
  *         raise ValueError("passing a single string into fromstringlist() is not"
  *                          " efficient, use fromstring() instead")
  *     if parser is None:             # <<<<<<<<<<<<<<
@@ -81380,19 +81345,19 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
  */
   }
 
-  /* "lxml/etree.pyx":3248
+  /* "lxml/etree.pyx":3251
  *     if parser is None:
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *     feed = parser.feed             # <<<<<<<<<<<<<<
  *     for data in strings:
  *         feed(data)
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parser), __pyx_n_s_feed); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3248, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parser), __pyx_n_s_feed); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3251, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_v_feed = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":3249
+  /* "lxml/etree.pyx":3252
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *     feed = parser.feed
  *     for data in strings:             # <<<<<<<<<<<<<<
@@ -81403,26 +81368,26 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
     __pyx_t_4 = __pyx_v_strings; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
     __pyx_t_6 = NULL;
   } else {
-    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_strings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3249, __pyx_L1_error)
+    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_strings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3252, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3249, __pyx_L1_error)
+    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3252, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_6)) {
       if (likely(PyList_CheckExact(__pyx_t_4))) {
         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3249, __pyx_L1_error)
+        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3252, __pyx_L1_error)
         #else
-        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3249, __pyx_L1_error)
+        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3252, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         #endif
       } else {
         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3249, __pyx_L1_error)
+        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3252, __pyx_L1_error)
         #else
-        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3249, __pyx_L1_error)
+        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3252, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         #endif
       }
@@ -81431,8 +81396,8 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
       if (unlikely(!__pyx_t_7)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 3249, __pyx_L1_error)
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 3252, __pyx_L1_error)
         }
         break;
       }
@@ -81441,7 +81406,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
     __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_7);
     __pyx_t_7 = 0;
 
-    /* "lxml/etree.pyx":3250
+    /* "lxml/etree.pyx":3253
  *     feed = parser.feed
  *     for data in strings:
  *         feed(data)             # <<<<<<<<<<<<<<
@@ -81460,13 +81425,13 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
       }
     }
     if (!__pyx_t_9) {
-      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3250, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3253, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_8)) {
         PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_data};
-        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3250, __pyx_L1_error)
+        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3253, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_GOTREF(__pyx_t_7);
       } else
@@ -81474,19 +81439,19 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
         PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_data};
-        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3250, __pyx_L1_error)
+        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3253, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_GOTREF(__pyx_t_7);
       } else
       #endif
       {
-        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3250, __pyx_L1_error)
+        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3253, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
         __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
         __Pyx_INCREF(__pyx_v_data);
         __Pyx_GIVEREF(__pyx_v_data);
         PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_data);
-        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3250, __pyx_L1_error)
+        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3253, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       }
@@ -81494,7 +81459,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "lxml/etree.pyx":3249
+    /* "lxml/etree.pyx":3252
  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  *     feed = parser.feed
  *     for data in strings:             # <<<<<<<<<<<<<<
@@ -81504,7 +81469,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
   }
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":3251
+  /* "lxml/etree.pyx":3254
  *     for data in strings:
  *         feed(data)
  *     return parser.close()             # <<<<<<<<<<<<<<
@@ -81512,7 +81477,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parser), __pyx_n_s_close); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3251, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parser), __pyx_n_s_close); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3254, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __pyx_t_8 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
@@ -81525,10 +81490,10 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
     }
   }
   if (__pyx_t_8) {
-    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3251, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3254, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   } else {
-    __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3251, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3254, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -81536,7 +81501,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3233
+  /* "lxml/etree.pyx":3236
  * 
  * 
  * def fromstringlist(strings, _BaseParser parser=None):             # <<<<<<<<<<<<<<
@@ -81562,7 +81527,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24fromstringlist(CYTHON_UNUSED PyObject *
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3254
+/* "lxml/etree.pyx":3257
  * 
  * 
  * def iselement(element):             # <<<<<<<<<<<<<<
@@ -81593,7 +81558,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26iselement(CYTHON_UNUSED PyObject *__pyx
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("iselement", 0);
 
-  /* "lxml/etree.pyx":3259
+  /* "lxml/etree.pyx":3262
  *     Checks if an object appears to be a valid element object.
  *     """
  *     return isinstance(element, _Element) and (<_Element>element)._c_node is not NULL             # <<<<<<<<<<<<<<
@@ -81604,14 +81569,14 @@ static PyObject *__pyx_pf_4lxml_5etree_26iselement(CYTHON_UNUSED PyObject *__pyx
   __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_element, __pyx_ptype_4lxml_5etree__Element); 
   if (__pyx_t_2) {
   } else {
-    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3259, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3262, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_1 = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L3_bool_binop_done;
   }
   __pyx_t_2 = (((struct LxmlElement *)__pyx_v_element)->_c_node != NULL);
-  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3259, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3262, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_1 = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -81620,7 +81585,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26iselement(CYTHON_UNUSED PyObject *__pyx
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3254
+  /* "lxml/etree.pyx":3257
  * 
  * 
  * def iselement(element):             # <<<<<<<<<<<<<<
@@ -81640,7 +81605,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26iselement(CYTHON_UNUSED PyObject *__pyx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3262
+/* "lxml/etree.pyx":3265
  * 
  * 
  * def dump(_Element elem not None, *, bint pretty_print=True, with_tail=True):             # <<<<<<<<<<<<<<
@@ -81686,7 +81651,7 @@ static PyObject *__pyx_pw_4lxml_5etree_29dump(PyObject *__pyx_self, PyObject *__
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dump") < 0)) __PYX_ERR(0, 3262, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dump") < 0)) __PYX_ERR(0, 3265, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -81695,7 +81660,7 @@ static PyObject *__pyx_pw_4lxml_5etree_29dump(PyObject *__pyx_self, PyObject *__
     }
     __pyx_v_elem = ((struct LxmlElement *)values[0]);
     if (values[1]) {
-      __pyx_v_pretty_print = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pretty_print == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3262, __pyx_L3_error)
+      __pyx_v_pretty_print = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pretty_print == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3265, __pyx_L3_error)
     } else {
       __pyx_v_pretty_print = ((int)((int)1));
     }
@@ -81703,13 +81668,13 @@ static PyObject *__pyx_pw_4lxml_5etree_29dump(PyObject *__pyx_self, PyObject *__
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("dump", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3262, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("dump", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3265, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elem), __pyx_ptype_4lxml_5etree__Element, 0, "elem", 0))) __PYX_ERR(0, 3262, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elem), __pyx_ptype_4lxml_5etree__Element, 0, "elem", 0))) __PYX_ERR(0, 3265, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_28dump(__pyx_self, __pyx_v_elem, __pyx_v_pretty_print, __pyx_v_with_tail);
 
   /* function exit code */
@@ -81732,29 +81697,29 @@ static PyObject *__pyx_pf_4lxml_5etree_28dump(CYTHON_UNUSED PyObject *__pyx_self
   int __pyx_t_5;
   __Pyx_RefNannySetupContext("dump", 0);
 
-  /* "lxml/etree.pyx":3268
+  /* "lxml/etree.pyx":3271
  *     should be used for debugging only.
  *     """
  *     xml = tostring(elem, pretty_print=pretty_print, with_tail=with_tail,             # <<<<<<<<<<<<<<
  *                    encoding=None if python.IS_PYTHON2 else 'unicode')
  *     if not pretty_print:
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tostring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3268, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tostring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3271, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3268, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3271, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(((PyObject *)__pyx_v_elem));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_elem));
   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_elem));
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3268, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3271, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_pretty_print); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3268, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_pretty_print); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3271, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pretty_print, __pyx_t_4) < 0) __PYX_ERR(0, 3268, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pretty_print, __pyx_t_4) < 0) __PYX_ERR(0, 3271, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_with_tail, __pyx_v_with_tail) < 0) __PYX_ERR(0, 3268, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_with_tail, __pyx_v_with_tail) < 0) __PYX_ERR(0, 3271, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3269
+  /* "lxml/etree.pyx":3272
  *     """
  *     xml = tostring(elem, pretty_print=pretty_print, with_tail=with_tail,
  *                    encoding=None if python.IS_PYTHON2 else 'unicode')             # <<<<<<<<<<<<<<
@@ -81768,17 +81733,17 @@ static PyObject *__pyx_pf_4lxml_5etree_28dump(CYTHON_UNUSED PyObject *__pyx_self
     __Pyx_INCREF(__pyx_n_s_unicode);
     __pyx_t_4 = __pyx_n_s_unicode;
   }
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_t_4) < 0) __PYX_ERR(0, 3268, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_t_4) < 0) __PYX_ERR(0, 3271, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":3268
+  /* "lxml/etree.pyx":3271
  *     should be used for debugging only.
  *     """
  *     xml = tostring(elem, pretty_print=pretty_print, with_tail=with_tail,             # <<<<<<<<<<<<<<
  *                    encoding=None if python.IS_PYTHON2 else 'unicode')
  *     if not pretty_print:
  */
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3268, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3271, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -81786,7 +81751,7 @@ static PyObject *__pyx_pf_4lxml_5etree_28dump(CYTHON_UNUSED PyObject *__pyx_self
   __pyx_v_xml = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":3270
+  /* "lxml/etree.pyx":3273
  *     xml = tostring(elem, pretty_print=pretty_print, with_tail=with_tail,
  *                    encoding=None if python.IS_PYTHON2 else 'unicode')
  *     if not pretty_print:             # <<<<<<<<<<<<<<
@@ -81796,19 +81761,19 @@ static PyObject *__pyx_pf_4lxml_5etree_28dump(CYTHON_UNUSED PyObject *__pyx_self
   __pyx_t_5 = ((!(__pyx_v_pretty_print != 0)) != 0);
   if (__pyx_t_5) {
 
-    /* "lxml/etree.pyx":3271
+    /* "lxml/etree.pyx":3274
  *                    encoding=None if python.IS_PYTHON2 else 'unicode')
  *     if not pretty_print:
  *         xml += '\n'             # <<<<<<<<<<<<<<
  *     sys.stdout.write(xml)
  * 
  */
-    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_xml, __pyx_kp_s__25); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3271, __pyx_L1_error)
+    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_xml, __pyx_kp_s__25); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3274, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF_SET(__pyx_v_xml, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":3270
+    /* "lxml/etree.pyx":3273
  *     xml = tostring(elem, pretty_print=pretty_print, with_tail=with_tail,
  *                    encoding=None if python.IS_PYTHON2 else 'unicode')
  *     if not pretty_print:             # <<<<<<<<<<<<<<
@@ -81817,16 +81782,16 @@ static PyObject *__pyx_pf_4lxml_5etree_28dump(CYTHON_UNUSED PyObject *__pyx_self
  */
   }
 
-  /* "lxml/etree.pyx":3272
+  /* "lxml/etree.pyx":3275
  *     if not pretty_print:
  *         xml += '\n'
  *     sys.stdout.write(xml)             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_sys, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3272, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_sys, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3275, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3272, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3275, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = NULL;
@@ -81840,13 +81805,13 @@ static PyObject *__pyx_pf_4lxml_5etree_28dump(CYTHON_UNUSED PyObject *__pyx_self
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_xml); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3272, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_xml); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3275, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_xml};
-      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3272, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3275, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_4);
     } else
@@ -81854,19 +81819,19 @@ static PyObject *__pyx_pf_4lxml_5etree_28dump(CYTHON_UNUSED PyObject *__pyx_self
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_xml};
-      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3272, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3275, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_4);
     } else
     #endif
     {
-      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3272, __pyx_L1_error)
+      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3275, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_INCREF(__pyx_v_xml);
       __Pyx_GIVEREF(__pyx_v_xml);
       PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_xml);
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3272, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3275, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     }
@@ -81874,7 +81839,7 @@ static PyObject *__pyx_pf_4lxml_5etree_28dump(CYTHON_UNUSED PyObject *__pyx_self
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "lxml/etree.pyx":3262
+  /* "lxml/etree.pyx":3265
  * 
  * 
  * def dump(_Element elem not None, *, bint pretty_print=True, with_tail=True):             # <<<<<<<<<<<<<<
@@ -81899,7 +81864,7 @@ static PyObject *__pyx_pf_4lxml_5etree_28dump(CYTHON_UNUSED PyObject *__pyx_self
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3275
+/* "lxml/etree.pyx":3278
  * 
  * 
  * def tostring(element_or_tree, *, encoding=None, method="xml",             # <<<<<<<<<<<<<<
@@ -81932,7 +81897,7 @@ static PyObject *__pyx_pw_4lxml_5etree_31tostring(PyObject *__pyx_self, PyObject
     values[1] = ((PyObject *)((PyObject *)Py_None));
     values[2] = ((PyObject *)((PyObject*)__pyx_n_s_xml));
 
-    /* "lxml/etree.pyx":3276
+    /* "lxml/etree.pyx":3279
  * 
  * def tostring(element_or_tree, *, encoding=None, method="xml",
  *              xml_declaration=None, bint pretty_print=False, bint with_tail=True,             # <<<<<<<<<<<<<<
@@ -81941,7 +81906,7 @@ static PyObject *__pyx_pw_4lxml_5etree_31tostring(PyObject *__pyx_self, PyObject
  */
     values[3] = ((PyObject *)((PyObject *)Py_None));
 
-    /* "lxml/etree.pyx":3277
+    /* "lxml/etree.pyx":3280
  * def tostring(element_or_tree, *, encoding=None, method="xml",
  *              xml_declaration=None, bint pretty_print=False, bint with_tail=True,
  *              standalone=None, doctype=None,             # <<<<<<<<<<<<<<
@@ -81951,7 +81916,7 @@ static PyObject *__pyx_pw_4lxml_5etree_31tostring(PyObject *__pyx_self, PyObject
     values[6] = ((PyObject *)((PyObject *)Py_None));
     values[7] = ((PyObject *)((PyObject *)Py_None));
 
-    /* "lxml/etree.pyx":3278
+    /* "lxml/etree.pyx":3281
  *              xml_declaration=None, bint pretty_print=False, bint with_tail=True,
  *              standalone=None, doctype=None,
  *              bint exclusive=False, bint with_comments=True, inclusive_ns_prefixes=None):             # <<<<<<<<<<<<<<
@@ -81982,7 +81947,7 @@ static PyObject *__pyx_pw_4lxml_5etree_31tostring(PyObject *__pyx_self, PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tostring") < 0)) __PYX_ERR(0, 3275, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tostring") < 0)) __PYX_ERR(0, 3278, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -81994,10 +81959,10 @@ static PyObject *__pyx_pw_4lxml_5etree_31tostring(PyObject *__pyx_self, PyObject
     __pyx_v_method = values[2];
     __pyx_v_xml_declaration = values[3];
     if (values[4]) {
-      __pyx_v_pretty_print = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_pretty_print == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3276, __pyx_L3_error)
+      __pyx_v_pretty_print = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_pretty_print == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3279, __pyx_L3_error)
     } else {
 
-      /* "lxml/etree.pyx":3276
+      /* "lxml/etree.pyx":3279
  * 
  * def tostring(element_or_tree, *, encoding=None, method="xml",
  *              xml_declaration=None, bint pretty_print=False, bint with_tail=True,             # <<<<<<<<<<<<<<
@@ -82007,17 +81972,17 @@ static PyObject *__pyx_pw_4lxml_5etree_31tostring(PyObject *__pyx_self, PyObject
       __pyx_v_pretty_print = ((int)((int)0));
     }
     if (values[5]) {
-      __pyx_v_with_tail = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_with_tail == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3276, __pyx_L3_error)
+      __pyx_v_with_tail = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_with_tail == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3279, __pyx_L3_error)
     } else {
       __pyx_v_with_tail = ((int)((int)1));
     }
     __pyx_v_standalone = values[6];
     __pyx_v_doctype = values[7];
     if (values[8]) {
-      __pyx_v_exclusive = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_exclusive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3278, __pyx_L3_error)
+      __pyx_v_exclusive = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_exclusive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3281, __pyx_L3_error)
     } else {
 
-      /* "lxml/etree.pyx":3278
+      /* "lxml/etree.pyx":3281
  *              xml_declaration=None, bint pretty_print=False, bint with_tail=True,
  *              standalone=None, doctype=None,
  *              bint exclusive=False, bint with_comments=True, inclusive_ns_prefixes=None):             # <<<<<<<<<<<<<<
@@ -82027,7 +81992,7 @@ static PyObject *__pyx_pw_4lxml_5etree_31tostring(PyObject *__pyx_self, PyObject
       __pyx_v_exclusive = ((int)((int)0));
     }
     if (values[9]) {
-      __pyx_v_with_comments = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_with_comments == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3278, __pyx_L3_error)
+      __pyx_v_with_comments = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_with_comments == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3281, __pyx_L3_error)
     } else {
       __pyx_v_with_comments = ((int)((int)1));
     }
@@ -82035,7 +82000,7 @@ static PyObject *__pyx_pw_4lxml_5etree_31tostring(PyObject *__pyx_self, PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("tostring", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3275, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("tostring", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3278, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.tostring", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -82043,7 +82008,7 @@ static PyObject *__pyx_pw_4lxml_5etree_31tostring(PyObject *__pyx_self, PyObject
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_4lxml_5etree_30tostring(__pyx_self, __pyx_v_element_or_tree, __pyx_v_encoding, __pyx_v_method, __pyx_v_xml_declaration, __pyx_v_pretty_print, __pyx_v_with_tail, __pyx_v_standalone, __pyx_v_doctype, __pyx_v_exclusive, __pyx_v_with_comments, __pyx_v_inclusive_ns_prefixes);
 
-  /* "lxml/etree.pyx":3275
+  /* "lxml/etree.pyx":3278
  * 
  * 
  * def tostring(element_or_tree, *, encoding=None, method="xml",             # <<<<<<<<<<<<<<
@@ -82071,17 +82036,17 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
   __Pyx_RefNannySetupContext("tostring", 0);
   __Pyx_INCREF(__pyx_v_encoding);
 
-  /* "lxml/etree.pyx":3324
+  /* "lxml/etree.pyx":3327
  *     cdef int is_standalone
  *     # C14N serialisation
  *     if method == 'c14n':             # <<<<<<<<<<<<<<
  *         if encoding is not None:
  *             raise ValueError("Cannot specify encoding with C14N")
  */
-  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_c14n, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3324, __pyx_L1_error)
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_c14n, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3327, __pyx_L1_error)
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":3325
+    /* "lxml/etree.pyx":3328
  *     # C14N serialisation
  *     if method == 'c14n':
  *         if encoding is not None:             # <<<<<<<<<<<<<<
@@ -82092,20 +82057,20 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     __pyx_t_2 = (__pyx_t_1 != 0);
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":3326
+      /* "lxml/etree.pyx":3329
  *     if method == 'c14n':
  *         if encoding is not None:
  *             raise ValueError("Cannot specify encoding with C14N")             # <<<<<<<<<<<<<<
  *         if xml_declaration:
  *             raise ValueError("Cannot enable XML declaration in C14N")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3326, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3329, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3326, __pyx_L1_error)
+      __PYX_ERR(0, 3329, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":3325
+      /* "lxml/etree.pyx":3328
  *     # C14N serialisation
  *     if method == 'c14n':
  *         if encoding is not None:             # <<<<<<<<<<<<<<
@@ -82114,30 +82079,30 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
     }
 
-    /* "lxml/etree.pyx":3327
+    /* "lxml/etree.pyx":3330
  *         if encoding is not None:
  *             raise ValueError("Cannot specify encoding with C14N")
  *         if xml_declaration:             # <<<<<<<<<<<<<<
  *             raise ValueError("Cannot enable XML declaration in C14N")
  *         return _tostringC14N(element_or_tree, exclusive, with_comments, inclusive_ns_prefixes)
  */
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3327, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3330, __pyx_L1_error)
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":3328
+      /* "lxml/etree.pyx":3331
  *             raise ValueError("Cannot specify encoding with C14N")
  *         if xml_declaration:
  *             raise ValueError("Cannot enable XML declaration in C14N")             # <<<<<<<<<<<<<<
  *         return _tostringC14N(element_or_tree, exclusive, with_comments, inclusive_ns_prefixes)
  *     if not with_comments:
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3328, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3331, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(0, 3328, __pyx_L1_error)
+      __PYX_ERR(0, 3331, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":3327
+      /* "lxml/etree.pyx":3330
  *         if encoding is not None:
  *             raise ValueError("Cannot specify encoding with C14N")
  *         if xml_declaration:             # <<<<<<<<<<<<<<
@@ -82146,7 +82111,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
     }
 
-    /* "lxml/etree.pyx":3329
+    /* "lxml/etree.pyx":3332
  *         if xml_declaration:
  *             raise ValueError("Cannot enable XML declaration in C14N")
  *         return _tostringC14N(element_or_tree, exclusive, with_comments, inclusive_ns_prefixes)             # <<<<<<<<<<<<<<
@@ -82154,13 +82119,13 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  *         raise ValueError("Can only discard comments in C14N serialisation")
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __pyx_f_4lxml_5etree__tostringC14N(__pyx_v_element_or_tree, __pyx_v_exclusive, __pyx_v_with_comments, __pyx_v_inclusive_ns_prefixes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3329, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__tostringC14N(__pyx_v_element_or_tree, __pyx_v_exclusive, __pyx_v_with_comments, __pyx_v_inclusive_ns_prefixes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3332, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":3324
+    /* "lxml/etree.pyx":3327
  *     cdef int is_standalone
  *     # C14N serialisation
  *     if method == 'c14n':             # <<<<<<<<<<<<<<
@@ -82169,7 +82134,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
   }
 
-  /* "lxml/etree.pyx":3330
+  /* "lxml/etree.pyx":3333
  *             raise ValueError("Cannot enable XML declaration in C14N")
  *         return _tostringC14N(element_or_tree, exclusive, with_comments, inclusive_ns_prefixes)
  *     if not with_comments:             # <<<<<<<<<<<<<<
@@ -82179,20 +82144,20 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
   __pyx_t_2 = ((!(__pyx_v_with_comments != 0)) != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3331
+    /* "lxml/etree.pyx":3334
  *         return _tostringC14N(element_or_tree, exclusive, with_comments, inclusive_ns_prefixes)
  *     if not with_comments:
  *         raise ValueError("Can only discard comments in C14N serialisation")             # <<<<<<<<<<<<<<
  *     if encoding is _unicode or (encoding is not None and encoding.lower() == 'unicode'):
  *         if xml_declaration:
  */
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3331, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3334, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 3331, __pyx_L1_error)
+    __PYX_ERR(0, 3334, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":3330
+    /* "lxml/etree.pyx":3333
  *             raise ValueError("Cannot enable XML declaration in C14N")
  *         return _tostringC14N(element_or_tree, exclusive, with_comments, inclusive_ns_prefixes)
  *     if not with_comments:             # <<<<<<<<<<<<<<
@@ -82201,7 +82166,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
   }
 
-  /* "lxml/etree.pyx":3332
+  /* "lxml/etree.pyx":3335
  *     if not with_comments:
  *         raise ValueError("Can only discard comments in C14N serialisation")
  *     if encoding is _unicode or (encoding is not None and encoding.lower() == 'unicode'):             # <<<<<<<<<<<<<<
@@ -82222,7 +82187,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     __pyx_t_2 = __pyx_t_1;
     goto __pyx_L8_bool_binop_done;
   }
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3332, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_lower); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3335, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_6 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -82235,30 +82200,30 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     }
   }
   if (__pyx_t_6) {
-    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3332, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3335, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   } else {
-    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3332, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3335, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_unicode, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3332, __pyx_L1_error)
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_unicode, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3335, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_2 = __pyx_t_1;
   __pyx_L8_bool_binop_done:;
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3333
+    /* "lxml/etree.pyx":3336
  *         raise ValueError("Can only discard comments in C14N serialisation")
  *     if encoding is _unicode or (encoding is not None and encoding.lower() == 'unicode'):
  *         if xml_declaration:             # <<<<<<<<<<<<<<
  *             raise ValueError, \
  *                 u"Serialisation to unicode must not request an XML declaration"
  */
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3333, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3336, __pyx_L1_error)
     if (__pyx_t_2) {
 
-      /* "lxml/etree.pyx":3334
+      /* "lxml/etree.pyx":3337
  *     if encoding is _unicode or (encoding is not None and encoding.lower() == 'unicode'):
  *         if xml_declaration:
  *             raise ValueError, \             # <<<<<<<<<<<<<<
@@ -82266,9 +82231,9 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  *         write_declaration = 0
  */
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Serialisation_to_unicode_must_no, 0, 0);
-      __PYX_ERR(0, 3334, __pyx_L1_error)
+      __PYX_ERR(0, 3337, __pyx_L1_error)
 
-      /* "lxml/etree.pyx":3333
+      /* "lxml/etree.pyx":3336
  *         raise ValueError("Can only discard comments in C14N serialisation")
  *     if encoding is _unicode or (encoding is not None and encoding.lower() == 'unicode'):
  *         if xml_declaration:             # <<<<<<<<<<<<<<
@@ -82277,7 +82242,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
     }
 
-    /* "lxml/etree.pyx":3336
+    /* "lxml/etree.pyx":3339
  *             raise ValueError, \
  *                 u"Serialisation to unicode must not request an XML declaration"
  *         write_declaration = 0             # <<<<<<<<<<<<<<
@@ -82286,7 +82251,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
     __pyx_v_write_declaration = 0;
 
-    /* "lxml/etree.pyx":3337
+    /* "lxml/etree.pyx":3340
  *                 u"Serialisation to unicode must not request an XML declaration"
  *         write_declaration = 0
  *         encoding = _unicode             # <<<<<<<<<<<<<<
@@ -82296,7 +82261,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     __Pyx_INCREF(__pyx_v_4lxml_5etree__unicode);
     __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_v_4lxml_5etree__unicode);
 
-    /* "lxml/etree.pyx":3332
+    /* "lxml/etree.pyx":3335
  *     if not with_comments:
  *         raise ValueError("Can only discard comments in C14N serialisation")
  *     if encoding is _unicode or (encoding is not None and encoding.lower() == 'unicode'):             # <<<<<<<<<<<<<<
@@ -82306,7 +82271,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     goto __pyx_L7;
   }
 
-  /* "lxml/etree.pyx":3338
+  /* "lxml/etree.pyx":3341
  *         write_declaration = 0
  *         encoding = _unicode
  *     elif xml_declaration is None:             # <<<<<<<<<<<<<<
@@ -82317,7 +82282,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":3340
+    /* "lxml/etree.pyx":3343
  *     elif xml_declaration is None:
  *         # by default, write an XML declaration only for non-standard encodings
  *         write_declaration = encoding is not None and encoding.upper() not in \             # <<<<<<<<<<<<<<
@@ -82331,7 +82296,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
       __pyx_t_1 = __pyx_t_4;
       goto __pyx_L12_bool_binop_done;
     }
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_upper); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_upper); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3343, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -82344,32 +82309,32 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
       }
     }
     if (__pyx_t_6) {
-      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3340, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3343, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     } else {
-      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3340, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3343, __pyx_L1_error)
     }
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_ASCII, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3340, __pyx_L1_error)
+    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_ASCII, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3343, __pyx_L1_error)
     if (__pyx_t_2) {
     } else {
       __pyx_t_4 = __pyx_t_2;
       goto __pyx_L14_bool_binop_done;
     }
-    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u_UTF_8, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3340, __pyx_L1_error)
+    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u_UTF_8, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3343, __pyx_L1_error)
     if (__pyx_t_2) {
     } else {
       __pyx_t_4 = __pyx_t_2;
       goto __pyx_L14_bool_binop_done;
     }
-    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_UTF8, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3340, __pyx_L1_error)
+    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_UTF8, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3343, __pyx_L1_error)
     if (__pyx_t_2) {
     } else {
       __pyx_t_4 = __pyx_t_2;
       goto __pyx_L14_bool_binop_done;
     }
-    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u_US_ASCII, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3340, __pyx_L1_error)
+    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_kp_u_US_ASCII, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3343, __pyx_L1_error)
     __pyx_t_4 = __pyx_t_2;
     __pyx_L14_bool_binop_done:;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -82378,7 +82343,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     __pyx_L12_bool_binop_done:;
     __pyx_v_write_declaration = __pyx_t_1;
 
-    /* "lxml/etree.pyx":3338
+    /* "lxml/etree.pyx":3341
  *         write_declaration = 0
  *         encoding = _unicode
  *     elif xml_declaration is None:             # <<<<<<<<<<<<<<
@@ -82388,7 +82353,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     goto __pyx_L7;
   }
 
-  /* "lxml/etree.pyx":3343
+  /* "lxml/etree.pyx":3346
  *                             (u'ASCII', u'UTF-8', u'UTF8', u'US-ASCII')
  *     else:
  *         write_declaration = xml_declaration             # <<<<<<<<<<<<<<
@@ -82396,12 +82361,12 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  *         encoding = u'ASCII'
  */
   /*else*/ {
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3343, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3346, __pyx_L1_error)
     __pyx_v_write_declaration = __pyx_t_1;
   }
   __pyx_L7:;
 
-  /* "lxml/etree.pyx":3344
+  /* "lxml/etree.pyx":3347
  *     else:
  *         write_declaration = xml_declaration
  *     if encoding is None:             # <<<<<<<<<<<<<<
@@ -82412,7 +82377,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3345
+    /* "lxml/etree.pyx":3348
  *         write_declaration = xml_declaration
  *     if encoding is None:
  *         encoding = u'ASCII'             # <<<<<<<<<<<<<<
@@ -82422,7 +82387,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     __Pyx_INCREF(__pyx_n_u_ASCII);
     __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_n_u_ASCII);
 
-    /* "lxml/etree.pyx":3344
+    /* "lxml/etree.pyx":3347
  *     else:
  *         write_declaration = xml_declaration
  *     if encoding is None:             # <<<<<<<<<<<<<<
@@ -82431,7 +82396,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
   }
 
-  /* "lxml/etree.pyx":3346
+  /* "lxml/etree.pyx":3349
  *     if encoding is None:
  *         encoding = u'ASCII'
  *     if standalone is None:             # <<<<<<<<<<<<<<
@@ -82442,7 +82407,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":3347
+    /* "lxml/etree.pyx":3350
  *         encoding = u'ASCII'
  *     if standalone is None:
  *         is_standalone = -1             # <<<<<<<<<<<<<<
@@ -82451,7 +82416,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
     __pyx_v_is_standalone = -1;
 
-    /* "lxml/etree.pyx":3346
+    /* "lxml/etree.pyx":3349
  *     if encoding is None:
  *         encoding = u'ASCII'
  *     if standalone is None:             # <<<<<<<<<<<<<<
@@ -82461,17 +82426,17 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     goto __pyx_L19;
   }
 
-  /* "lxml/etree.pyx":3348
+  /* "lxml/etree.pyx":3351
  *     if standalone is None:
  *         is_standalone = -1
  *     elif standalone:             # <<<<<<<<<<<<<<
  *         write_declaration = 1
  *         is_standalone = 1
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_standalone); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3348, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_standalone); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 3351, __pyx_L1_error)
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":3349
+    /* "lxml/etree.pyx":3352
  *         is_standalone = -1
  *     elif standalone:
  *         write_declaration = 1             # <<<<<<<<<<<<<<
@@ -82480,7 +82445,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
     __pyx_v_write_declaration = 1;
 
-    /* "lxml/etree.pyx":3350
+    /* "lxml/etree.pyx":3353
  *     elif standalone:
  *         write_declaration = 1
  *         is_standalone = 1             # <<<<<<<<<<<<<<
@@ -82489,7 +82454,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
     __pyx_v_is_standalone = 1;
 
-    /* "lxml/etree.pyx":3348
+    /* "lxml/etree.pyx":3351
  *     if standalone is None:
  *         is_standalone = -1
  *     elif standalone:             # <<<<<<<<<<<<<<
@@ -82499,7 +82464,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     goto __pyx_L19;
   }
 
-  /* "lxml/etree.pyx":3352
+  /* "lxml/etree.pyx":3355
  *         is_standalone = 1
  *     else:
  *         write_declaration = 1             # <<<<<<<<<<<<<<
@@ -82509,7 +82474,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
   /*else*/ {
     __pyx_v_write_declaration = 1;
 
-    /* "lxml/etree.pyx":3353
+    /* "lxml/etree.pyx":3356
  *     else:
  *         write_declaration = 1
  *         is_standalone = 0             # <<<<<<<<<<<<<<
@@ -82520,7 +82485,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
   }
   __pyx_L19:;
 
-  /* "lxml/etree.pyx":3355
+  /* "lxml/etree.pyx":3358
  *         is_standalone = 0
  * 
  *     if isinstance(element_or_tree, _Element):             # <<<<<<<<<<<<<<
@@ -82531,7 +82496,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3356
+    /* "lxml/etree.pyx":3359
  * 
  *     if isinstance(element_or_tree, _Element):
  *         return _tostring(<_Element>element_or_tree, encoding, doctype, method,             # <<<<<<<<<<<<<<
@@ -82540,20 +82505,20 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "lxml/etree.pyx":3358
+    /* "lxml/etree.pyx":3361
  *         return _tostring(<_Element>element_or_tree, encoding, doctype, method,
  *                          write_declaration, 0, pretty_print, with_tail,
  *                          is_standalone)             # <<<<<<<<<<<<<<
  *     elif isinstance(element_or_tree, _ElementTree):
  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElement *)__pyx_v_element_or_tree), __pyx_v_encoding, __pyx_v_doctype, __pyx_v_method, __pyx_v_write_declaration, 0, __pyx_v_pretty_print, __pyx_v_with_tail, __pyx_v_is_standalone); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3356, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElement *)__pyx_v_element_or_tree), __pyx_v_encoding, __pyx_v_doctype, __pyx_v_method, __pyx_v_write_declaration, 0, __pyx_v_pretty_print, __pyx_v_with_tail, __pyx_v_is_standalone); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3359, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":3355
+    /* "lxml/etree.pyx":3358
  *         is_standalone = 0
  * 
  *     if isinstance(element_or_tree, _Element):             # <<<<<<<<<<<<<<
@@ -82562,7 +82527,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
   }
 
-  /* "lxml/etree.pyx":3359
+  /* "lxml/etree.pyx":3362
  *                          write_declaration, 0, pretty_print, with_tail,
  *                          is_standalone)
  *     elif isinstance(element_or_tree, _ElementTree):             # <<<<<<<<<<<<<<
@@ -82573,7 +82538,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":3360
+    /* "lxml/etree.pyx":3363
  *                          is_standalone)
  *     elif isinstance(element_or_tree, _ElementTree):
  *         return _tostring((<_ElementTree>element_or_tree)._context_node,             # <<<<<<<<<<<<<<
@@ -82584,21 +82549,21 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
     __pyx_t_3 = ((PyObject *)((struct LxmlElementTree *)__pyx_v_element_or_tree)->_context_node);
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "lxml/etree.pyx":3362
+    /* "lxml/etree.pyx":3365
  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
  *                          encoding, doctype, method, write_declaration, 1,
  *                          pretty_print, with_tail, is_standalone)             # <<<<<<<<<<<<<<
  *     else:
  *         raise TypeError, u"Type '%s' cannot be serialized." % \
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElement *)__pyx_t_3), __pyx_v_encoding, __pyx_v_doctype, __pyx_v_method, __pyx_v_write_declaration, 1, __pyx_v_pretty_print, __pyx_v_with_tail, __pyx_v_is_standalone); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3360, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElement *)__pyx_t_3), __pyx_v_encoding, __pyx_v_doctype, __pyx_v_method, __pyx_v_write_declaration, 1, __pyx_v_pretty_print, __pyx_v_with_tail, __pyx_v_is_standalone); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3363, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_5;
     __pyx_t_5 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":3359
+    /* "lxml/etree.pyx":3362
  *                          write_declaration, 0, pretty_print, with_tail,
  *                          is_standalone)
  *     elif isinstance(element_or_tree, _ElementTree):             # <<<<<<<<<<<<<<
@@ -82607,7 +82572,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
   }
 
-  /* "lxml/etree.pyx":3364
+  /* "lxml/etree.pyx":3367
  *                          pretty_print, with_tail, is_standalone)
  *     else:
  *         raise TypeError, u"Type '%s' cannot be serialized." % \             # <<<<<<<<<<<<<<
@@ -82616,7 +82581,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  */
   /*else*/ {
 
-    /* "lxml/etree.pyx":3365
+    /* "lxml/etree.pyx":3368
  *     else:
  *         raise TypeError, u"Type '%s' cannot be serialized." % \
  *             python._fqtypename(element_or_tree).decode('utf8')             # <<<<<<<<<<<<<<
@@ -82624,25 +82589,25 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
  * 
  */
     __pyx_t_7 = _fqtypename(__pyx_v_element_or_tree);
-    __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_7, 0, strlen(__pyx_t_7), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3365, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_7, 0, strlen(__pyx_t_7), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3368, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
 
-    /* "lxml/etree.pyx":3364
+    /* "lxml/etree.pyx":3367
  *                          pretty_print, with_tail, is_standalone)
  *     else:
  *         raise TypeError, u"Type '%s' cannot be serialized." % \             # <<<<<<<<<<<<<<
  *             python._fqtypename(element_or_tree).decode('utf8')
  * 
  */
-    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Type_s_cannot_be_serialized, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3364, __pyx_L1_error)
+    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Type_s_cannot_be_serialized, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3367, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_3, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 3364, __pyx_L1_error)
+    __PYX_ERR(0, 3367, __pyx_L1_error)
   }
 
-  /* "lxml/etree.pyx":3275
+  /* "lxml/etree.pyx":3278
  * 
  * 
  * def tostring(element_or_tree, *, encoding=None, method="xml",             # <<<<<<<<<<<<<<
@@ -82664,7 +82629,7 @@ static PyObject *__pyx_pf_4lxml_5etree_30tostring(CYTHON_UNUSED PyObject *__pyx_
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3368
+/* "lxml/etree.pyx":3371
  * 
  * 
  * def tostringlist(element_or_tree, *args, **kwargs):             # <<<<<<<<<<<<<<
@@ -82716,7 +82681,7 @@ static PyObject *__pyx_pw_4lxml_5etree_33tostringlist(PyObject *__pyx_self, PyOb
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "tostringlist") < 0)) __PYX_ERR(0, 3368, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "tostringlist") < 0)) __PYX_ERR(0, 3371, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
       goto __pyx_L5_argtuple_error;
@@ -82727,7 +82692,7 @@ static PyObject *__pyx_pw_4lxml_5etree_33tostringlist(PyObject *__pyx_self, PyOb
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("tostringlist", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3368, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("tostringlist", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3371, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
   __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
@@ -82752,7 +82717,7 @@ static PyObject *__pyx_pf_4lxml_5etree_32tostringlist(CYTHON_UNUSED PyObject *__
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("tostringlist", 0);
 
-  /* "lxml/etree.pyx":3377
+  /* "lxml/etree.pyx":3380
  *     single string wrapped in a list.
  *     """
  *     return [tostring(element_or_tree, *args, **kwargs)]             # <<<<<<<<<<<<<<
@@ -82760,21 +82725,21 @@ static PyObject *__pyx_pf_4lxml_5etree_32tostringlist(CYTHON_UNUSED PyObject *__
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tostring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3377, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tostring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3377, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_element_or_tree);
   __Pyx_GIVEREF(__pyx_v_element_or_tree);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_element_or_tree);
-  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3377, __pyx_L1_error)
+  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3377, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3377, __pyx_L1_error)
+  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_2);
   PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
@@ -82783,7 +82748,7 @@ static PyObject *__pyx_pf_4lxml_5etree_32tostringlist(CYTHON_UNUSED PyObject *__
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3368
+  /* "lxml/etree.pyx":3371
  * 
  * 
  * def tostringlist(element_or_tree, *args, **kwargs):             # <<<<<<<<<<<<<<
@@ -82804,7 +82769,7 @@ static PyObject *__pyx_pf_4lxml_5etree_32tostringlist(CYTHON_UNUSED PyObject *__
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3380
+/* "lxml/etree.pyx":3383
  * 
  * 
  * def tounicode(element_or_tree, *, method=u"xml", bint pretty_print=False,             # <<<<<<<<<<<<<<
@@ -82830,7 +82795,7 @@ static PyObject *__pyx_pw_4lxml_5etree_35tounicode(PyObject *__pyx_self, PyObjec
     PyObject* values[5] = {0,0,0,0,0};
     values[1] = ((PyObject *)((PyObject*)__pyx_n_u_xml));
 
-    /* "lxml/etree.pyx":3381
+    /* "lxml/etree.pyx":3384
  * 
  * def tounicode(element_or_tree, *, method=u"xml", bint pretty_print=False,
  *               bint with_tail=True, doctype=None):             # <<<<<<<<<<<<<<
@@ -82861,7 +82826,7 @@ static PyObject *__pyx_pw_4lxml_5etree_35tounicode(PyObject *__pyx_self, PyObjec
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tounicode") < 0)) __PYX_ERR(0, 3380, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tounicode") < 0)) __PYX_ERR(0, 3383, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -82871,10 +82836,10 @@ static PyObject *__pyx_pw_4lxml_5etree_35tounicode(PyObject *__pyx_self, PyObjec
     __pyx_v_element_or_tree = values[0];
     __pyx_v_method = values[1];
     if (values[2]) {
-      __pyx_v_pretty_print = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_pretty_print == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3380, __pyx_L3_error)
+      __pyx_v_pretty_print = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_pretty_print == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3383, __pyx_L3_error)
     } else {
 
-      /* "lxml/etree.pyx":3380
+      /* "lxml/etree.pyx":3383
  * 
  * 
  * def tounicode(element_or_tree, *, method=u"xml", bint pretty_print=False,             # <<<<<<<<<<<<<<
@@ -82884,10 +82849,10 @@ static PyObject *__pyx_pw_4lxml_5etree_35tounicode(PyObject *__pyx_self, PyObjec
       __pyx_v_pretty_print = ((int)((int)0));
     }
     if (values[3]) {
-      __pyx_v_with_tail = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_with_tail == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3381, __pyx_L3_error)
+      __pyx_v_with_tail = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_with_tail == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3384, __pyx_L3_error)
     } else {
 
-      /* "lxml/etree.pyx":3381
+      /* "lxml/etree.pyx":3384
  * 
  * def tounicode(element_or_tree, *, method=u"xml", bint pretty_print=False,
  *               bint with_tail=True, doctype=None):             # <<<<<<<<<<<<<<
@@ -82900,7 +82865,7 @@ static PyObject *__pyx_pw_4lxml_5etree_35tounicode(PyObject *__pyx_self, PyObjec
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("tounicode", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3380, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("tounicode", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3383, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.tounicode", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -82908,7 +82873,7 @@ static PyObject *__pyx_pw_4lxml_5etree_35tounicode(PyObject *__pyx_self, PyObjec
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_4lxml_5etree_34tounicode(__pyx_self, __pyx_v_element_or_tree, __pyx_v_method, __pyx_v_pretty_print, __pyx_v_with_tail, __pyx_v_doctype);
 
-  /* "lxml/etree.pyx":3380
+  /* "lxml/etree.pyx":3383
  * 
  * 
  * def tounicode(element_or_tree, *, method=u"xml", bint pretty_print=False,             # <<<<<<<<<<<<<<
@@ -82931,7 +82896,7 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("tounicode", 0);
 
-  /* "lxml/etree.pyx":3403
+  /* "lxml/etree.pyx":3406
  *     on the tail text of children, which will always be serialised.
  *     """
  *     if isinstance(element_or_tree, _Element):             # <<<<<<<<<<<<<<
@@ -82942,7 +82907,7 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "lxml/etree.pyx":3404
+    /* "lxml/etree.pyx":3407
  *     """
  *     if isinstance(element_or_tree, _Element):
  *         return _tostring(<_Element>element_or_tree, _unicode, doctype, method,             # <<<<<<<<<<<<<<
@@ -82953,21 +82918,21 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
     __pyx_t_3 = __pyx_v_4lxml_5etree__unicode;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "lxml/etree.pyx":3405
+    /* "lxml/etree.pyx":3408
  *     if isinstance(element_or_tree, _Element):
  *         return _tostring(<_Element>element_or_tree, _unicode, doctype, method,
  *                           0, 0, pretty_print, with_tail, -1)             # <<<<<<<<<<<<<<
  *     elif isinstance(element_or_tree, _ElementTree):
  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElement *)__pyx_v_element_or_tree), __pyx_t_3, __pyx_v_doctype, __pyx_v_method, 0, 0, __pyx_v_pretty_print, __pyx_v_with_tail, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3404, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElement *)__pyx_v_element_or_tree), __pyx_t_3, __pyx_v_doctype, __pyx_v_method, 0, 0, __pyx_v_pretty_print, __pyx_v_with_tail, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3407, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_4;
     __pyx_t_4 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":3403
+    /* "lxml/etree.pyx":3406
  *     on the tail text of children, which will always be serialised.
  *     """
  *     if isinstance(element_or_tree, _Element):             # <<<<<<<<<<<<<<
@@ -82976,7 +82941,7 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
  */
   }
 
-  /* "lxml/etree.pyx":3406
+  /* "lxml/etree.pyx":3409
  *         return _tostring(<_Element>element_or_tree, _unicode, doctype, method,
  *                           0, 0, pretty_print, with_tail, -1)
  *     elif isinstance(element_or_tree, _ElementTree):             # <<<<<<<<<<<<<<
@@ -82987,7 +82952,7 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":3407
+    /* "lxml/etree.pyx":3410
  *                           0, 0, pretty_print, with_tail, -1)
  *     elif isinstance(element_or_tree, _ElementTree):
  *         return _tostring((<_ElementTree>element_or_tree)._context_node,             # <<<<<<<<<<<<<<
@@ -82998,7 +82963,7 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
     __pyx_t_4 = ((PyObject *)((struct LxmlElementTree *)__pyx_v_element_or_tree)->_context_node);
     __Pyx_INCREF(__pyx_t_4);
 
-    /* "lxml/etree.pyx":3408
+    /* "lxml/etree.pyx":3411
  *     elif isinstance(element_or_tree, _ElementTree):
  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
  *                          _unicode, doctype, method, 0, 1, pretty_print,             # <<<<<<<<<<<<<<
@@ -83008,14 +82973,14 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
     __pyx_t_3 = __pyx_v_4lxml_5etree__unicode;
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "lxml/etree.pyx":3407
+    /* "lxml/etree.pyx":3410
  *                           0, 0, pretty_print, with_tail, -1)
  *     elif isinstance(element_or_tree, _ElementTree):
  *         return _tostring((<_ElementTree>element_or_tree)._context_node,             # <<<<<<<<<<<<<<
  *                          _unicode, doctype, method, 0, 1, pretty_print,
  *                          with_tail, -1)
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElement *)__pyx_t_4), __pyx_t_3, __pyx_v_doctype, __pyx_v_method, 0, 1, __pyx_v_pretty_print, __pyx_v_with_tail, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3407, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElement *)__pyx_t_4), __pyx_t_3, __pyx_v_doctype, __pyx_v_method, 0, 1, __pyx_v_pretty_print, __pyx_v_with_tail, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3410, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -83023,7 +82988,7 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
     __pyx_t_5 = 0;
     goto __pyx_L0;
 
-    /* "lxml/etree.pyx":3406
+    /* "lxml/etree.pyx":3409
  *         return _tostring(<_Element>element_or_tree, _unicode, doctype, method,
  *                           0, 0, pretty_print, with_tail, -1)
  *     elif isinstance(element_or_tree, _ElementTree):             # <<<<<<<<<<<<<<
@@ -83032,7 +82997,7 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
  */
   }
 
-  /* "lxml/etree.pyx":3411
+  /* "lxml/etree.pyx":3414
  *                          with_tail, -1)
  *     else:
  *         raise TypeError, u"Type '%s' cannot be serialized." % \             # <<<<<<<<<<<<<<
@@ -83041,21 +83006,21 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
  */
   /*else*/ {
 
-    /* "lxml/etree.pyx":3412
+    /* "lxml/etree.pyx":3415
  *     else:
  *         raise TypeError, u"Type '%s' cannot be serialized." % \
  *             type(element_or_tree)             # <<<<<<<<<<<<<<
  * 
  * 
  */
-    __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_Type_s_cannot_be_serialized, ((PyObject *)Py_TYPE(__pyx_v_element_or_tree))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3411, __pyx_L1_error)
+    __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_Type_s_cannot_be_serialized, ((PyObject *)Py_TYPE(__pyx_v_element_or_tree))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3414, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_5, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(0, 3411, __pyx_L1_error)
+    __PYX_ERR(0, 3414, __pyx_L1_error)
   }
 
-  /* "lxml/etree.pyx":3380
+  /* "lxml/etree.pyx":3383
  * 
  * 
  * def tounicode(element_or_tree, *, method=u"xml", bint pretty_print=False,             # <<<<<<<<<<<<<<
@@ -83076,7 +83041,7 @@ static PyObject *__pyx_pf_4lxml_5etree_34tounicode(CYTHON_UNUSED PyObject *__pyx
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3415
+/* "lxml/etree.pyx":3418
  * 
  * 
  * def parse(source, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
@@ -83129,7 +83094,7 @@ static PyObject *__pyx_pw_4lxml_5etree_37parse(PyObject *__pyx_self, PyObject *_
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse") < 0)) __PYX_ERR(0, 3415, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse") < 0)) __PYX_ERR(0, 3418, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -83146,13 +83111,13 @@ static PyObject *__pyx_pw_4lxml_5etree_37parse(PyObject *__pyx_self, PyObject *_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("parse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3415, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("parse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3418, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3415, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3418, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_36parse(__pyx_self, __pyx_v_source, __pyx_v_parser, __pyx_v_base_url);
 
   /* function exit code */
@@ -83179,7 +83144,7 @@ static PyObject *__pyx_pf_4lxml_5etree_36parse(CYTHON_UNUSED PyObject *__pyx_sel
   PyObject *__pyx_t_8 = NULL;
   __Pyx_RefNannySetupContext("parse", 0);
 
-  /* "lxml/etree.pyx":3440
+  /* "lxml/etree.pyx":3443
  *     """
  *     cdef _Document doc
  *     try:             # <<<<<<<<<<<<<<
@@ -83195,19 +83160,19 @@ static PyObject *__pyx_pf_4lxml_5etree_36parse(CYTHON_UNUSED PyObject *__pyx_sel
     __Pyx_XGOTREF(__pyx_t_3);
     /*try:*/ {
 
-      /* "lxml/etree.pyx":3441
+      /* "lxml/etree.pyx":3444
  *     cdef _Document doc
  *     try:
  *         doc = _parseDocument(source, parser, base_url)             # <<<<<<<<<<<<<<
  *         return _elementTreeFactory(doc, None)
  *     except _TargetParserResult as result_container:
  */
-      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_source, __pyx_v_parser, __pyx_v_base_url)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3441, __pyx_L3_error)
+      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_source, __pyx_v_parser, __pyx_v_base_url)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3444, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_4);
       __pyx_t_4 = 0;
 
-      /* "lxml/etree.pyx":3442
+      /* "lxml/etree.pyx":3445
  *     try:
  *         doc = _parseDocument(source, parser, base_url)
  *         return _elementTreeFactory(doc, None)             # <<<<<<<<<<<<<<
@@ -83215,13 +83180,13 @@ static PyObject *__pyx_pf_4lxml_5etree_36parse(CYTHON_UNUSED PyObject *__pyx_sel
  *         return result_container.result
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3442, __pyx_L3_error)
+      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3445, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_r = __pyx_t_4;
       __pyx_t_4 = 0;
       goto __pyx_L7_try_return;
 
-      /* "lxml/etree.pyx":3440
+      /* "lxml/etree.pyx":3443
  *     """
  *     cdef _Document doc
  *     try:             # <<<<<<<<<<<<<<
@@ -83230,30 +83195,29 @@ static PyObject *__pyx_pf_4lxml_5etree_36parse(CYTHON_UNUSED PyObject *__pyx_sel
  */
     }
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/etree.pyx":3443
+    /* "lxml/etree.pyx":3446
  *         doc = _parseDocument(source, parser, base_url)
  *         return _elementTreeFactory(doc, None)
  *     except _TargetParserResult as result_container:             # <<<<<<<<<<<<<<
  *         return result_container.result
  * 
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3443, __pyx_L5_except_error)
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_TargetParserResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3446, __pyx_L5_except_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     if (__pyx_t_5) {
       __Pyx_AddTraceback("lxml.etree.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 3443, __pyx_L5_except_error)
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 3446, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_INCREF(__pyx_t_6);
       __pyx_v_result_container = __pyx_t_6;
 
-      /* "lxml/etree.pyx":3444
+      /* "lxml/etree.pyx":3447
  *         return _elementTreeFactory(doc, None)
  *     except _TargetParserResult as result_container:
  *         return result_container.result             # <<<<<<<<<<<<<<
@@ -83261,7 +83225,7 @@ static PyObject *__pyx_pf_4lxml_5etree_36parse(CYTHON_UNUSED PyObject *__pyx_sel
  * 
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3444, __pyx_L5_except_error)
+      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_result_container, __pyx_n_s_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3447, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_8);
       __pyx_r = __pyx_t_8;
       __pyx_t_8 = 0;
@@ -83273,28 +83237,25 @@ static PyObject *__pyx_pf_4lxml_5etree_36parse(CYTHON_UNUSED PyObject *__pyx_sel
     goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
 
-    /* "lxml/etree.pyx":3440
+    /* "lxml/etree.pyx":3443
  *     """
  *     cdef _Document doc
  *     try:             # <<<<<<<<<<<<<<
  *         doc = _parseDocument(source, parser, base_url)
  *         return _elementTreeFactory(doc, None)
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L7_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L0;
     __pyx_L6_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -83302,7 +83263,7 @@ static PyObject *__pyx_pf_4lxml_5etree_36parse(CYTHON_UNUSED PyObject *__pyx_sel
     goto __pyx_L0;
   }
 
-  /* "lxml/etree.pyx":3415
+  /* "lxml/etree.pyx":3418
  * 
  * 
  * def parse(source, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
@@ -83326,7 +83287,7 @@ static PyObject *__pyx_pf_4lxml_5etree_36parse(CYTHON_UNUSED PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3447
+/* "lxml/etree.pyx":3450
  * 
  * 
  * def adopt_external_document(capsule, _BaseParser parser=None):             # <<<<<<<<<<<<<<
@@ -83372,7 +83333,7 @@ static PyObject *__pyx_pw_4lxml_5etree_39adopt_external_document(PyObject *__pyx
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adopt_external_document") < 0)) __PYX_ERR(0, 3447, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adopt_external_document") < 0)) __PYX_ERR(0, 3450, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -83388,13 +83349,13 @@ static PyObject *__pyx_pw_4lxml_5etree_39adopt_external_document(PyObject *__pyx
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("adopt_external_document", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3447, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("adopt_external_document", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3450, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.adopt_external_document", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3447, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(0, 3450, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_38adopt_external_document(__pyx_self, __pyx_v_capsule, __pyx_v_parser);
 
   /* function exit code */
@@ -83418,7 +83379,7 @@ static PyObject *__pyx_pf_4lxml_5etree_38adopt_external_document(CYTHON_UNUSED P
   struct __pyx_opt_args_4lxml_5etree__adoptForeignDoc __pyx_t_4;
   __Pyx_RefNannySetupContext("adopt_external_document", 0);
 
-  /* "lxml/etree.pyx":3479
+  /* "lxml/etree.pyx":3482
  *     should not be attempted after transferring the ownership.
  *     """
  *     if python.PY_VERSION_HEX < 0x02070000:             # <<<<<<<<<<<<<<
@@ -83428,20 +83389,20 @@ static PyObject *__pyx_pf_4lxml_5etree_38adopt_external_document(CYTHON_UNUSED P
   __pyx_t_1 = ((PY_VERSION_HEX < 0x02070000) != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/etree.pyx":3480
+    /* "lxml/etree.pyx":3483
  *     """
  *     if python.PY_VERSION_HEX < 0x02070000:
  *         raise NotImplementedError("PyCapsule usage requires Python 2.7+")             # <<<<<<<<<<<<<<
  * 
  *     cdef xmlDoc* c_doc
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3480, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3483, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 3480, __pyx_L1_error)
+    __PYX_ERR(0, 3483, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":3479
+    /* "lxml/etree.pyx":3482
  *     should not be attempted after transferring the ownership.
  *     """
  *     if python.PY_VERSION_HEX < 0x02070000:             # <<<<<<<<<<<<<<
@@ -83450,7 +83411,7 @@ static PyObject *__pyx_pf_4lxml_5etree_38adopt_external_document(CYTHON_UNUSED P
  */
   }
 
-  /* "lxml/etree.pyx":3483
+  /* "lxml/etree.pyx":3486
  * 
  *     cdef xmlDoc* c_doc
  *     cdef bint is_owned = False             # <<<<<<<<<<<<<<
@@ -83459,17 +83420,17 @@ static PyObject *__pyx_pf_4lxml_5etree_38adopt_external_document(CYTHON_UNUSED P
  */
   __pyx_v_is_owned = 0;
 
-  /* "lxml/etree.pyx":3484
+  /* "lxml/etree.pyx":3487
  *     cdef xmlDoc* c_doc
  *     cdef bint is_owned = False
  *     c_doc = <xmlDoc*> python.lxml_unpack_xmldoc_capsule(capsule, &is_owned)             # <<<<<<<<<<<<<<
  *     doc = _adoptForeignDoc(c_doc, parser, is_owned)
  *     return _elementTreeFactory(doc, None)
  */
-  __pyx_t_3 = lxml_unpack_xmldoc_capsule(__pyx_v_capsule, (&__pyx_v_is_owned)); if (unlikely(__pyx_t_3 == NULL && PyErr_Occurred())) __PYX_ERR(0, 3484, __pyx_L1_error)
+  __pyx_t_3 = lxml_unpack_xmldoc_capsule(__pyx_v_capsule, (&__pyx_v_is_owned)); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 3487, __pyx_L1_error)
   __pyx_v_c_doc = ((xmlDoc *)__pyx_t_3);
 
-  /* "lxml/etree.pyx":3485
+  /* "lxml/etree.pyx":3488
  *     cdef bint is_owned = False
  *     c_doc = <xmlDoc*> python.lxml_unpack_xmldoc_capsule(capsule, &is_owned)
  *     doc = _adoptForeignDoc(c_doc, parser, is_owned)             # <<<<<<<<<<<<<<
@@ -83479,12 +83440,12 @@ static PyObject *__pyx_pf_4lxml_5etree_38adopt_external_document(CYTHON_UNUSED P
   __pyx_t_4.__pyx_n = 2;
   __pyx_t_4.parser = __pyx_v_parser;
   __pyx_t_4.is_owned = __pyx_v_is_owned;
-  __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__adoptForeignDoc(__pyx_v_c_doc, &__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3485, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__adoptForeignDoc(__pyx_v_c_doc, &__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3488, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/etree.pyx":3486
+  /* "lxml/etree.pyx":3489
  *     c_doc = <xmlDoc*> python.lxml_unpack_xmldoc_capsule(capsule, &is_owned)
  *     doc = _adoptForeignDoc(c_doc, parser, is_owned)
  *     return _elementTreeFactory(doc, None)             # <<<<<<<<<<<<<<
@@ -83492,13 +83453,13 @@ static PyObject *__pyx_pf_4lxml_5etree_38adopt_external_document(CYTHON_UNUSED P
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3486, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3447
+  /* "lxml/etree.pyx":3450
  * 
  * 
  * def adopt_external_document(capsule, _BaseParser parser=None):             # <<<<<<<<<<<<<<
@@ -83611,7 +83572,7 @@ static int __pyx_f_4lxml_5etree_14_ReadOnlyProxy__assertNode(struct __pyx_obj_4l
  *         return 0
  * 
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ReferenceError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 18, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ReferenceError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 18, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -83779,7 +83740,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_3tag___get__(struct __py
  *             if self._c_node.type == tree.XML_ELEMENT_NODE:
  *                 return _namespacedName(self._c_node)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 33, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 33, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":34
  *         def __get__(self):
@@ -83918,7 +83879,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_3tag___get__(struct __py
  * 
  *     property text:
  */
-    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 43, __pyx_L1_error)
+    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 43, __pyx_L1_error)
     break;
   }
 
@@ -83980,7 +83941,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4text___get__(struct __p
  *             if self._c_node.type == tree.XML_ELEMENT_NODE:
  *                 return _collectText(self._c_node.children)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 50, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 50, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":51
  *         def __get__(self):
@@ -84132,7 +84093,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4text___get__(struct __p
  * 
  *     property tail:
  */
-    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 62, __pyx_L1_error)
+    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 62, __pyx_L1_error)
     break;
   }
 
@@ -84193,7 +84154,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4tail___get__(struct __p
  *             return _collectText(self._c_node.next)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 70, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 70, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":71
  *         def __get__(self):
@@ -84265,7 +84226,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_10sourceline___get__(str
  *             line = tree.xmlGetLineNo(self._c_node)
  *             if line > 0:
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 78, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 78, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":79
  *             cdef long line
@@ -84381,7 +84342,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  *         if self._c_node.type == tree.XML_ELEMENT_NODE:
  *             return "<Element %s at 0x%x>" % (strrepr(self.tag), id(self))
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 86, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 86, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":87
  *     def __repr__(self):
@@ -84621,7 +84582,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  * 
  *     def __getitem__(self, x):
  */
-    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 100, __pyx_L1_error)
+    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 100, __pyx_L1_error)
     break;
   }
 
@@ -84719,7 +84680,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *         if isinstance(x, slice):
  *             # slicing
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 111, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 111, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":112
  *         cdef list result
@@ -84739,7 +84700,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *                 return _collectChildren(self)
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__isFullSlice(((PyObject*)__pyx_v_x)); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(6, 114, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__isFullSlice(((PyObject*)__pyx_v_x)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 114, __pyx_L1_error)
     __pyx_t_2 = (__pyx_t_3 != 0);
     if (__pyx_t_2) {
 
@@ -84774,7 +84735,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *             if c_node is NULL:
  *                 return []
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__findChildSlice(((PyObject*)__pyx_v_x), __pyx_v_self->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 116, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__findChildSlice(((PyObject*)__pyx_v_x), __pyx_v_self->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 116, __pyx_L1_error)
 
     /* "src/lxml/readonlytree.pxi":117
  *                 return _collectChildren(self)
@@ -84911,7 +84872,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
       __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_4), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 127, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(6, 127, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 127, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
       /* "src/lxml/readonlytree.pxi":128
@@ -84927,7 +84888,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
       __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 128, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(6, 128, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 128, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
       /* "src/lxml/readonlytree.pxi":129
@@ -85102,7 +85063,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_14_ReadOnlyProxy_6__len__(struct __pyx_o
  *         c = 0
  *         c_node = self._c_node.children
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 145, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 145, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":146
  *         cdef xmlNode* c_node
@@ -85235,7 +85196,7 @@ static int __pyx_pf_4lxml_5etree_14_ReadOnlyProxy_8__nonzero__(struct __pyx_obj_
  *         c_node = _findChildBackwards(self._c_node, 0)
  *         return c_node != NULL
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 156, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 156, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":157
  *         cdef xmlNode* c_node
@@ -85433,7 +85394,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy___copy__(struct __pyx_obj
  *         new_doc = _documentFactory(c_doc, None)
  *         root = new_doc.getroot()
  */
-  __pyx_t_6 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_self->_c_node->doc, __pyx_v_self->_c_node); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(6, 171, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_self->_c_node->doc, __pyx_v_self->_c_node); if (unlikely(__pyx_t_6 == ((xmlDoc *)NULL))) __PYX_ERR(6, 171, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_6;
 
   /* "src/lxml/readonlytree.pxi":172
@@ -85820,7 +85781,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
     __pyx_t_2 = __pyx_t_4;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_tag, __pyx_kp_s__42, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 193, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_tag, __pyx_kp_s__44, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 193, __pyx_L1_error)
   __pyx_t_2 = __pyx_t_4;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_2) {
@@ -85866,7 +85827,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
         if (unlikely(!__pyx_t_8)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(6, 194, __pyx_L1_error)
           }
           break;
@@ -85915,7 +85876,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
  *         return iter(children)
  * 
  */
-    __pyx_t_1 = PyObject_GetItem(__pyx_v_children, __pyx_slice__59); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 196, __pyx_L1_error)
+    __pyx_t_1 = PyObject_GetItem(__pyx_v_children, __pyx_slice__61); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 196, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF_SET(__pyx_v_children, __pyx_t_1);
     __pyx_t_1 = 0;
@@ -86032,7 +85993,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy_getchildren(struct __pyx_
  *         result = []
  *         c_node = self._c_node.children
  */
-  __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(6, 205, __pyx_L1_error)
+  __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 205, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":206
  *         cdef list result
@@ -86089,7 +86050,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy_getchildren(struct __pyx_
       __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1), __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 210, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(6, 210, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 210, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
       /* "src/lxml/readonlytree.pxi":209
@@ -86227,7 +86188,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_20getparent(struct __pyx
  *         c_parent = self._c_node.parent
  *         if c_parent is NULL or not tree._isElement(c_parent):
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 218, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 218, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":219
  *         cdef xmlNode* c_parent
@@ -86357,7 +86318,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_22getnext(struct __pyx_o
  *         c_node = _nextElement(self._c_node)
  *         if c_node is not NULL:
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 229, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 229, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":230
  *         cdef xmlNode* c_node
@@ -86476,7 +86437,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_24getprevious(struct __p
  *         c_node = _previousElement(self._c_node)
  *         if c_node is not NULL:
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 239, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 239, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":240
  *         cdef xmlNode* c_node
@@ -86590,7 +86551,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ReadOnlyPIProxy_6target___get__(struct
  *             return funicode(self._c_node.name)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 252, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 252, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":253
  *         def __get__(self):
@@ -86736,14 +86697,14 @@ static int __pyx_pf_4lxml_5etree_20_ReadOnlyEntityProxy_4name_2__set__(struct __
  *                 raise ValueError(u"Invalid entity name '%s'" % value)
  *             tree.xmlNodeSetName(self._c_node, _xcstr(value_utf))
  */
-  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__32, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 265, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__33, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 265, __pyx_L1_error)
   __pyx_t_4 = (__pyx_t_3 != 0);
   if (!__pyx_t_4) {
   } else {
     __pyx_t_2 = __pyx_t_4;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__33, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 265, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__34, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 265, __pyx_L1_error)
   __pyx_t_3 = (__pyx_t_4 != 0);
   __pyx_t_2 = __pyx_t_3;
   __pyx_L4_bool_binop_done:;
@@ -86911,7 +86872,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6attrib___get__(s
  *             return dict(_collectAttributes(self._c_node, 3))
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 280, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 280, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":281
  *         def __get__(self):
@@ -86991,7 +86952,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6prefix___get__(s
  *             if self._c_node.ns is not NULL:
  *                 if self._c_node.ns.prefix is not NULL:
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 287, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 287, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":288
  *         def __get__(self):
@@ -87165,7 +87126,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_get(struct __pyx_
  *         return _getNodeAttributeValue(self._c_node, key, default)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 296, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 296, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":297
  *         """
@@ -87237,7 +87198,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_2keys(struct __py
  *         return _collectAttributes(self._c_node, 1)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 303, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 303, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":304
  *         """
@@ -87309,7 +87270,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_4values(struct __
  *         return _collectAttributes(self._c_node, 2)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 310, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 310, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":311
  *         """
@@ -87381,7 +87342,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6items(struct __p
  *         return _collectAttributes(self._c_node, 3)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 317, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 317, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":318
  *         """
@@ -87706,10 +87667,10 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree__initReadOnlyProxy(struct __
  * cdef _freeReadOnlyProxies(_ReadOnlyProxy sourceProxy):
  */
     if (unlikely(__pyx_v_source_proxy->_dependent_proxies == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
       __PYX_ERR(6, 343, __pyx_L1_error)
     }
-    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_source_proxy->_dependent_proxies, ((PyObject *)__pyx_v_el)); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(6, 343, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_source_proxy->_dependent_proxies, ((PyObject *)__pyx_v_el)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 343, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -88074,7 +88035,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(struct __p
  *         c_node = _roNodeOf(other_element)
  *         if c_node.type == tree.XML_ELEMENT_NODE:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper__assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 384, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper__assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 384, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":385
  *         cdef xmlNode* c_node
@@ -88083,7 +88044,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(struct __p
  *         if c_node.type == tree.XML_ELEMENT_NODE:
  *             if tree.xmlDocGetRootElement(<tree.xmlDoc*>self._c_node) is not NULL:
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_other_element); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(6, 385, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_other_element); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(6, 385, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_2;
 
   /* "src/lxml/readonlytree.pxi":386
@@ -88187,7 +88148,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(struct __p
  *         c_next = c_node.next
  *         tree.xmlAddChild(self._c_node, c_node)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_node, ((xmlDoc *)__pyx_v_self->__pyx_base._c_node)); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(6, 391, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_node, ((xmlDoc *)__pyx_v_self->__pyx_base._c_node)); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(6, 391, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_2;
 
   /* "src/lxml/readonlytree.pxi":392
@@ -88319,7 +88280,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_OpaqueDocumentWrapper_2extend(struct _
  *         for element in elements:
  *             self.append(element)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper__assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 400, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper__assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 400, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":401
  *         """
@@ -88360,7 +88321,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_OpaqueDocumentWrapper_2extend(struct _
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(6, 401, __pyx_L1_error)
         }
         break;
@@ -88555,7 +88516,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_ModifyContentOnlyProxy_4text___get__(s
  *             if self._c_node.content is NULL:
  *                 return ''
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 421, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 421, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":422
  *         def __get__(self):
@@ -88662,7 +88623,7 @@ static int __pyx_pf_4lxml_5etree_23_ModifyContentOnlyProxy_4text_2__set__(struct
  *             if value is None:
  *                 c_text = <const_xmlChar*>NULL
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 429, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 429, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":430
  *             cdef tree.xmlDict* c_dict
@@ -88783,7 +88744,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25_ModifyContentOnlyPIProxy_6target___get
  *             return funicode(self._c_node.name)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 445, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 445, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":446
  *         def __get__(self):
@@ -88855,7 +88816,7 @@ static int __pyx_pf_4lxml_5etree_25_ModifyContentOnlyPIProxy_6target_2__set__(st
  *             value = _utf8(value)
  *             c_text = _xcstr(value)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 449, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 449, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":450
  *         def __set__(self, value):
@@ -89021,14 +88982,14 @@ static int __pyx_pf_4lxml_5etree_29_ModifyContentOnlyEntityProxy_4name_2__set__(
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
   if (unlikely(!Py_OptimizeFlag)) {
-    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__32, __pyx_v_value, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 464, __pyx_L1_error)
+    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__33, __pyx_v_value, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 464, __pyx_L1_error)
     __pyx_t_4 = (__pyx_t_3 != 0);
     if (__pyx_t_4) {
     } else {
       __pyx_t_2 = __pyx_t_4;
       goto __pyx_L3_bool_binop_done;
     }
-    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__33, __pyx_v_value, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 464, __pyx_L1_error)
+    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__34, __pyx_v_value, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 464, __pyx_L1_error)
     __pyx_t_3 = (__pyx_t_4 != 0);
     __pyx_t_2 = __pyx_t_3;
     __pyx_L3_bool_binop_done:;
@@ -89114,7 +89075,7 @@ static PyObject *__pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(struct __
  *         c_node = _roNodeOf(other_element)
  *         c_node = _copyNodeToDoc(c_node, self._c_node.doc)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 481, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 481, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":482
  *         cdef xmlNode* c_node
@@ -89123,7 +89084,7 @@ static PyObject *__pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(struct __
  *         c_node = _copyNodeToDoc(c_node, self._c_node.doc)
  *         c_next = c_node.next
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_other_element); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(6, 482, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_other_element); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(6, 482, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_2;
 
   /* "src/lxml/readonlytree.pxi":483
@@ -89133,7 +89094,7 @@ static PyObject *__pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(struct __
  *         c_next = c_node.next
  *         tree.xmlAddChild(self._c_node, c_node)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_node, __pyx_v_self->__pyx_base.__pyx_base._c_node->doc); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(6, 483, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_node, __pyx_v_self->__pyx_base.__pyx_base._c_node->doc); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(6, 483, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_2;
 
   /* "src/lxml/readonlytree.pxi":484
@@ -89263,7 +89224,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_2extend(struct
  *         for element in elements:
  *             self.append(element)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 492, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 492, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":493
  *         """
@@ -89304,7 +89265,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_2extend(struct
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(6, 493, __pyx_L1_error)
         }
         break;
@@ -89393,7 +89354,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text___get__(s
  *             return _collectText(self._c_node.children)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 501, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 501, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":502
  *         def __get__(self):
@@ -89467,7 +89428,7 @@ static int __pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text_2__set__(struct
  *             if isinstance(value, QName):
  *                 value = _resolveQNameText(self, value).decode('utf8')
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 505, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 505, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":506
  *         def __set__(self, value):
@@ -89491,7 +89452,7 @@ static int __pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text_2__set__(struct
     __pyx_t_4 = __pyx_f_4lxml_5etree__resolveQNameText(((struct LxmlElement *)__pyx_v_self), __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 507, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (unlikely(__pyx_t_4 == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
       __PYX_ERR(6, 507, __pyx_L1_error)
     }
     __pyx_t_5 = __Pyx_decode_bytes(__pyx_t_4, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 507, __pyx_L1_error)
@@ -89516,7 +89477,7 @@ static int __pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text_2__set__(struct
  * 
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_self->__pyx_base.__pyx_base._c_node, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(6, 508, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_self->__pyx_base.__pyx_base._c_node, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 508, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":504
  *             return _collectText(self._c_node.children)
@@ -90317,7 +90278,6 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -90362,14 +90322,12 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *             namespace = _utf8(_getattr(self, 'NAMESPACE'))
  *         except AttributeError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L1_error;
     __pyx_L4_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -90524,7 +90482,6 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     goto __pyx_L16_try_end;
     __pyx_L11_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -90672,7 +90629,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  */
         __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_tag, __pyx_n_s_split); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 61, __pyx_L13_except_error)
         __Pyx_GOTREF(__pyx_t_12);
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 61, __pyx_L13_except_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 61, __pyx_L13_except_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
         __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_5, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 61, __pyx_L13_except_error)
@@ -90704,14 +90661,12 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *             ns, tag = _getNsTag(_getattr(self, 'TAG'))
  *             if ns is not None:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
     goto __pyx_L1_error;
     __pyx_L12_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
@@ -90805,7 +90760,6 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L26_try_end;
     __pyx_L21_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
     __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -90925,14 +90879,12 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *             parser = _getattr(self, 'PARSER')
  *         except AttributeError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L1_error;
     __pyx_L22_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -91066,7 +91018,6 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       goto __pyx_L39_try_end;
       __pyx_L34_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
       __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -91098,14 +91049,12 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *                 is_html = _getattr(self, 'HTML')
  *             except AttributeError:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
       goto __pyx_L1_error;
       __pyx_L35_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_2);
@@ -91129,7 +91078,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *                         attrib, nsmap, _extra)
  *         last_child = None
  */
-  __pyx_t_7 = __pyx_f_4lxml_5etree__initNewElement(((struct LxmlElement *)__pyx_v_self), __pyx_v_is_html, __pyx_v_tag, __pyx_v_namespace, __pyx_v_parser, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(8, 77, __pyx_L1_error)
+  __pyx_t_7 = __pyx_f_4lxml_5etree__initNewElement(((struct LxmlElement *)__pyx_v_self), __pyx_v_is_html, __pyx_v_tag, __pyx_v_namespace, __pyx_v_parser, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 77, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":79
  *         _initNewElement(self, is_html, tag, namespace, parser,
@@ -91213,7 +91162,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *                                  (_collectText(self._c_node.children) or '') + child)
  *                 else:
  */
-        __pyx_t_7 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_self->__pyx_base._c_node, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(8, 83, __pyx_L1_error)
+        __pyx_t_7 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_self->__pyx_base._c_node, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 83, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
         /* "src/lxml/classlookup.pxi":82
@@ -91267,7 +91216,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *                                  (_collectText(last_child._c_node.next) or '') + child)
  *             elif isinstance(child, _Element):
  */
-        __pyx_t_7 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_last_child->_c_node, __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(8, 86, __pyx_L1_error)
+        __pyx_t_7 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_last_child->_c_node, __pyx_t_6); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 86, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       }
       __pyx_L43:;
@@ -91313,7 +91262,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *             elif isinstance(child, type) and issubclass(child, ElementBase):
  *                 last_child = child()
  */
-      __pyx_t_7 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_last_child); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(8, 90, __pyx_L1_error)
+      __pyx_t_7 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_last_child); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 90, __pyx_L1_error)
 
       /* "src/lxml/classlookup.pxi":88
  *                     _setTailText(last_child._c_node,
@@ -91339,7 +91288,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       __pyx_t_10 = __pyx_t_16;
       goto __pyx_L48_bool_binop_done;
     }
-    __pyx_t_16 = PyObject_IsSubclass(__pyx_v_child, ((PyObject *)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(8, 91, __pyx_L1_error)
+    __pyx_t_16 = PyObject_IsSubclass(__pyx_v_child, ((PyObject *)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(8, 91, __pyx_L1_error)
     __pyx_t_9 = (__pyx_t_16 != 0);
     __pyx_t_10 = __pyx_t_9;
     __pyx_L48_bool_binop_done:;
@@ -91382,7 +91331,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *             else:
  *                 raise TypeError, "Invalid child type: %r" % type(child)
  */
-      __pyx_t_7 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_last_child); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(8, 93, __pyx_L1_error)
+      __pyx_t_7 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_last_child); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 93, __pyx_L1_error)
 
       /* "src/lxml/classlookup.pxi":91
  *                 last_child = child
@@ -91580,7 +91529,7 @@ static int __pyx_pf_4lxml_5etree_11CommentBase___init__(struct __pyx_obj_4lxml_5
  *         doc = _documentFactory(c_doc, None)
  *         self._c_node = _createComment(c_doc, _xcstr(text))
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(8, 117, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_4 == ((xmlDoc *)NULL))) __PYX_ERR(8, 117, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_4;
 
   /* "src/lxml/classlookup.pxi":118
@@ -91648,7 +91597,7 @@ static int __pyx_pf_4lxml_5etree_11CommentBase___init__(struct __pyx_obj_4lxml_5
  *         self._init()
  * 
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(8, 123, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 123, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":124
  *         tree.xmlAddChild(<xmlNode*>c_doc, self._c_node)
@@ -91857,7 +91806,7 @@ static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_
  *         doc = _documentFactory(c_doc, None)
  *         self._c_node = _createPI(c_doc, _xcstr(target), _xcstr(text))
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(8, 148, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_4 == ((xmlDoc *)NULL))) __PYX_ERR(8, 148, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_4;
 
   /* "src/lxml/classlookup.pxi":149
@@ -91925,7 +91874,7 @@ static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_
  *         self._init()
  * 
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(8, 154, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 154, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":155
  *         tree.xmlAddChild(<xmlNode*>c_doc, self._c_node)
@@ -92167,7 +92116,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
  *         doc = _documentFactory(c_doc, None)
  *         self._c_node = _createEntity(c_doc, c_name)
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(8, 179, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(8, 179, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_3;
 
   /* "src/lxml/classlookup.pxi":180
@@ -92235,7 +92184,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
  *         self._init()
  * 
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(8, 185, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 185, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":186
  *         tree.xmlAddChild(<xmlNode*>c_doc, self._c_node)
@@ -92462,7 +92411,7 @@ static int __pyx_f_4lxml_5etree__validateNodeClass(xmlNode *__pyx_v_c_node, PyOb
     goto __pyx_L4_bool_binop_done;
   }
   if (unlikely(!__pyx_v_expected)) { __Pyx_RaiseUnboundLocalError("expected"); __PYX_ERR(8, 201, __pyx_L1_error) }
-  __pyx_t_5 = PyObject_IsSubclass(__pyx_v_cls, ((PyObject *)__pyx_v_expected)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(8, 201, __pyx_L1_error)
+  __pyx_t_5 = PyObject_IsSubclass(__pyx_v_cls, ((PyObject *)__pyx_v_expected)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 201, __pyx_L1_error)
   __pyx_t_4 = (__pyx_t_5 != 0);
   __pyx_t_3 = __pyx_t_4;
   __pyx_L4_bool_binop_done:;
@@ -92547,59 +92496,7 @@ static int __pyx_f_4lxml_5etree__validateNodeClass(xmlNode *__pyx_v_c_node, PyOb
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":220
- *     """
- *     cdef _element_class_lookup_function _lookup_function
- *     def __cinit__(self):             # <<<<<<<<<<<<<<
- *         self._lookup_function = NULL # use default lookup
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_4lxml_5etree_18ElementClassLookup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_4lxml_5etree_18ElementClassLookup_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
-    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
-  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
-  __pyx_r = __pyx_pf_4lxml_5etree_18ElementClassLookup___cinit__(((struct LxmlElementClassLookup *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_4lxml_5etree_18ElementClassLookup___cinit__(struct LxmlElementClassLookup *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-
-  /* "src/lxml/classlookup.pxi":221
- *     cdef _element_class_lookup_function _lookup_function
- *     def __cinit__(self):
- *         self._lookup_function = NULL # use default lookup             # <<<<<<<<<<<<<<
- * 
- * cdef public class FallbackElementClassLookup(ElementClassLookup) \
- */
-  __pyx_v_self->_lookup_function = NULL;
-
-  /* "src/lxml/classlookup.pxi":220
- *     """
- *     cdef _element_class_lookup_function _lookup_function
- *     def __cinit__(self):             # <<<<<<<<<<<<<<
- *         self._lookup_function = NULL # use default lookup
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "src/lxml/classlookup.pxi":232
+/* "src/lxml/classlookup.pxi":231
  *     cdef readonly ElementClassLookup fallback
  *     cdef _element_class_lookup_function _fallback_function
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -92628,7 +92525,7 @@ static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___cinit__(struct L
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/classlookup.pxi":234
+  /* "src/lxml/classlookup.pxi":233
  *     def __cinit__(self):
  *         # fall back to default lookup
  *         self._fallback_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<<
@@ -92637,7 +92534,7 @@ static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___cinit__(struct L
  */
   __pyx_v_self->_fallback_function = __pyx_f_4lxml_5etree__lookupDefaultElementClass;
 
-  /* "src/lxml/classlookup.pxi":232
+  /* "src/lxml/classlookup.pxi":231
  *     cdef readonly ElementClassLookup fallback
  *     cdef _element_class_lookup_function _fallback_function
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -92651,7 +92548,7 @@ static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___cinit__(struct L
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":236
+/* "src/lxml/classlookup.pxi":235
  *         self._fallback_function = _lookupDefaultElementClass
  * 
  *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<<
@@ -92688,7 +92585,7 @@ static int __pyx_pw_4lxml_5etree_26FallbackElementClassLookup_3__init__(PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 236, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 235, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -92702,13 +92599,13 @@ static int __pyx_pw_4lxml_5etree_26FallbackElementClassLookup_3__init__(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 236, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 235, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.FallbackElementClassLookup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) __PYX_ERR(8, 236, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) __PYX_ERR(8, 235, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_2__init__(((struct LxmlFallbackElementClassLookup *)__pyx_v_self), __pyx_v_fallback);
 
   /* function exit code */
@@ -92727,7 +92624,7 @@ static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_2__init__(struct L
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "src/lxml/classlookup.pxi":237
+  /* "src/lxml/classlookup.pxi":236
  * 
  *     def __init__(self, ElementClassLookup fallback=None):
  *         if fallback is not None:             # <<<<<<<<<<<<<<
@@ -92738,7 +92635,7 @@ static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_2__init__(struct L
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/classlookup.pxi":238
+    /* "src/lxml/classlookup.pxi":237
  *     def __init__(self, ElementClassLookup fallback=None):
  *         if fallback is not None:
  *             self._setFallback(fallback)             # <<<<<<<<<<<<<<
@@ -92747,7 +92644,7 @@ static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_2__init__(struct L
  */
     ((struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *)__pyx_v_self->__pyx_vtab)->_setFallback(__pyx_v_self, __pyx_v_fallback);
 
-    /* "src/lxml/classlookup.pxi":237
+    /* "src/lxml/classlookup.pxi":236
  * 
  *     def __init__(self, ElementClassLookup fallback=None):
  *         if fallback is not None:             # <<<<<<<<<<<<<<
@@ -92757,7 +92654,7 @@ static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_2__init__(struct L
     goto __pyx_L3;
   }
 
-  /* "src/lxml/classlookup.pxi":240
+  /* "src/lxml/classlookup.pxi":239
  *             self._setFallback(fallback)
  *         else:
  *             self._fallback_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<<
@@ -92769,7 +92666,7 @@ static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_2__init__(struct L
   }
   __pyx_L3:;
 
-  /* "src/lxml/classlookup.pxi":236
+  /* "src/lxml/classlookup.pxi":235
  *         self._fallback_function = _lookupDefaultElementClass
  * 
  *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<<
@@ -92783,7 +92680,7 @@ static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_2__init__(struct L
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":242
+/* "src/lxml/classlookup.pxi":241
  *             self._fallback_function = _lookupDefaultElementClass
  * 
  *     cdef void _setFallback(self, ElementClassLookup lookup):             # <<<<<<<<<<<<<<
@@ -92797,7 +92694,7 @@ static void __pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback(struc
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("_setFallback", 0);
 
-  /* "src/lxml/classlookup.pxi":245
+  /* "src/lxml/classlookup.pxi":244
  *         u"""Sets the fallback scheme for this lookup method.
  *         """
  *         self.fallback = lookup             # <<<<<<<<<<<<<<
@@ -92810,7 +92707,7 @@ static void __pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback(struc
   __Pyx_DECREF(((PyObject *)__pyx_v_self->fallback));
   __pyx_v_self->fallback = __pyx_v_lookup;
 
-  /* "src/lxml/classlookup.pxi":246
+  /* "src/lxml/classlookup.pxi":245
  *         """
  *         self.fallback = lookup
  *         self._fallback_function = lookup._lookup_function             # <<<<<<<<<<<<<<
@@ -92820,7 +92717,7 @@ static void __pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback(struc
   __pyx_t_1 = __pyx_v_lookup->_lookup_function;
   __pyx_v_self->_fallback_function = __pyx_t_1;
 
-  /* "src/lxml/classlookup.pxi":247
+  /* "src/lxml/classlookup.pxi":246
  *         self.fallback = lookup
  *         self._fallback_function = lookup._lookup_function
  *         if self._fallback_function is NULL:             # <<<<<<<<<<<<<<
@@ -92830,7 +92727,7 @@ static void __pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback(struc
   __pyx_t_2 = ((__pyx_v_self->_fallback_function == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/classlookup.pxi":248
+    /* "src/lxml/classlookup.pxi":247
  *         self._fallback_function = lookup._lookup_function
  *         if self._fallback_function is NULL:
  *             self._fallback_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<<
@@ -92839,7 +92736,7 @@ static void __pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback(struc
  */
     __pyx_v_self->_fallback_function = __pyx_f_4lxml_5etree__lookupDefaultElementClass;
 
-    /* "src/lxml/classlookup.pxi":247
+    /* "src/lxml/classlookup.pxi":246
  *         self.fallback = lookup
  *         self._fallback_function = lookup._lookup_function
  *         if self._fallback_function is NULL:             # <<<<<<<<<<<<<<
@@ -92848,7 +92745,7 @@ static void __pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback(struc
  */
   }
 
-  /* "src/lxml/classlookup.pxi":242
+  /* "src/lxml/classlookup.pxi":241
  *             self._fallback_function = _lookupDefaultElementClass
  * 
  *     cdef void _setFallback(self, ElementClassLookup lookup):             # <<<<<<<<<<<<<<
@@ -92860,7 +92757,7 @@ static void __pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback(struc
   __Pyx_RefNannyFinishContext();
 }
 
-/* "src/lxml/classlookup.pxi":250
+/* "src/lxml/classlookup.pxi":249
  *             self._fallback_function = _lookupDefaultElementClass
  * 
  *     def set_fallback(self, ElementClassLookup lookup not None):             # <<<<<<<<<<<<<<
@@ -92876,7 +92773,7 @@ static PyObject *__pyx_pw_4lxml_5etree_26FallbackElementClassLookup_5set_fallbac
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("set_fallback (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 0, "lookup", 0))) __PYX_ERR(8, 250, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 0, "lookup", 0))) __PYX_ERR(8, 249, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_4set_fallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_self), ((struct LxmlElementClassLookup *)__pyx_v_lookup));
 
   /* function exit code */
@@ -92893,7 +92790,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_4set_fallbac
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("set_fallback", 0);
 
-  /* "src/lxml/classlookup.pxi":255
+  /* "src/lxml/classlookup.pxi":254
  *         Sets the fallback scheme for this lookup method.
  *         """
  *         self._setFallback(lookup)             # <<<<<<<<<<<<<<
@@ -92902,7 +92799,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_4set_fallbac
  */
   ((struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *)__pyx_v_self->__pyx_vtab)->_setFallback(__pyx_v_self, __pyx_v_lookup);
 
-  /* "src/lxml/classlookup.pxi":250
+  /* "src/lxml/classlookup.pxi":249
  *             self._fallback_function = _lookupDefaultElementClass
  * 
  *     def set_fallback(self, ElementClassLookup lookup not None):             # <<<<<<<<<<<<<<
@@ -92917,7 +92814,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_4set_fallbac
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":230
+/* "src/lxml/classlookup.pxi":229
  *     Superclass of Element class lookups with additional fallback.
  *     """
  *     cdef readonly ElementClassLookup fallback             # <<<<<<<<<<<<<<
@@ -92954,7 +92851,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_8fallback___
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":257
+/* "src/lxml/classlookup.pxi":256
  *         self._setFallback(lookup)
  * 
  * cdef inline object _callLookupFallback(FallbackElementClassLookup lookup,             # <<<<<<<<<<<<<<
@@ -92969,7 +92866,7 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree__callLookupFallback(struct L
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("_callLookupFallback", 0);
 
-  /* "src/lxml/classlookup.pxi":259
+  /* "src/lxml/classlookup.pxi":258
  * cdef inline object _callLookupFallback(FallbackElementClassLookup lookup,
  *                                        _Document doc, xmlNode* c_node):
  *     return lookup._fallback_function(lookup.fallback, doc, c_node)             # <<<<<<<<<<<<<<
@@ -92979,14 +92876,14 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree__callLookupFallback(struct L
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = ((PyObject *)__pyx_v_lookup->fallback);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_v_lookup->_fallback_function(__pyx_t_1, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 259, __pyx_L1_error)
+  __pyx_t_2 = __pyx_v_lookup->_fallback_function(__pyx_t_1, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 258, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/classlookup.pxi":257
+  /* "src/lxml/classlookup.pxi":256
  *         self._setFallback(lookup)
  * 
  * cdef inline object _callLookupFallback(FallbackElementClassLookup lookup,             # <<<<<<<<<<<<<<
@@ -93006,7 +92903,7 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree__callLookupFallback(struct L
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":277
+/* "src/lxml/classlookup.pxi":276
  *     cdef readonly object pi_class
  *     cdef readonly object entity_class
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -93035,7 +92932,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___cinit__(struct __
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/classlookup.pxi":278
+  /* "src/lxml/classlookup.pxi":277
  *     cdef readonly object entity_class
  *     def __cinit__(self):
  *         self._lookup_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<<
@@ -93044,7 +92941,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___cinit__(struct __
  */
   __pyx_v_self->__pyx_base._lookup_function = __pyx_f_4lxml_5etree__lookupDefaultElementClass;
 
-  /* "src/lxml/classlookup.pxi":277
+  /* "src/lxml/classlookup.pxi":276
  *     cdef readonly object pi_class
  *     cdef readonly object entity_class
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -93058,7 +92955,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___cinit__(struct __
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":280
+/* "src/lxml/classlookup.pxi":279
  *         self._lookup_function = _lookupDefaultElementClass
  * 
  *     def __init__(self, element=None, comment=None, pi=None, entity=None):             # <<<<<<<<<<<<<<
@@ -93125,7 +93022,7 @@ static int __pyx_pw_4lxml_5etree_25ElementDefaultClassLookup_3__init__(PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 280, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 279, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -93148,7 +93045,7 @@ static int __pyx_pw_4lxml_5etree_25ElementDefaultClassLookup_3__init__(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 280, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 279, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.ElementDefaultClassLookup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -93168,7 +93065,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "src/lxml/classlookup.pxi":281
+  /* "src/lxml/classlookup.pxi":280
  * 
  *     def __init__(self, element=None, comment=None, pi=None, entity=None):
  *         if element is None:             # <<<<<<<<<<<<<<
@@ -93179,7 +93076,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/classlookup.pxi":282
+    /* "src/lxml/classlookup.pxi":281
  *     def __init__(self, element=None, comment=None, pi=None, entity=None):
  *         if element is None:
  *             self.element_class = _Element             # <<<<<<<<<<<<<<
@@ -93192,7 +93089,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     __Pyx_DECREF(__pyx_v_self->element_class);
     __pyx_v_self->element_class = ((PyObject *)__pyx_ptype_4lxml_5etree__Element);
 
-    /* "src/lxml/classlookup.pxi":281
+    /* "src/lxml/classlookup.pxi":280
  * 
  *     def __init__(self, element=None, comment=None, pi=None, entity=None):
  *         if element is None:             # <<<<<<<<<<<<<<
@@ -93202,18 +93099,18 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     goto __pyx_L3;
   }
 
-  /* "src/lxml/classlookup.pxi":283
+  /* "src/lxml/classlookup.pxi":282
  *         if element is None:
  *             self.element_class = _Element
  *         elif issubclass(element, ElementBase):             # <<<<<<<<<<<<<<
  *             self.element_class = element
  *         else:
  */
-  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_element, ((PyObject *)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(8, 283, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_element, ((PyObject *)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 282, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/classlookup.pxi":284
+    /* "src/lxml/classlookup.pxi":283
  *             self.element_class = _Element
  *         elif issubclass(element, ElementBase):
  *             self.element_class = element             # <<<<<<<<<<<<<<
@@ -93226,7 +93123,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     __Pyx_DECREF(__pyx_v_self->element_class);
     __pyx_v_self->element_class = __pyx_v_element;
 
-    /* "src/lxml/classlookup.pxi":283
+    /* "src/lxml/classlookup.pxi":282
  *         if element is None:
  *             self.element_class = _Element
  *         elif issubclass(element, ElementBase):             # <<<<<<<<<<<<<<
@@ -93236,7 +93133,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     goto __pyx_L3;
   }
 
-  /* "src/lxml/classlookup.pxi":286
+  /* "src/lxml/classlookup.pxi":285
  *             self.element_class = element
  *         else:
  *             raise TypeError, u"element class must be subclass of ElementBase"             # <<<<<<<<<<<<<<
@@ -93245,11 +93142,11 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_element_class_must_be_subclass_o, 0, 0);
-    __PYX_ERR(8, 286, __pyx_L1_error)
+    __PYX_ERR(8, 285, __pyx_L1_error)
   }
   __pyx_L3:;
 
-  /* "src/lxml/classlookup.pxi":288
+  /* "src/lxml/classlookup.pxi":287
  *             raise TypeError, u"element class must be subclass of ElementBase"
  * 
  *         if comment is None:             # <<<<<<<<<<<<<<
@@ -93260,7 +93157,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/classlookup.pxi":289
+    /* "src/lxml/classlookup.pxi":288
  * 
  *         if comment is None:
  *             self.comment_class = _Comment             # <<<<<<<<<<<<<<
@@ -93273,7 +93170,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     __Pyx_DECREF(__pyx_v_self->comment_class);
     __pyx_v_self->comment_class = ((PyObject *)__pyx_ptype_4lxml_5etree__Comment);
 
-    /* "src/lxml/classlookup.pxi":288
+    /* "src/lxml/classlookup.pxi":287
  *             raise TypeError, u"element class must be subclass of ElementBase"
  * 
  *         if comment is None:             # <<<<<<<<<<<<<<
@@ -93283,18 +93180,18 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     goto __pyx_L4;
   }
 
-  /* "src/lxml/classlookup.pxi":290
+  /* "src/lxml/classlookup.pxi":289
  *         if comment is None:
  *             self.comment_class = _Comment
  *         elif issubclass(comment, CommentBase):             # <<<<<<<<<<<<<<
  *             self.comment_class = comment
  *         else:
  */
-  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_comment, ((PyObject *)__pyx_ptype_4lxml_5etree_CommentBase)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(8, 290, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_comment, ((PyObject *)__pyx_ptype_4lxml_5etree_CommentBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 289, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/classlookup.pxi":291
+    /* "src/lxml/classlookup.pxi":290
  *             self.comment_class = _Comment
  *         elif issubclass(comment, CommentBase):
  *             self.comment_class = comment             # <<<<<<<<<<<<<<
@@ -93307,7 +93204,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     __Pyx_DECREF(__pyx_v_self->comment_class);
     __pyx_v_self->comment_class = __pyx_v_comment;
 
-    /* "src/lxml/classlookup.pxi":290
+    /* "src/lxml/classlookup.pxi":289
  *         if comment is None:
  *             self.comment_class = _Comment
  *         elif issubclass(comment, CommentBase):             # <<<<<<<<<<<<<<
@@ -93317,7 +93214,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     goto __pyx_L4;
   }
 
-  /* "src/lxml/classlookup.pxi":293
+  /* "src/lxml/classlookup.pxi":292
  *             self.comment_class = comment
  *         else:
  *             raise TypeError, u"comment class must be subclass of CommentBase"             # <<<<<<<<<<<<<<
@@ -93326,11 +93223,11 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_comment_class_must_be_subclass_o, 0, 0);
-    __PYX_ERR(8, 293, __pyx_L1_error)
+    __PYX_ERR(8, 292, __pyx_L1_error)
   }
   __pyx_L4:;
 
-  /* "src/lxml/classlookup.pxi":295
+  /* "src/lxml/classlookup.pxi":294
  *             raise TypeError, u"comment class must be subclass of CommentBase"
  * 
  *         if entity is None:             # <<<<<<<<<<<<<<
@@ -93341,7 +93238,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/classlookup.pxi":296
+    /* "src/lxml/classlookup.pxi":295
  * 
  *         if entity is None:
  *             self.entity_class = _Entity             # <<<<<<<<<<<<<<
@@ -93354,7 +93251,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     __Pyx_DECREF(__pyx_v_self->entity_class);
     __pyx_v_self->entity_class = ((PyObject *)__pyx_ptype_4lxml_5etree__Entity);
 
-    /* "src/lxml/classlookup.pxi":295
+    /* "src/lxml/classlookup.pxi":294
  *             raise TypeError, u"comment class must be subclass of CommentBase"
  * 
  *         if entity is None:             # <<<<<<<<<<<<<<
@@ -93364,18 +93261,18 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     goto __pyx_L5;
   }
 
-  /* "src/lxml/classlookup.pxi":297
+  /* "src/lxml/classlookup.pxi":296
  *         if entity is None:
  *             self.entity_class = _Entity
  *         elif issubclass(entity, EntityBase):             # <<<<<<<<<<<<<<
  *             self.entity_class = entity
  *         else:
  */
-  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_entity, ((PyObject *)__pyx_ptype_4lxml_5etree_EntityBase)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(8, 297, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_entity, ((PyObject *)__pyx_ptype_4lxml_5etree_EntityBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 296, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/classlookup.pxi":298
+    /* "src/lxml/classlookup.pxi":297
  *             self.entity_class = _Entity
  *         elif issubclass(entity, EntityBase):
  *             self.entity_class = entity             # <<<<<<<<<<<<<<
@@ -93388,7 +93285,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     __Pyx_DECREF(__pyx_v_self->entity_class);
     __pyx_v_self->entity_class = __pyx_v_entity;
 
-    /* "src/lxml/classlookup.pxi":297
+    /* "src/lxml/classlookup.pxi":296
  *         if entity is None:
  *             self.entity_class = _Entity
  *         elif issubclass(entity, EntityBase):             # <<<<<<<<<<<<<<
@@ -93398,7 +93295,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     goto __pyx_L5;
   }
 
-  /* "src/lxml/classlookup.pxi":300
+  /* "src/lxml/classlookup.pxi":299
  *             self.entity_class = entity
  *         else:
  *             raise TypeError, u"Entity class must be subclass of EntityBase"             # <<<<<<<<<<<<<<
@@ -93407,11 +93304,11 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Entity_class_must_be_subclass_of, 0, 0);
-    __PYX_ERR(8, 300, __pyx_L1_error)
+    __PYX_ERR(8, 299, __pyx_L1_error)
   }
   __pyx_L5:;
 
-  /* "src/lxml/classlookup.pxi":302
+  /* "src/lxml/classlookup.pxi":301
  *             raise TypeError, u"Entity class must be subclass of EntityBase"
  * 
  *         if pi is None:             # <<<<<<<<<<<<<<
@@ -93422,7 +93319,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/classlookup.pxi":303
+    /* "src/lxml/classlookup.pxi":302
  * 
  *         if pi is None:
  *             self.pi_class = None # special case, see below             # <<<<<<<<<<<<<<
@@ -93435,7 +93332,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     __Pyx_DECREF(__pyx_v_self->pi_class);
     __pyx_v_self->pi_class = Py_None;
 
-    /* "src/lxml/classlookup.pxi":302
+    /* "src/lxml/classlookup.pxi":301
  *             raise TypeError, u"Entity class must be subclass of EntityBase"
  * 
  *         if pi is None:             # <<<<<<<<<<<<<<
@@ -93445,18 +93342,18 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     goto __pyx_L6;
   }
 
-  /* "src/lxml/classlookup.pxi":304
+  /* "src/lxml/classlookup.pxi":303
  *         if pi is None:
  *             self.pi_class = None # special case, see below
  *         elif issubclass(pi, PIBase):             # <<<<<<<<<<<<<<
  *             self.pi_class = pi
  *         else:
  */
-  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_pi, ((PyObject *)__pyx_ptype_4lxml_5etree_PIBase)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(8, 304, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_pi, ((PyObject *)__pyx_ptype_4lxml_5etree_PIBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 303, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/classlookup.pxi":305
+    /* "src/lxml/classlookup.pxi":304
  *             self.pi_class = None # special case, see below
  *         elif issubclass(pi, PIBase):
  *             self.pi_class = pi             # <<<<<<<<<<<<<<
@@ -93469,7 +93366,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     __Pyx_DECREF(__pyx_v_self->pi_class);
     __pyx_v_self->pi_class = __pyx_v_pi;
 
-    /* "src/lxml/classlookup.pxi":304
+    /* "src/lxml/classlookup.pxi":303
  *         if pi is None:
  *             self.pi_class = None # special case, see below
  *         elif issubclass(pi, PIBase):             # <<<<<<<<<<<<<<
@@ -93479,7 +93376,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
     goto __pyx_L6;
   }
 
-  /* "src/lxml/classlookup.pxi":307
+  /* "src/lxml/classlookup.pxi":306
  *             self.pi_class = pi
  *         else:
  *             raise TypeError, u"PI class must be subclass of PIBase"             # <<<<<<<<<<<<<<
@@ -93488,11 +93385,11 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_PI_class_must_be_subclass_of_PIB, 0, 0);
-    __PYX_ERR(8, 307, __pyx_L1_error)
+    __PYX_ERR(8, 306, __pyx_L1_error)
   }
   __pyx_L6:;
 
-  /* "src/lxml/classlookup.pxi":280
+  /* "src/lxml/classlookup.pxi":279
  *         self._lookup_function = _lookupDefaultElementClass
  * 
  *     def __init__(self, element=None, comment=None, pi=None, entity=None):             # <<<<<<<<<<<<<<
@@ -93511,7 +93408,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":273
+/* "src/lxml/classlookup.pxi":272
  *     accept the respective Element classes.
  *     """
  *     cdef readonly object element_class             # <<<<<<<<<<<<<<
@@ -93548,7 +93445,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_13element_cla
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":274
+/* "src/lxml/classlookup.pxi":273
  *     """
  *     cdef readonly object element_class
  *     cdef readonly object comment_class             # <<<<<<<<<<<<<<
@@ -93585,7 +93482,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_13comment_cla
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":275
+/* "src/lxml/classlookup.pxi":274
  *     cdef readonly object element_class
  *     cdef readonly object comment_class
  *     cdef readonly object pi_class             # <<<<<<<<<<<<<<
@@ -93622,7 +93519,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_8pi_class___g
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":276
+/* "src/lxml/classlookup.pxi":275
  *     cdef readonly object comment_class
  *     cdef readonly object pi_class
  *     cdef readonly object entity_class             # <<<<<<<<<<<<<<
@@ -93659,7 +93556,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_12entity_clas
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":309
+/* "src/lxml/classlookup.pxi":308
  *             raise TypeError, u"PI class must be subclass of PIBase"
  * 
  * cdef object _lookupDefaultElementClass(state, _Document _doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -93677,7 +93574,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("_lookupDefaultElementClass", 0);
 
-  /* "src/lxml/classlookup.pxi":311
+  /* "src/lxml/classlookup.pxi":310
  * cdef object _lookupDefaultElementClass(state, _Document _doc, xmlNode* c_node):
  *     u"Trivial class lookup function that always returns the default class."
  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -93687,7 +93584,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
   switch (__pyx_v_c_node->type) {
     case XML_ELEMENT_NODE:
 
-    /* "src/lxml/classlookup.pxi":312
+    /* "src/lxml/classlookup.pxi":311
  *     u"Trivial class lookup function that always returns the default class."
  *     if c_node.type == tree.XML_ELEMENT_NODE:
  *         if state is not None:             # <<<<<<<<<<<<<<
@@ -93698,7 +93595,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
     __pyx_t_2 = (__pyx_t_1 != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/classlookup.pxi":313
+      /* "src/lxml/classlookup.pxi":312
  *     if c_node.type == tree.XML_ELEMENT_NODE:
  *         if state is not None:
  *             return (<ElementDefaultClassLookup>state).element_class             # <<<<<<<<<<<<<<
@@ -93710,7 +93607,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
       __pyx_r = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->element_class;
       goto __pyx_L0;
 
-      /* "src/lxml/classlookup.pxi":312
+      /* "src/lxml/classlookup.pxi":311
  *     u"Trivial class lookup function that always returns the default class."
  *     if c_node.type == tree.XML_ELEMENT_NODE:
  *         if state is not None:             # <<<<<<<<<<<<<<
@@ -93719,7 +93616,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
     }
 
-    /* "src/lxml/classlookup.pxi":315
+    /* "src/lxml/classlookup.pxi":314
  *             return (<ElementDefaultClassLookup>state).element_class
  *         else:
  *             return _Element             # <<<<<<<<<<<<<<
@@ -93733,7 +93630,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
       goto __pyx_L0;
     }
 
-    /* "src/lxml/classlookup.pxi":311
+    /* "src/lxml/classlookup.pxi":310
  * cdef object _lookupDefaultElementClass(state, _Document _doc, xmlNode* c_node):
  *     u"Trivial class lookup function that always returns the default class."
  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -93742,7 +93639,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
     break;
 
-    /* "src/lxml/classlookup.pxi":316
+    /* "src/lxml/classlookup.pxi":315
  *         else:
  *             return _Element
  *     elif c_node.type == tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
@@ -93751,7 +93648,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
     case XML_COMMENT_NODE:
 
-    /* "src/lxml/classlookup.pxi":317
+    /* "src/lxml/classlookup.pxi":316
  *             return _Element
  *     elif c_node.type == tree.XML_COMMENT_NODE:
  *         if state is not None:             # <<<<<<<<<<<<<<
@@ -93762,7 +93659,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
     __pyx_t_1 = (__pyx_t_2 != 0);
     if (__pyx_t_1) {
 
-      /* "src/lxml/classlookup.pxi":318
+      /* "src/lxml/classlookup.pxi":317
  *     elif c_node.type == tree.XML_COMMENT_NODE:
  *         if state is not None:
  *             return (<ElementDefaultClassLookup>state).comment_class             # <<<<<<<<<<<<<<
@@ -93774,7 +93671,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
       __pyx_r = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->comment_class;
       goto __pyx_L0;
 
-      /* "src/lxml/classlookup.pxi":317
+      /* "src/lxml/classlookup.pxi":316
  *             return _Element
  *     elif c_node.type == tree.XML_COMMENT_NODE:
  *         if state is not None:             # <<<<<<<<<<<<<<
@@ -93783,7 +93680,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
     }
 
-    /* "src/lxml/classlookup.pxi":320
+    /* "src/lxml/classlookup.pxi":319
  *             return (<ElementDefaultClassLookup>state).comment_class
  *         else:
  *             return _Comment             # <<<<<<<<<<<<<<
@@ -93797,7 +93694,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
       goto __pyx_L0;
     }
 
-    /* "src/lxml/classlookup.pxi":316
+    /* "src/lxml/classlookup.pxi":315
  *         else:
  *             return _Element
  *     elif c_node.type == tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
@@ -93806,7 +93703,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
     break;
 
-    /* "src/lxml/classlookup.pxi":321
+    /* "src/lxml/classlookup.pxi":320
  *         else:
  *             return _Comment
  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:             # <<<<<<<<<<<<<<
@@ -93815,7 +93712,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
     case XML_ENTITY_REF_NODE:
 
-    /* "src/lxml/classlookup.pxi":322
+    /* "src/lxml/classlookup.pxi":321
  *             return _Comment
  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
  *         if state is not None:             # <<<<<<<<<<<<<<
@@ -93826,7 +93723,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
     __pyx_t_2 = (__pyx_t_1 != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/classlookup.pxi":323
+      /* "src/lxml/classlookup.pxi":322
  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
  *         if state is not None:
  *             return (<ElementDefaultClassLookup>state).entity_class             # <<<<<<<<<<<<<<
@@ -93838,7 +93735,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
       __pyx_r = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->entity_class;
       goto __pyx_L0;
 
-      /* "src/lxml/classlookup.pxi":322
+      /* "src/lxml/classlookup.pxi":321
  *             return _Comment
  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
  *         if state is not None:             # <<<<<<<<<<<<<<
@@ -93847,7 +93744,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
     }
 
-    /* "src/lxml/classlookup.pxi":325
+    /* "src/lxml/classlookup.pxi":324
  *             return (<ElementDefaultClassLookup>state).entity_class
  *         else:
  *             return _Entity             # <<<<<<<<<<<<<<
@@ -93861,7 +93758,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
       goto __pyx_L0;
     }
 
-    /* "src/lxml/classlookup.pxi":321
+    /* "src/lxml/classlookup.pxi":320
  *         else:
  *             return _Comment
  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:             # <<<<<<<<<<<<<<
@@ -93870,7 +93767,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
     break;
 
-    /* "src/lxml/classlookup.pxi":326
+    /* "src/lxml/classlookup.pxi":325
  *         else:
  *             return _Entity
  *     elif c_node.type == tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
@@ -93879,7 +93776,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
     case XML_PI_NODE:
 
-    /* "src/lxml/classlookup.pxi":327
+    /* "src/lxml/classlookup.pxi":326
  *             return _Entity
  *     elif c_node.type == tree.XML_PI_NODE:
  *         if state is None or (<ElementDefaultClassLookup>state).pi_class is None:             # <<<<<<<<<<<<<<
@@ -93899,7 +93796,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
     __pyx_L7_bool_binop_done:;
     if (__pyx_t_2) {
 
-      /* "src/lxml/classlookup.pxi":329
+      /* "src/lxml/classlookup.pxi":328
  *         if state is None or (<ElementDefaultClassLookup>state).pi_class is None:
  *             # special case XSLT-PI
  *             if c_node.name is not NULL and c_node.content is not NULL:             # <<<<<<<<<<<<<<
@@ -93917,7 +93814,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
       __pyx_L10_bool_binop_done:;
       if (__pyx_t_2) {
 
-        /* "src/lxml/classlookup.pxi":330
+        /* "src/lxml/classlookup.pxi":329
  *             # special case XSLT-PI
  *             if c_node.name is not NULL and c_node.content is not NULL:
  *                 if tree.xmlStrcmp(c_node.name, <unsigned char*>"xml-stylesheet") == 0:             # <<<<<<<<<<<<<<
@@ -93927,7 +93824,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
         __pyx_t_2 = ((xmlStrcmp(__pyx_v_c_node->name, ((unsigned char *)((unsigned char *)((char const *)"xml-stylesheet")))) == 0) != 0);
         if (__pyx_t_2) {
 
-          /* "src/lxml/classlookup.pxi":331
+          /* "src/lxml/classlookup.pxi":330
  *             if c_node.name is not NULL and c_node.content is not NULL:
  *                 if tree.xmlStrcmp(c_node.name, <unsigned char*>"xml-stylesheet") == 0:
  *                     if tree.xmlStrstr(c_node.content, <unsigned char*>"text/xsl") is not NULL or \             # <<<<<<<<<<<<<<
@@ -93941,7 +93838,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
             goto __pyx_L14_bool_binop_done;
           }
 
-          /* "src/lxml/classlookup.pxi":332
+          /* "src/lxml/classlookup.pxi":331
  *                 if tree.xmlStrcmp(c_node.name, <unsigned char*>"xml-stylesheet") == 0:
  *                     if tree.xmlStrstr(c_node.content, <unsigned char*>"text/xsl") is not NULL or \
  *                            tree.xmlStrstr(c_node.content, <unsigned char*>"text/xml") is not NULL:             # <<<<<<<<<<<<<<
@@ -93952,7 +93849,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
           __pyx_t_2 = __pyx_t_1;
           __pyx_L14_bool_binop_done:;
 
-          /* "src/lxml/classlookup.pxi":331
+          /* "src/lxml/classlookup.pxi":330
  *             if c_node.name is not NULL and c_node.content is not NULL:
  *                 if tree.xmlStrcmp(c_node.name, <unsigned char*>"xml-stylesheet") == 0:
  *                     if tree.xmlStrstr(c_node.content, <unsigned char*>"text/xsl") is not NULL or \             # <<<<<<<<<<<<<<
@@ -93961,7 +93858,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
           if (__pyx_t_2) {
 
-            /* "src/lxml/classlookup.pxi":333
+            /* "src/lxml/classlookup.pxi":332
  *                     if tree.xmlStrstr(c_node.content, <unsigned char*>"text/xsl") is not NULL or \
  *                            tree.xmlStrstr(c_node.content, <unsigned char*>"text/xml") is not NULL:
  *                         return _XSLTProcessingInstruction             # <<<<<<<<<<<<<<
@@ -93973,7 +93870,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
             __pyx_r = ((PyObject *)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction);
             goto __pyx_L0;
 
-            /* "src/lxml/classlookup.pxi":331
+            /* "src/lxml/classlookup.pxi":330
  *             if c_node.name is not NULL and c_node.content is not NULL:
  *                 if tree.xmlStrcmp(c_node.name, <unsigned char*>"xml-stylesheet") == 0:
  *                     if tree.xmlStrstr(c_node.content, <unsigned char*>"text/xsl") is not NULL or \             # <<<<<<<<<<<<<<
@@ -93982,7 +93879,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
           }
 
-          /* "src/lxml/classlookup.pxi":330
+          /* "src/lxml/classlookup.pxi":329
  *             # special case XSLT-PI
  *             if c_node.name is not NULL and c_node.content is not NULL:
  *                 if tree.xmlStrcmp(c_node.name, <unsigned char*>"xml-stylesheet") == 0:             # <<<<<<<<<<<<<<
@@ -93991,7 +93888,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
         }
 
-        /* "src/lxml/classlookup.pxi":329
+        /* "src/lxml/classlookup.pxi":328
  *         if state is None or (<ElementDefaultClassLookup>state).pi_class is None:
  *             # special case XSLT-PI
  *             if c_node.name is not NULL and c_node.content is not NULL:             # <<<<<<<<<<<<<<
@@ -94000,7 +93897,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
       }
 
-      /* "src/lxml/classlookup.pxi":334
+      /* "src/lxml/classlookup.pxi":333
  *                            tree.xmlStrstr(c_node.content, <unsigned char*>"text/xml") is not NULL:
  *                         return _XSLTProcessingInstruction
  *             return _ProcessingInstruction             # <<<<<<<<<<<<<<
@@ -94012,7 +93909,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
       __pyx_r = ((PyObject *)__pyx_ptype_4lxml_5etree__ProcessingInstruction);
       goto __pyx_L0;
 
-      /* "src/lxml/classlookup.pxi":327
+      /* "src/lxml/classlookup.pxi":326
  *             return _Entity
  *     elif c_node.type == tree.XML_PI_NODE:
  *         if state is None or (<ElementDefaultClassLookup>state).pi_class is None:             # <<<<<<<<<<<<<<
@@ -94021,7 +93918,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
  */
     }
 
-    /* "src/lxml/classlookup.pxi":336
+    /* "src/lxml/classlookup.pxi":335
  *             return _ProcessingInstruction
  *         else:
  *             return (<ElementDefaultClassLookup>state).pi_class             # <<<<<<<<<<<<<<
@@ -94035,7 +93932,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
       goto __pyx_L0;
     }
 
-    /* "src/lxml/classlookup.pxi":326
+    /* "src/lxml/classlookup.pxi":325
  *         else:
  *             return _Entity
  *     elif c_node.type == tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
@@ -94045,7 +93942,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
     break;
     default:
 
-    /* "src/lxml/classlookup.pxi":338
+    /* "src/lxml/classlookup.pxi":337
  *             return (<ElementDefaultClassLookup>state).pi_class
  *     else:
  *         assert 0, u"Unknown node type: %s" % c_node.type             # <<<<<<<<<<<<<<
@@ -94055,21 +93952,21 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
     #ifndef CYTHON_WITHOUT_ASSERTIONS
     if (unlikely(!Py_OptimizeFlag)) {
       if (unlikely(!0)) {
-        __pyx_t_4 = __Pyx_PyInt_From_xmlElementType(__pyx_v_c_node->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 338, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyInt_From_xmlElementType(__pyx_v_c_node->type); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 337, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_Unknown_node_type_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 338, __pyx_L1_error)
+        __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_Unknown_node_type_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 337, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         PyErr_SetObject(PyExc_AssertionError, __pyx_t_5);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __PYX_ERR(8, 338, __pyx_L1_error)
+        __PYX_ERR(8, 337, __pyx_L1_error)
       }
     }
     #endif
     break;
   }
 
-  /* "src/lxml/classlookup.pxi":309
+  /* "src/lxml/classlookup.pxi":308
  *             raise TypeError, u"PI class must be subclass of PIBase"
  * 
  * cdef object _lookupDefaultElementClass(state, _Document _doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -94091,7 +93988,7 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":361
+/* "src/lxml/classlookup.pxi":360
  *     cdef const_xmlChar* _c_ns
  *     cdef const_xmlChar* _c_name
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -94120,7 +94017,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___cinit__(st
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/classlookup.pxi":362
+  /* "src/lxml/classlookup.pxi":361
  *     cdef const_xmlChar* _c_name
  *     def __cinit__(self):
  *         self._lookup_function = _attribute_class_lookup             # <<<<<<<<<<<<<<
@@ -94129,7 +94026,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___cinit__(st
  */
   __pyx_v_self->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__attribute_class_lookup;
 
-  /* "src/lxml/classlookup.pxi":361
+  /* "src/lxml/classlookup.pxi":360
  *     cdef const_xmlChar* _c_ns
  *     cdef const_xmlChar* _c_name
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -94143,7 +94040,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___cinit__(st
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":364
+/* "src/lxml/classlookup.pxi":363
  *         self._lookup_function = _attribute_class_lookup
  * 
  *     def __init__(self, attribute_name, class_mapping,             # <<<<<<<<<<<<<<
@@ -94164,7 +94061,7 @@ static int __pyx_pw_4lxml_5etree_32AttributeBasedElementClassLookup_3__init__(Py
     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_attribute_name,&__pyx_n_s_class_mapping,&__pyx_n_s_fallback,0};
     PyObject* values[3] = {0,0,0};
 
-    /* "src/lxml/classlookup.pxi":365
+    /* "src/lxml/classlookup.pxi":364
  * 
  *     def __init__(self, attribute_name, class_mapping,
  *                  ElementClassLookup fallback=None):             # <<<<<<<<<<<<<<
@@ -94194,7 +94091,7 @@ static int __pyx_pw_4lxml_5etree_32AttributeBasedElementClassLookup_3__init__(Py
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_class_mapping)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(8, 364, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(8, 363, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -94204,7 +94101,7 @@ static int __pyx_pw_4lxml_5etree_32AttributeBasedElementClassLookup_3__init__(Py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 364, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 363, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -94222,16 +94119,16 @@ static int __pyx_pw_4lxml_5etree_32AttributeBasedElementClassLookup_3__init__(Py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 364, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 363, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.AttributeBasedElementClassLookup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) __PYX_ERR(8, 365, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) __PYX_ERR(8, 364, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self), __pyx_v_attribute_name, __pyx_v_class_mapping, __pyx_v_fallback);
 
-  /* "src/lxml/classlookup.pxi":364
+  /* "src/lxml/classlookup.pxi":363
  *         self._lookup_function = _attribute_class_lookup
  * 
  *     def __init__(self, attribute_name, class_mapping,             # <<<<<<<<<<<<<<
@@ -94262,14 +94159,14 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "src/lxml/classlookup.pxi":366
+  /* "src/lxml/classlookup.pxi":365
  *     def __init__(self, attribute_name, class_mapping,
  *                  ElementClassLookup fallback=None):
  *         self._pytag = _getNsTag(attribute_name)             # <<<<<<<<<<<<<<
  *         ns, name = self._pytag
  *         if ns is None:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_attribute_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 366, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_attribute_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 365, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_pytag);
@@ -94277,7 +94174,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
   __pyx_v_self->_pytag = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/classlookup.pxi":367
+  /* "src/lxml/classlookup.pxi":366
  *                  ElementClassLookup fallback=None):
  *         self._pytag = _getNsTag(attribute_name)
  *         ns, name = self._pytag             # <<<<<<<<<<<<<<
@@ -94296,7 +94193,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(8, 367, __pyx_L1_error)
+      __PYX_ERR(8, 366, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
@@ -94304,21 +94201,21 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 367, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 366, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 367, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 366, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(8, 367, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(8, 366, __pyx_L1_error)
   }
   __pyx_v_ns = __pyx_t_2;
   __pyx_t_2 = 0;
   __pyx_v_name = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "src/lxml/classlookup.pxi":368
+  /* "src/lxml/classlookup.pxi":367
  *         self._pytag = _getNsTag(attribute_name)
  *         ns, name = self._pytag
  *         if ns is None:             # <<<<<<<<<<<<<<
@@ -94329,7 +94226,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
   __pyx_t_5 = (__pyx_t_4 != 0);
   if (__pyx_t_5) {
 
-    /* "src/lxml/classlookup.pxi":369
+    /* "src/lxml/classlookup.pxi":368
  *         ns, name = self._pytag
  *         if ns is None:
  *             self._c_ns = NULL             # <<<<<<<<<<<<<<
@@ -94338,7 +94235,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
  */
     __pyx_v_self->_c_ns = NULL;
 
-    /* "src/lxml/classlookup.pxi":368
+    /* "src/lxml/classlookup.pxi":367
  *         self._pytag = _getNsTag(attribute_name)
  *         ns, name = self._pytag
  *         if ns is None:             # <<<<<<<<<<<<<<
@@ -94348,7 +94245,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
     goto __pyx_L3;
   }
 
-  /* "src/lxml/classlookup.pxi":371
+  /* "src/lxml/classlookup.pxi":370
  *             self._c_ns = NULL
  *         else:
  *             self._c_ns = _xcstr(ns)             # <<<<<<<<<<<<<<
@@ -94360,7 +94257,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
   }
   __pyx_L3:;
 
-  /* "src/lxml/classlookup.pxi":372
+  /* "src/lxml/classlookup.pxi":371
  *         else:
  *             self._c_ns = _xcstr(ns)
  *         self._c_name = _xcstr(name)             # <<<<<<<<<<<<<<
@@ -94369,19 +94266,19 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
  */
   __pyx_v_self->_c_name = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_name);
 
-  /* "src/lxml/classlookup.pxi":373
+  /* "src/lxml/classlookup.pxi":372
  *             self._c_ns = _xcstr(ns)
  *         self._c_name = _xcstr(name)
  *         self._class_mapping = dict(class_mapping)             # <<<<<<<<<<<<<<
  * 
  *         FallbackElementClassLookup.__init__(self, fallback)
  */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 373, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 372, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_class_mapping);
   __Pyx_GIVEREF(__pyx_v_class_mapping);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_class_mapping);
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 373, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 372, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_GIVEREF(__pyx_t_3);
@@ -94390,14 +94287,14 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
   __pyx_v_self->_class_mapping = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "src/lxml/classlookup.pxi":375
+  /* "src/lxml/classlookup.pxi":374
  *         self._class_mapping = dict(class_mapping)
  * 
  *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<<
  * 
  * cdef object _attribute_class_lookup(state, _Document doc, xmlNode* c_node):
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 375, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 374, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = NULL;
   __pyx_t_6 = 0;
@@ -94414,7 +94311,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_1)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_fallback)};
-    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 375, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 374, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
@@ -94422,13 +94319,13 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_fallback)};
-    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 375, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 374, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 375, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 374, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_2) {
       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
@@ -94439,14 +94336,14 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
     __Pyx_INCREF(((PyObject *)__pyx_v_fallback));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_fallback));
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_fallback));
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 375, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 374, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "src/lxml/classlookup.pxi":364
+  /* "src/lxml/classlookup.pxi":363
  *         self._lookup_function = _attribute_class_lookup
  * 
  *     def __init__(self, attribute_name, class_mapping,             # <<<<<<<<<<<<<<
@@ -94471,7 +94368,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":377
+/* "src/lxml/classlookup.pxi":376
  *         FallbackElementClassLookup.__init__(self, fallback)
  * 
  * cdef object _attribute_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -94491,7 +94388,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
   int __pyx_t_3;
   __Pyx_RefNannySetupContext("_attribute_class_lookup", 0);
 
-  /* "src/lxml/classlookup.pxi":381
+  /* "src/lxml/classlookup.pxi":380
  *     cdef python.PyObject* dict_result
  * 
  *     lookup = <AttributeBasedElementClassLookup>state             # <<<<<<<<<<<<<<
@@ -94503,7 +94400,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/classlookup.pxi":382
+  /* "src/lxml/classlookup.pxi":381
  * 
  *     lookup = <AttributeBasedElementClassLookup>state
  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -94513,19 +94410,19 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
   __pyx_t_2 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/classlookup.pxi":383
+    /* "src/lxml/classlookup.pxi":382
  *     lookup = <AttributeBasedElementClassLookup>state
  *     if c_node.type == tree.XML_ELEMENT_NODE:
  *         value = _attributeValueFromNsName(             # <<<<<<<<<<<<<<
  *             c_node, lookup._c_ns, lookup._c_name)
  *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__attributeValueFromNsName(__pyx_v_c_node, __pyx_v_lookup->_c_ns, __pyx_v_lookup->_c_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 383, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__attributeValueFromNsName(__pyx_v_c_node, __pyx_v_lookup->_c_ns, __pyx_v_lookup->_c_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 382, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_value = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "src/lxml/classlookup.pxi":385
+    /* "src/lxml/classlookup.pxi":384
  *         value = _attributeValueFromNsName(
  *             c_node, lookup._c_ns, lookup._c_name)
  *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)             # <<<<<<<<<<<<<<
@@ -94537,7 +94434,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
     __pyx_v_dict_result = PyDict_GetItem(__pyx_t_1, __pyx_v_value);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "src/lxml/classlookup.pxi":386
+    /* "src/lxml/classlookup.pxi":385
  *             c_node, lookup._c_ns, lookup._c_name)
  *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
  *         if dict_result is not NULL:             # <<<<<<<<<<<<<<
@@ -94547,7 +94444,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
     __pyx_t_2 = ((__pyx_v_dict_result != NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/classlookup.pxi":387
+      /* "src/lxml/classlookup.pxi":386
  *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
  *         if dict_result is not NULL:
  *             cls = <object>dict_result             # <<<<<<<<<<<<<<
@@ -94559,16 +94456,16 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
       __pyx_v_cls = __pyx_t_1;
       __pyx_t_1 = 0;
 
-      /* "src/lxml/classlookup.pxi":388
+      /* "src/lxml/classlookup.pxi":387
  *         if dict_result is not NULL:
  *             cls = <object>dict_result
  *             _validateNodeClass(c_node, cls)             # <<<<<<<<<<<<<<
  *             return cls
  *     return _callLookupFallback(lookup, doc, c_node)
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(8, 388, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 387, __pyx_L1_error)
 
-      /* "src/lxml/classlookup.pxi":389
+      /* "src/lxml/classlookup.pxi":388
  *             cls = <object>dict_result
  *             _validateNodeClass(c_node, cls)
  *             return cls             # <<<<<<<<<<<<<<
@@ -94580,7 +94477,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
       __pyx_r = __pyx_v_cls;
       goto __pyx_L0;
 
-      /* "src/lxml/classlookup.pxi":386
+      /* "src/lxml/classlookup.pxi":385
  *             c_node, lookup._c_ns, lookup._c_name)
  *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
  *         if dict_result is not NULL:             # <<<<<<<<<<<<<<
@@ -94589,7 +94486,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
  */
     }
 
-    /* "src/lxml/classlookup.pxi":382
+    /* "src/lxml/classlookup.pxi":381
  * 
  *     lookup = <AttributeBasedElementClassLookup>state
  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -94598,7 +94495,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
  */
   }
 
-  /* "src/lxml/classlookup.pxi":390
+  /* "src/lxml/classlookup.pxi":389
  *             _validateNodeClass(c_node, cls)
  *             return cls
  *     return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
@@ -94606,13 +94503,13 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 390, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 389, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/classlookup.pxi":377
+  /* "src/lxml/classlookup.pxi":376
  *         FallbackElementClassLookup.__init__(self, fallback)
  * 
  * cdef object _attribute_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -94634,7 +94531,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":400
+/* "src/lxml/classlookup.pxi":399
  *     Element class lookup based on the XML parser.
  *     """
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -94663,7 +94560,7 @@ static int __pyx_pf_4lxml_5etree_29ParserBasedElementClassLookup___cinit__(struc
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/classlookup.pxi":401
+  /* "src/lxml/classlookup.pxi":400
  *     """
  *     def __cinit__(self):
  *         self._lookup_function = _parser_class_lookup             # <<<<<<<<<<<<<<
@@ -94672,7 +94569,7 @@ static int __pyx_pf_4lxml_5etree_29ParserBasedElementClassLookup___cinit__(struc
  */
   __pyx_v_self->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__parser_class_lookup;
 
-  /* "src/lxml/classlookup.pxi":400
+  /* "src/lxml/classlookup.pxi":399
  *     Element class lookup based on the XML parser.
  *     """
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -94686,7 +94583,7 @@ static int __pyx_pf_4lxml_5etree_29ParserBasedElementClassLookup___cinit__(struc
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":403
+/* "src/lxml/classlookup.pxi":402
  *         self._lookup_function = _parser_class_lookup
  * 
  * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -94703,7 +94600,7 @@ static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_sta
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("_parser_class_lookup", 0);
 
-  /* "src/lxml/classlookup.pxi":404
+  /* "src/lxml/classlookup.pxi":403
  * 
  * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):
  *     if doc._parser._class_lookup is not None:             # <<<<<<<<<<<<<<
@@ -94714,7 +94611,7 @@ static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_sta
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/classlookup.pxi":405
+    /* "src/lxml/classlookup.pxi":404
  * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):
  *     if doc._parser._class_lookup is not None:
  *         return doc._parser._class_lookup._lookup_function(             # <<<<<<<<<<<<<<
@@ -94723,7 +94620,7 @@ static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_sta
  */
     __Pyx_XDECREF(__pyx_r);
 
-    /* "src/lxml/classlookup.pxi":406
+    /* "src/lxml/classlookup.pxi":405
  *     if doc._parser._class_lookup is not None:
  *         return doc._parser._class_lookup._lookup_function(
  *             doc._parser._class_lookup, doc, c_node)             # <<<<<<<<<<<<<<
@@ -94733,21 +94630,21 @@ static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_sta
     __pyx_t_3 = ((PyObject *)__pyx_v_doc->_parser->_class_lookup);
     __Pyx_INCREF(__pyx_t_3);
 
-    /* "src/lxml/classlookup.pxi":405
+    /* "src/lxml/classlookup.pxi":404
  * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):
  *     if doc._parser._class_lookup is not None:
  *         return doc._parser._class_lookup._lookup_function(             # <<<<<<<<<<<<<<
  *             doc._parser._class_lookup, doc, c_node)
  *     return _callLookupFallback(<FallbackElementClassLookup>state, doc, c_node)
  */
-    __pyx_t_4 = __pyx_v_doc->_parser->_class_lookup->_lookup_function(__pyx_t_3, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 405, __pyx_L1_error)
+    __pyx_t_4 = __pyx_v_doc->_parser->_class_lookup->_lookup_function(__pyx_t_3, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 404, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_4;
     __pyx_t_4 = 0;
     goto __pyx_L0;
 
-    /* "src/lxml/classlookup.pxi":404
+    /* "src/lxml/classlookup.pxi":403
  * 
  * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):
  *     if doc._parser._class_lookup is not None:             # <<<<<<<<<<<<<<
@@ -94756,7 +94653,7 @@ static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_sta
  */
   }
 
-  /* "src/lxml/classlookup.pxi":407
+  /* "src/lxml/classlookup.pxi":406
  *         return doc._parser._class_lookup._lookup_function(
  *             doc._parser._class_lookup, doc, c_node)
  *     return _callLookupFallback(<FallbackElementClassLookup>state, doc, c_node)             # <<<<<<<<<<<<<<
@@ -94764,13 +94661,13 @@ static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_sta
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_state), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 407, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_state), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 406, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_r = __pyx_t_4;
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/classlookup.pxi":403
+  /* "src/lxml/classlookup.pxi":402
  *         self._lookup_function = _parser_class_lookup
  * 
  * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -94790,7 +94687,7 @@ static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_sta
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":429
+/* "src/lxml/classlookup.pxi":428
  *     If you return None from this method, the fallback will be called.
  *     """
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -94819,7 +94716,7 @@ static int __pyx_pf_4lxml_5etree_24CustomElementClassLookup___cinit__(struct __p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/classlookup.pxi":430
+  /* "src/lxml/classlookup.pxi":429
  *     """
  *     def __cinit__(self):
  *         self._lookup_function = _custom_class_lookup             # <<<<<<<<<<<<<<
@@ -94828,7 +94725,7 @@ static int __pyx_pf_4lxml_5etree_24CustomElementClassLookup___cinit__(struct __p
  */
   __pyx_v_self->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__custom_class_lookup;
 
-  /* "src/lxml/classlookup.pxi":429
+  /* "src/lxml/classlookup.pxi":428
  *     If you return None from this method, the fallback will be called.
  *     """
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -94842,7 +94739,7 @@ static int __pyx_pf_4lxml_5etree_24CustomElementClassLookup___cinit__(struct __p
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":432
+/* "src/lxml/classlookup.pxi":431
  *         self._lookup_function = _custom_class_lookup
  * 
  *     def lookup(self, type, doc, namespace, name):             # <<<<<<<<<<<<<<
@@ -94889,23 +94786,23 @@ static PyObject *__pyx_pw_4lxml_5etree_24CustomElementClassLookup_3lookup(PyObje
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_doc_2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 1); __PYX_ERR(8, 432, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 1); __PYX_ERR(8, 431, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_namespace)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 2); __PYX_ERR(8, 432, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 2); __PYX_ERR(8, 431, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
         if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 3); __PYX_ERR(8, 432, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 3); __PYX_ERR(8, 431, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) __PYX_ERR(8, 432, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) __PYX_ERR(8, 431, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
       goto __pyx_L5_argtuple_error;
@@ -94922,7 +94819,7 @@ static PyObject *__pyx_pw_4lxml_5etree_24CustomElementClassLookup_3lookup(PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 432, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 431, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.CustomElementClassLookup.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -94940,7 +94837,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24CustomElementClassLookup_2lookup(CYTHON
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("lookup", 0);
 
-  /* "src/lxml/classlookup.pxi":434
+  /* "src/lxml/classlookup.pxi":433
  *     def lookup(self, type, doc, namespace, name):
  *         u"lookup(self, type, doc, namespace, name)"
  *         return None             # <<<<<<<<<<<<<<
@@ -94952,7 +94849,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24CustomElementClassLookup_2lookup(CYTHON
   __pyx_r = Py_None;
   goto __pyx_L0;
 
-  /* "src/lxml/classlookup.pxi":432
+  /* "src/lxml/classlookup.pxi":431
  *         self._lookup_function = _custom_class_lookup
  * 
  *     def lookup(self, type, doc, namespace, name):             # <<<<<<<<<<<<<<
@@ -94967,7 +94864,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24CustomElementClassLookup_2lookup(CYTHON
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":436
+/* "src/lxml/classlookup.pxi":435
  *         return None
  * 
  * cdef object _custom_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -94993,7 +94890,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   int __pyx_t_7;
   __Pyx_RefNannySetupContext("_custom_class_lookup", 0);
 
-  /* "src/lxml/classlookup.pxi":439
+  /* "src/lxml/classlookup.pxi":438
  *     cdef CustomElementClassLookup lookup
  * 
  *     lookup = <CustomElementClassLookup>state             # <<<<<<<<<<<<<<
@@ -95005,7 +94902,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/classlookup.pxi":441
+  /* "src/lxml/classlookup.pxi":440
  *     lookup = <CustomElementClassLookup>state
  * 
  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -95015,7 +94912,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   switch (__pyx_v_c_node->type) {
     case XML_ELEMENT_NODE:
 
-    /* "src/lxml/classlookup.pxi":442
+    /* "src/lxml/classlookup.pxi":441
  * 
  *     if c_node.type == tree.XML_ELEMENT_NODE:
  *         element_type = u"element"             # <<<<<<<<<<<<<<
@@ -95025,7 +94922,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     __Pyx_INCREF(__pyx_n_u_element);
     __pyx_v_element_type = __pyx_n_u_element;
 
-    /* "src/lxml/classlookup.pxi":441
+    /* "src/lxml/classlookup.pxi":440
  *     lookup = <CustomElementClassLookup>state
  * 
  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -95034,7 +94931,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  */
     break;
 
-    /* "src/lxml/classlookup.pxi":443
+    /* "src/lxml/classlookup.pxi":442
  *     if c_node.type == tree.XML_ELEMENT_NODE:
  *         element_type = u"element"
  *     elif c_node.type == tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
@@ -95043,7 +94940,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  */
     case XML_COMMENT_NODE:
 
-    /* "src/lxml/classlookup.pxi":444
+    /* "src/lxml/classlookup.pxi":443
  *         element_type = u"element"
  *     elif c_node.type == tree.XML_COMMENT_NODE:
  *         element_type = u"comment"             # <<<<<<<<<<<<<<
@@ -95053,7 +94950,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     __Pyx_INCREF(__pyx_n_u_comment);
     __pyx_v_element_type = __pyx_n_u_comment;
 
-    /* "src/lxml/classlookup.pxi":443
+    /* "src/lxml/classlookup.pxi":442
  *     if c_node.type == tree.XML_ELEMENT_NODE:
  *         element_type = u"element"
  *     elif c_node.type == tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
@@ -95062,7 +94959,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  */
     break;
 
-    /* "src/lxml/classlookup.pxi":445
+    /* "src/lxml/classlookup.pxi":444
  *     elif c_node.type == tree.XML_COMMENT_NODE:
  *         element_type = u"comment"
  *     elif c_node.type == tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
@@ -95071,7 +94968,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  */
     case XML_PI_NODE:
 
-    /* "src/lxml/classlookup.pxi":446
+    /* "src/lxml/classlookup.pxi":445
  *         element_type = u"comment"
  *     elif c_node.type == tree.XML_PI_NODE:
  *         element_type = u"PI"             # <<<<<<<<<<<<<<
@@ -95081,7 +94978,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     __Pyx_INCREF(__pyx_n_u_PI);
     __pyx_v_element_type = __pyx_n_u_PI;
 
-    /* "src/lxml/classlookup.pxi":445
+    /* "src/lxml/classlookup.pxi":444
  *     elif c_node.type == tree.XML_COMMENT_NODE:
  *         element_type = u"comment"
  *     elif c_node.type == tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
@@ -95090,7 +94987,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  */
     break;
 
-    /* "src/lxml/classlookup.pxi":447
+    /* "src/lxml/classlookup.pxi":446
  *     elif c_node.type == tree.XML_PI_NODE:
  *         element_type = u"PI"
  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:             # <<<<<<<<<<<<<<
@@ -95099,7 +94996,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  */
     case XML_ENTITY_REF_NODE:
 
-    /* "src/lxml/classlookup.pxi":448
+    /* "src/lxml/classlookup.pxi":447
  *         element_type = u"PI"
  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
  *         element_type = u"entity"             # <<<<<<<<<<<<<<
@@ -95109,7 +95006,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     __Pyx_INCREF(__pyx_n_u_entity);
     __pyx_v_element_type = __pyx_n_u_entity;
 
-    /* "src/lxml/classlookup.pxi":447
+    /* "src/lxml/classlookup.pxi":446
  *     elif c_node.type == tree.XML_PI_NODE:
  *         element_type = u"PI"
  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:             # <<<<<<<<<<<<<<
@@ -95119,7 +95016,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     break;
     default:
 
-    /* "src/lxml/classlookup.pxi":450
+    /* "src/lxml/classlookup.pxi":449
  *         element_type = u"entity"
  *     else:
  *         element_type = u"element"             # <<<<<<<<<<<<<<
@@ -95131,7 +95028,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     break;
   }
 
-  /* "src/lxml/classlookup.pxi":451
+  /* "src/lxml/classlookup.pxi":450
  *     else:
  *         element_type = u"element"
  *     if c_node.name is NULL:             # <<<<<<<<<<<<<<
@@ -95141,7 +95038,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   __pyx_t_2 = ((__pyx_v_c_node->name == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/classlookup.pxi":452
+    /* "src/lxml/classlookup.pxi":451
  *         element_type = u"element"
  *     if c_node.name is NULL:
  *         name = None             # <<<<<<<<<<<<<<
@@ -95151,7 +95048,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     __Pyx_INCREF(Py_None);
     __pyx_v_name = Py_None;
 
-    /* "src/lxml/classlookup.pxi":451
+    /* "src/lxml/classlookup.pxi":450
  *     else:
  *         element_type = u"element"
  *     if c_node.name is NULL:             # <<<<<<<<<<<<<<
@@ -95161,7 +95058,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     goto __pyx_L3;
   }
 
-  /* "src/lxml/classlookup.pxi":454
+  /* "src/lxml/classlookup.pxi":453
  *         name = None
  *     else:
  *         name = funicode(c_node.name)             # <<<<<<<<<<<<<<
@@ -95169,14 +95066,14 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  *     ns = funicode(c_str) if c_str is not NULL else None
  */
   /*else*/ {
-    __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_node->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 454, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_node->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 453, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_name = __pyx_t_1;
     __pyx_t_1 = 0;
   }
   __pyx_L3:;
 
-  /* "src/lxml/classlookup.pxi":455
+  /* "src/lxml/classlookup.pxi":454
  *     else:
  *         name = funicode(c_node.name)
  *     c_str = tree._getNs(c_node)             # <<<<<<<<<<<<<<
@@ -95185,7 +95082,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  */
   __pyx_v_c_str = _getNs(__pyx_v_c_node);
 
-  /* "src/lxml/classlookup.pxi":456
+  /* "src/lxml/classlookup.pxi":455
  *         name = funicode(c_node.name)
  *     c_str = tree._getNs(c_node)
  *     ns = funicode(c_str) if c_str is not NULL else None             # <<<<<<<<<<<<<<
@@ -95193,7 +95090,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  *     cls = lookup.lookup(element_type, doc, ns, name)
  */
   if (((__pyx_v_c_str != NULL) != 0)) {
-    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 456, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 455, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_1 = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -95204,14 +95101,14 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   __pyx_v_ns = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/classlookup.pxi":458
+  /* "src/lxml/classlookup.pxi":457
  *     ns = funicode(c_str) if c_str is not NULL else None
  * 
  *     cls = lookup.lookup(element_type, doc, ns, name)             # <<<<<<<<<<<<<<
  *     if cls is not None:
  *         _validateNodeClass(c_node, cls)
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lookup), __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 458, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lookup), __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 457, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   __pyx_t_5 = 0;
@@ -95228,7 +95125,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_element_type, ((PyObject *)__pyx_v_doc), __pyx_v_ns, __pyx_v_name};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 458, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 457, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -95236,13 +95133,13 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_element_type, ((PyObject *)__pyx_v_doc), __pyx_v_ns, __pyx_v_name};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 458, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 457, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 458, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 457, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -95259,7 +95156,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     __Pyx_INCREF(__pyx_v_name);
     __Pyx_GIVEREF(__pyx_v_name);
     PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_name);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 458, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 457, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -95267,7 +95164,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   __pyx_v_cls = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/classlookup.pxi":459
+  /* "src/lxml/classlookup.pxi":458
  * 
  *     cls = lookup.lookup(element_type, doc, ns, name)
  *     if cls is not None:             # <<<<<<<<<<<<<<
@@ -95278,16 +95175,16 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   __pyx_t_7 = (__pyx_t_2 != 0);
   if (__pyx_t_7) {
 
-    /* "src/lxml/classlookup.pxi":460
+    /* "src/lxml/classlookup.pxi":459
  *     cls = lookup.lookup(element_type, doc, ns, name)
  *     if cls is not None:
  *         _validateNodeClass(c_node, cls)             # <<<<<<<<<<<<<<
  *         return cls
  *     return _callLookupFallback(lookup, doc, c_node)
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(8, 460, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 459, __pyx_L1_error)
 
-    /* "src/lxml/classlookup.pxi":461
+    /* "src/lxml/classlookup.pxi":460
  *     if cls is not None:
  *         _validateNodeClass(c_node, cls)
  *         return cls             # <<<<<<<<<<<<<<
@@ -95299,7 +95196,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     __pyx_r = __pyx_v_cls;
     goto __pyx_L0;
 
-    /* "src/lxml/classlookup.pxi":459
+    /* "src/lxml/classlookup.pxi":458
  * 
  *     cls = lookup.lookup(element_type, doc, ns, name)
  *     if cls is not None:             # <<<<<<<<<<<<<<
@@ -95308,7 +95205,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  */
   }
 
-  /* "src/lxml/classlookup.pxi":462
+  /* "src/lxml/classlookup.pxi":461
  *         _validateNodeClass(c_node, cls)
  *         return cls
  *     return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
@@ -95316,13 +95213,13 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 462, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 461, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/classlookup.pxi":436
+  /* "src/lxml/classlookup.pxi":435
  *         return None
  * 
  * cdef object _custom_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -95349,7 +95246,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":511
+/* "src/lxml/classlookup.pxi":510
  *     See http://codespeak.net/lxml/element_classes.html
  *     """
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -95378,7 +95275,7 @@ static int __pyx_pf_4lxml_5etree_24PythonElementClassLookup___cinit__(struct __p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/classlookup.pxi":512
+  /* "src/lxml/classlookup.pxi":511
  *     """
  *     def __cinit__(self):
  *         self._lookup_function = _python_class_lookup             # <<<<<<<<<<<<<<
@@ -95387,7 +95284,7 @@ static int __pyx_pf_4lxml_5etree_24PythonElementClassLookup___cinit__(struct __p
  */
   __pyx_v_self->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__python_class_lookup;
 
-  /* "src/lxml/classlookup.pxi":511
+  /* "src/lxml/classlookup.pxi":510
  *     See http://codespeak.net/lxml/element_classes.html
  *     """
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -95401,7 +95298,7 @@ static int __pyx_pf_4lxml_5etree_24PythonElementClassLookup___cinit__(struct __p
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":514
+/* "src/lxml/classlookup.pxi":513
  *         self._lookup_function = _python_class_lookup
  * 
  *     def lookup(self, doc, element):             # <<<<<<<<<<<<<<
@@ -95442,11 +95339,11 @@ static PyObject *__pyx_pw_4lxml_5etree_24PythonElementClassLookup_3lookup(PyObje
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_element)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, 1); __PYX_ERR(8, 514, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, 1); __PYX_ERR(8, 513, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) __PYX_ERR(8, 514, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) __PYX_ERR(8, 513, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -95459,7 +95356,7 @@ static PyObject *__pyx_pw_4lxml_5etree_24PythonElementClassLookup_3lookup(PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 514, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 513, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.PythonElementClassLookup.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -95477,7 +95374,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24PythonElementClassLookup_2lookup(CYTHON
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("lookup", 0);
 
-  /* "src/lxml/classlookup.pxi":519
+  /* "src/lxml/classlookup.pxi":518
  *         Override this method to implement your own lookup scheme.
  *         """
  *         return None             # <<<<<<<<<<<<<<
@@ -95489,7 +95386,7 @@ static PyObject *__pyx_pf_4lxml_5etree_24PythonElementClassLookup_2lookup(CYTHON
   __pyx_r = Py_None;
   goto __pyx_L0;
 
-  /* "src/lxml/classlookup.pxi":514
+  /* "src/lxml/classlookup.pxi":513
  *         self._lookup_function = _python_class_lookup
  * 
  *     def lookup(self, doc, element):             # <<<<<<<<<<<<<<
@@ -95504,17 +95401,17 @@ static PyObject *__pyx_pf_4lxml_5etree_24PythonElementClassLookup_2lookup(CYTHON
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":521
+/* "src/lxml/classlookup.pxi":520
  *         return None
  * 
  * cdef object _python_class_lookup(state, _Document doc, tree.xmlNode* c_node):             # <<<<<<<<<<<<<<
  *     cdef PythonElementClassLookup lookup
- *     cdef _ReadOnlyElementProxy proxy
+ *     cdef _ReadOnlyProxy proxy
  */
 
 static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_state, struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
   struct __pyx_obj_4lxml_5etree_PythonElementClassLookup *__pyx_v_lookup = 0;
-  struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_proxy = 0;
+  struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_v_proxy = 0;
   PyObject *__pyx_v_cls = NULL;
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -95527,9 +95424,9 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
   int __pyx_t_7;
   __Pyx_RefNannySetupContext("_python_class_lookup", 0);
 
-  /* "src/lxml/classlookup.pxi":524
+  /* "src/lxml/classlookup.pxi":523
  *     cdef PythonElementClassLookup lookup
- *     cdef _ReadOnlyElementProxy proxy
+ *     cdef _ReadOnlyProxy proxy
  *     lookup = <PythonElementClassLookup>state             # <<<<<<<<<<<<<<
  * 
  *     proxy = _newReadOnlyProxy(None, c_node)
@@ -95539,27 +95436,26 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_PythonElementClassLookup *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/classlookup.pxi":526
+  /* "src/lxml/classlookup.pxi":525
  *     lookup = <PythonElementClassLookup>state
  * 
  *     proxy = _newReadOnlyProxy(None, c_node)             # <<<<<<<<<<<<<<
  *     cls = lookup.lookup(doc, proxy)
  *     _freeReadOnlyProxies(proxy)
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)Py_None), __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 526, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)Py_None), __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 525, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy))))) __PYX_ERR(8, 526, __pyx_L1_error)
-  __pyx_v_proxy = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_t_1);
+  __pyx_v_proxy = ((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/classlookup.pxi":527
+  /* "src/lxml/classlookup.pxi":526
  * 
  *     proxy = _newReadOnlyProxy(None, c_node)
  *     cls = lookup.lookup(doc, proxy)             # <<<<<<<<<<<<<<
  *     _freeReadOnlyProxies(proxy)
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lookup), __pyx_n_s_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 527, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lookup), __pyx_n_s_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 526, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   __pyx_t_4 = 0;
@@ -95576,7 +95472,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_doc), ((PyObject *)__pyx_v_proxy)};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 527, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 526, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -95584,13 +95480,13 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_doc), ((PyObject *)__pyx_v_proxy)};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 527, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 526, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 527, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 526, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_3) {
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
@@ -95601,7 +95497,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
     __Pyx_INCREF(((PyObject *)__pyx_v_proxy));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_proxy));
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_proxy));
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 527, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 526, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -95609,18 +95505,18 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
   __pyx_v_cls = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/classlookup.pxi":528
+  /* "src/lxml/classlookup.pxi":527
  *     proxy = _newReadOnlyProxy(None, c_node)
  *     cls = lookup.lookup(doc, proxy)
  *     _freeReadOnlyProxies(proxy)             # <<<<<<<<<<<<<<
  * 
  *     if cls is not None:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__freeReadOnlyProxies(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_proxy)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 528, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__freeReadOnlyProxies(__pyx_v_proxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 527, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/classlookup.pxi":530
+  /* "src/lxml/classlookup.pxi":529
  *     _freeReadOnlyProxies(proxy)
  * 
  *     if cls is not None:             # <<<<<<<<<<<<<<
@@ -95631,16 +95527,16 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
   __pyx_t_7 = (__pyx_t_6 != 0);
   if (__pyx_t_7) {
 
-    /* "src/lxml/classlookup.pxi":531
+    /* "src/lxml/classlookup.pxi":530
  * 
  *     if cls is not None:
  *         _validateNodeClass(c_node, cls)             # <<<<<<<<<<<<<<
  *         return cls
  *     return _callLookupFallback(lookup, doc, c_node)
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(8, 531, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 530, __pyx_L1_error)
 
-    /* "src/lxml/classlookup.pxi":532
+    /* "src/lxml/classlookup.pxi":531
  *     if cls is not None:
  *         _validateNodeClass(c_node, cls)
  *         return cls             # <<<<<<<<<<<<<<
@@ -95652,7 +95548,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
     __pyx_r = __pyx_v_cls;
     goto __pyx_L0;
 
-    /* "src/lxml/classlookup.pxi":530
+    /* "src/lxml/classlookup.pxi":529
  *     _freeReadOnlyProxies(proxy)
  * 
  *     if cls is not None:             # <<<<<<<<<<<<<<
@@ -95661,7 +95557,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
  */
   }
 
-  /* "src/lxml/classlookup.pxi":533
+  /* "src/lxml/classlookup.pxi":532
  *         _validateNodeClass(c_node, cls)
  *         return cls
  *     return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
@@ -95669,18 +95565,18 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
  * ################################################################################
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 533, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 532, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/classlookup.pxi":521
+  /* "src/lxml/classlookup.pxi":520
  *         return None
  * 
  * cdef object _python_class_lookup(state, _Document doc, tree.xmlNode* c_node):             # <<<<<<<<<<<<<<
  *     cdef PythonElementClassLookup lookup
- *     cdef _ReadOnlyElementProxy proxy
+ *     cdef _ReadOnlyProxy proxy
  */
 
   /* function exit code */
@@ -95700,7 +95596,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
   return __pyx_r;
 }
 
-/* "src/lxml/classlookup.pxi":541
+/* "src/lxml/classlookup.pxi":540
  * cdef object ELEMENT_CLASS_LOOKUP_STATE
  * 
  * cdef void _setElementClassLookupFunction(             # <<<<<<<<<<<<<<
@@ -95715,7 +95611,7 @@ static void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_l
   __Pyx_RefNannySetupContext("_setElementClassLookupFunction", 0);
   __Pyx_INCREF(__pyx_v_state);
 
-  /* "src/lxml/classlookup.pxi":544
+  /* "src/lxml/classlookup.pxi":543
  *     _element_class_lookup_function function, object state):
  *     global LOOKUP_ELEMENT_CLASS, ELEMENT_CLASS_LOOKUP_STATE
  *     if function is NULL:             # <<<<<<<<<<<<<<
@@ -95725,7 +95621,7 @@ static void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_l
   __pyx_t_1 = ((__pyx_v_function == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/classlookup.pxi":545
+    /* "src/lxml/classlookup.pxi":544
  *     global LOOKUP_ELEMENT_CLASS, ELEMENT_CLASS_LOOKUP_STATE
  *     if function is NULL:
  *         state    = DEFAULT_ELEMENT_CLASS_LOOKUP             # <<<<<<<<<<<<<<
@@ -95735,7 +95631,7 @@ static void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_l
     __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
 
-    /* "src/lxml/classlookup.pxi":546
+    /* "src/lxml/classlookup.pxi":545
  *     if function is NULL:
  *         state    = DEFAULT_ELEMENT_CLASS_LOOKUP
  *         function = DEFAULT_ELEMENT_CLASS_LOOKUP._lookup_function             # <<<<<<<<<<<<<<
@@ -95745,7 +95641,7 @@ static void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_l
     __pyx_t_2 = __pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP->__pyx_base.__pyx_base._lookup_function;
     __pyx_v_function = __pyx_t_2;
 
-    /* "src/lxml/classlookup.pxi":544
+    /* "src/lxml/classlookup.pxi":543
  *     _element_class_lookup_function function, object state):
  *     global LOOKUP_ELEMENT_CLASS, ELEMENT_CLASS_LOOKUP_STATE
  *     if function is NULL:             # <<<<<<<<<<<<<<
@@ -95754,7 +95650,7 @@ static void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_l
  */
   }
 
-  /* "src/lxml/classlookup.pxi":548
+  /* "src/lxml/classlookup.pxi":547
  *         function = DEFAULT_ELEMENT_CLASS_LOOKUP._lookup_function
  * 
  *     ELEMENT_CLASS_LOOKUP_STATE = state             # <<<<<<<<<<<<<<
@@ -95766,7 +95662,7 @@ static void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_l
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE, __pyx_v_state);
   __Pyx_GIVEREF(__pyx_v_state);
 
-  /* "src/lxml/classlookup.pxi":549
+  /* "src/lxml/classlookup.pxi":548
  * 
  *     ELEMENT_CLASS_LOOKUP_STATE = state
  *     LOOKUP_ELEMENT_CLASS = function             # <<<<<<<<<<<<<<
@@ -95775,7 +95671,7 @@ static void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_l
  */
   __pyx_v_4lxml_5etree_LOOKUP_ELEMENT_CLASS = __pyx_v_function;
 
-  /* "src/lxml/classlookup.pxi":541
+  /* "src/lxml/classlookup.pxi":540
  * cdef object ELEMENT_CLASS_LOOKUP_STATE
  * 
  * cdef void _setElementClassLookupFunction(             # <<<<<<<<<<<<<<
@@ -95788,7 +95684,7 @@ static void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_l
   __Pyx_RefNannyFinishContext();
 }
 
-/* "src/lxml/classlookup.pxi":551
+/* "src/lxml/classlookup.pxi":550
  *     LOOKUP_ELEMENT_CLASS = function
  * 
  * def set_element_class_lookup(ElementClassLookup lookup = None):             # <<<<<<<<<<<<<<
@@ -95827,7 +95723,7 @@ static PyObject *__pyx_pw_4lxml_5etree_41set_element_class_lookup(PyObject *__py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_element_class_lookup") < 0)) __PYX_ERR(8, 551, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_element_class_lookup") < 0)) __PYX_ERR(8, 550, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -95841,13 +95737,13 @@ static PyObject *__pyx_pw_4lxml_5etree_41set_element_class_lookup(PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("set_element_class_lookup", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 551, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("set_element_class_lookup", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 550, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.set_element_class_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup", 0))) __PYX_ERR(8, 551, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup", 0))) __PYX_ERR(8, 550, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_40set_element_class_lookup(__pyx_self, __pyx_v_lookup);
 
   /* function exit code */
@@ -95867,7 +95763,7 @@ static PyObject *__pyx_pf_4lxml_5etree_40set_element_class_lookup(CYTHON_UNUSED
   int __pyx_t_3;
   __Pyx_RefNannySetupContext("set_element_class_lookup", 0);
 
-  /* "src/lxml/classlookup.pxi":556
+  /* "src/lxml/classlookup.pxi":555
  *     Set the global default element class lookup method.
  *     """
  *     if lookup is None or lookup._lookup_function is NULL:             # <<<<<<<<<<<<<<
@@ -95886,7 +95782,7 @@ static PyObject *__pyx_pf_4lxml_5etree_40set_element_class_lookup(CYTHON_UNUSED
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/classlookup.pxi":557
+    /* "src/lxml/classlookup.pxi":556
  *     """
  *     if lookup is None or lookup._lookup_function is NULL:
  *         _setElementClassLookupFunction(NULL, None)             # <<<<<<<<<<<<<<
@@ -95895,7 +95791,7 @@ static PyObject *__pyx_pf_4lxml_5etree_40set_element_class_lookup(CYTHON_UNUSED
  */
     __pyx_f_4lxml_5etree__setElementClassLookupFunction(NULL, Py_None);
 
-    /* "src/lxml/classlookup.pxi":556
+    /* "src/lxml/classlookup.pxi":555
  *     Set the global default element class lookup method.
  *     """
  *     if lookup is None or lookup._lookup_function is NULL:             # <<<<<<<<<<<<<<
@@ -95905,7 +95801,7 @@ static PyObject *__pyx_pf_4lxml_5etree_40set_element_class_lookup(CYTHON_UNUSED
     goto __pyx_L3;
   }
 
-  /* "src/lxml/classlookup.pxi":559
+  /* "src/lxml/classlookup.pxi":558
  *         _setElementClassLookupFunction(NULL, None)
  *     else:
  *         _setElementClassLookupFunction(lookup._lookup_function, lookup)             # <<<<<<<<<<<<<<
@@ -95917,7 +95813,7 @@ static PyObject *__pyx_pf_4lxml_5etree_40set_element_class_lookup(CYTHON_UNUSED
   }
   __pyx_L3:;
 
-  /* "src/lxml/classlookup.pxi":551
+  /* "src/lxml/classlookup.pxi":550
  *     LOOKUP_ELEMENT_CLASS = function
  * 
  * def set_element_class_lookup(ElementClassLookup lookup = None):             # <<<<<<<<<<<<<<
@@ -96091,7 +95987,7 @@ static int __pyx_pf_4lxml_5etree_18_NamespaceRegistry___cinit__(struct __pyx_obj
  * 
  *     def update(self, class_dict_iterable):
  */
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 27, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 27, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_3);
   __Pyx_GOTREF(__pyx_v_self->_entries);
@@ -96168,7 +96064,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_2update(struct __pyx
  *             class_dict_iterable = class_dict_iterable.items()
  *         for name, item in class_dict_iterable:
  */
-  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_class_dict_iterable, __pyx_n_u_items); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(9, 41, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_class_dict_iterable, __pyx_n_u_items); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 41, __pyx_L1_error)
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
@@ -96250,7 +96146,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_2update(struct __pyx
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(9, 43, __pyx_L1_error)
         }
         break;
@@ -96325,9 +96221,9 @@ static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_2update(struct __pyx
     } else {
       goto __pyx_L10_next_and;
     }
-    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_name, 0, 1, NULL, NULL, &__pyx_slice__61, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 44, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_name, 0, 1, NULL, NULL, &__pyx_slice__63, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 44, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s__62, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(9, 44, __pyx_L1_error)
+    __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s__64, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(9, 44, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     if (__pyx_t_11) {
     } else {
@@ -96335,7 +96231,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_2update(struct __pyx
       goto __pyx_L9_bool_binop_done;
     }
     __pyx_L10_next_and:;
-    __pyx_t_11 = __Pyx_PyCallable_Check(__pyx_v_item); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(9, 44, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyCallable_Check(__pyx_v_item); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(9, 44, __pyx_L1_error)
     __pyx_t_1 = (__pyx_t_11 != 0);
     __pyx_t_2 = __pyx_t_1;
     __pyx_L9_bool_binop_done:;
@@ -96873,7 +96769,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_10items(struct __pyx
  */
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(__pyx_v_self->_entries == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
     __PYX_ERR(9, 75, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_self->_entries); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 75, __pyx_L1_error)
@@ -96943,7 +96839,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_12iteritems(struct _
  */
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(__pyx_v_self->_entries == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
     __PYX_ERR(9, 78, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_self->_entries); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 78, __pyx_L1_error)
@@ -97008,13 +96904,13 @@ static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_14clear(struct __pyx
  *     def clear(self):
  *         self._entries.clear()             # <<<<<<<<<<<<<<
  * 
- * @cython.final
+ *     def __call__(self, obj):
  */
   if (unlikely(__pyx_v_self->_entries == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "clear");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
     __PYX_ERR(9, 81, __pyx_L1_error)
   }
-  __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_self->_entries); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(9, 81, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_self->_entries); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 81, __pyx_L1_error)
 
   /* "src/lxml/nsclasses.pxi":80
  *         return iter(self._entries.items())
@@ -97036,11 +96932,334 @@ static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_14clear(struct __pyx
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":87
+/* "src/lxml/nsclasses.pxi":83
+ *         self._entries.clear()
+ * 
+ *     def __call__(self, obj):             # <<<<<<<<<<<<<<
+ *         # Usage as decorator:
+ *         #   ns = lookup.get_namespace("...")
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4lxml_5etree_18_NamespaceRegistry_17__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_4lxml_5etree_18_NamespaceRegistry_17__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_obj = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(9, 83, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_obj = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 83, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_4lxml_5etree_18_NamespaceRegistry_16__call__(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self), __pyx_v_obj);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_16__call__(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self, PyObject *__pyx_v_obj) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  int __pyx_t_2;
+  int __pyx_t_3;
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  PyObject *__pyx_t_6 = NULL;
+  PyObject *__pyx_t_7 = NULL;
+  int __pyx_t_8;
+  PyObject *__pyx_t_9 = NULL;
+  __Pyx_RefNannySetupContext("__call__", 0);
+
+  /* "src/lxml/nsclasses.pxi":92
+ *         #   class elementname(ElementBase): pass
+ * 
+ *         if obj is None or python._isString(obj):             # <<<<<<<<<<<<<<
+ *             # @ns(None) or @ns('tag')
+ *             return partial(self.__deco, obj)
+ */
+  __pyx_t_2 = (__pyx_v_obj == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (!__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_3 = (_isString(__pyx_v_obj) != 0);
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+
+    /* "src/lxml/nsclasses.pxi":94
+ *         if obj is None or python._isString(obj):
+ *             # @ns(None) or @ns('tag')
+ *             return partial(self.__deco, obj)             # <<<<<<<<<<<<<<
+ *         # plain @ns decorator
+ *         self[obj.__name__] = obj
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_deco); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 94, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(__pyx_v_4lxml_5etree_partial);
+    __pyx_t_6 = __pyx_v_4lxml_5etree_partial; __pyx_t_7 = NULL;
+    __pyx_t_8 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __pyx_t_8 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_6)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_v_obj};
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 94, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_v_obj};
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 94, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 94, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      if (__pyx_t_7) {
+        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
+      __Pyx_INCREF(__pyx_v_obj);
+      __Pyx_GIVEREF(__pyx_v_obj);
+      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_obj);
+      __pyx_t_5 = 0;
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 94, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+
+    /* "src/lxml/nsclasses.pxi":92
+ *         #   class elementname(ElementBase): pass
+ * 
+ *         if obj is None or python._isString(obj):             # <<<<<<<<<<<<<<
+ *             # @ns(None) or @ns('tag')
+ *             return partial(self.__deco, obj)
+ */
+  }
+
+  /* "src/lxml/nsclasses.pxi":96
+ *             return partial(self.__deco, obj)
+ *         # plain @ns decorator
+ *         self[obj.__name__] = obj             # <<<<<<<<<<<<<<
+ *         return obj
+ * 
+ */
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 96, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_t_4, __pyx_v_obj) < 0)) __PYX_ERR(9, 96, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+  /* "src/lxml/nsclasses.pxi":97
+ *         # plain @ns decorator
+ *         self[obj.__name__] = obj
+ *         return obj             # <<<<<<<<<<<<<<
+ * 
+ *     def __deco(self, name, obj):
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_obj);
+  __pyx_r = __pyx_v_obj;
+  goto __pyx_L0;
+
+  /* "src/lxml/nsclasses.pxi":83
+ *         self._entries.clear()
+ * 
+ *     def __call__(self, obj):             # <<<<<<<<<<<<<<
+ *         # Usage as decorator:
+ *         #   ns = lookup.get_namespace("...")
+ */
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "src/lxml/nsclasses.pxi":99
+ *         return obj
+ * 
+ *     def __deco(self, name, obj):             # <<<<<<<<<<<<<<
+ *         self[name] = obj
+ *         return obj
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4lxml_5etree_18_NamespaceRegistry_19__deco(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_4lxml_5etree_18_NamespaceRegistry_19__deco = {"__deco", (PyCFunction)__pyx_pw_4lxml_5etree_18_NamespaceRegistry_19__deco, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_4lxml_5etree_18_NamespaceRegistry_19__deco(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_name = 0;
+  PyObject *__pyx_v_obj = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__deco (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,&__pyx_n_s_obj,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__deco", 1, 2, 2, 1); __PYX_ERR(9, 99, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__deco") < 0)) __PYX_ERR(9, 99, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_name = values[0];
+    __pyx_v_obj = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__deco", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 99, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__deco", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_4lxml_5etree_18_NamespaceRegistry_18__deco(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self), __pyx_v_name, __pyx_v_obj);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_18__deco(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_obj) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__deco", 0);
+
+  /* "src/lxml/nsclasses.pxi":100
+ * 
+ *     def __deco(self, name, obj):
+ *         self[name] = obj             # <<<<<<<<<<<<<<
+ *         return obj
+ * 
+ */
+  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj) < 0)) __PYX_ERR(9, 100, __pyx_L1_error)
+
+  /* "src/lxml/nsclasses.pxi":101
+ *     def __deco(self, name, obj):
+ *         self[name] = obj
+ *         return obj             # <<<<<<<<<<<<<<
+ * 
+ * 
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_obj);
+  __pyx_r = __pyx_v_obj;
+  goto __pyx_L0;
+
+  /* "src/lxml/nsclasses.pxi":99
+ *         return obj
+ * 
+ *     def __deco(self, name, obj):             # <<<<<<<<<<<<<<
+ *         self[name] = obj
+ *         return obj
+ */
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__deco", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "src/lxml/nsclasses.pxi":108
  * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):
  *     u"Dictionary-like registry for namespace implementation classes"
  *     def __setitem__(self, name, item):             # <<<<<<<<<<<<<<
- *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):
+ *         if not isinstance(item, type) or not issubclass(item, ElementBase):
  *             raise NamespaceRegistryError, \
  */
 
@@ -97067,45 +97286,46 @@ static int __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(struct __
   __Pyx_RefNannySetupContext("__setitem__", 0);
   __Pyx_INCREF(__pyx_v_name);
 
-  /* "src/lxml/nsclasses.pxi":88
+  /* "src/lxml/nsclasses.pxi":109
  *     u"Dictionary-like registry for namespace implementation classes"
  *     def __setitem__(self, name, item):
- *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):             # <<<<<<<<<<<<<<
+ *         if not isinstance(item, type) or not issubclass(item, ElementBase):             # <<<<<<<<<<<<<<
  *             raise NamespaceRegistryError, \
  *                 u"Registered element classes must be subtypes of ElementBase"
  */
-  __pyx_t_2 = ((!(PyType_Check(__pyx_v_item) != 0)) != 0);
-  if (!__pyx_t_2) {
+  __pyx_t_2 = PyType_Check(__pyx_v_item); 
+  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
+  if (!__pyx_t_3) {
   } else {
-    __pyx_t_1 = __pyx_t_2;
+    __pyx_t_1 = __pyx_t_3;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_item, ((PyObject *)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(9, 88, __pyx_L1_error)
-  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
-  __pyx_t_1 = __pyx_t_3;
+  __pyx_t_3 = PyObject_IsSubclass(__pyx_v_item, ((PyObject *)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 109, __pyx_L1_error)
+  __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/nsclasses.pxi":89
+    /* "src/lxml/nsclasses.pxi":110
  *     def __setitem__(self, name, item):
- *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):
+ *         if not isinstance(item, type) or not issubclass(item, ElementBase):
  *             raise NamespaceRegistryError, \             # <<<<<<<<<<<<<<
  *                 u"Registered element classes must be subtypes of ElementBase"
  *         if name is not None:
  */
     __Pyx_Raise(((PyObject *)__pyx_ptype_4lxml_5etree_NamespaceRegistryError), __pyx_kp_u_Registered_element_classes_must, 0, 0);
-    __PYX_ERR(9, 89, __pyx_L1_error)
+    __PYX_ERR(9, 110, __pyx_L1_error)
 
-    /* "src/lxml/nsclasses.pxi":88
+    /* "src/lxml/nsclasses.pxi":109
  *     u"Dictionary-like registry for namespace implementation classes"
  *     def __setitem__(self, name, item):
- *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):             # <<<<<<<<<<<<<<
+ *         if not isinstance(item, type) or not issubclass(item, ElementBase):             # <<<<<<<<<<<<<<
  *             raise NamespaceRegistryError, \
  *                 u"Registered element classes must be subtypes of ElementBase"
  */
   }
 
-  /* "src/lxml/nsclasses.pxi":91
+  /* "src/lxml/nsclasses.pxi":112
  *             raise NamespaceRegistryError, \
  *                 u"Registered element classes must be subtypes of ElementBase"
  *         if name is not None:             # <<<<<<<<<<<<<<
@@ -97113,22 +97333,22 @@ static int __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(struct __
  *         self._entries[name] = item
  */
   __pyx_t_1 = (__pyx_v_name != Py_None);
-  __pyx_t_3 = (__pyx_t_1 != 0);
-  if (__pyx_t_3) {
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
 
-    /* "src/lxml/nsclasses.pxi":92
+    /* "src/lxml/nsclasses.pxi":113
  *                 u"Registered element classes must be subtypes of ElementBase"
  *         if name is not None:
  *             name = _utf8(name)             # <<<<<<<<<<<<<<
  *         self._entries[name] = item
  * 
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 92, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 113, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/nsclasses.pxi":91
+    /* "src/lxml/nsclasses.pxi":112
  *             raise NamespaceRegistryError, \
  *                 u"Registered element classes must be subtypes of ElementBase"
  *         if name is not None:             # <<<<<<<<<<<<<<
@@ -97137,7 +97357,7 @@ static int __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(struct __
  */
   }
 
-  /* "src/lxml/nsclasses.pxi":93
+  /* "src/lxml/nsclasses.pxi":114
  *         if name is not None:
  *             name = _utf8(name)
  *         self._entries[name] = item             # <<<<<<<<<<<<<<
@@ -97146,15 +97366,15 @@ static int __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(struct __
  */
   if (unlikely(__pyx_v_self->__pyx_base._entries == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(9, 93, __pyx_L1_error)
+    __PYX_ERR(9, 114, __pyx_L1_error)
   }
-  if (unlikely(PyDict_SetItem(__pyx_v_self->__pyx_base._entries, __pyx_v_name, __pyx_v_item) < 0)) __PYX_ERR(9, 93, __pyx_L1_error)
+  if (unlikely(PyDict_SetItem(__pyx_v_self->__pyx_base._entries, __pyx_v_name, __pyx_v_item) < 0)) __PYX_ERR(9, 114, __pyx_L1_error)
 
-  /* "src/lxml/nsclasses.pxi":87
+  /* "src/lxml/nsclasses.pxi":108
  * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):
  *     u"Dictionary-like registry for namespace implementation classes"
  *     def __setitem__(self, name, item):             # <<<<<<<<<<<<<<
- *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):
+ *         if not isinstance(item, type) or not issubclass(item, ElementBase):
  *             raise NamespaceRegistryError, \
  */
 
@@ -97171,7 +97391,7 @@ static int __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(struct __
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":95
+/* "src/lxml/nsclasses.pxi":116
  *         self._entries[name] = item
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -97198,7 +97418,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry_2__repr__(struc
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "src/lxml/nsclasses.pxi":96
+  /* "src/lxml/nsclasses.pxi":117
  * 
  *     def __repr__(self):
  *         return u"Namespace(%r)" % self._ns_uri             # <<<<<<<<<<<<<<
@@ -97206,13 +97426,13 @@ static PyObject *__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry_2__repr__(struc
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Namespace_r, __pyx_v_self->__pyx_base._ns_uri); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 96, __pyx_L1_error)
+  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_Namespace_r, __pyx_v_self->__pyx_base._ns_uri); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 117, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/nsclasses.pxi":95
+  /* "src/lxml/nsclasses.pxi":116
  *         self._entries[name] = item
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -97231,7 +97451,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry_2__repr__(struc
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":106
+/* "src/lxml/nsclasses.pxi":140
  *     """
  *     cdef dict _namespace_registries
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -97261,14 +97481,14 @@ static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup___cinit__(struct
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/nsclasses.pxi":107
+  /* "src/lxml/nsclasses.pxi":141
  *     cdef dict _namespace_registries
  *     def __cinit__(self):
  *         self._namespace_registries = {}             # <<<<<<<<<<<<<<
  * 
  *     def __init__(self, ElementClassLookup fallback=None):
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 107, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 141, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_namespace_registries);
@@ -97276,7 +97496,7 @@ static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup___cinit__(struct
   __pyx_v_self->_namespace_registries = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/nsclasses.pxi":106
+  /* "src/lxml/nsclasses.pxi":140
  *     """
  *     cdef dict _namespace_registries
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -97296,7 +97516,7 @@ static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup___cinit__(struct
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":109
+/* "src/lxml/nsclasses.pxi":143
  *         self._namespace_registries = {}
  * 
  *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<<
@@ -97333,7 +97553,7 @@ static int __pyx_pw_4lxml_5etree_27ElementNamespaceClassLookup_3__init__(PyObjec
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(9, 109, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(9, 143, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -97347,13 +97567,13 @@ static int __pyx_pw_4lxml_5etree_27ElementNamespaceClassLookup_3__init__(PyObjec
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 109, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 143, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.ElementNamespaceClassLookup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) __PYX_ERR(9, 109, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) __PYX_ERR(9, 143, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_2__init__(((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self), __pyx_v_fallback);
 
   /* function exit code */
@@ -97375,14 +97595,14 @@ static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_2__init__(struct
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "src/lxml/nsclasses.pxi":110
+  /* "src/lxml/nsclasses.pxi":144
  * 
  *     def __init__(self, ElementClassLookup fallback=None):
  *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<<
  *         self._lookup_function = _find_nselement_class
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 110, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 144, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   __pyx_t_4 = 0;
@@ -97399,7 +97619,7 @@ static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_2__init__(struct
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_fallback)};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 110, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 144, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -97407,13 +97627,13 @@ static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_2__init__(struct
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_fallback)};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 110, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 144, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 110, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 144, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_3) {
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
@@ -97424,14 +97644,14 @@ static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_2__init__(struct
     __Pyx_INCREF(((PyObject *)__pyx_v_fallback));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_fallback));
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_fallback));
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 110, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 144, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/nsclasses.pxi":111
+  /* "src/lxml/nsclasses.pxi":145
  *     def __init__(self, ElementClassLookup fallback=None):
  *         FallbackElementClassLookup.__init__(self, fallback)
  *         self._lookup_function = _find_nselement_class             # <<<<<<<<<<<<<<
@@ -97440,7 +97660,7 @@ static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_2__init__(struct
  */
   __pyx_v_self->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__find_nselement_class;
 
-  /* "src/lxml/nsclasses.pxi":109
+  /* "src/lxml/nsclasses.pxi":143
  *         self._namespace_registries = {}
  * 
  *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<<
@@ -97463,7 +97683,7 @@ static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_2__init__(struct
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":113
+/* "src/lxml/nsclasses.pxi":147
  *         self._lookup_function = _find_nselement_class
  * 
  *     def get_namespace(self, ns_uri):             # <<<<<<<<<<<<<<
@@ -97503,29 +97723,29 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
   PyObject *__pyx_t_10 = NULL;
   __Pyx_RefNannySetupContext("get_namespace", 0);
 
-  /* "src/lxml/nsclasses.pxi":120
+  /* "src/lxml/nsclasses.pxi":154
  * 
  *         Creates a new namespace object if it does not yet exist."""
  *         if ns_uri:             # <<<<<<<<<<<<<<
  *             ns_utf = _utf8(ns_uri)
  *         else:
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ns_uri); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 120, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ns_uri); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 154, __pyx_L1_error)
   if (__pyx_t_1) {
 
-    /* "src/lxml/nsclasses.pxi":121
+    /* "src/lxml/nsclasses.pxi":155
  *         Creates a new namespace object if it does not yet exist."""
  *         if ns_uri:
  *             ns_utf = _utf8(ns_uri)             # <<<<<<<<<<<<<<
  *         else:
  *             ns_utf = None
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns_uri); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 121, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns_uri); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 155, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_v_ns_utf = __pyx_t_2;
     __pyx_t_2 = 0;
 
-    /* "src/lxml/nsclasses.pxi":120
+    /* "src/lxml/nsclasses.pxi":154
  * 
  *         Creates a new namespace object if it does not yet exist."""
  *         if ns_uri:             # <<<<<<<<<<<<<<
@@ -97535,7 +97755,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
     goto __pyx_L3;
   }
 
-  /* "src/lxml/nsclasses.pxi":123
+  /* "src/lxml/nsclasses.pxi":157
  *             ns_utf = _utf8(ns_uri)
  *         else:
  *             ns_utf = None             # <<<<<<<<<<<<<<
@@ -97548,7 +97768,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
   }
   __pyx_L3:;
 
-  /* "src/lxml/nsclasses.pxi":124
+  /* "src/lxml/nsclasses.pxi":158
  *         else:
  *             ns_utf = None
  *         try:             # <<<<<<<<<<<<<<
@@ -97564,7 +97784,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
     __Pyx_XGOTREF(__pyx_t_5);
     /*try:*/ {
 
-      /* "src/lxml/nsclasses.pxi":125
+      /* "src/lxml/nsclasses.pxi":159
  *             ns_utf = None
  *         try:
  *             return self._namespace_registries[ns_utf]             # <<<<<<<<<<<<<<
@@ -97574,15 +97794,15 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
       __Pyx_XDECREF(__pyx_r);
       if (unlikely(__pyx_v_self->_namespace_registries == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(9, 125, __pyx_L4_error)
+        __PYX_ERR(9, 159, __pyx_L4_error)
       }
-      __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->_namespace_registries, __pyx_v_ns_utf); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 125, __pyx_L4_error)
+      __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->_namespace_registries, __pyx_v_ns_utf); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 159, __pyx_L4_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_r = __pyx_t_2;
       __pyx_t_2 = 0;
       goto __pyx_L8_try_return;
 
-      /* "src/lxml/nsclasses.pxi":124
+      /* "src/lxml/nsclasses.pxi":158
  *         else:
  *             ns_utf = None
  *         try:             # <<<<<<<<<<<<<<
@@ -97591,10 +97811,9 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
  */
     }
     __pyx_L4_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/nsclasses.pxi":126
+    /* "src/lxml/nsclasses.pxi":160
  *         try:
  *             return self._namespace_registries[ns_utf]
  *         except KeyError:             # <<<<<<<<<<<<<<
@@ -97604,30 +97823,30 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
     if (__pyx_t_6) {
       __Pyx_AddTraceback("lxml.etree.ElementNamespaceClassLookup.get_namespace", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(9, 126, __pyx_L6_except_error)
+      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(9, 160, __pyx_L6_except_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GOTREF(__pyx_t_8);
 
-      /* "src/lxml/nsclasses.pxi":128
+      /* "src/lxml/nsclasses.pxi":162
  *         except KeyError:
  *             registry = self._namespace_registries[ns_utf] = \
  *                        _ClassNamespaceRegistry(ns_uri)             # <<<<<<<<<<<<<<
  *             return registry
  * 
  */
-      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 128, __pyx_L6_except_error)
+      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 162, __pyx_L6_except_error)
       __Pyx_GOTREF(__pyx_t_9);
       __Pyx_INCREF(__pyx_v_ns_uri);
       __Pyx_GIVEREF(__pyx_v_ns_uri);
       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_ns_uri);
-      __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__ClassNamespaceRegistry), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 128, __pyx_L6_except_error)
+      __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__ClassNamespaceRegistry), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 162, __pyx_L6_except_error)
       __Pyx_GOTREF(__pyx_t_10);
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_INCREF(__pyx_t_10);
       __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *)__pyx_t_10);
 
-      /* "src/lxml/nsclasses.pxi":127
+      /* "src/lxml/nsclasses.pxi":161
  *             return self._namespace_registries[ns_utf]
  *         except KeyError:
  *             registry = self._namespace_registries[ns_utf] = \             # <<<<<<<<<<<<<<
@@ -97636,12 +97855,12 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
  */
       if (unlikely(__pyx_v_self->_namespace_registries == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(9, 127, __pyx_L6_except_error)
+        __PYX_ERR(9, 161, __pyx_L6_except_error)
       }
-      if (unlikely(PyDict_SetItem(__pyx_v_self->_namespace_registries, __pyx_v_ns_utf, __pyx_t_10) < 0)) __PYX_ERR(9, 127, __pyx_L6_except_error)
+      if (unlikely(PyDict_SetItem(__pyx_v_self->_namespace_registries, __pyx_v_ns_utf, __pyx_t_10) < 0)) __PYX_ERR(9, 161, __pyx_L6_except_error)
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
 
-      /* "src/lxml/nsclasses.pxi":129
+      /* "src/lxml/nsclasses.pxi":163
  *             registry = self._namespace_registries[ns_utf] = \
  *                        _ClassNamespaceRegistry(ns_uri)
  *             return registry             # <<<<<<<<<<<<<<
@@ -97659,28 +97878,25 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
     goto __pyx_L6_except_error;
     __pyx_L6_except_error:;
 
-    /* "src/lxml/nsclasses.pxi":124
+    /* "src/lxml/nsclasses.pxi":158
  *         else:
  *             ns_utf = None
  *         try:             # <<<<<<<<<<<<<<
  *             return self._namespace_registries[ns_utf]
  *         except KeyError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
     goto __pyx_L1_error;
     __pyx_L8_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
     goto __pyx_L0;
     __pyx_L7_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
@@ -97688,7 +97904,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
     goto __pyx_L0;
   }
 
-  /* "src/lxml/nsclasses.pxi":113
+  /* "src/lxml/nsclasses.pxi":147
  *         self._lookup_function = _find_nselement_class
  * 
  *     def get_namespace(self, ns_uri):             # <<<<<<<<<<<<<<
@@ -97713,7 +97929,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_4get_namesp
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":131
+/* "src/lxml/nsclasses.pxi":165
  *             return registry
  * 
  * cdef object _find_nselement_class(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -97735,7 +97951,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("_find_nselement_class", 0);
 
-  /* "src/lxml/nsclasses.pxi":135
+  /* "src/lxml/nsclasses.pxi":169
  *     cdef ElementNamespaceClassLookup lookup
  *     cdef _NamespaceRegistry registry
  *     if state is None:             # <<<<<<<<<<<<<<
@@ -97746,7 +97962,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/nsclasses.pxi":136
+    /* "src/lxml/nsclasses.pxi":170
  *     cdef _NamespaceRegistry registry
  *     if state is None:
  *         return _lookupDefaultElementClass(None, doc, c_node)             # <<<<<<<<<<<<<<
@@ -97754,13 +97970,13 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  *     lookup = <ElementNamespaceClassLookup>state
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __pyx_f_4lxml_5etree__lookupDefaultElementClass(Py_None, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 136, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__lookupDefaultElementClass(Py_None, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 170, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "src/lxml/nsclasses.pxi":135
+    /* "src/lxml/nsclasses.pxi":169
  *     cdef ElementNamespaceClassLookup lookup
  *     cdef _NamespaceRegistry registry
  *     if state is None:             # <<<<<<<<<<<<<<
@@ -97769,7 +97985,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  */
   }
 
-  /* "src/lxml/nsclasses.pxi":138
+  /* "src/lxml/nsclasses.pxi":172
  *         return _lookupDefaultElementClass(None, doc, c_node)
  * 
  *     lookup = <ElementNamespaceClassLookup>state             # <<<<<<<<<<<<<<
@@ -97781,7 +97997,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/nsclasses.pxi":139
+  /* "src/lxml/nsclasses.pxi":173
  * 
  *     lookup = <ElementNamespaceClassLookup>state
  *     if c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -97791,7 +98007,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
   __pyx_t_2 = ((__pyx_v_c_node->type != XML_ELEMENT_NODE) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/nsclasses.pxi":140
+    /* "src/lxml/nsclasses.pxi":174
  *     lookup = <ElementNamespaceClassLookup>state
  *     if c_node.type != tree.XML_ELEMENT_NODE:
  *         return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
@@ -97799,13 +98015,13 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  *     c_namespace_utf = _getNs(c_node)
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 140, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 174, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "src/lxml/nsclasses.pxi":139
+    /* "src/lxml/nsclasses.pxi":173
  * 
  *     lookup = <ElementNamespaceClassLookup>state
  *     if c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -97814,7 +98030,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  */
   }
 
-  /* "src/lxml/nsclasses.pxi":142
+  /* "src/lxml/nsclasses.pxi":176
  *         return _callLookupFallback(lookup, doc, c_node)
  * 
  *     c_namespace_utf = _getNs(c_node)             # <<<<<<<<<<<<<<
@@ -97823,7 +98039,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  */
   __pyx_v_c_namespace_utf = _getNs(__pyx_v_c_node);
 
-  /* "src/lxml/nsclasses.pxi":143
+  /* "src/lxml/nsclasses.pxi":177
  * 
  *     c_namespace_utf = _getNs(c_node)
  *     if c_namespace_utf is not NULL:             # <<<<<<<<<<<<<<
@@ -97833,7 +98049,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
   __pyx_t_2 = ((__pyx_v_c_namespace_utf != NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/nsclasses.pxi":145
+    /* "src/lxml/nsclasses.pxi":179
  *     if c_namespace_utf is not NULL:
  *         dict_result = python.PyDict_GetItem(
  *             lookup._namespace_registries, <unsigned char*>c_namespace_utf)             # <<<<<<<<<<<<<<
@@ -97842,10 +98058,10 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  */
     __pyx_t_3 = __pyx_v_lookup->_namespace_registries;
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_namespace_utf)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 145, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_namespace_utf)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 179, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
 
-    /* "src/lxml/nsclasses.pxi":144
+    /* "src/lxml/nsclasses.pxi":178
  *     c_namespace_utf = _getNs(c_node)
  *     if c_namespace_utf is not NULL:
  *         dict_result = python.PyDict_GetItem(             # <<<<<<<<<<<<<<
@@ -97856,7 +98072,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "src/lxml/nsclasses.pxi":143
+    /* "src/lxml/nsclasses.pxi":177
  * 
  *     c_namespace_utf = _getNs(c_node)
  *     if c_namespace_utf is not NULL:             # <<<<<<<<<<<<<<
@@ -97866,7 +98082,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
     goto __pyx_L5;
   }
 
-  /* "src/lxml/nsclasses.pxi":147
+  /* "src/lxml/nsclasses.pxi":181
  *             lookup._namespace_registries, <unsigned char*>c_namespace_utf)
  *     else:
  *         dict_result = python.PyDict_GetItem(             # <<<<<<<<<<<<<<
@@ -97875,7 +98091,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  */
   /*else*/ {
 
-    /* "src/lxml/nsclasses.pxi":148
+    /* "src/lxml/nsclasses.pxi":182
  *     else:
  *         dict_result = python.PyDict_GetItem(
  *             lookup._namespace_registries, None)             # <<<<<<<<<<<<<<
@@ -97885,7 +98101,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
     __pyx_t_4 = __pyx_v_lookup->_namespace_registries;
     __Pyx_INCREF(__pyx_t_4);
 
-    /* "src/lxml/nsclasses.pxi":147
+    /* "src/lxml/nsclasses.pxi":181
  *             lookup._namespace_registries, <unsigned char*>c_namespace_utf)
  *     else:
  *         dict_result = python.PyDict_GetItem(             # <<<<<<<<<<<<<<
@@ -97897,7 +98113,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
   }
   __pyx_L5:;
 
-  /* "src/lxml/nsclasses.pxi":149
+  /* "src/lxml/nsclasses.pxi":183
  *         dict_result = python.PyDict_GetItem(
  *             lookup._namespace_registries, None)
  *     if dict_result is not NULL:             # <<<<<<<<<<<<<<
@@ -97907,7 +98123,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
   __pyx_t_2 = ((__pyx_v_dict_result != NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/nsclasses.pxi":150
+    /* "src/lxml/nsclasses.pxi":184
  *             lookup._namespace_registries, None)
  *     if dict_result is not NULL:
  *         registry = <_NamespaceRegistry>dict_result             # <<<<<<<<<<<<<<
@@ -97919,7 +98135,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
     __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/nsclasses.pxi":151
+    /* "src/lxml/nsclasses.pxi":185
  *     if dict_result is not NULL:
  *         registry = <_NamespaceRegistry>dict_result
  *         classes = registry._entries             # <<<<<<<<<<<<<<
@@ -97931,7 +98147,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
     __pyx_v_classes = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/nsclasses.pxi":153
+    /* "src/lxml/nsclasses.pxi":187
  *         classes = registry._entries
  * 
  *         if c_node.name is not NULL:             # <<<<<<<<<<<<<<
@@ -97941,17 +98157,17 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
     __pyx_t_2 = ((__pyx_v_c_node->name != NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/nsclasses.pxi":155
+      /* "src/lxml/nsclasses.pxi":189
  *         if c_node.name is not NULL:
  *             dict_result = python.PyDict_GetItem(
  *                 classes, <unsigned char*>c_node.name)             # <<<<<<<<<<<<<<
  *         else:
  *             dict_result = NULL
  */
-      __pyx_t_4 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_node->name)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 155, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_node->name)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 189, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
 
-      /* "src/lxml/nsclasses.pxi":154
+      /* "src/lxml/nsclasses.pxi":188
  * 
  *         if c_node.name is not NULL:
  *             dict_result = python.PyDict_GetItem(             # <<<<<<<<<<<<<<
@@ -97961,7 +98177,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
       __pyx_v_dict_result = PyDict_GetItem(__pyx_v_classes, __pyx_t_4);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-      /* "src/lxml/nsclasses.pxi":153
+      /* "src/lxml/nsclasses.pxi":187
  *         classes = registry._entries
  * 
  *         if c_node.name is not NULL:             # <<<<<<<<<<<<<<
@@ -97971,7 +98187,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
       goto __pyx_L7;
     }
 
-    /* "src/lxml/nsclasses.pxi":157
+    /* "src/lxml/nsclasses.pxi":191
  *                 classes, <unsigned char*>c_node.name)
  *         else:
  *             dict_result = NULL             # <<<<<<<<<<<<<<
@@ -97983,7 +98199,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
     }
     __pyx_L7:;
 
-    /* "src/lxml/nsclasses.pxi":159
+    /* "src/lxml/nsclasses.pxi":193
  *             dict_result = NULL
  * 
  *         if dict_result is NULL:             # <<<<<<<<<<<<<<
@@ -97993,7 +98209,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
     __pyx_t_2 = ((__pyx_v_dict_result == NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/nsclasses.pxi":160
+      /* "src/lxml/nsclasses.pxi":194
  * 
  *         if dict_result is NULL:
  *             dict_result = python.PyDict_GetItem(classes, None)             # <<<<<<<<<<<<<<
@@ -98002,7 +98218,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  */
       __pyx_v_dict_result = PyDict_GetItem(__pyx_v_classes, Py_None);
 
-      /* "src/lxml/nsclasses.pxi":159
+      /* "src/lxml/nsclasses.pxi":193
  *             dict_result = NULL
  * 
  *         if dict_result is NULL:             # <<<<<<<<<<<<<<
@@ -98011,7 +98227,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  */
     }
 
-    /* "src/lxml/nsclasses.pxi":162
+    /* "src/lxml/nsclasses.pxi":196
  *             dict_result = python.PyDict_GetItem(classes, None)
  * 
  *         if dict_result is not NULL:             # <<<<<<<<<<<<<<
@@ -98021,7 +98237,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
     __pyx_t_2 = ((__pyx_v_dict_result != NULL) != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/nsclasses.pxi":163
+      /* "src/lxml/nsclasses.pxi":197
  * 
  *         if dict_result is not NULL:
  *             return <object>dict_result             # <<<<<<<<<<<<<<
@@ -98033,7 +98249,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
       __pyx_r = ((PyObject *)__pyx_v_dict_result);
       goto __pyx_L0;
 
-      /* "src/lxml/nsclasses.pxi":162
+      /* "src/lxml/nsclasses.pxi":196
  *             dict_result = python.PyDict_GetItem(classes, None)
  * 
  *         if dict_result is not NULL:             # <<<<<<<<<<<<<<
@@ -98042,7 +98258,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  */
     }
 
-    /* "src/lxml/nsclasses.pxi":149
+    /* "src/lxml/nsclasses.pxi":183
  *         dict_result = python.PyDict_GetItem(
  *             lookup._namespace_registries, None)
  *     if dict_result is not NULL:             # <<<<<<<<<<<<<<
@@ -98051,7 +98267,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  */
   }
 
-  /* "src/lxml/nsclasses.pxi":164
+  /* "src/lxml/nsclasses.pxi":198
  *         if dict_result is not NULL:
  *             return <object>dict_result
  *     return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
@@ -98059,13 +98275,13 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 164, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 198, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_r = __pyx_t_4;
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/nsclasses.pxi":131
+  /* "src/lxml/nsclasses.pxi":165
  *             return registry
  * 
  * cdef object _find_nselement_class(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
@@ -98088,7 +98304,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":173
+/* "src/lxml/nsclasses.pxi":207
  * __FUNCTION_NAMESPACE_REGISTRIES = {}
  * 
  * def FunctionNamespace(ns_uri):             # <<<<<<<<<<<<<<
@@ -98098,7 +98314,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_st
 
 /* Python wrapper */
 static PyObject *__pyx_pw_4lxml_5etree_43FunctionNamespace(PyObject *__pyx_self, PyObject *__pyx_v_ns_uri); /*proto*/
-static char __pyx_doc_4lxml_5etree_42FunctionNamespace[] = "FunctionNamespace(ns_uri)\n\n    Retrieve the function namespace object associated with the given\n    URI.\n\n    Creates a new one if it does not yet exist. A function namespace\n    can only be used to register extension functions.";
+static char __pyx_doc_4lxml_5etree_42FunctionNamespace[] = "FunctionNamespace(ns_uri)\n\n    Retrieve the function namespace object associated with the given\n    URI.\n\n    Creates a new one if it does not yet exist. A function namespace\n    can only be used to register extension functions.\n\n    Usage:\n\n    >>> ns_functions = FunctionNamespace(\"http://schema.org/Movie\")\n\n    >>> @ns_functions  # uses function name\n    ... def add2(x):\n    ...     return x + 2\n\n    >>> @ns_functions(\"add3\")  # uses explicit name\n    ... def add_three(x):\n    ...     return x + 3\n    ";
 static PyMethodDef __pyx_mdef_4lxml_5etree_43FunctionNamespace = {"FunctionNamespace", (PyCFunction)__pyx_pw_4lxml_5etree_43FunctionNamespace, METH_O, __pyx_doc_4lxml_5etree_42FunctionNamespace};
 static PyObject *__pyx_pw_4lxml_5etree_43FunctionNamespace(PyObject *__pyx_self, PyObject *__pyx_v_ns_uri) {
   PyObject *__pyx_r = 0;
@@ -98128,16 +98344,16 @@ static PyObject *__pyx_pf_4lxml_5etree_42FunctionNamespace(CYTHON_UNUSED PyObjec
   PyObject *__pyx_t_10 = NULL;
   __Pyx_RefNannySetupContext("FunctionNamespace", 0);
 
-  /* "src/lxml/nsclasses.pxi":181
- *     Creates a new one if it does not yet exist. A function namespace
- *     can only be used to register extension functions."""
+  /* "src/lxml/nsclasses.pxi":228
+ *     ...     return x + 3
+ *     """
  *     ns_utf = _utf8(ns_uri) if ns_uri else None             # <<<<<<<<<<<<<<
  *     try:
  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ns_uri); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 181, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ns_uri); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 228, __pyx_L1_error)
   if (__pyx_t_2) {
-    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns_uri); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 181, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns_uri); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 228, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_1 = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -98148,8 +98364,8 @@ static PyObject *__pyx_pf_4lxml_5etree_42FunctionNamespace(CYTHON_UNUSED PyObjec
   __pyx_v_ns_utf = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/nsclasses.pxi":182
- *     can only be used to register extension functions."""
+  /* "src/lxml/nsclasses.pxi":229
+ *     """
  *     ns_utf = _utf8(ns_uri) if ns_uri else None
  *     try:             # <<<<<<<<<<<<<<
  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
@@ -98164,7 +98380,7 @@ static PyObject *__pyx_pf_4lxml_5etree_42FunctionNamespace(CYTHON_UNUSED PyObjec
     __Pyx_XGOTREF(__pyx_t_6);
     /*try:*/ {
 
-      /* "src/lxml/nsclasses.pxi":183
+      /* "src/lxml/nsclasses.pxi":230
  *     ns_utf = _utf8(ns_uri) if ns_uri else None
  *     try:
  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]             # <<<<<<<<<<<<<<
@@ -98174,16 +98390,16 @@ static PyObject *__pyx_pf_4lxml_5etree_42FunctionNamespace(CYTHON_UNUSED PyObjec
       __Pyx_XDECREF(__pyx_r);
       if (unlikely(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(9, 183, __pyx_L3_error)
+        __PYX_ERR(9, 230, __pyx_L3_error)
       }
-      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_v_ns_utf); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 183, __pyx_L3_error)
+      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_v_ns_utf); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 230, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_r = __pyx_t_1;
       __pyx_t_1 = 0;
       goto __pyx_L7_try_return;
 
-      /* "src/lxml/nsclasses.pxi":182
- *     can only be used to register extension functions."""
+      /* "src/lxml/nsclasses.pxi":229
+ *     """
  *     ns_utf = _utf8(ns_uri) if ns_uri else None
  *     try:             # <<<<<<<<<<<<<<
  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
@@ -98191,11 +98407,10 @@ static PyObject *__pyx_pf_4lxml_5etree_42FunctionNamespace(CYTHON_UNUSED PyObjec
  */
     }
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "src/lxml/nsclasses.pxi":184
+    /* "src/lxml/nsclasses.pxi":231
  *     try:
  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
  *     except KeyError:             # <<<<<<<<<<<<<<
@@ -98205,30 +98420,30 @@ static PyObject *__pyx_pf_4lxml_5etree_42FunctionNamespace(CYTHON_UNUSED PyObjec
     __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
     if (__pyx_t_7) {
       __Pyx_AddTraceback("lxml.etree.FunctionNamespace", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_8) < 0) __PYX_ERR(9, 184, __pyx_L5_except_error)
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_8) < 0) __PYX_ERR(9, 231, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_GOTREF(__pyx_t_8);
 
-      /* "src/lxml/nsclasses.pxi":186
+      /* "src/lxml/nsclasses.pxi":233
  *     except KeyError:
  *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \
  *                    _XPathFunctionNamespaceRegistry(ns_uri)             # <<<<<<<<<<<<<<
  *         return registry
  * 
  */
-      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 186, __pyx_L5_except_error)
+      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 233, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_9);
       __Pyx_INCREF(__pyx_v_ns_uri);
       __Pyx_GIVEREF(__pyx_v_ns_uri);
       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_ns_uri);
-      __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 186, __pyx_L5_except_error)
+      __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 233, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_10);
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_INCREF(__pyx_t_10);
       __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_t_10);
 
-      /* "src/lxml/nsclasses.pxi":185
+      /* "src/lxml/nsclasses.pxi":232
  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
  *     except KeyError:
  *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \             # <<<<<<<<<<<<<<
@@ -98237,12 +98452,12 @@ static PyObject *__pyx_pf_4lxml_5etree_42FunctionNamespace(CYTHON_UNUSED PyObjec
  */
       if (unlikely(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(9, 185, __pyx_L5_except_error)
+        __PYX_ERR(9, 232, __pyx_L5_except_error)
       }
-      if (unlikely(PyDict_SetItem(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_v_ns_utf, __pyx_t_10) < 0)) __PYX_ERR(9, 185, __pyx_L5_except_error)
+      if (unlikely(PyDict_SetItem(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_v_ns_utf, __pyx_t_10) < 0)) __PYX_ERR(9, 232, __pyx_L5_except_error)
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
 
-      /* "src/lxml/nsclasses.pxi":187
+      /* "src/lxml/nsclasses.pxi":234
  *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \
  *                    _XPathFunctionNamespaceRegistry(ns_uri)
  *         return registry             # <<<<<<<<<<<<<<
@@ -98260,28 +98475,25 @@ static PyObject *__pyx_pf_4lxml_5etree_42FunctionNamespace(CYTHON_UNUSED PyObjec
     goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
 
-    /* "src/lxml/nsclasses.pxi":182
- *     can only be used to register extension functions."""
+    /* "src/lxml/nsclasses.pxi":229
+ *     """
  *     ns_utf = _utf8(ns_uri) if ns_uri else None
  *     try:             # <<<<<<<<<<<<<<
  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
  *     except KeyError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L1_error;
     __pyx_L7_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L0;
     __pyx_L6_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
@@ -98289,7 +98501,7 @@ static PyObject *__pyx_pf_4lxml_5etree_42FunctionNamespace(CYTHON_UNUSED PyObjec
     goto __pyx_L0;
   }
 
-  /* "src/lxml/nsclasses.pxi":173
+  /* "src/lxml/nsclasses.pxi":207
  * __FUNCTION_NAMESPACE_REGISTRIES = {}
  * 
  * def FunctionNamespace(ns_uri):             # <<<<<<<<<<<<<<
@@ -98314,7 +98526,7 @@ static PyObject *__pyx_pf_4lxml_5etree_42FunctionNamespace(CYTHON_UNUSED PyObjec
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":191
+/* "src/lxml/nsclasses.pxi":238
  * @cython.internal
  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):
  *     def __setitem__(self, name, item):             # <<<<<<<<<<<<<<
@@ -98343,18 +98555,18 @@ static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(struct
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__setitem__", 0);
 
-  /* "src/lxml/nsclasses.pxi":192
+  /* "src/lxml/nsclasses.pxi":239
  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):
  *     def __setitem__(self, name, item):
  *         if not callable(item):             # <<<<<<<<<<<<<<
  *             raise NamespaceRegistryError, \
  *                 u"Registered functions must be callable."
  */
-  __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_item); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(9, 192, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_item); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 239, __pyx_L1_error)
   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/nsclasses.pxi":193
+    /* "src/lxml/nsclasses.pxi":240
  *     def __setitem__(self, name, item):
  *         if not callable(item):
  *             raise NamespaceRegistryError, \             # <<<<<<<<<<<<<<
@@ -98362,9 +98574,9 @@ static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(struct
  *         if not name:
  */
     __Pyx_Raise(((PyObject *)__pyx_ptype_4lxml_5etree_NamespaceRegistryError), __pyx_kp_u_Registered_functions_must_be_cal, 0, 0);
-    __PYX_ERR(9, 193, __pyx_L1_error)
+    __PYX_ERR(9, 240, __pyx_L1_error)
 
-    /* "src/lxml/nsclasses.pxi":192
+    /* "src/lxml/nsclasses.pxi":239
  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):
  *     def __setitem__(self, name, item):
  *         if not callable(item):             # <<<<<<<<<<<<<<
@@ -98373,18 +98585,18 @@ static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(struct
  */
   }
 
-  /* "src/lxml/nsclasses.pxi":195
+  /* "src/lxml/nsclasses.pxi":242
  *             raise NamespaceRegistryError, \
  *                 u"Registered functions must be callable."
  *         if not name:             # <<<<<<<<<<<<<<
  *             raise ValueError, \
  *                 u"extensions must have non empty names"
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 195, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 242, __pyx_L1_error)
   __pyx_t_1 = ((!__pyx_t_2) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/nsclasses.pxi":196
+    /* "src/lxml/nsclasses.pxi":243
  *                 u"Registered functions must be callable."
  *         if not name:
  *             raise ValueError, \             # <<<<<<<<<<<<<<
@@ -98392,9 +98604,9 @@ static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(struct
  *         self._entries[_utf8(name)] = item
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_extensions_must_have_non_empty_n, 0, 0);
-    __PYX_ERR(9, 196, __pyx_L1_error)
+    __PYX_ERR(9, 243, __pyx_L1_error)
 
-    /* "src/lxml/nsclasses.pxi":195
+    /* "src/lxml/nsclasses.pxi":242
  *             raise NamespaceRegistryError, \
  *                 u"Registered functions must be callable."
  *         if not name:             # <<<<<<<<<<<<<<
@@ -98403,7 +98615,7 @@ static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(struct
  */
   }
 
-  /* "src/lxml/nsclasses.pxi":198
+  /* "src/lxml/nsclasses.pxi":245
  *             raise ValueError, \
  *                 u"extensions must have non empty names"
  *         self._entries[_utf8(name)] = item             # <<<<<<<<<<<<<<
@@ -98412,14 +98624,14 @@ static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(struct
  */
   if (unlikely(__pyx_v_self->__pyx_base._entries == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(9, 198, __pyx_L1_error)
+    __PYX_ERR(9, 245, __pyx_L1_error)
   }
-  __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 198, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 245, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (unlikely(PyDict_SetItem(__pyx_v_self->__pyx_base._entries, __pyx_t_3, __pyx_v_item) < 0)) __PYX_ERR(9, 198, __pyx_L1_error)
+  if (unlikely(PyDict_SetItem(__pyx_v_self->__pyx_base._entries, __pyx_t_3, __pyx_v_item) < 0)) __PYX_ERR(9, 245, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "src/lxml/nsclasses.pxi":191
+  /* "src/lxml/nsclasses.pxi":238
  * @cython.internal
  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):
  *     def __setitem__(self, name, item):             # <<<<<<<<<<<<<<
@@ -98439,7 +98651,7 @@ static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(struct
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":200
+/* "src/lxml/nsclasses.pxi":247
  *         self._entries[_utf8(name)] = item
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -98466,7 +98678,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry_2__repr__(st
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "src/lxml/nsclasses.pxi":201
+  /* "src/lxml/nsclasses.pxi":248
  * 
  *     def __repr__(self):
  *         return u"FunctionNamespace(%r)" % self._ns_uri             # <<<<<<<<<<<<<<
@@ -98474,13 +98686,13 @@ static PyObject *__pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry_2__repr__(st
  * @cython.final
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_FunctionNamespace_r, __pyx_v_self->__pyx_base._ns_uri); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 201, __pyx_L1_error)
+  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_FunctionNamespace_r, __pyx_v_self->__pyx_base._ns_uri); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 248, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/nsclasses.pxi":200
+  /* "src/lxml/nsclasses.pxi":247
  *         self._entries[_utf8(name)] = item
  * 
  *     def __repr__(self):             # <<<<<<<<<<<<<<
@@ -98499,7 +98711,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry_2__repr__(st
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":211
+/* "src/lxml/nsclasses.pxi":258
  *     property prefix:
  *         u"Namespace prefix for extension functions."
  *         def __del__(self):             # <<<<<<<<<<<<<<
@@ -98525,7 +98737,7 @@ static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__del__", 0);
 
-  /* "src/lxml/nsclasses.pxi":212
+  /* "src/lxml/nsclasses.pxi":259
  *         u"Namespace prefix for extension functions."
  *         def __del__(self):
  *             self._prefix = None # no prefix configured             # <<<<<<<<<<<<<<
@@ -98538,7 +98750,7 @@ static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del
   __Pyx_DECREF(__pyx_v_self->_prefix);
   __pyx_v_self->_prefix = Py_None;
 
-  /* "src/lxml/nsclasses.pxi":213
+  /* "src/lxml/nsclasses.pxi":260
  *         def __del__(self):
  *             self._prefix = None # no prefix configured
  *             self._prefix_utf = None             # <<<<<<<<<<<<<<
@@ -98551,7 +98763,7 @@ static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del
   __Pyx_DECREF(__pyx_v_self->_prefix_utf);
   __pyx_v_self->_prefix_utf = ((PyObject*)Py_None);
 
-  /* "src/lxml/nsclasses.pxi":211
+  /* "src/lxml/nsclasses.pxi":258
  *     property prefix:
  *         u"Namespace prefix for extension functions."
  *         def __del__(self):             # <<<<<<<<<<<<<<
@@ -98565,7 +98777,7 @@ static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":214
+/* "src/lxml/nsclasses.pxi":261
  *             self._prefix = None # no prefix configured
  *             self._prefix_utf = None
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -98593,7 +98805,7 @@ static PyObject *__pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "src/lxml/nsclasses.pxi":215
+  /* "src/lxml/nsclasses.pxi":262
  *             self._prefix_utf = None
  *         def __get__(self):
  *             if self._prefix is None:             # <<<<<<<<<<<<<<
@@ -98604,7 +98816,7 @@ static PyObject *__pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/nsclasses.pxi":216
+    /* "src/lxml/nsclasses.pxi":263
  *         def __get__(self):
  *             if self._prefix is None:
  *                 return ''             # <<<<<<<<<<<<<<
@@ -98616,7 +98828,7 @@ static PyObject *__pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix
     __pyx_r = __pyx_kp_s__16;
     goto __pyx_L0;
 
-    /* "src/lxml/nsclasses.pxi":215
+    /* "src/lxml/nsclasses.pxi":262
  *             self._prefix_utf = None
  *         def __get__(self):
  *             if self._prefix is None:             # <<<<<<<<<<<<<<
@@ -98625,7 +98837,7 @@ static PyObject *__pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix
  */
   }
 
-  /* "src/lxml/nsclasses.pxi":218
+  /* "src/lxml/nsclasses.pxi":265
  *                 return ''
  *             else:
  *                 return self._prefix             # <<<<<<<<<<<<<<
@@ -98639,7 +98851,7 @@ static PyObject *__pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix
     goto __pyx_L0;
   }
 
-  /* "src/lxml/nsclasses.pxi":214
+  /* "src/lxml/nsclasses.pxi":261
  *             self._prefix = None # no prefix configured
  *             self._prefix_utf = None
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -98654,7 +98866,7 @@ static PyObject *__pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":219
+/* "src/lxml/nsclasses.pxi":266
  *             else:
  *                 return self._prefix
  *         def __set__(self, prefix):             # <<<<<<<<<<<<<<
@@ -98679,95 +98891,66 @@ static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix_4__se
   int __pyx_r;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
-  int __pyx_t_2;
+  PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__set__", 0);
   __Pyx_INCREF(__pyx_v_prefix);
 
-  /* "src/lxml/nsclasses.pxi":220
+  /* "src/lxml/nsclasses.pxi":267
  *                 return self._prefix
  *         def __set__(self, prefix):
  *             if prefix == '':             # <<<<<<<<<<<<<<
  *                 prefix = None # empty prefix
- *             if prefix is None:
+ *             self._prefix_utf = _utf8(prefix) if prefix is not None else None
  */
-  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_prefix, __pyx_kp_s__16, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 220, __pyx_L1_error)
+  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_prefix, __pyx_kp_s__16, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 267, __pyx_L1_error)
   if (__pyx_t_1) {
 
-    /* "src/lxml/nsclasses.pxi":221
+    /* "src/lxml/nsclasses.pxi":268
  *         def __set__(self, prefix):
  *             if prefix == '':
  *                 prefix = None # empty prefix             # <<<<<<<<<<<<<<
- *             if prefix is None:
- *                 self._prefix_utf = None
+ *             self._prefix_utf = _utf8(prefix) if prefix is not None else None
+ *             self._prefix = prefix
  */
     __Pyx_INCREF(Py_None);
     __Pyx_DECREF_SET(__pyx_v_prefix, Py_None);
 
-    /* "src/lxml/nsclasses.pxi":220
+    /* "src/lxml/nsclasses.pxi":267
  *                 return self._prefix
  *         def __set__(self, prefix):
  *             if prefix == '':             # <<<<<<<<<<<<<<
  *                 prefix = None # empty prefix
- *             if prefix is None:
+ *             self._prefix_utf = _utf8(prefix) if prefix is not None else None
  */
   }
 
-  /* "src/lxml/nsclasses.pxi":222
+  /* "src/lxml/nsclasses.pxi":269
  *             if prefix == '':
  *                 prefix = None # empty prefix
- *             if prefix is None:             # <<<<<<<<<<<<<<
- *                 self._prefix_utf = None
- *             else:
- */
-  __pyx_t_1 = (__pyx_v_prefix == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "src/lxml/nsclasses.pxi":223
- *                 prefix = None # empty prefix
- *             if prefix is None:
- *                 self._prefix_utf = None             # <<<<<<<<<<<<<<
- *             else:
- *                 self._prefix_utf = _utf8(prefix)
- */
-    __Pyx_INCREF(Py_None);
-    __Pyx_GIVEREF(Py_None);
-    __Pyx_GOTREF(__pyx_v_self->_prefix_utf);
-    __Pyx_DECREF(__pyx_v_self->_prefix_utf);
-    __pyx_v_self->_prefix_utf = ((PyObject*)Py_None);
-
-    /* "src/lxml/nsclasses.pxi":222
- *             if prefix == '':
- *                 prefix = None # empty prefix
- *             if prefix is None:             # <<<<<<<<<<<<<<
- *                 self._prefix_utf = None
- *             else:
- */
-    goto __pyx_L4;
-  }
-
-  /* "src/lxml/nsclasses.pxi":225
- *                 self._prefix_utf = None
- *             else:
- *                 self._prefix_utf = _utf8(prefix)             # <<<<<<<<<<<<<<
+ *             self._prefix_utf = _utf8(prefix) if prefix is not None else None             # <<<<<<<<<<<<<<
  *             self._prefix = prefix
  * 
  */
-  /*else*/ {
-    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 225, __pyx_L1_error)
+  __pyx_t_1 = (__pyx_v_prefix != Py_None);
+  if ((__pyx_t_1 != 0)) {
+    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 269, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __Pyx_GOTREF(__pyx_v_self->_prefix_utf);
-    __Pyx_DECREF(__pyx_v_self->_prefix_utf);
-    __pyx_v_self->_prefix_utf = ((PyObject*)__pyx_t_3);
+    __pyx_t_2 = __pyx_t_3;
     __pyx_t_3 = 0;
+  } else {
+    __Pyx_INCREF(Py_None);
+    __pyx_t_2 = Py_None;
   }
-  __pyx_L4:;
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_GOTREF(__pyx_v_self->_prefix_utf);
+  __Pyx_DECREF(__pyx_v_self->_prefix_utf);
+  __pyx_v_self->_prefix_utf = ((PyObject*)__pyx_t_2);
+  __pyx_t_2 = 0;
 
-  /* "src/lxml/nsclasses.pxi":226
- *             else:
- *                 self._prefix_utf = _utf8(prefix)
+  /* "src/lxml/nsclasses.pxi":270
+ *                 prefix = None # empty prefix
+ *             self._prefix_utf = _utf8(prefix) if prefix is not None else None
  *             self._prefix = prefix             # <<<<<<<<<<<<<<
  * 
  * cdef list _find_all_extension_prefixes():
@@ -98778,7 +98961,7 @@ static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix_4__se
   __Pyx_DECREF(__pyx_v_self->_prefix);
   __pyx_v_self->_prefix = __pyx_v_prefix;
 
-  /* "src/lxml/nsclasses.pxi":219
+  /* "src/lxml/nsclasses.pxi":266
  *             else:
  *                 return self._prefix
  *         def __set__(self, prefix):             # <<<<<<<<<<<<<<
@@ -98790,6 +98973,7 @@ static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix_4__se
   __pyx_r = 0;
   goto __pyx_L0;
   __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_AddTraceback("lxml.etree._XPathFunctionNamespaceRegistry.prefix.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
@@ -98799,7 +98983,7 @@ static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix_4__se
   return __pyx_r;
 }
 
-/* "src/lxml/nsclasses.pxi":228
+/* "src/lxml/nsclasses.pxi":272
  *             self._prefix = prefix
  * 
  * cdef list _find_all_extension_prefixes():             # <<<<<<<<<<<<<<
@@ -98823,19 +99007,19 @@ static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
   int __pyx_t_9;
   __Pyx_RefNannySetupContext("_find_all_extension_prefixes", 0);
 
-  /* "src/lxml/nsclasses.pxi":231
+  /* "src/lxml/nsclasses.pxi":275
  *     u"Internal lookup function to find all function prefixes for XSLT/XPath."
  *     cdef _XPathFunctionNamespaceRegistry registry
  *     cdef list ns_prefixes = []             # <<<<<<<<<<<<<<
  *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
  *         if registry._prefix_utf is not None:
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 231, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 275, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_ns_prefixes = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/nsclasses.pxi":232
+  /* "src/lxml/nsclasses.pxi":276
  *     cdef _XPathFunctionNamespaceRegistry registry
  *     cdef list ns_prefixes = []
  *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():             # <<<<<<<<<<<<<<
@@ -98844,10 +99028,10 @@ static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
  */
   __pyx_t_2 = 0;
   if (unlikely(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "itervalues");
-    __PYX_ERR(9, 232, __pyx_L1_error)
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "itervalues");
+    __PYX_ERR(9, 276, __pyx_L1_error)
   }
-  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, 1, __pyx_n_s_itervalues, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 232, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, 1, __pyx_n_s_itervalues, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 276, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_1);
   __pyx_t_1 = __pyx_t_5;
@@ -98855,13 +99039,13 @@ static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
   while (1) {
     __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_5, NULL, __pyx_t_4);
     if (unlikely(__pyx_t_6 == 0)) break;
-    if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(9, 232, __pyx_L1_error)
+    if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(9, 276, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry))))) __PYX_ERR(9, 232, __pyx_L1_error)
+    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry))))) __PYX_ERR(9, 276, __pyx_L1_error)
     __Pyx_XDECREF_SET(__pyx_v_registry, ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_t_5));
     __pyx_t_5 = 0;
 
-    /* "src/lxml/nsclasses.pxi":233
+    /* "src/lxml/nsclasses.pxi":277
  *     cdef list ns_prefixes = []
  *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
  *         if registry._prefix_utf is not None:             # <<<<<<<<<<<<<<
@@ -98872,7 +99056,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
     __pyx_t_8 = (__pyx_t_7 != 0);
     if (__pyx_t_8) {
 
-      /* "src/lxml/nsclasses.pxi":234
+      /* "src/lxml/nsclasses.pxi":278
  *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
  *         if registry._prefix_utf is not None:
  *             if registry._ns_uri_utf is not None:             # <<<<<<<<<<<<<<
@@ -98883,13 +99067,13 @@ static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
       __pyx_t_7 = (__pyx_t_8 != 0);
       if (__pyx_t_7) {
 
-        /* "src/lxml/nsclasses.pxi":236
+        /* "src/lxml/nsclasses.pxi":280
  *             if registry._ns_uri_utf is not None:
  *                 ns_prefixes.append(
  *                     (registry._prefix_utf, registry._ns_uri_utf))             # <<<<<<<<<<<<<<
  *     return ns_prefixes
  */
-        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 236, __pyx_L1_error)
+        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 280, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_INCREF(__pyx_v_registry->_prefix_utf);
         __Pyx_GIVEREF(__pyx_v_registry->_prefix_utf);
@@ -98898,17 +99082,17 @@ static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
         __Pyx_GIVEREF(__pyx_v_registry->__pyx_base.__pyx_base._ns_uri_utf);
         PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_registry->__pyx_base.__pyx_base._ns_uri_utf);
 
-        /* "src/lxml/nsclasses.pxi":235
+        /* "src/lxml/nsclasses.pxi":279
  *         if registry._prefix_utf is not None:
  *             if registry._ns_uri_utf is not None:
  *                 ns_prefixes.append(             # <<<<<<<<<<<<<<
  *                     (registry._prefix_utf, registry._ns_uri_utf))
  *     return ns_prefixes
  */
-        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ns_prefixes, __pyx_t_5); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(9, 235, __pyx_L1_error)
+        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ns_prefixes, __pyx_t_5); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(9, 279, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-        /* "src/lxml/nsclasses.pxi":234
+        /* "src/lxml/nsclasses.pxi":278
  *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
  *         if registry._prefix_utf is not None:
  *             if registry._ns_uri_utf is not None:             # <<<<<<<<<<<<<<
@@ -98917,7 +99101,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
  */
       }
 
-      /* "src/lxml/nsclasses.pxi":233
+      /* "src/lxml/nsclasses.pxi":277
  *     cdef list ns_prefixes = []
  *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
  *         if registry._prefix_utf is not None:             # <<<<<<<<<<<<<<
@@ -98928,7 +99112,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/nsclasses.pxi":237
+  /* "src/lxml/nsclasses.pxi":281
  *                 ns_prefixes.append(
  *                     (registry._prefix_utf, registry._ns_uri_utf))
  *     return ns_prefixes             # <<<<<<<<<<<<<<
@@ -98938,7 +99122,7 @@ static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
   __pyx_r = __pyx_v_ns_prefixes;
   goto __pyx_L0;
 
-  /* "src/lxml/nsclasses.pxi":228
+  /* "src/lxml/nsclasses.pxi":272
  *             self._prefix = prefix
  * 
  * cdef list _find_all_extension_prefixes():             # <<<<<<<<<<<<<<
@@ -99317,7 +99501,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8Resolver_4resolve_string(CYTHON_UNUSED s
  *             raise TypeError, "argument must be a byte string or unicode string"
  */
     if (unlikely(__pyx_v_string == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
       __PYX_ERR(10, 59, __pyx_L1_error)
     }
     __pyx_t_3 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_string)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 59, __pyx_L1_error)
@@ -99759,7 +99943,6 @@ static PyObject *__pyx_pf_4lxml_5etree_8Resolver_8resolve_file(CYTHON_UNUSED str
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "src/lxml/docloader.pxi":99
@@ -99797,7 +99980,6 @@ static PyObject *__pyx_pf_4lxml_5etree_8Resolver_8resolve_file(CYTHON_UNUSED str
  *             f.read
  *         except AttributeError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -100587,7 +100769,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_8resolve(struct __pyx
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(10, 149, __pyx_L1_error)
         }
         break;
@@ -100913,7 +101095,7 @@ static void __pyx_f_4lxml_5etree_16_ResolverContext_clear(struct __pyx_obj_4lxml
  * 
  * cdef _initResolverContext(_ResolverContext context,
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_10_TempStore_clear(__pyx_v_self->_storage); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(10, 167, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_10_TempStore_clear(__pyx_v_self->_storage); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 167, __pyx_L1_error)
 
   /* "src/lxml/docloader.pxi":165
  *     cdef _TempStore _storage
@@ -102760,10 +102942,10 @@ static void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_pushImpliedContext(s
  *     cdef void popImpliedContext(self):
  */
   if (unlikely(__pyx_v_context->_implied_parser_contexts == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(2, 177, __pyx_L1_error)
   }
-  __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_context->_implied_parser_contexts, ((PyObject *)__pyx_v_parser_context)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 177, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_context->_implied_parser_contexts, ((PyObject *)__pyx_v_parser_context)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 177, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":173
  *             self.pushImpliedContext(None)
@@ -102817,7 +102999,7 @@ static void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_popImpliedContext(st
  * cdef _ParserDictionaryContext __GLOBAL_PARSER_CONTEXT = _ParserDictionaryContext()
  */
   if (unlikely(__pyx_v_context->_implied_parser_contexts == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "pop");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
     __PYX_ERR(2, 183, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_context->_implied_parser_contexts); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 183, __pyx_L1_error)
@@ -103792,7 +103974,6 @@ static PyObject *__pyx_f_4lxml_5etree_18_FileReaderContext__close_file(struct __
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
       /* "src/lxml/parser.pxi":285
@@ -103834,14 +104015,12 @@ static PyObject *__pyx_f_4lxml_5etree_18_FileReaderContext__close_file(struct __
  *             close = self._filelike.close
  *         except AttributeError:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -103890,7 +104069,6 @@ static PyObject *__pyx_f_4lxml_5etree_18_FileReaderContext__close_file(struct __
         __Pyx_DECREF(__pyx_v_self->_filelike);
         __pyx_v_self->_filelike = Py_None;
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_14);
@@ -104576,7 +104754,6 @@ static xmlDoc *__pyx_f_4lxml_5etree_18_FileReaderContext__readDoc(struct __pyx_o
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       goto __pyx_L19_try_end;
       __pyx_L14_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
       /* "src/lxml/parser.pxi":355
@@ -104615,14 +104792,12 @@ static xmlDoc *__pyx_f_4lxml_5etree_18_FileReaderContext__readDoc(struct __pyx_o
  *             self._close_file()
  *         except:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_XGIVEREF(__pyx_t_7);
       __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
       goto __pyx_L12_error;
       __pyx_L15_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_XGIVEREF(__pyx_t_7);
@@ -104664,7 +104839,6 @@ static xmlDoc *__pyx_f_4lxml_5etree_18_FileReaderContext__readDoc(struct __pyx_o
         goto __pyx_L22_return;
       }
       __pyx_L22_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -104969,7 +105143,7 @@ static int __pyx_f_4lxml_5etree_18_FileReaderContext_copyToBuffer(struct __pyx_o
  *                             self._bytes = python.PyUnicode_AsEncodedString(
  */
                 if (unlikely(__pyx_v_self->_bytes == Py_None)) {
-                  PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
+                  PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
                   __PYX_ERR(2, 380, __pyx_L7_error)
                 }
                 __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_self->_bytes)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 380, __pyx_L7_error)
@@ -105215,7 +105389,6 @@ static int __pyx_f_4lxml_5etree_18_FileReaderContext_copyToBuffer(struct __pyx_o
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       goto __pyx_L12_try_end;
       __pyx_L7_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -105294,7 +105467,6 @@ static int __pyx_f_4lxml_5etree_18_FileReaderContext_copyToBuffer(struct __pyx_o
           __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
           goto __pyx_L29_try_end;
           __pyx_L22_error:;
-          __Pyx_PyThreadState_assign
           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
@@ -105334,14 +105506,12 @@ static int __pyx_f_4lxml_5etree_18_FileReaderContext_copyToBuffer(struct __pyx_o
  *                 self._close_file()
  *             except:
  */
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_11);
           __Pyx_XGIVEREF(__pyx_t_12);
           __Pyx_XGIVEREF(__pyx_t_13);
           __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
           goto __pyx_L9_except_error;
           __pyx_L23_exception_handled:;
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_11);
           __Pyx_XGIVEREF(__pyx_t_12);
           __Pyx_XGIVEREF(__pyx_t_13);
@@ -105362,21 +105532,18 @@ static int __pyx_f_4lxml_5etree_18_FileReaderContext_copyToBuffer(struct __pyx_o
  *             byte_count = python.PyBytes_GET_SIZE(self._bytes)
  *             remaining  = byte_count - self._bytes_read
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
       goto __pyx_L5_error;
       __pyx_L11_try_return:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
       goto __pyx_L4_return;
       __pyx_L8_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
@@ -105421,7 +105588,6 @@ static int __pyx_f_4lxml_5etree_18_FileReaderContext_copyToBuffer(struct __pyx_o
         goto __pyx_L32_return;
       }
       __pyx_L32_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_12);
@@ -105897,7 +106063,6 @@ static xmlParserInput *__pyx_f_4lxml_5etree__local_resolver(const char *__pyx_v_
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     goto __pyx_L14_try_end;
     __pyx_L9_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -105948,14 +106113,12 @@ static xmlParserInput *__pyx_f_4lxml_5etree__local_resolver(const char *__pyx_v_
  *         if c_url is NULL:
  *             url = None
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L1_error;
     __pyx_L12_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
@@ -106060,7 +106223,7 @@ static xmlParserInput *__pyx_f_4lxml_5etree__local_resolver(const char *__pyx_v_
  */
         __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 467, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 467, __pyx_L1_error)
+        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 467, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
         __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_7);
@@ -106410,7 +106573,7 @@ static xmlParserInput *__pyx_f_4lxml_5etree__local_resolver(const char *__pyx_v_
  *         if c_input is not NULL:
  *             return c_input
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree_10_TempStore_add(__pyx_v_context->_storage, __pyx_v_data); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 496, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree_10_TempStore_add(__pyx_v_context->_storage, __pyx_v_data); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 496, __pyx_L1_error)
 
       /* "src/lxml/parser.pxi":495
  *             c_input = NULL
@@ -107228,7 +107391,7 @@ static int __pyx_f_4lxml_5etree_14_ParserContext_prepare(struct __pyx_obj_4lxml_
  */
     __pyx_t_3 = ((PyObject *)__pyx_v_self->_error_log);
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_4 = __pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_connect(__pyx_v_self->_validator, __pyx_v_self->_c_ctxt, ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_3)); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 573, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_connect(__pyx_v_self->_validator, __pyx_v_self->_c_ctxt, ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_3)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 573, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
     /* "src/lxml/parser.pxi":572
@@ -107438,7 +107601,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ParserContext__handleParseResult(struct
  *         if self._doc is not None and self._doc._c_doc is c_doc:
  *             return self._doc
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_self, __pyx_v_parser, __pyx_v_result, __pyx_v_filename); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 589, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_self, __pyx_v_parser, __pyx_v_result, __pyx_v_filename); if (unlikely(__pyx_t_1 == ((xmlDoc *)NULL))) __PYX_ERR(2, 589, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_1;
 
   /* "src/lxml/parser.pxi":590
@@ -107557,7 +107720,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_14_ParserContext__handleParseResultDoc(struc
  *                                   filename, recover,
  *                                   free_doc=self._doc is None)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__handleParseResult(__pyx_v_self, __pyx_v_self->_c_ctxt, __pyx_v_result, __pyx_v_filename, __pyx_v_recover, __pyx_t_1); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(2, 598, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__handleParseResult(__pyx_v_self, __pyx_v_self->_c_ctxt, __pyx_v_result, __pyx_v_filename, __pyx_v_recover, __pyx_t_1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(2, 598, __pyx_L1_error)
   __pyx_r = __pyx_t_2;
   goto __pyx_L0;
 
@@ -107852,12 +108015,16 @@ static int __pyx_f_4lxml_5etree__raiseParseError(xmlParserCtxt *__pyx_v_ctxt, Py
  *         if ctxt.lastError.message is not NULL:
  *             try:
  */
-      __pyx_t_4 = __Pyx_PyObject_AsUString(__pyx_v_filename); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(2, 625, __pyx_L1_error)
+      if (unlikely(__pyx_v_filename == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+        __PYX_ERR(2, 625, __pyx_L1_error)
+      }
+      __pyx_t_4 = __Pyx_PyBytes_AsUString(__pyx_v_filename); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(2, 625, __pyx_L1_error)
       if (unlikely(__pyx_v_filename == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
         __PYX_ERR(2, 625, __pyx_L1_error)
       }
-      __pyx_t_5 = PyBytes_GET_SIZE(((PyObject*)__pyx_v_filename)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 625, __pyx_L1_error)
+      __pyx_t_5 = PyBytes_GET_SIZE(((PyObject*)__pyx_v_filename)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 625, __pyx_L1_error)
 
       /* "src/lxml/parser.pxi":624
  *            ctxt.lastError.domain == xmlerror.XML_FROM_IO:
@@ -107933,7 +108100,6 @@ static int __pyx_f_4lxml_5etree__raiseParseError(xmlParserCtxt *__pyx_v_ctxt, Py
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         goto __pyx_L13_try_end;
         __pyx_L8_error:;
-        __Pyx_PyThreadState_assign
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
         /* "src/lxml/parser.pxi":629
@@ -107979,14 +108145,12 @@ static int __pyx_f_4lxml_5etree__raiseParseError(xmlParserCtxt *__pyx_v_ctxt, Py
  *                 message = (ctxt.lastError.message).decode('utf-8')
  *             except UnicodeDecodeError:
  */
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L1_error;
         __pyx_L9_exception_handled:;
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
@@ -108697,7 +108861,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__handleParseResult(struct __pyx_obj_4lxml_5e
         if (unlikely(!__pyx_t_8)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(2, 672, __pyx_L1_error)
           }
           break;
@@ -108932,7 +109096,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__handleParseResult(struct __pyx_obj_4lxml_5e
           if (unlikely(!__pyx_t_4)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(2, 685, __pyx_L1_error)
             }
             break;
@@ -109224,7 +109388,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__handleParseResult(struct __pyx_obj_4lxml_5e
  * 
  *     if result is NULL:
  */
-    __pyx_t_11 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_context)); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(2, 705, __pyx_L1_error)
+    __pyx_t_11 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_context)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 705, __pyx_L1_error)
 
     /* "src/lxml/parser.pxi":700
  *             result = NULL
@@ -109265,7 +109429,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__handleParseResult(struct __pyx_obj_4lxml_5e
  */
       __pyx_t_5 = ((PyObject *)__pyx_v_context->_error_log);
       __Pyx_INCREF(__pyx_t_5);
-      __pyx_t_11 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_c_ctxt, __pyx_v_filename, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_5)); if (unlikely(__pyx_t_11 == 0)) __PYX_ERR(2, 709, __pyx_L1_error)
+      __pyx_t_11 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_c_ctxt, __pyx_v_filename, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_5)); if (unlikely(__pyx_t_11 == ((int)0))) __PYX_ERR(2, 709, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
       /* "src/lxml/parser.pxi":708
@@ -109286,7 +109450,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__handleParseResult(struct __pyx_obj_4lxml_5e
  *         if result.URL is NULL and filename is not None:
  */
     /*else*/ {
-      __pyx_t_11 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_c_ctxt, __pyx_v_filename, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None)); if (unlikely(__pyx_t_11 == 0)) __PYX_ERR(2, 711, __pyx_L1_error)
+      __pyx_t_11 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_c_ctxt, __pyx_v_filename, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None)); if (unlikely(__pyx_t_11 == ((int)0))) __PYX_ERR(2, 711, __pyx_L1_error)
     }
     __pyx_L37:;
 
@@ -110542,7 +110706,7 @@ static PyObject *__pyx_f_4lxml_5etree_11_BaseParser__collectEvents(struct __pyx_
  *         self._events_to_collect = (event_types, tag)
  * 
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__buildParseEventFilter(__pyx_v_event_types); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 833, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__buildParseEventFilter(__pyx_v_event_types); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 833, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -110700,7 +110864,7 @@ static struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_11_Bas
  *             _initParserContext(self._parser_context, self._resolvers, pctxt)
  *             self._configureSaxContext(pctxt)
  */
-    __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_newParserCtxt(__pyx_v_self); if (unlikely(__pyx_t_5 == NULL)) __PYX_ERR(2, 845, __pyx_L1_error)
+    __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_newParserCtxt(__pyx_v_self); if (unlikely(__pyx_t_5 == ((xmlParserCtxt *)NULL))) __PYX_ERR(2, 845, __pyx_L1_error)
     __pyx_v_pctxt = __pyx_t_5;
 
     /* "src/lxml/parser.pxi":846
@@ -110727,7 +110891,7 @@ static struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_11_Bas
  *         return self._parser_context
  * 
  */
-    __pyx_t_7 = __pyx_f_4lxml_5etree_11_BaseParser__configureSaxContext(__pyx_v_self, __pyx_v_pctxt); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(2, 847, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree_11_BaseParser__configureSaxContext(__pyx_v_self, __pyx_v_pctxt); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 847, __pyx_L1_error)
 
     /* "src/lxml/parser.pxi":838
  *     cdef _ParserContext _getParserContext(self):
@@ -110892,7 +111056,7 @@ static struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_11_Bas
  *             _initParserContext(
  *                 self._push_parser_context, self._resolvers, pctxt)
  */
-    __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_newPushParserCtxt(__pyx_v_self); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 860, __pyx_L1_error)
+    __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_newPushParserCtxt(__pyx_v_self); if (unlikely(__pyx_t_6 == ((xmlParserCtxt *)NULL))) __PYX_ERR(2, 860, __pyx_L1_error)
     __pyx_v_pctxt = __pyx_t_6;
 
     /* "src/lxml/parser.pxi":862
@@ -110927,7 +111091,7 @@ static struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_11_Bas
  *         return self._push_parser_context
  * 
  */
-    __pyx_t_7 = __pyx_f_4lxml_5etree_11_BaseParser__configureSaxContext(__pyx_v_self, __pyx_v_pctxt); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(2, 863, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree_11_BaseParser__configureSaxContext(__pyx_v_self, __pyx_v_pctxt); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 863, __pyx_L1_error)
 
     /* "src/lxml/parser.pxi":852
  *     cdef _ParserContext _getPushParserContext(self):
@@ -111030,7 +111194,7 @@ static struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_11_Bas
  *         elif events_to_collect:
  *             sax_context = _SaxParserContext(self)
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree_20_TargetParserContext__setTarget(((struct __pyx_obj_4lxml_5etree__TargetParserContext *)__pyx_v_sax_context), __pyx_v_target); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 870, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree_20_TargetParserContext__setTarget(((struct __pyx_obj_4lxml_5etree__TargetParserContext *)__pyx_v_sax_context), __pyx_v_target); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 870, __pyx_L1_error)
 
     /* "src/lxml/parser.pxi":868
  *     cdef _ParserContext _createContext(self, target, events_to_collect):
@@ -111593,7 +111757,7 @@ static xmlParserCtxt *__pyx_f_4lxml_5etree_11_BaseParser__newParserCtxt(struct _
  *         else:
  *             c_ctxt = xmlparser.xmlNewParserCtxt()
  */
-      __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_registerHtmlErrorHandler(__pyx_v_self, __pyx_v_c_ctxt); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 914, __pyx_L1_error)
+      __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_registerHtmlErrorHandler(__pyx_v_self, __pyx_v_c_ctxt); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 914, __pyx_L1_error)
 
       /* "src/lxml/parser.pxi":913
  *         if self._for_html:
@@ -111763,7 +111927,7 @@ static xmlParserCtxt *__pyx_f_4lxml_5etree_11_BaseParser__newPushParserCtxt(stru
  *                 htmlparser.htmlCtxtUseOptions(c_ctxt, self._parse_options)
  *         else:
  */
-      __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_registerHtmlErrorHandler(__pyx_v_self, __pyx_v_c_ctxt); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 929, __pyx_L1_error)
+      __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_registerHtmlErrorHandler(__pyx_v_self, __pyx_v_c_ctxt); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 929, __pyx_L1_error)
 
       /* "src/lxml/parser.pxi":930
  *             if c_ctxt is not NULL:
@@ -113168,7 +113332,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc(struct __pyx_
  *         try:
  *             pctxt = context._c_ctxt
  */
-  __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 1046, __pyx_L1_error)
+  __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 1046, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1047
  *         context = self._getParserContext()
@@ -113364,7 +113528,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc(struct __pyx_
  *         finally:
  *             context.cleanup()
  */
-    __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, Py_None); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 1066, __pyx_L9_error)
+    __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, Py_None); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1066, __pyx_L9_error)
     __pyx_r = __pyx_t_7;
     goto __pyx_L8_return;
   }
@@ -113394,9 +113558,8 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc(struct __pyx_
       __Pyx_XGOTREF(__pyx_t_15);
       __pyx_t_5 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename;
       {
-        __pyx_t_16 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(2, 1068, __pyx_L18_error)
+        __pyx_t_16 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(2, 1068, __pyx_L18_error)
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_14);
@@ -113411,7 +113574,6 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc(struct __pyx_
       __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9;
       goto __pyx_L1_error;
       __pyx_L18_error:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_14);
@@ -113426,7 +113588,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc(struct __pyx_
     }
     __pyx_L8_return: {
       __pyx_t_7 = __pyx_r;
-      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 1068, __pyx_L1_error)
+      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 1068, __pyx_L1_error)
       __pyx_r = __pyx_t_7;
       goto __pyx_L0;
     }
@@ -113505,7 +113667,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDoc(struct __pyx_obj_4lx
  *         try:
  *             pctxt = context._c_ctxt
  */
-  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 1080, __pyx_L1_error)
+  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1080, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1081
  *         context = self._getParserContext()
@@ -113993,7 +114155,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDoc(struct __pyx_obj_4lx
  *         finally:
  *             context.cleanup()
  */
-    __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, Py_None); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1125, __pyx_L4_error)
+    __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, Py_None); if (unlikely(__pyx_t_6 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1125, __pyx_L4_error)
     __pyx_r = __pyx_t_6;
     goto __pyx_L3_return;
   }
@@ -114022,9 +114184,8 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDoc(struct __pyx_obj_4lx
       __Pyx_XGOTREF(__pyx_t_14);
       __pyx_t_2 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
       {
-        __pyx_t_15 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(2, 1127, __pyx_L25_error)
+        __pyx_t_15 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(2, 1127, __pyx_L25_error)
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_13);
@@ -114039,7 +114200,6 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDoc(struct __pyx_obj_4lx
       __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
       goto __pyx_L1_error;
       __pyx_L25_error:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_13);
@@ -114054,7 +114214,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDoc(struct __pyx_obj_4lx
     }
     __pyx_L3_return: {
       __pyx_t_6 = __pyx_r;
-      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(2, 1127, __pyx_L1_error)
+      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 1127, __pyx_L1_error)
       __pyx_r = __pyx_t_6;
       goto __pyx_L0;
     }
@@ -114140,7 +114300,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile(struct __pyx
  *         try:
  *             pctxt = context._c_ctxt
  */
-  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 1137, __pyx_L1_error)
+  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1137, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1138
  *         context = self._getParserContext()
@@ -114383,7 +114543,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile(struct __pyx
  */
     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_c_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1161, __pyx_L4_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(2, 1161, __pyx_L4_error)
+    __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_6 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1161, __pyx_L4_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_r = __pyx_t_6;
     goto __pyx_L3_return;
@@ -114413,9 +114573,8 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile(struct __pyx
       __Pyx_XGOTREF(__pyx_t_14);
       __pyx_t_2 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
       {
-        __pyx_t_15 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(2, 1163, __pyx_L14_error)
+        __pyx_t_15 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(2, 1163, __pyx_L14_error)
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_13);
@@ -114430,7 +114589,6 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile(struct __pyx
       __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
       goto __pyx_L1_error;
       __pyx_L14_error:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_13);
@@ -114445,7 +114603,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile(struct __pyx
     }
     __pyx_L3_return: {
       __pyx_t_6 = __pyx_r;
-      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(2, 1163, __pyx_L1_error)
+      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 1163, __pyx_L1_error)
       __pyx_r = __pyx_t_6;
       goto __pyx_L0;
     }
@@ -114553,7 +114711,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFilelike(struct _
  *         try:
  *             pctxt = context._c_ctxt
  */
-  __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1176, __pyx_L1_error)
+  __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1176, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1177
  *         context = self._getParserContext()
@@ -114644,7 +114802,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFilelike(struct _
  *                 self, result, filename)
  *         finally:
  */
-    __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, __pyx_v_filename); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 1185, __pyx_L5_error)
+    __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, __pyx_v_filename); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1185, __pyx_L5_error)
     __pyx_r = __pyx_t_7;
     goto __pyx_L4_return;
   }
@@ -114674,9 +114832,8 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFilelike(struct _
       __Pyx_XGOTREF(__pyx_t_15);
       __pyx_t_4 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename;
       {
-        __pyx_t_16 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(2, 1188, __pyx_L10_error)
+        __pyx_t_16 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(2, 1188, __pyx_L10_error)
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_14);
@@ -114691,7 +114848,6 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFilelike(struct _
       __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9;
       goto __pyx_L1_error;
       __pyx_L10_error:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_14);
@@ -114706,7 +114862,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFilelike(struct _
     }
     __pyx_L4_return: {
       __pyx_t_7 = __pyx_r;
-      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 1188, __pyx_L1_error)
+      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 1188, __pyx_L1_error)
       __pyx_r = __pyx_t_7;
       goto __pyx_L0;
     }
@@ -115503,7 +115659,7 @@ static PyObject *__pyx_f_4lxml_5etree_11_FeedParser_feed(struct __pyx_obj_4lxml_
  *             self._feed_parser_running = 1
  *             c_filename = (_cstr(self._filename)
  */
-    __pyx_t_10 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(2, 1287, __pyx_L1_error)
+    __pyx_t_10 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(2, 1287, __pyx_L1_error)
 
     /* "src/lxml/parser.pxi":1288
  *         if not self._feed_parser_running:
@@ -115579,7 +115735,7 @@ static PyObject *__pyx_f_4lxml_5etree_11_FeedParser_feed(struct __pyx_obj_4lxml_
  *                     pctxt, c_data, buffer_len, c_filename, c_encoding,
  *                     self._parse_options)
  */
-      __pyx_t_10 = __pyx_f_4lxml_5etree__htmlCtxtResetPush(__pyx_v_pctxt, __pyx_v_c_data, __pyx_v_buffer_len, __pyx_v_c_filename, __pyx_v_c_encoding, __pyx_v_self->__pyx_base._parse_options); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(2, 1298, __pyx_L1_error)
+      __pyx_t_10 = __pyx_f_4lxml_5etree__htmlCtxtResetPush(__pyx_v_pctxt, __pyx_v_c_data, __pyx_v_buffer_len, __pyx_v_c_filename, __pyx_v_c_encoding, __pyx_v_self->__pyx_base._parse_options); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(2, 1298, __pyx_L1_error)
       __pyx_v_error = __pyx_t_10;
 
       /* "src/lxml/parser.pxi":1297
@@ -116147,7 +116303,7 @@ static PyObject *__pyx_f_4lxml_5etree_11_FeedParser_feed(struct __pyx_obj_4lxml_
           if (unlikely(!__pyx_t_1)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(2, 1347, __pyx_L1_error)
             }
             break;
@@ -116392,7 +116548,7 @@ static PyObject *__pyx_f_4lxml_5etree_11_FeedParser_feed(struct __pyx_obj_4lxml_
  */
     /*finally:*/ {
       /*normal exit:*/{
-        __pyx_t_10 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(2, 1364, __pyx_L1_error)
+        __pyx_t_10 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(2, 1364, __pyx_L1_error)
         goto __pyx_L48;
       }
       /*exception exit:*/{
@@ -116415,9 +116571,8 @@ static PyObject *__pyx_f_4lxml_5etree_11_FeedParser_feed(struct __pyx_obj_4lxml_
         __Pyx_XGOTREF(__pyx_t_23);
         __pyx_t_10 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
         {
-          __pyx_t_24 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_24 == -1)) __PYX_ERR(2, 1364, __pyx_L50_error)
+          __pyx_t_24 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(2, 1364, __pyx_L50_error)
         }
-        __Pyx_PyThreadState_assign
         if (PY_MAJOR_VERSION >= 3) {
           __Pyx_XGIVEREF(__pyx_t_21);
           __Pyx_XGIVEREF(__pyx_t_22);
@@ -116432,7 +116587,6 @@ static PyObject *__pyx_f_4lxml_5etree_11_FeedParser_feed(struct __pyx_obj_4lxml_
         __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
         goto __pyx_L1_error;
         __pyx_L50_error:;
-        __Pyx_PyThreadState_assign
         if (PY_MAJOR_VERSION >= 3) {
           __Pyx_XGIVEREF(__pyx_t_21);
           __Pyx_XGIVEREF(__pyx_t_22);
@@ -116818,7 +116972,7 @@ static PyObject *__pyx_f_4lxml_5etree_11_FeedParser_close(struct __pyx_obj_4lxml
  * 
  *         try:
  */
-    __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_context)->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->flushEvents(((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_context)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(2, 1394, __pyx_L1_error)
+    __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_context)->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->flushEvents(((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_context)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1394, __pyx_L1_error)
 
     /* "src/lxml/parser.pxi":1391
  *             xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)
@@ -116860,7 +117014,7 @@ static PyObject *__pyx_f_4lxml_5etree_11_FeedParser_close(struct __pyx_obj_4lxml
  */
   /*finally:*/ {
     /*normal exit:*/{
-      __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(2, 1399, __pyx_L1_error)
+      __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1399, __pyx_L1_error)
       goto __pyx_L11;
     }
     /*exception exit:*/{
@@ -116883,9 +117037,8 @@ static PyObject *__pyx_f_4lxml_5etree_11_FeedParser_close(struct __pyx_obj_4lxml
       __Pyx_XGOTREF(__pyx_t_18);
       __pyx_t_6 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
       {
-        __pyx_t_19 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(2, 1399, __pyx_L13_error)
+        __pyx_t_19 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(2, 1399, __pyx_L13_error)
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_16);
         __Pyx_XGIVEREF(__pyx_t_17);
@@ -116900,7 +117053,6 @@ static PyObject *__pyx_f_4lxml_5etree_11_FeedParser_close(struct __pyx_obj_4lxml
       __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
       goto __pyx_L1_error;
       __pyx_L13_error:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_16);
         __Pyx_XGIVEREF(__pyx_t_17);
@@ -117901,8 +118053,8 @@ static int __pyx_pf_4lxml_5etree_13XMLPullParser___init__(struct __pyx_obj_4lxml
  *         self._setBaseURL(base_url)
  *         self._collectEvents(events, tag)
  */
-    __Pyx_INCREF(__pyx_tuple__64);
-    __Pyx_DECREF_SET(__pyx_v_events, __pyx_tuple__64);
+    __Pyx_INCREF(__pyx_tuple__66);
+    __Pyx_DECREF_SET(__pyx_v_events, __pyx_tuple__66);
 
     /* "src/lxml/parser.pxi":1543
  *     def __init__(self, events=None, *, tag=None, base_url=None, **kwargs):
@@ -118203,7 +118355,7 @@ static int __pyx_pf_4lxml_5etree_17ETCompatXMLParser___init__(struct __pyx_obj_4
  *                            dtd_validation=dtd_validation,
  *                            load_dtd=load_dtd,
  */
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1574, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(16); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1574, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_attribute_defaults, __pyx_v_attribute_defaults) < 0) __PYX_ERR(2, 1574, __pyx_L1_error)
 
@@ -119125,8 +119277,8 @@ static int __pyx_pf_4lxml_5etree_14HTMLPullParser___init__(struct __pyx_obj_4lxm
  *         self._setBaseURL(base_url)
  *         self._collectEvents(events, tag)
  */
-    __Pyx_INCREF(__pyx_tuple__65);
-    __Pyx_DECREF_SET(__pyx_v_events, __pyx_tuple__65);
+    __Pyx_INCREF(__pyx_tuple__67);
+    __Pyx_DECREF_SET(__pyx_v_events, __pyx_tuple__67);
 
     /* "src/lxml/parser.pxi":1712
  *     def __init__(self, events=None, *, tag=None, base_url=None, **kwargs):
@@ -119506,7 +119658,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__parseDoc(PyObject *__pyx_v_text, PyObject *
  *                 StringIO(text), filename, None)
  *         if _UNICODE_ENCODING is NULL and not is_pep393_string:
  */
-      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_t_3, __pyx_v_filename, Py_None); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 1746, __pyx_L1_error)
+      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_t_3, __pyx_v_filename, Py_None); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1746, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __pyx_r = __pyx_t_7;
       goto __pyx_L0;
@@ -119546,7 +119698,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__parseDoc(PyObject *__pyx_v_text, PyObject *
  *                 BytesIO(text), filename, "UTF-8")
  */
       if (unlikely(__pyx_v_text == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "encode");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
         __PYX_ERR(2, 1749, __pyx_L1_error)
       }
       __pyx_t_3 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_text)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1749, __pyx_L1_error)
@@ -119613,7 +119765,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__parseDoc(PyObject *__pyx_v_text, PyObject *
  *                 BytesIO(text), filename, "UTF-8")
  *         return (<_BaseParser>parser)._parseUnicodeDoc(text, c_filename)
  */
-      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_t_3, __pyx_v_filename, __pyx_kp_s_UTF_8); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 1750, __pyx_L1_error)
+      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_t_3, __pyx_v_filename, __pyx_kp_s_UTF_8); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1750, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __pyx_r = __pyx_t_7;
       goto __pyx_L0;
@@ -119634,7 +119786,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__parseDoc(PyObject *__pyx_v_text, PyObject *
  *     else:
  *         c_len = python.PyBytes_GET_SIZE(text)
  */
-    __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseUnicodeDoc(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_text, __pyx_v_c_filename); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 1752, __pyx_L1_error)
+    __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseUnicodeDoc(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_text, __pyx_v_c_filename); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1752, __pyx_L1_error)
     __pyx_r = __pyx_t_7;
     goto __pyx_L0;
 
@@ -119726,7 +119878,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__parseDoc(PyObject *__pyx_v_text, PyObject *
  *                 BytesIO(text), filename, None)
  *         c_text = _cstr(text)
  */
-      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_t_3, __pyx_v_filename, Py_None); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 1756, __pyx_L1_error)
+      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_t_3, __pyx_v_filename, Py_None); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1756, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __pyx_r = __pyx_t_7;
       goto __pyx_L0;
@@ -119756,7 +119908,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__parseDoc(PyObject *__pyx_v_text, PyObject *
  * 
  * cdef xmlDoc* _parseDocFromFile(filename8, _BaseParser parser) except NULL:
  */
-    __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDoc(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_c_text, __pyx_v_c_len, __pyx_v_c_filename); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 1759, __pyx_L1_error)
+    __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDoc(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_c_text, __pyx_v_c_len, __pyx_v_c_filename); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1759, __pyx_L1_error)
     __pyx_r = __pyx_t_7;
     goto __pyx_L0;
   }
@@ -119842,7 +119994,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__parseDocFromFile(PyObject *__pyx_v_filename
  * 
  * cdef xmlDoc* _parseDocFromFilelike(source, filename,
  */
-  __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFile(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), PyBytes_AS_STRING(__pyx_v_filename8)); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(2, 1764, __pyx_L1_error)
+  __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFile(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), PyBytes_AS_STRING(__pyx_v_filename8)); if (unlikely(__pyx_t_4 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1764, __pyx_L1_error)
   __pyx_r = __pyx_t_4;
   goto __pyx_L0;
 
@@ -119922,7 +120074,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__parseDocFromFilelike(PyObject *__pyx_v_sour
  * 
  * cdef xmlDoc* _newXMLDoc() except NULL:
  */
-  __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_source, __pyx_v_filename, Py_None); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(2, 1770, __pyx_L1_error)
+  __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_source, __pyx_v_filename, Py_None); if (unlikely(__pyx_t_4 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1770, __pyx_L1_error)
   __pyx_r = __pyx_t_4;
   goto __pyx_L0;
 
@@ -120427,7 +120579,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__copyDocRoot(xmlDoc *__pyx_v_c_doc, xmlNode
  *     return result
  * 
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyTail(__pyx_v_c_new_root->next, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 1813, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyTail(__pyx_v_c_new_root->next, __pyx_v_c_node); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1813, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1814
  *     tree.xmlDocSetRootElement(result, c_node)
@@ -120516,7 +120668,7 @@ static xmlNode *__pyx_f_4lxml_5etree__copyNodeToDoc(xmlNode *__pyx_v_c_node, xml
  *     return c_root
  * 
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyTail(__pyx_v_c_node->next, __pyx_v_c_root); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 1822, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyTail(__pyx_v_c_node->next, __pyx_v_c_root); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1822, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1823
  *         raise MemoryError()
@@ -120736,14 +120888,14 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocument(PyObject *__pyx_
  *         # StringIO - reading from start?
  *         if source.tell() == 0:
  */
-  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_getvalue); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1848, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_getvalue); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1848, __pyx_L1_error)
   __pyx_t_5 = (__pyx_t_4 != 0);
   if (__pyx_t_5) {
   } else {
     __pyx_t_1 = __pyx_t_5;
     goto __pyx_L8_bool_binop_done;
   }
-  __pyx_t_5 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_tell); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 1848, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_tell); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 1848, __pyx_L1_error)
   __pyx_t_4 = (__pyx_t_5 != 0);
   __pyx_t_1 = __pyx_t_4;
   __pyx_L8_bool_binop_done:;
@@ -120843,7 +120995,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocument(PyObject *__pyx_
  *         return _parseFilelikeDocument(source, url, parser)
  * 
  */
-  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_read); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 1854, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_u_read); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1854, __pyx_L1_error)
   __pyx_t_4 = (__pyx_t_1 != 0);
   if (__pyx_t_4) {
 
@@ -120934,7 +121086,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocumentFromURL(PyObject
  *     return _documentFactory(c_doc, parser)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__parseDocFromFile(__pyx_v_url, __pyx_v_parser); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 1860, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__parseDocFromFile(__pyx_v_url, __pyx_v_parser); if (unlikely(__pyx_t_1 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1860, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_1;
 
   /* "src/lxml/parser.pxi":1861
@@ -121006,7 +121158,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__parseMemoryDocument(PyObject *
  *             raise ValueError(
  *                 u"Unicode strings with encoding declaration are not supported. "
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree__hasEncodingDeclaration(__pyx_v_text); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(2, 1865, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__hasEncodingDeclaration(__pyx_v_text); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1865, __pyx_L1_error)
     __pyx_t_1 = (__pyx_t_2 != 0);
     if (__pyx_t_1) {
 
@@ -121017,7 +121169,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__parseMemoryDocument(PyObject *
  *                 u"Unicode strings with encoding declaration are not supported. "
  *                 u"Please use bytes input or XML fragments without declaration.")
  */
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1866, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1866, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -121080,7 +121232,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__parseMemoryDocument(PyObject *
  *     return _documentFactory(c_doc, parser)
  * 
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__parseDoc(__pyx_v_text, __pyx_v_url, __pyx_v_parser); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(2, 1871, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__parseDoc(__pyx_v_text, __pyx_v_url, __pyx_v_parser); if (unlikely(__pyx_t_4 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1871, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_4;
 
   /* "src/lxml/parser.pxi":1872
@@ -121138,7 +121290,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__parseFilelikeDocument(PyObject
  *     c_doc = _parseDocFromFilelike(source, url, parser)             # <<<<<<<<<<<<<<
  *     return _documentFactory(c_doc, parser)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__parseDocFromFilelike(__pyx_v_source, __pyx_v_url, __pyx_v_parser); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(2, 1875, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__parseDocFromFilelike(__pyx_v_source, __pyx_v_url, __pyx_v_parser); if (unlikely(__pyx_t_1 == ((xmlDoc *)NULL))) __PYX_ERR(2, 1875, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_1;
 
   /* "src/lxml/parser.pxi":1876
@@ -121240,7 +121392,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(11, 23, __pyx_L1_error)
         }
         break;
@@ -122734,7 +122886,7 @@ static PyObject *__pyx_f_4lxml_5etree_17_SaxParserContext__setEventFilter(struct
  *         if not self._event_filter or tag is None or tag == '*':
  *             self._matcher = None
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__buildParseEventFilter(__pyx_v_events); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(11, 178, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__buildParseEventFilter(__pyx_v_events); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 178, __pyx_L1_error)
   __pyx_v_self->_event_filter = __pyx_t_1;
 
   /* "src/lxml/saxparser.pxi":179
@@ -122757,7 +122909,7 @@ static PyObject *__pyx_f_4lxml_5etree_17_SaxParserContext__setEventFilter(struct
     __pyx_t_2 = __pyx_t_4;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_tag, __pyx_kp_s__42, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(11, 179, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_tag, __pyx_kp_s__44, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(11, 179, __pyx_L1_error)
   __pyx_t_2 = __pyx_t_4;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_2) {
@@ -122925,7 +123077,6 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
         __Pyx_DECREF(((PyObject *)__pyx_v_self->_parser));
         __pyx_v_self->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_10);
@@ -122965,7 +123116,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
     __Pyx_INCREF(__pyx_t_2);
     __pyx_t_14.__pyx_n = 1;
     __pyx_t_14.force_into_dict = 1;
-    __pyx_t_4 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_2), &__pyx_t_14); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(11, 190, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_2), &__pyx_t_14); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(11, 190, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
     /* "src/lxml/saxparser.pxi":189
@@ -123124,7 +123275,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
  * 
  */
   if (unlikely(__pyx_v_self->events_iterator->_events == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(11, 200, __pyx_L1_error)
   }
   __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 200, __pyx_L1_error)
@@ -123135,7 +123286,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
   __Pyx_INCREF(((PyObject *)__pyx_v_node));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
   PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_node));
-  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->events_iterator->_events, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(11, 200, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->events_iterator->_events, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(11, 200, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "src/lxml/saxparser.pxi":201
@@ -123219,11 +123370,11 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
  *         while self._ns_stack:
  */
     if (unlikely(__pyx_v_events == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
       __PYX_ERR(11, 206, __pyx_L1_error)
     }
     if (unlikely(__pyx_v_self->_node_stack == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "pop");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
       __PYX_ERR(11, 206, __pyx_L1_error)
     }
     __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_self->_node_stack); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 206, __pyx_L1_error)
@@ -123236,7 +123387,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
     __Pyx_GIVEREF(__pyx_t_1);
     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_events, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(11, 206, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_events, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(11, 206, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
     /* "src/lxml/saxparser.pxi":207
@@ -123246,7 +123397,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
  *         while self._ns_stack:
  *             _pushSaxNsEndEvents(self)
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_self); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(11, 207, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(11, 207, __pyx_L1_error)
   }
 
   /* "src/lxml/saxparser.pxi":208
@@ -123267,7 +123418,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
  * 
  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_self); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(11, 209, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(11, 209, __pyx_L1_error)
   }
 
   /* "src/lxml/saxparser.pxi":203
@@ -123581,7 +123732,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(11, 238, __pyx_L1_error)
   }
-  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_events); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(11, 238, __pyx_L1_error)
+  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_events); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(11, 238, __pyx_L1_error)
   __pyx_t_4 = (((__pyx_v_event_index * 2) >= __pyx_t_5) != 0);
   __pyx_t_3 = __pyx_t_4;
   __pyx_L4_bool_binop_done:;
@@ -123640,7 +123791,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
       __PYX_ERR(11, 243, __pyx_L1_error)
     }
-    __pyx_t_5 = PyList_GET_SIZE(__pyx_v_events); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(11, 243, __pyx_L1_error)
+    __pyx_t_5 = PyList_GET_SIZE(__pyx_v_events); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(11, 243, __pyx_L1_error)
     __pyx_t_3 = ((__pyx_v_event_index >= __pyx_t_5) != 0);
     if (__pyx_t_3) {
 
@@ -123808,7 +123959,7 @@ static int __pyx_f_4lxml_5etree__appendNsEvents(struct __pyx_obj_4lxml_5etree__S
  *     return 0
  */
     if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
       __PYX_ERR(11, 256, __pyx_L1_error)
     }
     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 256, __pyx_L1_error)
@@ -123819,7 +123970,7 @@ static int __pyx_f_4lxml_5etree__appendNsEvents(struct __pyx_obj_4lxml_5etree__S
     __Pyx_INCREF(__pyx_v_ns_tuple);
     __Pyx_GIVEREF(__pyx_v_ns_tuple);
     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ns_tuple);
-    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(11, 256, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(11, 256, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "src/lxml/saxparser.pxi":257
@@ -124008,7 +124159,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  *         context._origSaxStart(c_ctxt, c_localname, c_prefix, c_namespace,
  *                               c_nb_namespaces, c_namespaces, c_nb_attributes,
  */
-          __pyx_t_7 = __pyx_f_4lxml_5etree__appendNsEvents(__pyx_v_context, __pyx_v_c_nb_namespaces, __pyx_v_c_namespaces); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(11, 276, __pyx_L9_error)
+          __pyx_t_7 = __pyx_f_4lxml_5etree__appendNsEvents(__pyx_v_context, __pyx_v_c_nb_namespaces, __pyx_v_c_namespaces); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 276, __pyx_L9_error)
 
           /* "src/lxml/saxparser.pxi":274
  *     context = <_SaxParserContext>c_ctxt._private
@@ -124074,12 +124225,12 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  *                                     PARSE_EVENT_FILTER_START):
  */
           if (unlikely(__pyx_v_context->_ns_stack == Py_None)) {
-            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
             __PYX_ERR(11, 284, __pyx_L9_error)
           }
           __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_c_nb_namespaces); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 284, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_3);
-          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_context->_ns_stack, __pyx_t_3); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(11, 284, __pyx_L9_error)
+          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_context->_ns_stack, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(11, 284, __pyx_L9_error)
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
           /* "src/lxml/saxparser.pxi":283
@@ -124108,7 +124259,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  *                                c_localname, None)
  *     except:
  */
-          __pyx_t_7 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, __pyx_v_c_namespace, __pyx_v_c_localname, Py_None); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(11, 287, __pyx_L9_error)
+          __pyx_t_7 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, __pyx_v_c_namespace, __pyx_v_c_localname, Py_None); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 287, __pyx_L9_error)
 
           /* "src/lxml/saxparser.pxi":285
  *         if context._event_filter & PARSE_EVENT_FILTER_END_NS:
@@ -124132,7 +124283,6 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
       /* "src/lxml/saxparser.pxi":289
@@ -124171,14 +124321,12 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  *         if (c_nb_namespaces and
  *                 context._event_filter & PARSE_EVENT_FILTER_START_NS):
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -124218,7 +124366,6 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
         goto __pyx_L23_return;
       }
       __pyx_L23_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_11);
         __Pyx_XGIVEREF(__pyx_t_12);
@@ -124404,7 +124551,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  *         if c_nb_defaulted > 0:
  *             # only add default attributes if we asked for them
  */
-          __pyx_t_7 = __pyx_f_4lxml_5etree__appendNsEvents(__pyx_v_context, __pyx_v_c_nb_namespaces, __pyx_v_c_namespaces); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(11, 310, __pyx_L9_error)
+          __pyx_t_7 = __pyx_f_4lxml_5etree__appendNsEvents(__pyx_v_context, __pyx_v_c_nb_namespaces, __pyx_v_c_namespaces); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 310, __pyx_L9_error)
 
           /* "src/lxml/saxparser.pxi":308
  *     context = <_SaxParserContext>c_ctxt._private
@@ -124500,7 +124647,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  *                 name = _namespacedNameFromNsName(
  */
         /*else*/ {
-          __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 318, __pyx_L9_error)
+          __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 318, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_3);
           __pyx_v_attrib = __pyx_t_3;
           __pyx_t_3 = 0;
@@ -124641,7 +124788,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  *                 prefix = funicodeOrNone(c_namespaces[0])
  */
         /*else*/ {
-          __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 332, __pyx_L9_error)
+          __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 332, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_3);
           __pyx_v_nsmap = __pyx_t_3;
           __pyx_t_3 = 0;
@@ -124734,12 +124881,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  *                                     PARSE_EVENT_FILTER_START):
  */
           if (unlikely(__pyx_v_context->_ns_stack == Py_None)) {
-            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
             __PYX_ERR(11, 343, __pyx_L9_error)
           }
           __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_c_nb_namespaces); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 343, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_9);
-          __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_context->_ns_stack, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(11, 343, __pyx_L9_error)
+          __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_context->_ns_stack, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(11, 343, __pyx_L9_error)
           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
           /* "src/lxml/saxparser.pxi":342
@@ -124768,7 +124915,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  *                                c_localname, element)
  *     except:
  */
-          __pyx_t_7 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, __pyx_v_c_namespace, __pyx_v_c_localname, __pyx_v_element); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(11, 346, __pyx_L9_error)
+          __pyx_t_7 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, __pyx_v_c_namespace, __pyx_v_c_localname, __pyx_v_element); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 346, __pyx_L9_error)
 
           /* "src/lxml/saxparser.pxi":344
  *         if context._event_filter & PARSE_EVENT_FILTER_END_NS:
@@ -124792,7 +124939,6 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
 
@@ -124832,14 +124978,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  *         if (c_nb_namespaces and
  *                 context._event_filter & PARSE_EVENT_FILTER_START_NS):
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -124879,7 +125023,6 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
         goto __pyx_L31_return;
       }
       __pyx_L31_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_13);
@@ -125074,7 +125217,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-          __pyx_t_7 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, NULL, __pyx_v_c_name, Py_None); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(11, 366, __pyx_L9_error)
+          __pyx_t_7 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, NULL, __pyx_v_c_name, Py_None); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 366, __pyx_L9_error)
 
           /* "src/lxml/saxparser.pxi":364
  *         if c_ctxt.html:
@@ -125098,7 +125241,6 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
       /* "src/lxml/saxparser.pxi":367
@@ -125137,14 +125279,12 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
  *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
  *         if c_ctxt.html:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -125184,7 +125324,6 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
         goto __pyx_L19_return;
       }
       __pyx_L19_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -125360,7 +125499,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
  *                 name = funicode(c_attributes[0])
  */
         /*else*/ {
-          __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 383, __pyx_L9_error)
+          __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 383, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_3);
           __pyx_v_attrib = __pyx_t_3;
           __pyx_t_3 = 0;
@@ -125463,7 +125602,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-          __pyx_t_9 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, NULL, __pyx_v_c_name, __pyx_v_element); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(11, 393, __pyx_L9_error)
+          __pyx_t_9 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, NULL, __pyx_v_c_name, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(11, 393, __pyx_L9_error)
 
           /* "src/lxml/saxparser.pxi":391
  *             context, c_ctxt, funicode(c_name),
@@ -125487,7 +125626,6 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -125528,14 +125666,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
  *         if c_attributes is NULL:
  *             attrib = IMMUTABLE_EMPTY_MAPPING
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -125575,7 +125711,6 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
         goto __pyx_L21_return;
       }
       __pyx_L21_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -125885,7 +126020,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  *                 context._event_filter & PARSE_EVENT_FILTER_END):
  */
       if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(11, 422, __pyx_L1_error)
       }
       __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 422, __pyx_L1_error)
@@ -125896,7 +126031,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
       __Pyx_INCREF(__pyx_v_node);
       __Pyx_GIVEREF(__pyx_v_node);
       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_node);
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(11, 422, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(11, 422, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
       /* "src/lxml/saxparser.pxi":421
@@ -125951,10 +126086,10 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  * 
  */
       if (unlikely(__pyx_v_context->_node_stack == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(11, 425, __pyx_L1_error)
       }
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_context->_node_stack, __pyx_v_node); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(11, 425, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_context->_node_stack, __pyx_v_node); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(11, 425, __pyx_L1_error)
 
       /* "src/lxml/saxparser.pxi":423
  *         if context._event_filter & PARSE_EVENT_FILTER_START:
@@ -126181,7 +126316,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
  *         _pushSaxNsEndEvents(context)
  *     except:
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_context, __pyx_v_c_namespace, __pyx_v_c_localname, __pyx_v_node); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(11, 443, __pyx_L9_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_context, __pyx_v_c_namespace, __pyx_v_c_localname, __pyx_v_node); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(11, 443, __pyx_L9_error)
 
         /* "src/lxml/saxparser.pxi":444
  *             node = None
@@ -126190,7 +126325,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_context); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(11, 444, __pyx_L9_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_context); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(11, 444, __pyx_L9_error)
 
         /* "src/lxml/saxparser.pxi":436
  *         return
@@ -126205,7 +126340,6 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
@@ -126245,14 +126379,12 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
  *         if context._target is not None:
  *             node = context._target._handleSaxEnd(
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -126292,7 +126424,6 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
         goto __pyx_L18_return;
       }
       __pyx_L18_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -126494,7 +126625,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_context, NULL, __pyx_v_c_name, __pyx_v_node); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(11, 462, __pyx_L9_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_context, NULL, __pyx_v_c_name, __pyx_v_node); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(11, 462, __pyx_L9_error)
 
         /* "src/lxml/saxparser.pxi":456
  *         return
@@ -126509,7 +126640,6 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
@@ -126549,14 +126679,12 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
  *         if context._target is not None:
  *             node = context._target._handleSaxEnd(funicode(c_name))
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -126596,7 +126724,6 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
         goto __pyx_L18_return;
       }
       __pyx_L18_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -126666,7 +126793,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  *     return 0
  */
     if (unlikely(__pyx_v_context->_ns_stack == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "pop");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
       __PYX_ERR(11, 475, __pyx_L1_error)
     }
     __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_context->_ns_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 475, __pyx_L1_error)
@@ -126684,12 +126811,12 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  * 
  */
       if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(11, 476, __pyx_L1_error)
       }
       __pyx_t_2 = __pyx_v_4lxml_5etree_NS_END_EVENT;
       __Pyx_INCREF(__pyx_t_2);
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_2); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(11, 476, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(11, 476, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     }
 
@@ -126813,7 +126940,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
  *     return 0
  */
         if (unlikely(__pyx_v_context->_node_stack == Py_None)) {
-          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "pop");
+          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
           __PYX_ERR(11, 487, __pyx_L1_error)
         }
         __pyx_t_4 = __Pyx_PyList_Pop(__pyx_v_context->_node_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 487, __pyx_L1_error)
@@ -126838,7 +126965,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
  * 
  */
       if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(11, 488, __pyx_L1_error)
       }
       __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 488, __pyx_L1_error)
@@ -126849,7 +126976,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
       __Pyx_INCREF(__pyx_v_node);
       __Pyx_GIVEREF(__pyx_v_node);
       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_node);
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(11, 488, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(11, 488, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
       /* "src/lxml/saxparser.pxi":484
@@ -127019,7 +127146,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
  *             c_data[:data_len].decode('utf8'))
  *     except:
  */
-        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxData(__pyx_v_context->_target, __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(11, 499, __pyx_L9_error)
+        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxData(__pyx_v_context->_target, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 499, __pyx_L9_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
         /* "src/lxml/saxparser.pxi":498
@@ -127035,7 +127162,6 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
       /* "src/lxml/saxparser.pxi":501
@@ -127074,14 +127200,12 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
  *         context._target._handleSaxData(
  *             c_data[:data_len].decode('utf8'))
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -127121,7 +127245,6 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
         goto __pyx_L17_return;
       }
       __pyx_L17_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -127293,7 +127416,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
  *             funicodeOrNone(c_name),
  *             funicodeOrNone(c_public),
  */
-        __pyx_t_9 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxDoctype(__pyx_v_context->_target, __pyx_t_3, __pyx_t_7, __pyx_t_8); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(11, 516, __pyx_L9_error)
+        __pyx_t_9 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxDoctype(__pyx_v_context->_target, __pyx_t_3, __pyx_t_7, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(11, 516, __pyx_L9_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -127311,7 +127434,6 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -127352,14 +127474,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
  *         context._target._handleSaxDoctype(
  *             funicodeOrNone(c_name),
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -127399,7 +127519,6 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
         goto __pyx_L17_return;
       }
       __pyx_L17_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -127562,7 +127681,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->startDocument(__pyx_v_context, __pyx_v_c_doc); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(11, 534, __pyx_L9_error)
+        __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->startDocument(__pyx_v_context, __pyx_v_c_doc); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(11, 534, __pyx_L9_error)
 
         /* "src/lxml/saxparser.pxi":533
  *     context._origSaxStartDocument(ctxt)
@@ -127577,7 +127696,6 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
       /* "src/lxml/saxparser.pxi":535
@@ -127616,14 +127734,12 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
  *         context.startDocument(c_doc)
  *     except:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_XGIVEREF(__pyx_t_7);
       __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_XGIVEREF(__pyx_t_7);
@@ -127663,7 +127779,6 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
         goto __pyx_L17_return;
       }
       __pyx_L17_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_11);
         __Pyx_XGIVEREF(__pyx_t_12);
@@ -127851,7 +127966,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPI(void *__pyx_v_ctxt, const xmlChar
  *         context._handleSaxException(c_ctxt)
  */
           if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
-            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
             __PYX_ERR(11, 553, __pyx_L9_error)
           }
           __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 553, __pyx_L9_error)
@@ -127862,7 +127977,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPI(void *__pyx_v_ctxt, const xmlChar
           __Pyx_INCREF(__pyx_v_pi);
           __Pyx_GIVEREF(__pyx_v_pi);
           PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_pi);
-          __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_8); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(11, 553, __pyx_L9_error)
+          __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(11, 553, __pyx_L9_error)
           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
           /* "src/lxml/saxparser.pxi":552
@@ -127887,7 +128002,6 @@ static void __pyx_f_4lxml_5etree__handleSaxPI(void *__pyx_v_ctxt, const xmlChar
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -127928,14 +128042,12 @@ static void __pyx_f_4lxml_5etree__handleSaxPI(void *__pyx_v_ctxt, const xmlChar
  *         pi = context._target._handleSaxPi(
  *             funicodeOrNone(c_target),
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -127975,7 +128087,6 @@ static void __pyx_f_4lxml_5etree__handleSaxPI(void *__pyx_v_ctxt, const xmlChar
         goto __pyx_L18_return;
       }
       __pyx_L18_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -128165,7 +128276,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->pushEvent(__pyx_v_context, __pyx_n_s_pi, __pyx_v_c_node); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(11, 572, __pyx_L10_error)
+        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->pushEvent(__pyx_v_context, __pyx_n_s_pi, __pyx_v_c_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 572, __pyx_L10_error)
 
         /* "src/lxml/saxparser.pxi":571
  *     if c_node is NULL:
@@ -128180,7 +128291,6 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L15_try_end;
       __pyx_L10_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
       /* "src/lxml/saxparser.pxi":573
@@ -128219,14 +128329,12 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
  *         context.pushEvent('pi', c_node)
  *     except:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L8_error;
       __pyx_L11_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -128266,7 +128374,6 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
         goto __pyx_L18_return;
       }
       __pyx_L18_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -128435,7 +128542,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
  *         context._handleSaxException(c_ctxt)
  */
           if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
-            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
             __PYX_ERR(11, 588, __pyx_L9_error)
           }
           __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 588, __pyx_L9_error)
@@ -128446,7 +128553,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
           __Pyx_INCREF(__pyx_v_comment);
           __Pyx_GIVEREF(__pyx_v_comment);
           PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_comment);
-          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_7); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(11, 588, __pyx_L9_error)
+          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(11, 588, __pyx_L9_error)
           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
           /* "src/lxml/saxparser.pxi":587
@@ -128471,7 +128578,6 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L14_try_end;
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
@@ -128511,14 +128617,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
  *         comment = context._target._handleSaxComment(funicodeOrEmpty(c_data))
  *         if context._event_filter & PARSE_EVENT_FILTER_COMMENT:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L7_error;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -128558,7 +128662,6 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
         goto __pyx_L18_return;
       }
       __pyx_L18_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -128748,7 +128851,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->pushEvent(__pyx_v_context, __pyx_n_s_comment, __pyx_v_c_node); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(11, 606, __pyx_L10_error)
+        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->pushEvent(__pyx_v_context, __pyx_n_s_comment, __pyx_v_c_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 606, __pyx_L10_error)
 
         /* "src/lxml/saxparser.pxi":605
  *     if c_node is NULL:
@@ -128763,7 +128866,6 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L15_try_end;
       __pyx_L10_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
       /* "src/lxml/saxparser.pxi":607
@@ -128802,14 +128904,12 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
  *         context.pushEvent('comment', c_node)
  *     except:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
       goto __pyx_L8_error;
       __pyx_L11_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_XGIVEREF(__pyx_t_6);
@@ -128849,7 +128949,6 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
         goto __pyx_L18_return;
       }
       __pyx_L18_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -129453,7 +129552,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
  *         if self._factory is not None:
  *             self._last = self._factory(tag, attrib)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(11, 675, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 675, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":676
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
@@ -129552,7 +129651,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(11, 679, __pyx_L1_error)
       __pyx_t_5 = ((PyObject *)__pyx_v_self->_last);
       __Pyx_INCREF(__pyx_t_5);
-      __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_4), ((struct LxmlElement *)__pyx_t_5)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(11, 679, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_4), ((struct LxmlElement *)__pyx_t_5)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 679, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -129671,12 +129770,12 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
  *         return self._last
  */
   if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(11, 686, __pyx_L1_error)
   }
   __pyx_t_5 = ((PyObject *)__pyx_v_self->_last);
   __Pyx_INCREF(__pyx_t_5);
-  __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_element_stack, __pyx_t_5); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(11, 686, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_element_stack, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(11, 686, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "src/lxml/saxparser.pxi":687
@@ -129746,7 +129845,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(struct __pyx_o
  *         self._last = self._element_stack_pop()
  *         self._in_tail = 1
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(11, 692, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 692, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":693
  *     cdef _handleSaxEnd(self, tag):
@@ -129845,10 +129944,10 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(struct __pyx_obj_4l
  *     @cython.final
  */
   if (unlikely(__pyx_v_self->_data == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(11, 699, __pyx_L1_error)
   }
-  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_data, __pyx_v_data); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(11, 699, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_data, __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 699, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":698
  * 
@@ -129895,7 +129994,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
  *         self._last = ProcessingInstruction(target, data)
  *         if self._element_stack:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(11, 703, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 703, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":704
  *     cdef _handleSaxPi(self, target, data):
@@ -129984,7 +130083,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
     if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(11, 706, __pyx_L1_error)
     __pyx_t_3 = ((PyObject *)__pyx_v_self->_last);
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_2), ((struct LxmlElement *)__pyx_t_3)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(11, 706, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_2), ((struct LxmlElement *)__pyx_t_3)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 706, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
@@ -130066,7 +130165,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
  *         self._last = Comment(comment)
  *         if self._element_stack:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(11, 712, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 712, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":713
  *     cdef _handleSaxComment(self, comment):
@@ -130153,7 +130252,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
     if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(11, 715, __pyx_L1_error)
     __pyx_t_3 = ((PyObject *)__pyx_v_self->_last);
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_2), ((struct LxmlElement *)__pyx_t_3)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(11, 715, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_2), ((struct LxmlElement *)__pyx_t_3)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 715, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
@@ -130338,7 +130437,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_4data(struct __pyx_obj_4lxm
  * 
  *     def start(self, tag, attrs, nsmap=None):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_data); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(11, 737, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 737, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":731
  *         return self._last
@@ -131169,7 +131268,7 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
  */
           __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arguments, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 42, __pyx_L10_error)
           __Pyx_GOTREF(__pyx_t_4);
-          __pyx_t_13 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(12, 42, __pyx_L10_error)
+          __pyx_t_13 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(12, 42, __pyx_L10_error)
           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
           __pyx_t_5 = ((__pyx_t_13 > 3) != 0);
           if (!__pyx_t_5) {
@@ -131217,7 +131316,6 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         goto __pyx_L15_try_end;
         __pyx_L10_error:;
-        __Pyx_PyThreadState_assign
         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -131245,14 +131343,12 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
  *                 arguments = inspect_getargspec(self._target_start)
  *                 if len(arguments[0]) > 3 or arguments[1] is not None:
  */
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
         goto __pyx_L5_except_error;
         __pyx_L11_exception_handled:;
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_7);
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
@@ -131265,7 +131361,6 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "src/lxml/parsertarget.pxi":37
@@ -131290,14 +131385,12 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
  *             self._target_start = target.start
  *             if self._target_start is not None:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L4_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -131378,7 +131471,6 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     goto __pyx_L24_try_end;
     __pyx_L19_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -131406,14 +131498,12 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
  *             self._target_end = target.end
  *             if self._target_end is not None:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
     goto __pyx_L1_error;
     __pyx_L20_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_1);
@@ -131494,7 +131584,6 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L31_try_end;
     __pyx_L26_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -131522,14 +131611,12 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
  *             self._target_data = target.data
  *             if self._target_data is not None:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L27_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -131610,7 +131697,6 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     goto __pyx_L38_try_end;
     __pyx_L33_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -131638,14 +131724,12 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
  *             self._target_doctype = target.doctype
  *             if self._target_doctype is not None:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
     goto __pyx_L1_error;
     __pyx_L34_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_1);
@@ -131726,7 +131810,6 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L45_try_end;
     __pyx_L40_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -131754,14 +131837,12 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
  *             self._target_pi = target.pi
  *             if self._target_pi is not None:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L41_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -131842,7 +131923,6 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     goto __pyx_L52_try_end;
     __pyx_L47_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -131870,14 +131950,12 @@ static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___cinit__(struct __pyx
  *             self._target_comment = target.comment
  *             if self._target_comment is not None:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
     goto __pyx_L1_error;
     __pyx_L48_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_1);
@@ -132633,7 +132711,7 @@ static int __pyx_f_4lxml_5etree_20_TargetParserContext__setTarget(struct __pyx_o
  *             target = _PythonSaxParserTarget(target)
  *         self._setSaxParserTarget(target)
  */
-  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_target, __pyx_n_u_dict); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(12, 109, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_target, __pyx_n_u_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(12, 109, __pyx_L1_error)
   __pyx_t_2 = (__pyx_t_3 != 0);
   __pyx_t_1 = __pyx_t_2;
   __pyx_L4_bool_binop_done:;
@@ -132752,7 +132830,7 @@ static struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_20_Tar
  */
   __pyx_t_1 = __pyx_v_self->_python_target;
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_20_TargetParserContext__setTarget(__pyx_v_context, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(12, 117, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_20_TargetParserContext__setTarget(__pyx_v_context, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 117, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "src/lxml/parsertarget.pxi":118
@@ -132974,7 +133052,7 @@ static PyObject *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResult(
  *             if not self._c_ctxt.wellFormed and not recover:
  *                 _raiseParseError(self._c_ctxt, filename, self._error_log)
  */
-        __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self)); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(12, 135, __pyx_L3_error)
+        __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(12, 135, __pyx_L3_error)
 
         /* "src/lxml/parsertarget.pxi":133
  *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER
@@ -133012,7 +133090,7 @@ static PyObject *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResult(
  */
         __pyx_t_7 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._error_log);
         __Pyx_INCREF(__pyx_t_7);
-        __pyx_t_5 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_self->__pyx_base.__pyx_base._c_ctxt, __pyx_v_filename, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_7)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(12, 137, __pyx_L3_error)
+        __pyx_t_5 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_self->__pyx_base.__pyx_base._c_ctxt, __pyx_v_filename, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_7)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(12, 137, __pyx_L3_error)
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
         /* "src/lxml/parsertarget.pxi":136
@@ -133037,7 +133115,6 @@ static PyObject *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResult(
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
     /* "src/lxml/parsertarget.pxi":138
@@ -133136,7 +133213,6 @@ static PyObject *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResult(
           __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
           goto __pyx_L23_try_end;
           __pyx_L16_error:;
-          __Pyx_PyThreadState_assign
           __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
           __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
           __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -133153,7 +133229,6 @@ static PyObject *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResult(
             goto __pyx_L17_exception_handled;
           }
           __pyx_L17_exception_handled:;
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_13);
           __Pyx_XGIVEREF(__pyx_t_14);
           __Pyx_XGIVEREF(__pyx_t_15);
@@ -133243,7 +133318,6 @@ static PyObject *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResult(
  *             if self._has_raised():
  *                 self._cleanupTargetParserContext(result)
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -133417,7 +133491,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResultDoc
  *             if not self._c_ctxt.wellFormed and not recover:
  *                 _raiseParseError(self._c_ctxt, filename, self._error_log)
  */
-      __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(12, 159, __pyx_L6_error)
+      __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(12, 159, __pyx_L6_error)
 
       /* "src/lxml/parsertarget.pxi":160
  *             self._cleanupTargetParserContext(result)
@@ -133446,7 +133520,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResultDoc
  */
         __pyx_t_7 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._error_log);
         __Pyx_INCREF(__pyx_t_7);
-        __pyx_t_6 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_self->__pyx_base.__pyx_base._c_ctxt, __pyx_v_filename, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_7)); if (unlikely(__pyx_t_6 == 0)) __PYX_ERR(12, 161, __pyx_L6_error)
+        __pyx_t_6 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_self->__pyx_base.__pyx_base._c_ctxt, __pyx_v_filename, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_7)); if (unlikely(__pyx_t_6 == ((int)0))) __PYX_ERR(12, 161, __pyx_L6_error)
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
         /* "src/lxml/parsertarget.pxi":160
@@ -133471,7 +133545,6 @@ static xmlDoc *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResultDoc
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L11_try_end;
     __pyx_L6_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
     /* "src/lxml/parsertarget.pxi":162
@@ -133570,7 +133643,6 @@ static xmlDoc *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResultDoc
           __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
           goto __pyx_L25_try_end;
           __pyx_L18_error:;
-          __Pyx_PyThreadState_assign
           __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
           __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
           __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -133587,7 +133659,6 @@ static xmlDoc *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResultDoc
             goto __pyx_L19_exception_handled;
           }
           __pyx_L19_exception_handled:;
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_13);
           __Pyx_XGIVEREF(__pyx_t_14);
           __Pyx_XGIVEREF(__pyx_t_15);
@@ -133677,7 +133748,6 @@ static xmlDoc *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResultDoc
  *             self._cleanupTargetParserContext(result)
  *             self._raise_if_stored()
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
@@ -134553,7 +134623,6 @@ static PyObject *__pyx_f_4lxml_5etree__textToString(xmlNode *__pyx_v_c_node, PyO
       {
         xmlBufferFree(__pyx_v_c_buffer);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_14);
@@ -134683,7 +134752,7 @@ static PyObject *__pyx_f_4lxml_5etree__tostring(struct LxmlElement *__pyx_v_elem
  *     c_method = _findOutputMethod(method)
  *     if c_method == OUTPUT_METHOD_TEXT:
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(7, 98, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 98, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":99
  *         return None
@@ -134692,7 +134761,7 @@ static PyObject *__pyx_f_4lxml_5etree__tostring(struct LxmlElement *__pyx_v_elem
  *     if c_method == OUTPUT_METHOD_TEXT:
  *         return _textToString(element._c_node, encoding, with_tail)
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(7, 99, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 99, __pyx_L1_error)
   __pyx_v_c_method = __pyx_t_3;
 
   /* "src/lxml/serializer.pxi":100
@@ -134892,7 +134961,7 @@ static PyObject *__pyx_f_4lxml_5etree__tostring(struct LxmlElement *__pyx_v_elem
  */
       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_encoding, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 117, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 117, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 117, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_6);
@@ -135228,7 +135297,6 @@ static PyObject *__pyx_f_4lxml_5etree__tostring(struct LxmlElement *__pyx_v_elem
       {
         __pyx_v_error_result = xmlOutputBufferClose(__pyx_v_c_buffer);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_14);
@@ -135381,7 +135449,7 @@ static PyObject *__pyx_f_4lxml_5etree__tostringC14N(PyObject *__pyx_v_element_or
  *         doc = (<_Element>element_or_tree)._doc
  *         c_doc = _plainFakeRootDoc(doc._c_doc, (<_Element>element_or_tree)._c_node, 0)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_element_or_tree)); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(7, 162, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_element_or_tree)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 162, __pyx_L1_error)
 
     /* "src/lxml/serializer.pxi":163
  *     if isinstance(element_or_tree, _Element):
@@ -135402,7 +135470,7 @@ static PyObject *__pyx_f_4lxml_5etree__tostringC14N(PyObject *__pyx_v_element_or
  *     else:
  *         doc = _documentOrRaise(element_or_tree)
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__plainFakeRootDoc(__pyx_v_doc->_c_doc, ((struct LxmlElement *)__pyx_v_element_or_tree)->_c_node, 0); if (unlikely(__pyx_t_5 == NULL)) __PYX_ERR(7, 164, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__plainFakeRootDoc(__pyx_v_doc->_c_doc, ((struct LxmlElement *)__pyx_v_element_or_tree)->_c_node, 0); if (unlikely(__pyx_t_5 == ((xmlDoc *)NULL))) __PYX_ERR(7, 164, __pyx_L1_error)
     __pyx_v_c_doc = __pyx_t_5;
 
     /* "src/lxml/serializer.pxi":161
@@ -135435,7 +135503,7 @@ static PyObject *__pyx_f_4lxml_5etree__tostringC14N(PyObject *__pyx_v_element_or
  *         c_doc = doc._c_doc
  * 
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__assertValidDoc(__pyx_v_doc); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(7, 167, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__assertValidDoc(__pyx_v_doc); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 167, __pyx_L1_error)
 
     /* "src/lxml/serializer.pxi":168
  *         doc = _documentOrRaise(element_or_tree)
@@ -135458,7 +135526,7 @@ static PyObject *__pyx_f_4lxml_5etree__tostringC14N(PyObject *__pyx_v_element_or
  */
   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_inclusive_ns_prefixes); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 170, __pyx_L1_error)
   if (__pyx_t_2) {
-    __pyx_t_7 = __pyx_f_4lxml_5etree__convert_ns_prefixes(__pyx_v_c_doc->dict, __pyx_v_inclusive_ns_prefixes); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(7, 170, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__convert_ns_prefixes(__pyx_v_c_doc->dict, __pyx_v_inclusive_ns_prefixes); if (unlikely(__pyx_t_7 == ((xmlChar **)NULL))) __PYX_ERR(7, 170, __pyx_L1_error)
     __pyx_t_6 = __pyx_t_7;
   } else {
     __pyx_t_6 = NULL;
@@ -135679,7 +135747,6 @@ static PyObject *__pyx_f_4lxml_5etree__tostringC14N(PyObject *__pyx_v_element_or
       {
         xmlFree(__pyx_v_c_buffer);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_14);
@@ -139906,7 +139973,7 @@ static int __pyx_pf_4lxml_5etree_15_FilelikeWriter___cinit__(struct __pyx_obj_4l
  *             self._close_filelike = filelike.close
  *         elif close:
  */
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 622, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 622, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fileobj, __pyx_v_filelike) < 0) __PYX_ERR(7, 622, __pyx_L1_error)
     if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_n_s_wb) < 0) __PYX_ERR(7, 622, __pyx_L1_error)
@@ -140325,7 +140392,6 @@ static int __pyx_f_4lxml_5etree_15_FilelikeWriter_write(struct __pyx_obj_4lxml_5
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       goto __pyx_L11_try_end;
       __pyx_L6_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -140376,14 +140442,12 @@ static int __pyx_f_4lxml_5etree_15_FilelikeWriter_write(struct __pyx_obj_4lxml_5
  *             if self._filelike is None:
  *                 raise IOError, u"File is already closed"
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_1);
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
       goto __pyx_L4_error;
       __pyx_L7_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_1);
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
@@ -140426,7 +140490,6 @@ static int __pyx_f_4lxml_5etree_15_FilelikeWriter_write(struct __pyx_obj_4lxml_5
         goto __pyx_L15_return;
       }
       __pyx_L15_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -140581,7 +140644,6 @@ static int __pyx_f_4lxml_5etree_15_FilelikeWriter_close(struct __pyx_obj_4lxml_5
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       goto __pyx_L11_try_end;
       __pyx_L6_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -140631,14 +140693,12 @@ static int __pyx_f_4lxml_5etree_15_FilelikeWriter_close(struct __pyx_obj_4lxml_5
  *             if self._close_filelike is not None:
  *                 self._close_filelike()
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_1);
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
       goto __pyx_L4_error;
       __pyx_L7_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_1);
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
@@ -140680,7 +140740,6 @@ static int __pyx_f_4lxml_5etree_15_FilelikeWriter_close(struct __pyx_obj_4lxml_5
         goto __pyx_L15_return;
       }
       __pyx_L15_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_10);
@@ -140842,7 +140901,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelike(PyObject *__pyx_v_f, struct Lx
  *     if c_method == OUTPUT_METHOD_TEXT:
  *         data = _textToString(element._c_node, encoding, with_tail)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(7, 685, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 685, __pyx_L1_error)
   __pyx_v_c_method = __pyx_t_1;
 
   /* "src/lxml/serializer.pxi":686
@@ -140913,7 +140972,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelike(PyObject *__pyx_v_f, struct Lx
  *             try:
  *                 gzip_file.write(data)
  */
-      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 691, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 691, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fileobj, __pyx_v_bytes_out) < 0) __PYX_ERR(7, 691, __pyx_L1_error)
       if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mode, __pyx_n_s_wb) < 0) __PYX_ERR(7, 691, __pyx_L1_error)
@@ -141072,7 +141131,6 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelike(PyObject *__pyx_v_f, struct Lx
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
           }
-          __Pyx_PyThreadState_assign
           if (PY_MAJOR_VERSION >= 3) {
             __Pyx_XGIVEREF(__pyx_t_12);
             __Pyx_XGIVEREF(__pyx_t_13);
@@ -141087,7 +141145,6 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelike(PyObject *__pyx_v_f, struct Lx
           __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
           goto __pyx_L1_error;
           __pyx_L9_error:;
-          __Pyx_PyThreadState_assign
           if (PY_MAJOR_VERSION >= 3) {
             __Pyx_XGIVEREF(__pyx_t_12);
             __Pyx_XGIVEREF(__pyx_t_13);
@@ -141322,7 +141379,6 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelike(PyObject *__pyx_v_f, struct Lx
             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
           }
-          __Pyx_PyThreadState_assign
           if (PY_MAJOR_VERSION >= 3) {
             __Pyx_XGIVEREF(__pyx_t_11);
             __Pyx_XGIVEREF(__pyx_t_10);
@@ -141337,7 +141393,6 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelike(PyObject *__pyx_v_f, struct Lx
           __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_1; __pyx_filename = __pyx_t_15;
           goto __pyx_L1_error;
           __pyx_L15_error:;
-          __Pyx_PyThreadState_assign
           if (PY_MAJOR_VERSION >= 3) {
             __Pyx_XGIVEREF(__pyx_t_11);
             __Pyx_XGIVEREF(__pyx_t_10);
@@ -141663,7 +141718,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelike(PyObject *__pyx_v_f, struct Lx
  *     if error_result != xmlerror.XML_ERR_OK:
  *         _raiseSerialisationError(error_result)
  */
-    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(7, 731, __pyx_L1_error)
+    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 731, __pyx_L1_error)
 
     /* "src/lxml/serializer.pxi":730
  *             write_xml_declaration, write_doctype, pretty_print, with_tail, standalone)
@@ -142063,7 +142118,7 @@ static struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_f_4lxml_5etree__crea
  *             writer = _FilelikeWriter(f, compression=c_compression, close=close)
  *             c_buffer = writer._createOutputBuffer(enchandler)
  */
-      __pyx_t_1 = __Pyx_HasAttr(__pyx_v_f, __pyx_n_s_write); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(7, 770, __pyx_L4_error)
+      __pyx_t_1 = __Pyx_HasAttr(__pyx_v_f, __pyx_n_s_write); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 770, __pyx_L4_error)
       __pyx_t_8 = (__pyx_t_1 != 0);
       if (__pyx_t_8) {
 
@@ -142079,7 +142134,7 @@ static struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_f_4lxml_5etree__crea
         __Pyx_INCREF(__pyx_v_f);
         __Pyx_GIVEREF(__pyx_v_f);
         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f);
-        __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 771, __pyx_L4_error)
+        __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 771, __pyx_L4_error)
         __Pyx_GOTREF(__pyx_t_4);
         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_c_compression); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 771, __pyx_L4_error)
         __Pyx_GOTREF(__pyx_t_3);
@@ -142103,7 +142158,7 @@ static struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_f_4lxml_5etree__crea
  *         else:
  *             raise TypeError(
  */
-        __pyx_t_9 = __pyx_f_4lxml_5etree_15_FilelikeWriter__createOutputBuffer(__pyx_v_writer, __pyx_v_enchandler); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(7, 772, __pyx_L4_error)
+        __pyx_t_9 = __pyx_f_4lxml_5etree_15_FilelikeWriter__createOutputBuffer(__pyx_v_writer, __pyx_v_enchandler); if (unlikely(__pyx_t_9 == ((xmlOutputBuffer *)NULL))) __PYX_ERR(7, 772, __pyx_L4_error)
         __pyx_v_c_buffer = __pyx_t_9;
 
         /* "src/lxml/serializer.pxi":770
@@ -142181,7 +142236,6 @@ static struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_f_4lxml_5etree__crea
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     goto __pyx_L9_try_end;
     __pyx_L4_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -142232,14 +142286,12 @@ static struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_f_4lxml_5etree__crea
  *         if _isString(f):
  *             filename8 = _encodeFilename(f)
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_XGIVEREF(__pyx_t_7);
     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
     goto __pyx_L1_error;
     __pyx_L8_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_XGIVEREF(__pyx_t_7);
@@ -142328,7 +142380,7 @@ static xmlChar **__pyx_f_4lxml_5etree__convert_ns_prefixes(xmlDict *__pyx_v_c_di
  *     # Need to allocate one extra memory block to handle last NULL entry
  *     c_ns_prefixes = <xmlChar **>python.lxml_malloc(num_ns_prefixes + 1, sizeof(xmlChar*))
  */
-  __pyx_t_1 = PyObject_Length(__pyx_v_ns_prefixes); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(7, 784, __pyx_L1_error)
+  __pyx_t_1 = PyObject_Length(__pyx_v_ns_prefixes); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(7, 784, __pyx_L1_error)
   __pyx_v_num_ns_prefixes = __pyx_t_1;
 
   /* "src/lxml/serializer.pxi":786
@@ -142432,7 +142484,7 @@ static xmlChar **__pyx_f_4lxml_5etree__convert_ns_prefixes(xmlDict *__pyx_v_c_di
           if (unlikely(!__pyx_t_8)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(7, 791, __pyx_L4_error)
             }
             break;
@@ -142465,7 +142517,7 @@ static xmlChar **__pyx_f_4lxml_5etree__convert_ns_prefixes(xmlDict *__pyx_v_c_di
           PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
           __PYX_ERR(7, 793, __pyx_L4_error)
         }
-        __pyx_t_9 = PyBytes_GET_SIZE(__pyx_v_prefix_utf); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(7, 793, __pyx_L4_error)
+        __pyx_t_9 = PyBytes_GET_SIZE(__pyx_v_prefix_utf); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(7, 793, __pyx_L4_error)
         __pyx_v_c_prefix = xmlDictExists(__pyx_v_c_dict, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_prefix_utf), __pyx_t_9);
 
         /* "src/lxml/serializer.pxi":794
@@ -142528,7 +142580,6 @@ static xmlChar **__pyx_f_4lxml_5etree__convert_ns_prefixes(xmlDict *__pyx_v_c_di
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L9_try_end;
     __pyx_L4_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
@@ -142578,7 +142629,6 @@ static xmlChar **__pyx_f_4lxml_5etree__convert_ns_prefixes(xmlDict *__pyx_v_c_di
  *         for prefix in ns_prefixes:
  *              prefix_utf = _utf8(prefix)
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
@@ -142717,7 +142767,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struc
  *     try:
  *         c_inclusive_ns_prefixes = (
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_c_base_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(7, 816, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_c_base_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_1 == ((xmlDoc *)NULL))) __PYX_ERR(7, 816, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_1;
 
   /* "src/lxml/serializer.pxi":817
@@ -142746,7 +142796,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struc
  *             if inclusive_ns_prefixes else NULL)
  * 
  */
-      __pyx_t_4 = __pyx_f_4lxml_5etree__convert_ns_prefixes(__pyx_v_c_doc->dict, __pyx_v_inclusive_ns_prefixes); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(7, 819, __pyx_L4_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__convert_ns_prefixes(__pyx_v_c_doc->dict, __pyx_v_inclusive_ns_prefixes); if (unlikely(__pyx_t_4 == ((xmlChar **)NULL))) __PYX_ERR(7, 819, __pyx_L4_error)
       __pyx_t_2 = __pyx_t_4;
     } else {
 
@@ -142853,7 +142903,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struc
  *             writer   = _FilelikeWriter(f, compression=compression)
  *             c_buffer = writer._createOutputBuffer(NULL)
  */
-    __pyx_t_3 = __Pyx_HasAttr(__pyx_v_f, __pyx_n_s_write); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(7, 829, __pyx_L4_error)
+    __pyx_t_3 = __Pyx_HasAttr(__pyx_v_f, __pyx_n_s_write); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 829, __pyx_L4_error)
     __pyx_t_6 = (__pyx_t_3 != 0);
     if (__pyx_t_6) {
 
@@ -142869,7 +142919,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struc
       __Pyx_INCREF(__pyx_v_f);
       __Pyx_GIVEREF(__pyx_v_f);
       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_f);
-      __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 830, __pyx_L4_error)
+      __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 830, __pyx_L4_error)
       __Pyx_GOTREF(__pyx_t_7);
       __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_compression); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 830, __pyx_L4_error)
       __Pyx_GOTREF(__pyx_t_8);
@@ -142889,7 +142939,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struc
  *             with writer.error_log:
  *                 bytes_count = c14n.xmlC14NDocSaveTo(
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree_15_FilelikeWriter__createOutputBuffer(__pyx_v_writer, NULL); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(7, 831, __pyx_L4_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree_15_FilelikeWriter__createOutputBuffer(__pyx_v_writer, NULL); if (unlikely(__pyx_t_9 == ((xmlOutputBuffer *)NULL))) __PYX_ERR(7, 831, __pyx_L4_error)
       __pyx_v_c_buffer = __pyx_t_9;
 
       /* "src/lxml/serializer.pxi":832
@@ -142902,7 +142952,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struc
       /*with:*/ {
         __pyx_t_10 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_writer->error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 832, __pyx_L4_error)
         __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_11 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_writer->error_log); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(7, 832, __pyx_L10_error)
+        __pyx_t_11 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_writer->error_log); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 832, __pyx_L10_error)
         /*try:*/ {
           {
             if (__pyx_t_12||__pyx_t_13||__pyx_t_14); else {/*mark used*/}
@@ -142967,7 +143017,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struc
         /*finally:*/ {
           /*normal exit:*/{
             if (__pyx_t_10) {
-              __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__68, NULL);
+              __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__70, NULL);
               __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
               if (unlikely(!__pyx_t_14)) __PYX_ERR(7, 832, __pyx_L4_error)
               __Pyx_GOTREF(__pyx_t_14);
@@ -143135,7 +143185,6 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struc
  */
         }
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_18);
@@ -143171,7 +143220,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struc
  * 
  *     if error < 0:
  */
-    __pyx_t_16 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(7, 848, __pyx_L1_error)
+    __pyx_t_16 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(7, 848, __pyx_L1_error)
 
     /* "src/lxml/serializer.pxi":847
  *             python.lxml_free(c_inclusive_ns_prefixes)
@@ -143232,7 +143281,7 @@ static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struc
  *                 message = errors[0].message
  *         raise C14NError(message)
  */
-      __pyx_t_20 = PyObject_Length(((PyObject *)__pyx_v_errors)); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(7, 854, __pyx_L1_error)
+      __pyx_t_20 = PyObject_Length(((PyObject *)__pyx_v_errors)); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(7, 854, __pyx_L1_error)
       __pyx_t_6 = (__pyx_t_20 != 0);
       if (__pyx_t_6) {
 
@@ -143919,7 +143968,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_4__exit__(struct __pyx_obj_4lxml
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":929
  *                 self.output_file = None
@@ -143976,7 +144025,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_6__aenter__(struct __pyx_obj_4lx
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct____aenter__ *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct____aenter__ *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -143988,7 +144037,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator(__pyx_CoroutineObject
   PyObject *__pyx_t_6 = NULL;
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("__aenter__", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     default: /* CPython raises the right error here */
@@ -144036,7 +144085,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator(__pyx_CoroutineObject
  *         if not hasattr(self.output_file, 'write'):
  *             raise TypeError("Output file needs an async .write() method")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 932, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 932, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -144060,7 +144109,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator(__pyx_CoroutineObject
  */
   __pyx_t_2 = __pyx_cur_scope->__pyx_v_self->output_file;
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_write); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(7, 933, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_write); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 933, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_1 = ((!(__pyx_t_3 != 0)) != 0);
   if (__pyx_t_1) {
@@ -144072,7 +144121,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator(__pyx_CoroutineObject
  *         self.async_writer = _AsyncIncrementalFileWriter(
  *             self.output_file, self.encoding, self.compresslevel,
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 934, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 934, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -144177,12 +144226,13 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator(__pyx_CoroutineObject
   __Pyx_AddTraceback("__aenter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":940
  *         return self.async_writer
@@ -144307,7 +144357,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_9__aexit__(struct __pyx_obj_4lxm
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_1___aexit__ *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_1___aexit__ *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -144318,10 +144368,10 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator1(__pyx_CoroutineObje
   PyObject *__pyx_t_5 = NULL;
   PyObject *__pyx_t_6 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("__aexit__", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
-    case 1: goto __pyx_L5_resume_from_yield;
+    case 1: goto __pyx_L5_resume_from_await;
     default: /* CPython raises the right error here */
     __Pyx_RefNannyFinishContext();
     return NULL;
@@ -144432,15 +144482,16 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator1(__pyx_CoroutineObje
     if (likely(__pyx_r)) {
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+      /* return from generator, awaiting value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
-      __pyx_L5_resume_from_yield:;
+      __pyx_L5_resume_from_await:;
       if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 944, __pyx_L1_error)
     } else {
-      PyObject* exc_type = PyErr_Occurred();
+      PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
-        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
         else __PYX_ERR(7, 944, __pyx_L1_error)
       }
     }
@@ -144506,6 +144557,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator1(__pyx_CoroutineObje
   __Pyx_AddTraceback("__aexit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -145079,7 +145131,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  */
     __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1006, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1006, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1006, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
@@ -145114,7 +145166,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  */
     __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1008, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1008, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1008, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
@@ -145439,7 +145491,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
  */
     __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1035, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1035, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1035, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
@@ -145608,7 +145660,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_8method(struct _
   if ((__pyx_t_2 != 0)) {
     __pyx_t_1 = __pyx_v_self->_method;
   } else {
-    __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(7, 1050, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 1050, __pyx_L1_error)
     __pyx_t_1 = __pyx_t_3;
   }
   __pyx_v_c_method = __pyx_t_1;
@@ -145871,7 +145923,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         if (unlikely(!__pyx_t_1)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(7, 1062, __pyx_L1_error)
           }
           break;
@@ -146005,7 +146057,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         __Pyx_GIVEREF(__pyx_t_1);
         PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_1);
         __pyx_t_1 = 0;
-        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_attributes, __pyx_t_7); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(7, 1065, __pyx_L1_error)
+        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_attributes, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 1065, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
         /* "src/lxml/serializer.pxi":1063
@@ -146131,7 +146183,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
       __Pyx_GIVEREF(__pyx_t_1);
       PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1);
       __pyx_t_1 = 0;
-      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_attributes, __pyx_t_8); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(7, 1069, __pyx_L1_error)
+      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_attributes, __pyx_t_8); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 1069, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -146152,7 +146204,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
  *         if nsmap:
  *             for prefix, ns in nsmap.items():
  */
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1070, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1070, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_v_reversed_nsmap = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
@@ -146227,7 +146279,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         if (unlikely(!__pyx_t_4)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(7, 1072, __pyx_L1_error)
           }
           break;
@@ -146319,7 +146371,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
  *                 reversed_nsmap[_utf8(ns)] = prefix
  *         ns, name = _getNsTag(tag)
  */
-        __pyx_t_13 = __pyx_f_4lxml_5etree__prefixValidOrRaise(__pyx_v_prefix); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(7, 1075, __pyx_L1_error)
+        __pyx_t_13 = __pyx_f_4lxml_5etree__prefixValidOrRaise(__pyx_v_prefix); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(7, 1075, __pyx_L1_error)
 
         /* "src/lxml/serializer.pxi":1073
  *         if nsmap:
@@ -146413,7 +146465,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
   if ((__pyx_t_3 != 0)) {
     __pyx_t_13 = __pyx_v_self->_method;
   } else {
-    __pyx_t_14 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(7, 1079, __pyx_L1_error)
+    __pyx_t_14 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(7, 1079, __pyx_L1_error)
     __pyx_t_13 = __pyx_t_14;
   }
   __pyx_v_c_method = __pyx_t_13;
@@ -146525,7 +146577,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(stru
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
       __PYX_ERR(7, 1085, __pyx_L1_error)
     }
-    __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_prefix); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(7, 1085, __pyx_L1_error)
+    __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_prefix); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(7, 1085, __pyx_L1_error)
     xmlOutputBufferWrite(__pyx_v_self->_c_out, __pyx_t_2, PyBytes_AS_STRING(__pyx_v_prefix));
 
     /* "src/lxml/serializer.pxi":1086
@@ -146557,7 +146609,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(stru
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(7, 1087, __pyx_L1_error)
   }
-  __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_name); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(7, 1087, __pyx_L1_error)
+  __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_name); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(7, 1087, __pyx_L1_error)
   xmlOutputBufferWrite(__pyx_v_self->_c_out, __pyx_t_2, PyBytes_AS_STRING(__pyx_v_name));
 
   /* "src/lxml/serializer.pxi":1083
@@ -146627,7 +146679,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
  */
     __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1091, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1091, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1091, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
@@ -146900,7 +146952,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
  * 
  */
   if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(7, 1106, __pyx_L1_error)
   }
   __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1106, __pyx_L1_error)
@@ -146917,7 +146969,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
   __Pyx_INCREF(__pyx_v_flat_namespace_map);
   __Pyx_GIVEREF(__pyx_v_flat_namespace_map);
   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_flat_namespace_map);
-  __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_element_stack, __pyx_t_5); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(7, 1106, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_element_stack, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(7, 1106, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "src/lxml/serializer.pxi":1107
@@ -147156,10 +147208,10 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
  *         if attributes:
  */
     if (unlikely(__pyx_v_new_namespaces == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "sort");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "sort");
       __PYX_ERR(7, 1118, __pyx_L1_error)
     }
-    __pyx_t_11 = PyList_Sort(__pyx_v_new_namespaces); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(7, 1118, __pyx_L1_error)
+    __pyx_t_11 = PyList_Sort(__pyx_v_new_namespaces); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 1118, __pyx_L1_error)
 
     /* "src/lxml/serializer.pxi":1119
  *         if new_namespaces:
@@ -147483,7 +147535,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
     __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1134, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1134, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1134, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
@@ -147519,10 +147571,10 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
   }
   __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1135, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 2, NULL, NULL, &__pyx_slice__76, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1135, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 2, NULL, NULL, &__pyx_slice__78, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1135, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_element_config, 0, 2, NULL, NULL, &__pyx_slice__77, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1135, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_element_config, 0, 2, NULL, NULL, &__pyx_slice__79, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1135, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1135, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -147542,7 +147594,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
     __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1136, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1136, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1136, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
@@ -147578,12 +147630,12 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  *             tree.xmlOutputBufferWrite(self._c_out, 2, '</')
  */
   if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "pop");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
     __PYX_ERR(7, 1143, __pyx_L1_error)
   }
   __pyx_t_3 = __Pyx_PyList_Pop(__pyx_v_self->_element_stack); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1143, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_3, 1, 3, NULL, NULL, &__pyx_slice__79, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1143, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_3, 1, 3, NULL, NULL, &__pyx_slice__81, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1143, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
@@ -147908,7 +147960,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
  *         while True:
  */
   if (unlikely(__pyx_v_flat_namespaces_map == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
     __PYX_ERR(7, 1162, __pyx_L1_error)
   }
   __pyx_t_3 = __Pyx_PyDict_Values(__pyx_v_flat_namespaces_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1162, __pyx_L1_error)
@@ -147969,7 +148021,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
  *                 return prefix
  */
       if (unlikely(__pyx_v_new_namespaces == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(7, 1167, __pyx_L1_error)
       }
       __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1167, __pyx_L1_error)
@@ -147983,7 +148035,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
       __Pyx_INCREF(__pyx_v_href);
       __Pyx_GIVEREF(__pyx_v_href);
       PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_href);
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(7, 1167, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 1167, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
       /* "src/lxml/serializer.pxi":1168
@@ -148104,7 +148156,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
  *         for ns, prefix in nsmap.iteritems():
  *             flat_namespaces_map[ns] = prefix
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1174, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1174, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_flat_namespaces_map = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -148118,7 +148170,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
  */
   __pyx_t_2 = 0;
   if (unlikely(__pyx_v_nsmap == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
     __PYX_ERR(7, 1175, __pyx_L1_error)
   }
   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_nsmap, 1, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1175, __pyx_L1_error)
@@ -148175,7 +148227,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
       __Pyx_INCREF(__pyx_v_ns);
       __Pyx_GIVEREF(__pyx_v_ns);
       PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_ns);
-      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(7, 1179, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 1179, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
       /* "src/lxml/serializer.pxi":1177
@@ -148207,7 +148259,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
       __Pyx_INCREF(__pyx_v_ns);
       __Pyx_GIVEREF(__pyx_v_ns);
       PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_ns);
-      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(7, 1181, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 1181, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     }
     __pyx_L5:;
@@ -148242,7 +148294,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     if (unlikely(__pyx_t_5 == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
       __PYX_ERR(7, 1184, __pyx_L1_error)
     }
     __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_t_5), 1, __pyx_n_s_iteritems, (&__pyx_t_2), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1184, __pyx_L1_error)
@@ -148488,7 +148540,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
   if ((__pyx_t_2 != 0)) {
     __pyx_t_1 = __pyx_v_self->_method;
   } else {
-    __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(7, 1199, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 1199, __pyx_L1_error)
     __pyx_t_1 = __pyx_t_3;
   }
   __pyx_v_c_method = __pyx_t_1;
@@ -148580,7 +148632,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
           __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 1205, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1205, __pyx_L1_error)
+          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1205, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_8);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_Raise(__pyx_t_8, 0, 0, 0);
@@ -148816,7 +148868,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
           PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
           __PYX_ERR(7, 1214, __pyx_L1_error)
         }
-        __pyx_t_15 = PyBytes_GET_SIZE(__pyx_v_bstring); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(7, 1214, __pyx_L1_error)
+        __pyx_t_15 = PyBytes_GET_SIZE(__pyx_v_bstring); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(7, 1214, __pyx_L1_error)
         xmlOutputBufferWrite(__pyx_v_self->_c_out, __pyx_t_15, PyBytes_AS_STRING(__pyx_v_bstring));
 
         /* "src/lxml/serializer.pxi":1211
@@ -148926,7 +148978,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
         __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1221, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 1221, __pyx_L1_error)
+        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 1221, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_11);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
@@ -149277,7 +149329,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
       __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1248, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1248, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1248, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
@@ -149312,7 +149364,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
       __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1250, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1250, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1250, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
@@ -149544,7 +149596,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(str
  *             _raiseSerialisationError(error_result)
  * 
  */
-      __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_target->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_self->_target->_exc_context); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(7, 1267, __pyx_L1_error)
+      __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_target->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_self->_target->_exc_context); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 1267, __pyx_L1_error)
 
       /* "src/lxml/serializer.pxi":1266
  *     cdef _handle_error(self, int error_result):
@@ -149775,10 +149827,10 @@ static PyObject *__pyx_pf_4lxml_5etree_16_AsyncDataWriter_2write(struct __pyx_ob
  *     def close(self):
  */
   if (unlikely(__pyx_v_self->_data == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(7, 1284, __pyx_L1_error)
   }
-  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_data, __pyx_v_data); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(7, 1284, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_data, __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 1284, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1283
  *         return data
@@ -150051,7 +150103,7 @@ static int __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(struct
  * 
  *     cdef bytes _flush(self):
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1308, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1308, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_close, Py_True) < 0) __PYX_ERR(7, 1308, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_buffered, Py_False) < 0) __PYX_ERR(7, 1308, __pyx_L1_error)
@@ -150135,7 +150187,7 @@ static PyObject *__pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(struc
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(7, 1311, __pyx_L1_error)
   }
-  __pyx_t_4 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(7, 1311, __pyx_L1_error)
+  __pyx_t_4 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(7, 1311, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_2 = ((__pyx_t_4 > __pyx_v_self->_flush_after_writes) != 0);
   __pyx_t_1 = __pyx_t_2;
@@ -150195,7 +150247,7 @@ static PyObject *__pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(struc
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":1315
  *         return None
@@ -150252,7 +150304,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_2flush(stru
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_2_flush *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_2_flush *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -150262,10 +150314,10 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator2
   int __pyx_t_4;
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("flush", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
-    case 1: goto __pyx_L5_resume_from_yield;
+    case 1: goto __pyx_L5_resume_from_await;
     default: /* CPython raises the right error here */
     __Pyx_RefNannyFinishContext();
     return NULL;
@@ -150383,15 +150435,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator2
     if (likely(__pyx_r)) {
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+      /* return from generator, awaiting value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
-      __pyx_L5_resume_from_yield:;
+      __pyx_L5_resume_from_await:;
       if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 1319, __pyx_L1_error)
     } else {
-      PyObject* exc_type = PyErr_Occurred();
+      PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
-        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
         else __PYX_ERR(7, 1319, __pyx_L1_error)
       }
     }
@@ -150425,12 +150478,13 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator2
   __Pyx_AddTraceback("flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator3(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":1321
  *             await self._async_outfile.write(data)
@@ -150565,7 +150619,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_5write_decl
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator3(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_3_write_declaration *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_3_write_declaration *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -150576,10 +150630,10 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator3
   PyObject *__pyx_t_5 = NULL;
   int __pyx_t_6;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("write_declaration", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
-    case 1: goto __pyx_L5_resume_from_yield;
+    case 1: goto __pyx_L5_resume_from_await;
     default: /* CPython raises the right error here */
     __Pyx_RefNannyFinishContext();
     return NULL;
@@ -150727,15 +150781,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator3
     if (likely(__pyx_r)) {
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+      /* return from generator, awaiting value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
-      __pyx_L5_resume_from_yield:;
+      __pyx_L5_resume_from_await:;
       if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 1325, __pyx_L1_error)
     } else {
-      PyObject* exc_type = PyErr_Occurred();
+      PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
-        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
         else __PYX_ERR(7, 1325, __pyx_L1_error)
       }
     }
@@ -150769,12 +150824,13 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator3
   __Pyx_AddTraceback("write_declaration", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator4(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":1327
  *             await self._async_outfile.write(data)
@@ -150834,7 +150890,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_8write_doct
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator4(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_4_write_doctype *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_4_write_doctype *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -150844,10 +150900,10 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator
   PyObject *__pyx_t_4 = NULL;
   int __pyx_t_5;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("write_doctype", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
-    case 1: goto __pyx_L5_resume_from_yield;
+    case 1: goto __pyx_L5_resume_from_await;
     default: /* CPython raises the right error here */
     __Pyx_RefNannyFinishContext();
     return NULL;
@@ -150990,15 +151046,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator
     if (likely(__pyx_r)) {
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+      /* return from generator, awaiting value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
-      __pyx_L5_resume_from_yield:;
+      __pyx_L5_resume_from_await:;
       if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 1331, __pyx_L1_error)
     } else {
-      PyObject* exc_type = PyErr_Occurred();
+      PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
-        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
         else __PYX_ERR(7, 1331, __pyx_L1_error)
       }
     }
@@ -151032,12 +151089,13 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator
   __Pyx_AddTraceback("write_doctype", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator5(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":1333
  *             await self._async_outfile.write(data)
@@ -151162,7 +151220,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_11write(str
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator5(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_5_write *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_5_write *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -151172,10 +151230,10 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator
   int __pyx_t_4;
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("write", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
-    case 1: goto __pyx_L5_resume_from_yield;
+    case 1: goto __pyx_L5_resume_from_await;
     default: /* CPython raises the right error here */
     __Pyx_RefNannyFinishContext();
     return NULL;
@@ -151192,7 +151250,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator
  */
   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_writer), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1334, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1334, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1334, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_with_tail, __pyx_cur_scope->__pyx_v_with_tail) < 0) __PYX_ERR(7, 1334, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pretty_print, __pyx_cur_scope->__pyx_v_pretty_print) < 0) __PYX_ERR(7, 1334, __pyx_L1_error)
@@ -151284,15 +151342,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator
     if (likely(__pyx_r)) {
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+      /* return from generator, awaiting value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
-      __pyx_L5_resume_from_yield:;
+      __pyx_L5_resume_from_await:;
       if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 1337, __pyx_L1_error)
     } else {
-      PyObject* exc_type = PyErr_Occurred();
+      PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
-        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
         else __PYX_ERR(7, 1337, __pyx_L1_error)
       }
     }
@@ -151326,6 +151385,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator
   __Pyx_AddTraceback("write", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -151630,7 +151690,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_16element(s
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator6(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":1346
  *         return _AsyncFileWriterElement(element_writer, self)
@@ -151698,7 +151758,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_18_close(st
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator6(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_6__close *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_6__close *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -151708,11 +151768,11 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("_close", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
-    case 1: goto __pyx_L5_resume_from_yield;
-    case 2: goto __pyx_L7_resume_from_yield;
+    case 1: goto __pyx_L5_resume_from_await;
+    case 2: goto __pyx_L7_resume_from_await;
     default: /* CPython raises the right error here */
     __Pyx_RefNannyFinishContext();
     return NULL;
@@ -151812,15 +151872,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
     if (likely(__pyx_r)) {
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+      /* return from generator, awaiting value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
-      __pyx_L5_resume_from_yield:;
+      __pyx_L5_resume_from_await:;
       if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 1350, __pyx_L1_error)
     } else {
-      PyObject* exc_type = PyErr_Occurred();
+      PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
-        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
         else __PYX_ERR(7, 1350, __pyx_L1_error)
       }
     }
@@ -151877,15 +151938,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
     if (likely(__pyx_r)) {
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+      /* return from generator, awaiting value */
       __pyx_generator->resume_label = 2;
       return __pyx_r;
-      __pyx_L7_resume_from_yield:;
+      __pyx_L7_resume_from_await:;
       if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 1352, __pyx_L1_error)
     } else {
-      PyObject* exc_type = PyErr_Occurred();
+      PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
-        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
         else __PYX_ERR(7, 1352, __pyx_L1_error)
       }
     }
@@ -151919,6 +151981,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
   __Pyx_AddTraceback("_close", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -152044,7 +152107,7 @@ static int __pyx_pf_4lxml_5etree_23_AsyncFileWriterElement___cinit__(struct __py
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator7(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":1366
  *         self._writer = writer
@@ -152101,7 +152164,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AsyncFileWriterElement_2__aenter__(str
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator7(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_7___aenter__ *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_7___aenter__ *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -152111,10 +152174,10 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator7(__p
   int __pyx_t_4;
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("__aenter__", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
-    case 1: goto __pyx_L5_resume_from_yield;
+    case 1: goto __pyx_L5_resume_from_await;
     default: /* CPython raises the right error here */
     __Pyx_RefNannyFinishContext();
     return NULL;
@@ -152232,15 +152295,16 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator7(__p
     if (likely(__pyx_r)) {
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+      /* return from generator, awaiting value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
-      __pyx_L5_resume_from_yield:;
+      __pyx_L5_resume_from_await:;
       if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 1370, __pyx_L1_error)
     } else {
-      PyObject* exc_type = PyErr_Occurred();
+      PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
-        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
         else __PYX_ERR(7, 1370, __pyx_L1_error)
       }
     }
@@ -152274,12 +152338,13 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator7(__p
   __Pyx_AddTraceback("__aenter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator8(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":1372
  *             await self._writer._async_outfile.write(data)
@@ -152344,7 +152409,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AsyncFileWriterElement_5__aexit__(stru
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator8(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_8___aexit__ *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_8___aexit__ *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -152354,10 +152419,10 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator8(__p
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("__aexit__", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
-    case 1: goto __pyx_L5_resume_from_yield;
+    case 1: goto __pyx_L5_resume_from_await;
     default: /* CPython raises the right error here */
     __Pyx_RefNannyFinishContext();
     return NULL;
@@ -152460,15 +152525,16 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator8(__p
     if (likely(__pyx_r)) {
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+      /* return from generator, awaiting value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
-      __pyx_L5_resume_from_yield:;
+      __pyx_L5_resume_from_await:;
       if (unlikely(!__pyx_sent_value)) __PYX_ERR(7, 1376, __pyx_L1_error)
     } else {
-      PyObject* exc_type = PyErr_Occurred();
+      PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
-        if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
         else __PYX_ERR(7, 1376, __pyx_L1_error)
       }
     }
@@ -152502,6 +152568,7 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator8(__p
   __Pyx_AddTraceback("__aexit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -153063,7 +153130,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_2__enter__(struct __pyx_
  */
     __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1422, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1422, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1422, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
@@ -153229,7 +153296,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
  */
     __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1428, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1428, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1428, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
@@ -153264,7 +153331,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
  */
     __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1430, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1430, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1430, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
@@ -153320,7 +153387,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator9(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":1434
  *         self._exited = True
@@ -153377,7 +153444,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_6__aenter__(struct __pyx
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator9(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_9___aenter__ *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_9___aenter__ *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -153385,7 +153452,7 @@ static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator9(__pyx_Corout
   PyObject *__pyx_t_2 = NULL;
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("__aenter__", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     default: /* CPython raises the right error here */
@@ -153445,12 +153512,13 @@ static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator9(__pyx_Corout
   __Pyx_AddTraceback("__aenter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_11generator10(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_11generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/serializer.pxi":1438
  *         return self.__enter__()
@@ -153515,14 +153583,14 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_9__aexit__(struct __pyx_
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_11generator10(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_11generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_10___aexit__ *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_10___aexit__ *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("__aexit__", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     default: /* CPython raises the right error here */
@@ -153564,6 +153632,7 @@ static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_11generator10(__pyx_Coro
   __Pyx_AddTraceback("__aexit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -153606,7 +153675,7 @@ static int __pyx_pw_4lxml_5etree_9iterparse_1__init__(PyObject *__pyx_v_self, Py
   {
     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_events,&__pyx_n_s_tag,&__pyx_n_s_attribute_defaults,&__pyx_n_s_dtd_validation,&__pyx_n_s_load_dtd,&__pyx_n_s_no_network,&__pyx_n_s_remove_blank_text,&__pyx_n_s_compact,&__pyx_n_s_resolve_entities,&__pyx_n_s_remove_comments,&__pyx_n_s_remove_pis,&__pyx_n_s_strip_cdata,&__pyx_n_s_encoding,&__pyx_n_s_html,&__pyx_n_s_recover,&__pyx_n_s_huge_tree,&__pyx_n_s_collect_ids,&__pyx_n_s_schema,0};
     PyObject* values[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-    values[1] = ((PyObject *)__pyx_tuple__87);
+    values[1] = ((PyObject *)__pyx_tuple__89);
     values[2] = ((PyObject *)Py_None);
 
     /* "src/lxml/iterparse.pxi":67
@@ -153786,7 +153855,7 @@ static int __pyx_pf_4lxml_5etree_9iterparse___init__(struct __pyx_obj_4lxml_5etr
  *             self._filename = source
  *             if python.IS_PYTHON2:
  */
-  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_s_read); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(13, 73, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_s_read); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(13, 73, __pyx_L1_error)
   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
   if (__pyx_t_2) {
 
@@ -153950,14 +154019,6 @@ static int __pyx_pf_4lxml_5etree_9iterparse___init__(struct __pyx_obj_4lxml_5etr
  */
     __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 88, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-
-    /* "src/lxml/iterparse.pxi":89
- *             # make sure we're not looking for namespaces
- *             events = [event for event in events
- *                       if event not in ('start-ns', 'end-ns')]             # <<<<<<<<<<<<<<
- *             parser = HTMLPullParser(
- *                 events,
- */
     if (likely(PyList_CheckExact(__pyx_v_events)) || PyTuple_CheckExact(__pyx_v_events)) {
       __pyx_t_3 = __pyx_v_events; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
       __pyx_t_6 = NULL;
@@ -153967,14 +154028,6 @@ static int __pyx_pf_4lxml_5etree_9iterparse___init__(struct __pyx_obj_4lxml_5etr
       __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 88, __pyx_L1_error)
     }
     for (;;) {
-
-      /* "src/lxml/iterparse.pxi":88
- *         if html:
- *             # make sure we're not looking for namespaces
- *             events = [event for event in events             # <<<<<<<<<<<<<<
- *                       if event not in ('start-ns', 'end-ns')]
- *             parser = HTMLPullParser(
- */
       if (likely(!__pyx_t_6)) {
         if (likely(PyList_CheckExact(__pyx_t_3))) {
           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
@@ -153998,7 +154051,7 @@ static int __pyx_pf_4lxml_5etree_9iterparse___init__(struct __pyx_obj_4lxml_5etr
         if (unlikely(!__pyx_t_7)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(13, 88, __pyx_L1_error)
           }
           break;
@@ -154080,7 +154133,7 @@ static int __pyx_pf_4lxml_5etree_9iterparse___init__(struct __pyx_obj_4lxml_5etr
  *                 recover=recover,
  *                 base_url=self._filename,
  */
-    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 92, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 92, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(13, 92, __pyx_L1_error)
 
@@ -154236,7 +154289,7 @@ static int __pyx_pf_4lxml_5etree_9iterparse___init__(struct __pyx_obj_4lxml_5etr
  *                 recover=recover,
  *                 base_url=self._filename,
  */
-    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 107, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyDict_NewPresized(18); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 107, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(13, 107, __pyx_L1_error)
 
@@ -154965,7 +155018,7 @@ static PyObject *__pyx_pf_4lxml_5etree_9iterparse_4makeelement(struct __pyx_obj_
  *             _tag, attrib=None, nsmap=None, **_extra)
  * 
  */
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 162, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 162, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
 
   /* "src/lxml/iterparse.pxi":162
@@ -155163,7 +155216,6 @@ static PyObject *__pyx_f_4lxml_5etree_9iterparse__close_source(struct __pyx_obj_
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       goto __pyx_L13_try_end;
       __pyx_L8_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
       /* "src/lxml/iterparse.pxi":173
@@ -155205,14 +155257,12 @@ static PyObject *__pyx_f_4lxml_5etree_9iterparse__close_source(struct __pyx_obj_
  *             close = self._source.close
  *         except AttributeError:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
       goto __pyx_L6_error;
       __pyx_L9_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
@@ -155261,7 +155311,6 @@ static PyObject *__pyx_f_4lxml_5etree_9iterparse__close_source(struct __pyx_obj_
         __Pyx_DECREF(__pyx_v_self->_source);
         __pyx_v_self->_source = Py_None;
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_13);
@@ -155492,7 +155541,6 @@ static PyObject *__pyx_pf_4lxml_5etree_9iterparse_8__next__(struct __pyx_obj_4lx
  */
     }
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -155518,21 +155566,18 @@ static PyObject *__pyx_pf_4lxml_5etree_9iterparse_8__next__(struct __pyx_obj_4lx
  *             return next(self._events)
  *         except StopIteration:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L7_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L0;
     __pyx_L4_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -155608,7 +155653,7 @@ static PyObject *__pyx_pf_4lxml_5etree_9iterparse_8__next__(struct __pyx_obj_4lx
  *                     return next(self._events)
  *                 except StopIteration:
  */
-          __pyx_t_8 = __pyx_f_4lxml_5etree_9iterparse__read_more_events(__pyx_v_self, __pyx_v_context); if (unlikely(__pyx_t_8 == -123)) __PYX_ERR(13, 193, __pyx_L12_error)
+          __pyx_t_8 = __pyx_f_4lxml_5etree_9iterparse__read_more_events(__pyx_v_self, __pyx_v_context); if (unlikely(__pyx_t_8 == ((int)-123))) __PYX_ERR(13, 193, __pyx_L12_error)
           __pyx_v_done = __pyx_t_8;
 
           /* "src/lxml/iterparse.pxi":194
@@ -155637,7 +155682,6 @@ static PyObject *__pyx_pf_4lxml_5etree_9iterparse_8__next__(struct __pyx_obj_4lx
  */
         }
         __pyx_L12_error:;
-        __Pyx_PyThreadState_assign
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -155740,7 +155784,6 @@ static PyObject *__pyx_pf_4lxml_5etree_9iterparse_8__next__(struct __pyx_obj_4lx
  */
             }
             __pyx_L22_error:;
-            __Pyx_PyThreadState_assign
             __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
             __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
 
@@ -155783,21 +155826,18 @@ static PyObject *__pyx_pf_4lxml_5etree_9iterparse_8__next__(struct __pyx_obj_4lx
  *                         return next(self._events)
  *                     except StopIteration:
  */
-            __Pyx_PyThreadState_assign
             __Pyx_XGIVEREF(__pyx_t_11);
             __Pyx_XGIVEREF(__pyx_t_12);
             __Pyx_XGIVEREF(__pyx_t_13);
             __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
             goto __pyx_L14_except_error;
             __pyx_L27_try_break:;
-            __Pyx_PyThreadState_assign
             __Pyx_XGIVEREF(__pyx_t_11);
             __Pyx_XGIVEREF(__pyx_t_12);
             __Pyx_XGIVEREF(__pyx_t_13);
             __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
             goto __pyx_L20_except_break;
             __pyx_L26_try_return:;
-            __Pyx_PyThreadState_assign
             __Pyx_XGIVEREF(__pyx_t_11);
             __Pyx_XGIVEREF(__pyx_t_12);
             __Pyx_XGIVEREF(__pyx_t_13);
@@ -155820,35 +155860,30 @@ static PyObject *__pyx_pf_4lxml_5etree_9iterparse_8__next__(struct __pyx_obj_4lx
  *                     done = self._read_more_events(context)
  *                     return next(self._events)
  */
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_3);
         __Pyx_XGIVEREF(__pyx_t_2);
         __Pyx_XGIVEREF(__pyx_t_1);
         __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
         goto __pyx_L1_error;
         __pyx_L17_try_break:;
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_3);
         __Pyx_XGIVEREF(__pyx_t_2);
         __Pyx_XGIVEREF(__pyx_t_1);
         __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
         goto __pyx_L11_break;
         __pyx_L16_try_return:;
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_3);
         __Pyx_XGIVEREF(__pyx_t_2);
         __Pyx_XGIVEREF(__pyx_t_1);
         __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
         goto __pyx_L0;
         __pyx_L15_except_return:;
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_3);
         __Pyx_XGIVEREF(__pyx_t_2);
         __Pyx_XGIVEREF(__pyx_t_1);
         __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
         goto __pyx_L0;
         __pyx_L13_exception_handled:;
-        __Pyx_PyThreadState_assign
         __Pyx_XGIVEREF(__pyx_t_3);
         __Pyx_XGIVEREF(__pyx_t_2);
         __Pyx_XGIVEREF(__pyx_t_1);
@@ -155983,7 +156018,7 @@ static PyObject *__pyx_pf_4lxml_5etree_9iterparse_8__next__(struct __pyx_obj_4lx
  *                              context._error_log)
  *         # no errors => all done
  */
-    __pyx_t_6 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_context->__pyx_base._c_ctxt, __pyx_t_9, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_4)); if (unlikely(__pyx_t_6 == 0)) __PYX_ERR(13, 211, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_context->__pyx_base._c_ctxt, __pyx_t_9, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_4)); if (unlikely(__pyx_t_6 == ((int)0))) __PYX_ERR(13, 211, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
@@ -156069,7 +156104,7 @@ static int __pyx_f_4lxml_5etree_9iterparse__read_more_events(struct __pyx_obj_4l
  */
   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_source, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 218, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 218, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 218, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_data = __pyx_t_2;
@@ -156104,7 +156139,7 @@ static int __pyx_f_4lxml_5etree_9iterparse__read_more_events(struct __pyx_obj_4l
  *         if not data:
  *             try:
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 221, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 221, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -156190,7 +156225,6 @@ static int __pyx_f_4lxml_5etree_9iterparse__read_more_events(struct __pyx_obj_4l
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
         }
-        __Pyx_PyThreadState_assign
         if (PY_MAJOR_VERSION >= 3) {
           __Pyx_XGIVEREF(__pyx_t_11);
           __Pyx_XGIVEREF(__pyx_t_12);
@@ -156205,7 +156239,6 @@ static int __pyx_f_4lxml_5etree_9iterparse__read_more_events(struct __pyx_obj_4l
         __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7;
         goto __pyx_L1_error;
         __pyx_L9_error:;
-        __Pyx_PyThreadState_assign
         if (PY_MAJOR_VERSION >= 3) {
           __Pyx_XGIVEREF(__pyx_t_11);
           __Pyx_XGIVEREF(__pyx_t_12);
@@ -156338,7 +156371,7 @@ static int __pyx_pw_4lxml_5etree_8iterwalk_1__init__(PyObject *__pyx_v_self, PyO
   {
     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_element_or_tree,&__pyx_n_s_events,&__pyx_n_s_tag,0};
     PyObject* values[3] = {0,0,0};
-    values[1] = ((PyObject *)__pyx_tuple__90);
+    values[1] = ((PyObject *)__pyx_tuple__92);
     values[2] = ((PyObject *)Py_None);
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
@@ -156437,7 +156470,7 @@ static int __pyx_pf_4lxml_5etree_8iterwalk___init__(struct __pyx_obj_4lxml_5etre
  *         if tag is None or tag == '*':
  *             self._matcher = None
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__buildParseEventFilter(__pyx_v_events); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(13, 261, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__buildParseEventFilter(__pyx_v_events); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(13, 261, __pyx_L1_error)
   __pyx_v_self->_event_filter = __pyx_t_2;
 
   /* "src/lxml/iterparse.pxi":262
@@ -156454,7 +156487,7 @@ static int __pyx_pf_4lxml_5etree_8iterwalk___init__(struct __pyx_obj_4lxml_5etre
     __pyx_t_3 = __pyx_t_5;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_tag, __pyx_kp_s__42, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(13, 262, __pyx_L1_error)
+  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_tag, __pyx_kp_s__44, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(13, 262, __pyx_L1_error)
   __pyx_t_3 = __pyx_t_5;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_3) {
@@ -156586,7 +156619,7 @@ static int __pyx_pf_4lxml_5etree_8iterwalk___init__(struct __pyx_obj_4lxml_5etre
  *             self._node_stack.append( (root, ns_count) )
  *         else:
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree_8iterwalk__start_node(__pyx_v_self, __pyx_v_root); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(13, 273, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_8iterwalk__start_node(__pyx_v_self, __pyx_v_root); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(13, 273, __pyx_L1_error)
     __pyx_v_ns_count = __pyx_t_2;
 
     /* "src/lxml/iterparse.pxi":274
@@ -156597,7 +156630,7 @@ static int __pyx_pf_4lxml_5etree_8iterwalk___init__(struct __pyx_obj_4lxml_5etre
  *             self._index = -1
  */
     if (unlikely(__pyx_v_self->_node_stack == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
       __PYX_ERR(13, 274, __pyx_L1_error)
     }
     __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ns_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 274, __pyx_L1_error)
@@ -156610,7 +156643,7 @@ static int __pyx_pf_4lxml_5etree_8iterwalk___init__(struct __pyx_obj_4lxml_5etre
     __Pyx_GIVEREF(__pyx_t_6);
     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
     __pyx_t_6 = 0;
-    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->_node_stack, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(13, 274, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->_node_stack, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(13, 274, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
     /* "src/lxml/iterparse.pxi":271
@@ -156838,7 +156871,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8iterwalk_4__next__(struct __pyx_obj_4lxm
  */
     __pyx_t_5 = ((PyObject *)__pyx_v_node->_doc);
     __Pyx_INCREF(__pyx_t_5);
-    __pyx_t_6 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_5), NULL); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(13, 290, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_5), NULL); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(13, 290, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "src/lxml/iterparse.pxi":288
@@ -157101,7 +157134,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8iterwalk_4__next__(struct __pyx_obj_4lxm
  *                 elif self._event_filter & PARSE_EVENT_FILTER_END_NS:
  *                     ns_count = _countNsDefs(next_node._c_node)
  */
-        __pyx_t_6 = __pyx_f_4lxml_5etree_8iterwalk__start_node(__pyx_v_self, __pyx_v_next_node); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(13, 318, __pyx_L1_error)
+        __pyx_t_6 = __pyx_f_4lxml_5etree_8iterwalk__start_node(__pyx_v_self, __pyx_v_next_node); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(13, 318, __pyx_L1_error)
         __pyx_v_ns_count = __pyx_t_6;
 
         /* "src/lxml/iterparse.pxi":316
@@ -157151,7 +157184,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8iterwalk_4__next__(struct __pyx_obj_4lxm
  *             if self._events:
  */
       if (unlikely(__pyx_v_self->_node_stack == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(13, 321, __pyx_L1_error)
       }
       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ns_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 321, __pyx_L1_error)
@@ -157164,7 +157197,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8iterwalk_4__next__(struct __pyx_obj_4lxm
       __Pyx_GIVEREF(__pyx_t_5);
       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
       __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_node_stack, __pyx_t_2); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(13, 321, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_node_stack, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(13, 321, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
       /* "src/lxml/iterparse.pxi":322
@@ -157343,7 +157376,7 @@ static PyObject *__pyx_f_4lxml_5etree_8iterwalk__next_event(struct __pyx_obj_4lx
  *     def skip_subtree(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_self->_pop_event, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 332, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_self->_pop_event, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 332, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -157480,7 +157513,7 @@ static int __pyx_f_4lxml_5etree_8iterwalk__start_node(struct __pyx_obj_4lxml_5et
  */
     __pyx_t_2 = __pyx_v_self->_events;
     __Pyx_INCREF(__pyx_t_2);
-    __pyx_t_3 = __pyx_f_4lxml_5etree__appendStartNsEvents(__pyx_v_node->_c_node, ((PyObject*)__pyx_t_2)); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(13, 348, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__appendStartNsEvents(__pyx_v_node->_c_node, ((PyObject*)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 348, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_v_ns_count = __pyx_t_3;
 
@@ -157600,7 +157633,7 @@ static int __pyx_f_4lxml_5etree_8iterwalk__start_node(struct __pyx_obj_4lxml_5et
  *         return ns_count
  */
       if (unlikely(__pyx_v_self->_events == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(13, 357, __pyx_L1_error)
       }
       __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 357, __pyx_L1_error)
@@ -157611,7 +157644,7 @@ static int __pyx_f_4lxml_5etree_8iterwalk__start_node(struct __pyx_obj_4lxml_5et
       __Pyx_INCREF(((PyObject *)__pyx_v_node));
       __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
       PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_node));
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->_events, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(13, 357, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->_events, __pyx_t_2); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(13, 357, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
       /* "src/lxml/iterparse.pxi":358
@@ -157705,7 +157738,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree_8iterwalk__end_node(struct __pyx
  *             if self._matcher is None or self._matcher.matches(node._c_node):
  */
   if (unlikely(__pyx_v_self->_node_stack == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "pop");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
     __PYX_ERR(13, 365, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_self->_node_stack); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 365, __pyx_L1_error)
@@ -157804,7 +157837,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree_8iterwalk__end_node(struct __pyx
  *             event = (u"end-ns", None)
  */
       if (unlikely(__pyx_v_self->_events == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(13, 368, __pyx_L1_error)
       }
       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 368, __pyx_L1_error)
@@ -157815,7 +157848,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree_8iterwalk__end_node(struct __pyx
       __Pyx_INCREF(((PyObject *)__pyx_v_node));
       __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
       PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_node));
-      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->_events, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(13, 368, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->_events, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(13, 368, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
       /* "src/lxml/iterparse.pxi":367
@@ -157861,8 +157894,8 @@ static struct LxmlElement *__pyx_f_4lxml_5etree_8iterwalk__end_node(struct __pyx
  *             for i in range(ns_count):
  *                 self._events.append(event)
  */
-    __Pyx_INCREF(__pyx_tuple__92);
-    __pyx_v_event = __pyx_tuple__92;
+    __Pyx_INCREF(__pyx_tuple__94);
+    __pyx_v_event = __pyx_tuple__94;
 
     /* "src/lxml/iterparse.pxi":371
  *         if self._event_filter & PARSE_EVENT_FILTER_END_NS and ns_count:
@@ -157883,10 +157916,10 @@ static struct LxmlElement *__pyx_f_4lxml_5etree_8iterwalk__end_node(struct __pyx
  * 
  */
       if (unlikely(__pyx_v_self->_events == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(13, 372, __pyx_L1_error)
       }
-      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->_events, __pyx_v_event); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(13, 372, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->_events, __pyx_v_event); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(13, 372, __pyx_L1_error)
     }
 
     /* "src/lxml/iterparse.pxi":369
@@ -158130,7 +158163,7 @@ static int __pyx_f_4lxml_5etree__appendStartNsEvents(xmlNode *__pyx_v_c_node, Py
  *         c_ns = c_ns.next
  */
     if (unlikely(__pyx_v_event_list == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
       __PYX_ERR(13, 395, __pyx_L1_error)
     }
     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 395, __pyx_L1_error)
@@ -158141,7 +158174,7 @@ static int __pyx_f_4lxml_5etree__appendStartNsEvents(xmlNode *__pyx_v_c_node, Py
     __Pyx_INCREF(__pyx_v_ns_tuple);
     __Pyx_GIVEREF(__pyx_v_ns_tuple);
     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ns_tuple);
-    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_event_list, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(13, 395, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_event_list, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(13, 395, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "src/lxml/iterparse.pxi":396
@@ -158309,7 +158342,7 @@ static PyObject *__pyx_pf_4lxml_5etree_48XMLID(CYTHON_UNUSED PyObject *__pyx_sel
  * 
  *     # ElementTree compatible implementation: parse and look for 'id' attributes
  */
-    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPath), __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 15, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPath), __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 15, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_XGOTREF(__pyx_v_4lxml_5etree__find_id_attributes);
     __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__find_id_attributes, __pyx_t_3);
@@ -158342,7 +158375,7 @@ static PyObject *__pyx_pf_4lxml_5etree_48XMLID(CYTHON_UNUSED PyObject *__pyx_sel
   __Pyx_INCREF(__pyx_v_parser);
   __Pyx_GIVEREF(__pyx_v_parser);
   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_parser);
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 18, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 18, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(14, 18, __pyx_L1_error)
   __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 18, __pyx_L1_error)
@@ -158360,7 +158393,7 @@ static PyObject *__pyx_pf_4lxml_5etree_48XMLID(CYTHON_UNUSED PyObject *__pyx_sel
  *     for elem in _find_id_attributes(root):
  *         dic[elem.get(u'id')] = elem
  */
-  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 19, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 19, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_v_dic = ((PyObject*)__pyx_t_6);
   __pyx_t_6 = 0;
@@ -158449,7 +158482,7 @@ static PyObject *__pyx_pf_4lxml_5etree_48XMLID(CYTHON_UNUSED PyObject *__pyx_sel
       if (unlikely(!__pyx_t_6)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(14, 20, __pyx_L1_error)
         }
         break;
@@ -158468,7 +158501,7 @@ static PyObject *__pyx_pf_4lxml_5etree_48XMLID(CYTHON_UNUSED PyObject *__pyx_sel
  */
     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_elem, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 21, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 21, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 21, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     if (unlikely(PyDict_SetItem(__pyx_v_dic, __pyx_t_3, __pyx_v_elem) < 0)) __PYX_ERR(14, 21, __pyx_L1_error)
@@ -158640,7 +158673,7 @@ static PyObject *__pyx_pf_4lxml_5etree_50XMLDTDID(CYTHON_UNUSED PyObject *__pyx_
   __Pyx_INCREF(__pyx_v_parser);
   __Pyx_GIVEREF(__pyx_v_parser);
   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_parser);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 37, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 37, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(14, 37, __pyx_L1_error)
   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 37, __pyx_L1_error)
@@ -158670,7 +158703,7 @@ static PyObject *__pyx_pf_4lxml_5etree_50XMLDTDID(CYTHON_UNUSED PyObject *__pyx_
  *         return (root, _IDDict(root))
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 40, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 40, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 40, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
@@ -159667,7 +159700,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_14keys(struct __pyx_obj_4lxml_5e
  *     def __iter__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_self->_keys, 0, 0, NULL, NULL, &__pyx_slice__95, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 114, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_self->_keys, 0, 0, NULL, NULL, &__pyx_slice__97, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 114, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -159922,7 +159955,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_7_IDDict_20__len__(struct __pyx_obj_4lxm
  */
   __pyx_t_3 = __pyx_v_self->_keys;
   __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(14, 127, __pyx_L1_error)
+  __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(14, 127, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_r = __pyx_t_4;
   goto __pyx_L0;
@@ -160018,7 +160051,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_22items(struct __pyx_obj_4lxml_5
  *     def iteritems(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_self->_items, 0, 0, NULL, NULL, &__pyx_slice__96, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 132, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_self->_items, 0, 0, NULL, NULL, &__pyx_slice__98, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 132, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -160269,7 +160302,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_26values(struct __pyx_obj_4lxml_
       if (unlikely(!__pyx_t_6)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(14, 143, __pyx_L1_error)
         }
         break;
@@ -160307,7 +160340,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_26values(struct __pyx_obj_4lxml_
  *         return values
  * 
  */
-    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_values, __pyx_v_value); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(14, 146, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_values, __pyx_v_value); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(14, 146, __pyx_L1_error)
 
     /* "src/lxml/xmlid.pxi":143
  *         if self._items is None:
@@ -160732,7 +160765,7 @@ static void __pyx_f_4lxml_5etree__collectIdHashItemList(void *__pyx_v_payload, v
  * cdef void _collectIdHashKeys(void* payload, void* collect_list, xmlChar* name):
  */
   if (unlikely(__pyx_v_lst == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(14, 173, __pyx_L1_error)
   }
   __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 173, __pyx_L1_error)
@@ -160745,7 +160778,7 @@ static void __pyx_f_4lxml_5etree__collectIdHashItemList(void *__pyx_v_payload, v
   __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
   PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_element));
   __pyx_t_3 = 0;
-  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_lst, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(14, 173, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_lst, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(14, 173, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "src/lxml/xmlid.pxi":165
@@ -160843,12 +160876,12 @@ static void __pyx_f_4lxml_5etree__collectIdHashKeys(void *__pyx_v_payload, void
  *     (<list>collect_list).append(funicode(name))             # <<<<<<<<<<<<<<
  */
   if (unlikely(((PyObject *)__pyx_v_collect_list) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(14, 179, __pyx_L1_error)
   }
   __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 179, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyList_Append(((PyObject*)__pyx_v_collect_list), __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(14, 179, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyList_Append(((PyObject*)__pyx_v_collect_list), __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(14, 179, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
   /* "src/lxml/xmlid.pxi":175
@@ -161099,7 +161132,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8XInclude_2__call__(struct __pyx_obj_4lxm
  *         assert self._error_log is not None, "XInclude processor not initialised"
  *         if node._doc._parser is not None:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(15, 37, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(15, 37, __pyx_L1_error)
 
   /* "src/lxml/xinclude.pxi":38
  *         cdef int result
@@ -161208,7 +161241,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8XInclude_2__call__(struct __pyx_obj_4lxm
  *         if tree.LIBXML_VERSION < 20704 or not c_context:
  *             __GLOBAL_PARSER_CONTEXT.pushImpliedContext(context)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_ErrorLog_connect(__pyx_v_self->_error_log); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(15, 48, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_ErrorLog_connect(__pyx_v_self->_error_log); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(15, 48, __pyx_L1_error)
 
   /* "src/lxml/xinclude.pxi":49
  * 
@@ -161366,7 +161399,7 @@ static PyObject *__pyx_pf_4lxml_5etree_8XInclude_2__call__(struct __pyx_obj_4lxm
  * 
  *         if result == -1:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_ErrorLog_disconnect(__pyx_v_self->_error_log); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(15, 59, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_ErrorLog_disconnect(__pyx_v_self->_error_log); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(15, 59, __pyx_L1_error)
 
   /* "src/lxml/xinclude.pxi":61
  *         self._error_log.disconnect()
@@ -161600,7 +161633,7 @@ static PyObject *__pyx_pf_4lxml_5etree_54cleanup_namespaces(CYTHON_UNUSED PyObje
  *         moveNodeToDocument(doc, c_element.doc, c_element)
  * 
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_element, __pyx_v_doc, Py_None, __pyx_v_top_nsmap); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(16, 23, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_element, __pyx_v_doc, Py_None, __pyx_v_top_nsmap); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(16, 23, __pyx_L1_error)
 
     /* "src/lxml/cleanup.pxi":24
  *         # declare namespaces from nsmap, then apply them to the subtree
@@ -161609,7 +161642,7 @@ static PyObject *__pyx_pf_4lxml_5etree_54cleanup_namespaces(CYTHON_UNUSED PyObje
  * 
  *     keep_ns_prefixes = (
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_c_element->doc, __pyx_v_c_element); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(16, 24, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_c_element->doc, __pyx_v_c_element); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(16, 24, __pyx_L1_error)
 
     /* "src/lxml/cleanup.pxi":20
  *     c_element = element._c_node
@@ -161671,7 +161704,7 @@ static PyObject *__pyx_pf_4lxml_5etree_54cleanup_namespaces(CYTHON_UNUSED PyObje
         if (unlikely(!__pyx_t_9)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(16, 27, __pyx_L1_error)
           }
           break;
@@ -161714,7 +161747,7 @@ static PyObject *__pyx_pf_4lxml_5etree_54cleanup_namespaces(CYTHON_UNUSED PyObje
  * 
  */
   if (!(likely(PySet_CheckExact(__pyx_v_keep_ns_prefixes))||((__pyx_v_keep_ns_prefixes) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_keep_ns_prefixes)->tp_name), 0))) __PYX_ERR(16, 30, __pyx_L1_error)
-  __pyx_t_4 = __pyx_f_4lxml_5etree__removeUnusedNamespaceDeclarations(__pyx_v_c_element, ((PyObject*)__pyx_v_keep_ns_prefixes)); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(16, 30, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__removeUnusedNamespaceDeclarations(__pyx_v_c_element, ((PyObject*)__pyx_v_keep_ns_prefixes)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(16, 30, __pyx_L1_error)
 
   /* "src/lxml/cleanup.pxi":3
  * # functions for tree cleanup and removing elements from subtrees
@@ -161900,7 +161933,7 @@ static PyObject *__pyx_pf_4lxml_5etree_56strip_attributes(CYTHON_UNUSED PyObject
  */
   __pyx_t_4 = ((PyObject *)__pyx_v_element->_doc);
   __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_5 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_matcher, ((struct LxmlDocument *)__pyx_t_4), NULL); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(16, 54, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_matcher, ((struct LxmlDocument *)__pyx_t_4), NULL); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(16, 54, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
   /* "src/lxml/cleanup.pxi":55
@@ -162284,7 +162317,7 @@ static PyObject *__pyx_pf_4lxml_5etree_58strip_elements(CYTHON_UNUSED PyObject *
  *     if matcher.rejectsAll():
  *         return
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_matcher, __pyx_v_doc, NULL); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(16, 106, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_matcher, __pyx_v_doc, NULL); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(16, 106, __pyx_L1_error)
 
   /* "src/lxml/cleanup.pxi":107
  *     matcher = _MultiTagMatcher(tag_names)
@@ -162344,7 +162377,7 @@ static PyObject *__pyx_pf_4lxml_5etree_58strip_elements(CYTHON_UNUSED PyObject *
  *         if matcher.matchesType(tree.XML_PI_NODE):
  *             _removeSiblings(element._c_node, tree.XML_PI_NODE, with_tail)
  */
-      __pyx_t_5 = __pyx_f_4lxml_5etree__removeSiblings(__pyx_v_element->_c_node, XML_COMMENT_NODE, __pyx_v_with_tail); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(16, 113, __pyx_L1_error)
+      __pyx_t_5 = __pyx_f_4lxml_5etree__removeSiblings(__pyx_v_element->_c_node, XML_COMMENT_NODE, __pyx_v_with_tail); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(16, 113, __pyx_L1_error)
 
       /* "src/lxml/cleanup.pxi":112
  *     if isinstance(tree_or_element, _ElementTree):
@@ -162372,7 +162405,7 @@ static PyObject *__pyx_pf_4lxml_5etree_58strip_elements(CYTHON_UNUSED PyObject *
  *     _strip_elements(doc, element._c_node, matcher, with_tail)
  * 
  */
-      __pyx_t_5 = __pyx_f_4lxml_5etree__removeSiblings(__pyx_v_element->_c_node, XML_PI_NODE, __pyx_v_with_tail); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(16, 115, __pyx_L1_error)
+      __pyx_t_5 = __pyx_f_4lxml_5etree__removeSiblings(__pyx_v_element->_c_node, XML_PI_NODE, __pyx_v_with_tail); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(16, 115, __pyx_L1_error)
 
       /* "src/lxml/cleanup.pxi":114
  *         if matcher.matchesType(tree.XML_COMMENT_NODE):
@@ -162548,7 +162581,7 @@ static PyObject *__pyx_f_4lxml_5etree__strip_elements(struct LxmlDocument *__pyx
  *                 else:
  *                     if with_tail:
  */
-          __pyx_t_2 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_doc, __pyx_v_c_child); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(16, 135, __pyx_L1_error)
+          __pyx_t_2 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_doc, __pyx_v_c_child); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(16, 135, __pyx_L1_error)
 
           /* "src/lxml/cleanup.pxi":132
  *             c_next = _nextElement(c_child)
@@ -162833,7 +162866,7 @@ static PyObject *__pyx_pf_4lxml_5etree_60strip_tags(CYTHON_UNUSED PyObject *__py
  *     if matcher.rejectsAll():
  *         return
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_matcher, __pyx_v_doc, NULL); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(16, 176, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_matcher, __pyx_v_doc, NULL); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(16, 176, __pyx_L1_error)
 
   /* "src/lxml/cleanup.pxi":177
  *     matcher = _MultiTagMatcher(tag_names)
@@ -162893,7 +162926,7 @@ static PyObject *__pyx_pf_4lxml_5etree_60strip_tags(CYTHON_UNUSED PyObject *__py
  *         if matcher.matchesType(tree.XML_PI_NODE):
  *             _removeSiblings(element._c_node, tree.XML_PI_NODE, 0)
  */
-      __pyx_t_5 = __pyx_f_4lxml_5etree__removeSiblings(__pyx_v_element->_c_node, XML_COMMENT_NODE, 0); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(16, 183, __pyx_L1_error)
+      __pyx_t_5 = __pyx_f_4lxml_5etree__removeSiblings(__pyx_v_element->_c_node, XML_COMMENT_NODE, 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(16, 183, __pyx_L1_error)
 
       /* "src/lxml/cleanup.pxi":182
  *     if isinstance(tree_or_element, _ElementTree):
@@ -162921,7 +162954,7 @@ static PyObject *__pyx_pf_4lxml_5etree_60strip_tags(CYTHON_UNUSED PyObject *__py
  *     _strip_tags(doc, element._c_node, matcher)
  * 
  */
-      __pyx_t_5 = __pyx_f_4lxml_5etree__removeSiblings(__pyx_v_element->_c_node, XML_PI_NODE, 0); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(16, 185, __pyx_L1_error)
+      __pyx_t_5 = __pyx_f_4lxml_5etree__removeSiblings(__pyx_v_element->_c_node, XML_PI_NODE, 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(16, 185, __pyx_L1_error)
 
       /* "src/lxml/cleanup.pxi":184
  *         if matcher.matchesType(tree.XML_COMMENT_NODE):
@@ -163107,7 +163140,7 @@ static PyObject *__pyx_f_4lxml_5etree__strip_tags(struct LxmlDocument *__pyx_v_d
  *                 if not attemptDeallocation(c_child):
  *                     if c_child.nsDef is not NULL:
  */
-        __pyx_t_4 = __pyx_f_4lxml_5etree__replaceNodeByChildren(__pyx_v_doc, __pyx_v_c_child); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(16, 204, __pyx_L1_error)
+        __pyx_t_4 = __pyx_f_4lxml_5etree__replaceNodeByChildren(__pyx_v_doc, __pyx_v_c_child); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(16, 204, __pyx_L1_error)
 
         /* "src/lxml/cleanup.pxi":205
  *                 c_next = _findChildForwards(c_child, 0) or _nextElement(c_child)
@@ -163136,7 +163169,7 @@ static PyObject *__pyx_f_4lxml_5etree__strip_tags(struct LxmlDocument *__pyx_v_d
  *                 c_child = c_next
  *             else:
  */
-            __pyx_t_4 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_doc->_c_doc, __pyx_v_c_child); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(16, 208, __pyx_L1_error)
+            __pyx_t_4 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_doc->_c_doc, __pyx_v_c_child); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(16, 208, __pyx_L1_error)
 
             /* "src/lxml/cleanup.pxi":206
  *                 _replaceNodeByChildren(doc, c_child)
@@ -163448,7 +163481,7 @@ static int __pyx_pf_4lxml_5etree_12_BaseContext_2__init__(struct __pyx_obj_4lxml
  *         self._global_namespaces = []
  *         self._function_cache = {}
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 53, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 53, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_utf_refs);
@@ -163478,7 +163511,7 @@ static int __pyx_pf_4lxml_5etree_12_BaseContext_2__init__(struct __pyx_obj_4lxml
  *         self._eval_context_dict = None
  *         self._error_log = error_log
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 55, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 55, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_function_cache);
@@ -163568,7 +163601,7 @@ static int __pyx_pf_4lxml_5etree_12_BaseContext_2__init__(struct __pyx_obj_4lxml
  *             for extension in extensions:
  *                 for (ns_uri, name), function in extension.items():
  */
-    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 64, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 64, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_new_extensions = ((PyObject*)__pyx_t_1);
     __pyx_t_1 = 0;
@@ -163612,7 +163645,7 @@ static int __pyx_pf_4lxml_5etree_12_BaseContext_2__init__(struct __pyx_obj_4lxml
         if (unlikely(!__pyx_t_6)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(17, 65, __pyx_L1_error)
           }
           break;
@@ -163682,7 +163715,7 @@ static int __pyx_pf_4lxml_5etree_12_BaseContext_2__init__(struct __pyx_obj_4lxml
           if (unlikely(!__pyx_t_6)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(17, 66, __pyx_L1_error)
             }
             break;
@@ -164039,7 +164072,7 @@ static int __pyx_pf_4lxml_5etree_12_BaseContext_2__init__(struct __pyx_obj_4lxml
           if (unlikely(!__pyx_t_7)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(17, 79, __pyx_L1_error)
             }
             break;
@@ -164218,7 +164251,7 @@ static int __pyx_pf_4lxml_5etree_12_BaseContext_2__init__(struct __pyx_obj_4lxml
         __Pyx_INCREF(__pyx_v_ns_uri_utf);
         __Pyx_GIVEREF(__pyx_v_ns_uri_utf);
         PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_ns_uri_utf);
-        __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_ns, __pyx_t_7); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(17, 88, __pyx_L1_error)
+        __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_ns, __pyx_t_7); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(17, 88, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
         /* "src/lxml/extensions.pxi":79
@@ -164635,7 +164668,7 @@ static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_BaseC
  * 
  */
     if (unlikely(__pyx_v_self->_extensions == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "copy");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "copy");
       __PYX_ERR(17, 114, __pyx_L1_error)
     }
     __pyx_t_3 = PyDict_Copy(__pyx_v_self->_extensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 114, __pyx_L1_error)
@@ -165012,7 +165045,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext__cleanup_context(struct __p
  */
     __pyx_t_3 = 0;
     if (unlikely(__pyx_v_self->_utf_refs == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "itervalues");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "itervalues");
       __PYX_ERR(17, 148, __pyx_L1_error)
     }
     __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_self->_utf_refs, 1, __pyx_n_s_itervalues, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 148, __pyx_L1_error)
@@ -165056,10 +165089,10 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext__cleanup_context(struct __p
  *         self._doc = None
  */
   if (unlikely(__pyx_v_self->_utf_refs == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "clear");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
     __PYX_ERR(17, 150, __pyx_L1_error)
   }
-  __pyx_t_8 = __Pyx_PyDict_Clear(__pyx_v_self->_utf_refs); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(17, 150, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_Clear(__pyx_v_self->_utf_refs); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(17, 150, __pyx_L1_error)
 
   /* "src/lxml/extensions.pxi":151
  *                 python.Py_DECREF(ref)
@@ -165396,7 +165429,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_addNamespace(struct __pyx_o
  *             if new_item is not None:
  *                 namespaces.append(new_item)
  */
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_namespaces, __pyx_v_item); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(17, 177, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_namespaces, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(17, 177, __pyx_L1_error)
 
       /* "src/lxml/extensions.pxi":173
  *         else:
@@ -165426,7 +165459,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_addNamespace(struct __pyx_o
  *             self._namespaces = namespaces
  *         if self._xpathCtxt is not NULL:
  */
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_namespaces, __pyx_v_new_item); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(17, 179, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_namespaces, __pyx_v_new_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(17, 179, __pyx_L1_error)
 
       /* "src/lxml/extensions.pxi":178
  *                     new_item = None
@@ -165588,10 +165621,10 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerNamespace(struct __
  *                                  _xcstr(prefix_utf), _xcstr(ns_uri_utf))
  */
   if (unlikely(__pyx_v_self->_global_namespaces == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(17, 190, __pyx_L1_error)
   }
-  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_self->_global_namespaces, __pyx_v_prefix_utf); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(17, 190, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_self->_global_namespaces, __pyx_v_prefix_utf); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(17, 190, __pyx_L1_error)
 
   /* "src/lxml/extensions.pxi":191
  *         ns_uri_utf = self._to_utf(ns_uri)
@@ -165931,10 +165964,10 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalNamespaces(st
  *                     self._xpathCtxt, _xcstr(prefix_utf), _xcstr(ns_uri_utf))
  */
       if (unlikely(__pyx_v_self->_global_namespaces == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(17, 205, __pyx_L1_error)
       }
-      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_self->_global_namespaces, __pyx_v_prefix_utf); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(17, 205, __pyx_L1_error)
+      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_self->_global_namespaces, __pyx_v_prefix_utf); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(17, 205, __pyx_L1_error)
 
       /* "src/lxml/extensions.pxi":206
  *             for prefix_utf, ns_uri_utf in ns_prefixes:
@@ -166177,7 +166210,7 @@ static int __pyx_f_4lxml_5etree_12_BaseContext__addLocalExtensionFunction(struct
  *         self._extensions[(ns_utf, name_utf)] = function
  *         return 0
  */
-    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 224, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 224, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_3);
     __Pyx_GOTREF(__pyx_v_self->_extensions);
@@ -166284,7 +166317,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalFunctions(str
  */
   __pyx_t_2 = 0;
   if (unlikely(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
     __PYX_ERR(17, 232, __pyx_L1_error)
   }
   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, 1, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 232, __pyx_L1_error)
@@ -166363,7 +166396,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalFunctions(str
  *             for name_utf, function in ns_functions.iteritems():
  */
     /*else*/ {
-      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 238, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 238, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_XDECREF_SET(__pyx_v_d, ((PyObject*)__pyx_t_6));
       __pyx_t_6 = 0;
@@ -166392,7 +166425,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalFunctions(str
  */
     __pyx_t_9 = 0;
     if (unlikely(__pyx_v_ns_functions == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
       __PYX_ERR(17, 240, __pyx_L1_error)
     }
     __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_ns_functions, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_7)); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 240, __pyx_L1_error)
@@ -166559,7 +166592,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerLocalFunctions(stru
  */
   __pyx_t_4 = 0;
   if (unlikely(__pyx_v_self->_extensions == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
     __PYX_ERR(17, 252, __pyx_L1_error)
   }
   __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_self->_extensions, 1, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 252, __pyx_L1_error)
@@ -166720,7 +166753,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerLocalFunctions(stru
  *             d[name_utf] = function
  */
       /*else*/ {
-        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 260, __pyx_L1_error)
+        __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 260, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_DECREF_SET(__pyx_v_d, ((PyObject*)__pyx_t_8));
         __pyx_t_8 = 0;
@@ -166838,7 +166871,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_unregisterAllFunctions(stru
  */
   __pyx_t_2 = 0;
   if (unlikely(__pyx_v_self->_function_cache == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
     __PYX_ERR(17, 267, __pyx_L1_error)
   }
   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->_function_cache, 1, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 267, __pyx_L1_error)
@@ -166896,7 +166929,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_unregisterAllFunctions(stru
         if (unlikely(!__pyx_t_5)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(17, 268, __pyx_L1_error)
           }
           break;
@@ -166990,7 +167023,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalFunctions(s
  *                 if self._extensions is None or \
  */
   if (unlikely(__pyx_v_self->_function_cache == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
     __PYX_ERR(17, 273, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_self->_function_cache); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 273, __pyx_L1_error)
@@ -167028,7 +167061,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalFunctions(s
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(17, 273, __pyx_L1_error)
         }
         break;
@@ -167129,7 +167162,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalFunctions(s
         if (unlikely(!__pyx_t_6)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(17, 274, __pyx_L1_error)
           }
           break;
@@ -167649,7 +167682,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_BaseContext_12eval_context___get__(str
  *             return self._eval_context_dict
  * 
  */
-    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 317, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 317, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_3);
     __Pyx_GOTREF(__pyx_v_self->_eval_context_dict);
@@ -167719,7 +167752,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext__release_temp_refs(struct _
  *         self._temp_documents.clear()
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_10_TempStore_clear(__pyx_v_self->_temp_refs); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(17, 325, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_10_TempStore_clear(__pyx_v_self->_temp_refs); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(17, 325, __pyx_L1_error)
 
   /* "src/lxml/extensions.pxi":326
  *         u"Free temporarily referenced objects from this context."
@@ -167729,10 +167762,10 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext__release_temp_refs(struct _
  *     @cython.final
  */
   if (unlikely(__pyx_v_self->_temp_documents == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "clear");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
     __PYX_ERR(17, 326, __pyx_L1_error)
   }
-  __pyx_t_2 = PySet_Clear(__pyx_v_self->_temp_documents); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(17, 326, __pyx_L1_error)
+  __pyx_t_2 = PySet_Clear(__pyx_v_self->_temp_documents); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(17, 326, __pyx_L1_error)
 
   /* "src/lxml/extensions.pxi":323
  * 
@@ -167794,7 +167827,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext__hold(struct __pyx_obj_4lxm
  *             self._temp_documents.add((<_Element>obj)._doc)
  *             return
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree_10_TempStore_add(__pyx_v_self->_temp_refs, __pyx_v_obj); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(17, 338, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_10_TempStore_add(__pyx_v_self->_temp_refs, __pyx_v_obj); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(17, 338, __pyx_L1_error)
 
     /* "src/lxml/extensions.pxi":339
  *         if isinstance(obj, _Element):
@@ -167804,12 +167837,12 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext__hold(struct __pyx_obj_4lxm
  *         elif _isString(obj) or not python.PySequence_Check(obj):
  */
     if (unlikely(__pyx_v_self->_temp_documents == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
       __PYX_ERR(17, 339, __pyx_L1_error)
     }
     __pyx_t_4 = ((PyObject *)((struct LxmlElement *)__pyx_v_obj)->_doc);
     __Pyx_INCREF(__pyx_t_4);
-    __pyx_t_5 = PySet_Add(__pyx_v_self->_temp_documents, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(17, 339, __pyx_L1_error)
+    __pyx_t_5 = PySet_Add(__pyx_v_self->_temp_documents, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(17, 339, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "src/lxml/extensions.pxi":340
@@ -167909,7 +167942,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext__hold(struct __pyx_obj_4lxm
       if (unlikely(!__pyx_t_8)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(17, 343, __pyx_L1_error)
         }
         break;
@@ -167937,7 +167970,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext__hold(struct __pyx_obj_4lxm
  *                 #print "Holding document:", <int>element._doc._c_doc
  *                 self._temp_documents.add((<_Element>o)._doc)
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree_10_TempStore_add(__pyx_v_self->_temp_refs, __pyx_v_o); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(17, 346, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree_10_TempStore_add(__pyx_v_self->_temp_refs, __pyx_v_o); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(17, 346, __pyx_L1_error)
 
       /* "src/lxml/extensions.pxi":348
  *                 self._temp_refs.add(o)
@@ -167947,12 +167980,12 @@ static PyObject *__pyx_f_4lxml_5etree_12_BaseContext__hold(struct __pyx_obj_4lxm
  *     @cython.final
  */
       if (unlikely(__pyx_v_self->_temp_documents == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
         __PYX_ERR(17, 348, __pyx_L1_error)
       }
       __pyx_t_8 = ((PyObject *)((struct LxmlElement *)__pyx_v_o)->_doc);
       __Pyx_INCREF(__pyx_t_8);
-      __pyx_t_5 = PySet_Add(__pyx_v_self->_temp_documents, __pyx_t_8); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(17, 348, __pyx_L1_error)
+      __pyx_t_5 = PySet_Add(__pyx_v_self->_temp_documents, __pyx_t_8); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(17, 348, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
       /* "src/lxml/extensions.pxi":344
@@ -168033,7 +168066,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree_12_BaseContext__findDocumentFor
       if (unlikely(!__pyx_t_3)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(17, 358, __pyx_L1_error)
         }
         break;
@@ -168207,7 +168240,7 @@ static void __pyx_f_4lxml_5etree__forwardXPathError(void *__pyx_v_c_ctxt, xmlErr
         PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
         __PYX_ERR(17, 403, __pyx_L1_error)
       }
-      __pyx_t_4 = PyTuple_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(17, 403, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(17, 403, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __pyx_t_1 = (__pyx_v_xpath_code < __pyx_t_4);
     }
@@ -168525,7 +168558,7 @@ static PyObject *__pyx_pf_4lxml_5etree_62Extension(CYTHON_UNUSED PyObject *__pyx
  *     if isinstance(function_mapping, dict):
  *         for function_name, xpath_name in function_mapping.items():
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 439, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 439, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_functions = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -168601,7 +168634,7 @@ static PyObject *__pyx_pf_4lxml_5etree_62Extension(CYTHON_UNUSED PyObject *__pyx
         if (unlikely(!__pyx_t_1)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(17, 441, __pyx_L1_error)
           }
           break;
@@ -168760,7 +168793,7 @@ static PyObject *__pyx_pf_4lxml_5etree_62Extension(CYTHON_UNUSED PyObject *__pyx
           if (unlikely(!__pyx_t_1)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(17, 445, __pyx_L1_error)
             }
             break;
@@ -168779,7 +168812,7 @@ static PyObject *__pyx_pf_4lxml_5etree_62Extension(CYTHON_UNUSED PyObject *__pyx
  */
         __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 446, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 446, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 446, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(17, 446, __pyx_L1_error)
@@ -168865,7 +168898,7 @@ static PyObject *__pyx_pf_4lxml_5etree_62Extension(CYTHON_UNUSED PyObject *__pyx
         if (unlikely(!__pyx_t_8)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(17, 447, __pyx_L1_error)
           }
           break;
@@ -168985,7 +169018,7 @@ static int __pyx_pf_4lxml_5etree_12_ExsltRegExp___cinit__(struct __pyx_obj_4lxml
  * 
  *     cdef _make_string(self, value):
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 459, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 459, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_compile_map);
@@ -169255,7 +169288,6 @@ static PyObject *__pyx_f_4lxml_5etree_12_ExsltRegExp__make_string(CYTHON_UNUSED
           {
             xmlFree(__pyx_v_c_text);
           }
-          __Pyx_PyThreadState_assign
           if (PY_MAJOR_VERSION >= 3) {
             __Pyx_XGIVEREF(__pyx_t_10);
             __Pyx_XGIVEREF(__pyx_t_11);
@@ -170285,7 +170317,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_4match(struct __pyx_obj_4l
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_groups); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 521, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 521, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 521, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_5 = NULL;
@@ -170359,7 +170391,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_4match(struct __pyx_obj_4l
  */
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Element); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 523, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 523, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 523, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_root = __pyx_t_3;
@@ -170416,7 +170448,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_4match(struct __pyx_obj_4l
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(17, 525, __pyx_L1_error)
         }
         break;
@@ -170572,7 +170604,7 @@ static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_4match(struct __pyx_obj_4l
  *         return result_list
  * 
  */
-    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_v_elem); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(17, 530, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_v_elem); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(17, 530, __pyx_L1_error)
 
     /* "src/lxml/extensions.pxi":525
  *         root = Element(u'matches')
@@ -170972,7 +171004,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_ExsltRegExp__register_in_context(struct
  */
   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_test); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 546, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context, __pyx_v_ns, __pyx_n_b_test, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(17, 546, __pyx_L1_error)
+  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context, __pyx_v_ns, __pyx_n_b_test, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(17, 546, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "src/lxml/extensions.pxi":547
@@ -170984,7 +171016,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_ExsltRegExp__register_in_context(struct
  */
   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_match); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 547, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context, __pyx_v_ns, __pyx_n_b_match, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(17, 547, __pyx_L1_error)
+  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context, __pyx_v_ns, __pyx_n_b_match, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(17, 547, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "src/lxml/extensions.pxi":548
@@ -170996,7 +171028,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_ExsltRegExp__register_in_context(struct
  */
   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 548, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context, __pyx_v_ns, __pyx_n_b_replace, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(17, 548, __pyx_L1_error)
+  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context, __pyx_v_ns, __pyx_n_b_replace, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(17, 548, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "src/lxml/extensions.pxi":544
@@ -171134,7 +171166,7 @@ static xmlXPathObject *__pyx_f_4lxml_5etree__wrapXPathObject(PyObject *__pyx_v_o
  */
   __pyx_t_3 = ((PyObject*)&PyBool_Type);
   __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(17, 565, __pyx_L1_error)
+  __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(17, 565, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
@@ -171323,7 +171355,7 @@ static xmlXPathObject *__pyx_f_4lxml_5etree__wrapXPathObject(PyObject *__pyx_v_o
             if (unlikely(!__pyx_t_11)) {
               PyObject* exc_type = PyErr_Occurred();
               if (exc_type) {
-                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                 else __PYX_ERR(17, 576, __pyx_L8_error)
               }
               break;
@@ -171698,7 +171730,6 @@ static xmlXPathObject *__pyx_f_4lxml_5etree__wrapXPathObject(PyObject *__pyx_v_o
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       goto __pyx_L13_try_end;
       __pyx_L8_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
@@ -171748,7 +171779,6 @@ static xmlXPathObject *__pyx_f_4lxml_5etree__wrapXPathObject(PyObject *__pyx_v_o
  *             for value in obj:
  *                 if isinstance(value, _Element):
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_XGIVEREF(__pyx_t_7);
       __Pyx_XGIVEREF(__pyx_t_8);
@@ -172445,7 +172475,7 @@ static PyObject *__pyx_f_4lxml_5etree__unpackNodeSetEntry(PyObject *__pyx_v_resu
  *     elif c_node.type == tree.XML_TEXT_NODE or \
  */
     if (unlikely(__pyx_v_results == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
       __PYX_ERR(17, 670, __pyx_L1_error)
     }
 
@@ -172466,7 +172496,7 @@ static PyObject *__pyx_f_4lxml_5etree__unpackNodeSetEntry(PyObject *__pyx_v_resu
  *             _fakeDocElementFactory(doc, c_node))
  *     elif c_node.type == tree.XML_TEXT_NODE or \
  */
-    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(17, 670, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(17, 670, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
     /* "src/lxml/extensions.pxi":662
@@ -172530,7 +172560,7 @@ static PyObject *__pyx_f_4lxml_5etree__unpackNodeSetEntry(PyObject *__pyx_v_resu
  *     elif c_node.type == tree.XML_NAMESPACE_DECL:
  */
     if (unlikely(__pyx_v_results == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
       __PYX_ERR(17, 675, __pyx_L1_error)
     }
 
@@ -172551,7 +172581,7 @@ static PyObject *__pyx_f_4lxml_5etree__unpackNodeSetEntry(PyObject *__pyx_v_resu
  *             _buildElementStringResult(doc, c_node, context))
  *     elif c_node.type == tree.XML_NAMESPACE_DECL:
  */
-    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(17, 675, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(17, 675, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
     /* "src/lxml/extensions.pxi":672
@@ -172582,7 +172612,7 @@ static PyObject *__pyx_f_4lxml_5etree__unpackNodeSetEntry(PyObject *__pyx_v_resu
  *     elif c_node.type == tree.XML_DOCUMENT_NODE or \
  */
     if (unlikely(__pyx_v_results == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
       __PYX_ERR(17, 678, __pyx_L1_error)
     }
     __pyx_t_3 = __pyx_f_4lxml_5etree_funicodeOrNone(((xmlNs *)__pyx_v_c_node)->prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 678, __pyx_L1_error)
@@ -172613,7 +172643,7 @@ static PyObject *__pyx_f_4lxml_5etree__unpackNodeSetEntry(PyObject *__pyx_v_resu
     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
     __pyx_t_3 = 0;
     __pyx_t_5 = 0;
-    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_6); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(17, 678, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_results, __pyx_t_6); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(17, 678, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
     /* "src/lxml/extensions.pxi":677
@@ -173986,7 +174016,6 @@ static PyObject *__pyx_f_4lxml_5etree__buildElementStringResult(struct LxmlDocum
         {
           xmlFree(__pyx_v_s);
         }
-        __Pyx_PyThreadState_assign
         if (PY_MAJOR_VERSION >= 3) {
           __Pyx_XGIVEREF(__pyx_t_9);
           __Pyx_XGIVEREF(__pyx_t_10);
@@ -174341,7 +174370,7 @@ static void __pyx_f_4lxml_5etree__extension_function_call(struct __pyx_obj_4lxml
  *         args.reverse()
  * 
  */
-          __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_args, __pyx_v_o); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(17, 837, __pyx_L6_error)
+          __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_args, __pyx_v_o); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(17, 837, __pyx_L6_error)
         }
 
         /* "src/lxml/extensions.pxi":838
@@ -174351,7 +174380,7 @@ static void __pyx_f_4lxml_5etree__extension_function_call(struct __pyx_obj_4lxml
  * 
  *         res = function(context, *args)
  */
-        __pyx_t_7 = PyList_Reverse(__pyx_v_args); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(17, 838, __pyx_L6_error)
+        __pyx_t_7 = PyList_Reverse(__pyx_v_args); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(17, 838, __pyx_L6_error)
 
         /* "src/lxml/extensions.pxi":840
  *         args.reverse()
@@ -174384,7 +174413,7 @@ static void __pyx_f_4lxml_5etree__extension_function_call(struct __pyx_obj_4lxml
  *         # prevent Python from deallocating elements handed to libxml2
  *         context._hold(res)
  */
-        __pyx_t_10 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_res, __pyx_v_doc, __pyx_v_context); if (unlikely(__pyx_t_10 == NULL)) __PYX_ERR(17, 842, __pyx_L6_error)
+        __pyx_t_10 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_res, __pyx_v_doc, __pyx_v_context); if (unlikely(__pyx_t_10 == ((xmlXPathObject *)NULL))) __PYX_ERR(17, 842, __pyx_L6_error)
         __pyx_v_obj = __pyx_t_10;
 
         /* "src/lxml/extensions.pxi":844
@@ -174420,7 +174449,6 @@ static void __pyx_f_4lxml_5etree__extension_function_call(struct __pyx_obj_4lxml
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       goto __pyx_L11_try_end;
       __pyx_L6_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -174470,14 +174498,12 @@ static void __pyx_f_4lxml_5etree__extension_function_call(struct __pyx_obj_4lxml
  *         args = []
  *         for i in range(nargs):
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
       goto __pyx_L4_error;
       __pyx_L7_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
@@ -174517,7 +174543,6 @@ static void __pyx_f_4lxml_5etree__extension_function_call(struct __pyx_obj_4lxml
         goto __pyx_L16_return;
       }
       __pyx_L16_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_11);
         __Pyx_XGIVEREF(__pyx_t_12);
@@ -174724,7 +174749,6 @@ static void __pyx_f_4lxml_5etree__xpath_function_call(xmlXPathParserContext *__p
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       goto __pyx_L11_try_end;
       __pyx_L6_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
 
@@ -174773,14 +174797,12 @@ static void __pyx_f_4lxml_5etree__xpath_function_call(xmlXPathParserContext *__p
  *         function = context._find_cached_function(rctxt.functionURI, rctxt.function)
  *         if function is not None:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
       goto __pyx_L4_error;
       __pyx_L7_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
@@ -174818,7 +174840,6 @@ static void __pyx_f_4lxml_5etree__xpath_function_call(xmlXPathParserContext *__p
         goto __pyx_L15_return;
       }
       __pyx_L15_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -175650,7 +175671,7 @@ static PyObject *__pyx_f_4lxml_5etree_13_XPathContext_registerVariables(struct _
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(18, 92, __pyx_L1_error)
         }
         break;
@@ -175731,7 +175752,7 @@ static PyObject *__pyx_f_4lxml_5etree_13_XPathContext_registerVariables(struct _
  * 
  *     cdef registerVariable(self, name, value):
  */
-    __pyx_t_9 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_value, ((struct LxmlDocument *)Py_None), ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None)); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(18, 95, __pyx_L1_error)
+    __pyx_t_9 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_value, ((struct LxmlDocument *)Py_None), ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None)); if (unlikely(__pyx_t_9 == ((xmlXPathObject *)NULL))) __PYX_ERR(18, 95, __pyx_L1_error)
 
     /* "src/lxml/xpath.pxi":94
  *         for name, value in variable_dict.items():
@@ -175815,7 +175836,7 @@ static PyObject *__pyx_f_4lxml_5etree_13_XPathContext_registerVariable(struct __
  * 
  * 
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_value, ((struct LxmlDocument *)Py_None), ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None)); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(18, 100, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_value, ((struct LxmlDocument *)Py_None), ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None)); if (unlikely(__pyx_t_2 == ((xmlXPathObject *)NULL))) __PYX_ERR(18, 100, __pyx_L1_error)
 
   /* "src/lxml/xpath.pxi":99
  *     cdef registerVariable(self, name, value):
@@ -177647,7 +177668,7 @@ static PyObject *__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__handle_result(struc
  * 
  *         if xpathObj is NULL:
  */
-    __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_context->__pyx_base._exc->__pyx_vtab)->_raise_if_stored(__pyx_v_self->_context->__pyx_base._exc); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(18, 223, __pyx_L1_error)
+    __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_context->__pyx_base._exc->__pyx_vtab)->_raise_if_stored(__pyx_v_self->_context->__pyx_base._exc); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(18, 223, __pyx_L1_error)
 
     /* "src/lxml/xpath.pxi":218
  * 
@@ -177787,7 +177808,6 @@ static PyObject *__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__handle_result(struc
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -177802,7 +177822,6 @@ static PyObject *__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__handle_result(struc
       __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
       goto __pyx_L1_error;
       __pyx_L10_error:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -177969,7 +177988,7 @@ static int __pyx_pf_4lxml_5etree_21XPathElementEvaluator___init__(struct __pyx_o
  *         _assertValidDoc(element._doc)
  *         self._element = element
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(18, 257, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(18, 257, __pyx_L1_error)
 
   /* "src/lxml/xpath.pxi":258
  *         cdef _Document doc
@@ -177980,7 +177999,7 @@ static int __pyx_pf_4lxml_5etree_21XPathElementEvaluator___init__(struct __pyx_o
  */
   __pyx_t_2 = ((PyObject *)__pyx_v_element->_doc);
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(18, 258, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_2)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(18, 258, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/xpath.pxi":259
@@ -178392,7 +178411,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_4register_namespa
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(18, 278, __pyx_L1_error)
         }
         break;
@@ -178637,7 +178656,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_6__call__(struct
  *         self._xpathCtxt.node = self._element._c_node
  *         try:
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(18, 298, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(18, 298, __pyx_L1_error)
 
   /* "src/lxml/xpath.pxi":299
  * 
@@ -178806,7 +178825,6 @@ static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_6__call__(struct
  */
         __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__unlock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self));
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_10);
@@ -178821,7 +178839,6 @@ static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_6__call__(struct
       __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
       goto __pyx_L1_error;
       __pyx_L10_error:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_10);
@@ -179003,7 +179020,7 @@ static int __pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___init__(struct __pyx_
   __Pyx_INCREF(((PyObject *)__pyx_v_etree->_context_node));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_etree->_context_node));
   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_etree->_context_node));
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 328, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 328, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_namespaces, __pyx_v_namespaces) < 0) __PYX_ERR(18, 328, __pyx_L1_error)
 
@@ -179200,7 +179217,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator_2__call__(struct
  *         try:
  *             self._context.register_context(doc)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(18, 347, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(18, 347, __pyx_L1_error)
 
   /* "src/lxml/xpath.pxi":348
  * 
@@ -179229,7 +179246,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator_2__call__(struct
  *             try:
  *                 self._context.registerVariables(_variables)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_self->__pyx_base._element->_c_node); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(18, 350, __pyx_L4_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_self->__pyx_base._element->_c_node); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(18, 350, __pyx_L4_error)
     __pyx_v_c_doc = __pyx_t_3;
 
     /* "src/lxml/xpath.pxi":351
@@ -179396,7 +179413,6 @@ static PyObject *__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator_2__call__(struct
           __Pyx_GOTREF(__pyx_t_1);
           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         }
-        __Pyx_PyThreadState_assign
         if (PY_MAJOR_VERSION >= 3) {
           __Pyx_XGIVEREF(__pyx_t_9);
           __Pyx_XGIVEREF(__pyx_t_10);
@@ -179411,7 +179427,6 @@ static PyObject *__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator_2__call__(struct
         __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
         goto __pyx_L4_error;
         __pyx_L13_error:;
-        __Pyx_PyThreadState_assign
         if (PY_MAJOR_VERSION >= 3) {
           __Pyx_XGIVEREF(__pyx_t_9);
           __Pyx_XGIVEREF(__pyx_t_10);
@@ -179458,7 +179473,6 @@ static PyObject *__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator_2__call__(struct
       {
         __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__unlock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self));
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_7);
@@ -179647,7 +179661,7 @@ static PyObject *__pyx_pf_4lxml_5etree_64XPathEvaluator(CYTHON_UNUSED PyObject *
     __Pyx_INCREF(__pyx_v_etree_or_element);
     __Pyx_GIVEREF(__pyx_v_etree_or_element);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_etree_or_element);
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 386, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 386, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_namespaces, __pyx_v_namespaces) < 0) __PYX_ERR(18, 386, __pyx_L1_error)
 
@@ -179708,7 +179722,7 @@ static PyObject *__pyx_pf_4lxml_5etree_64XPathEvaluator(CYTHON_UNUSED PyObject *
     __Pyx_INCREF(__pyx_v_etree_or_element);
     __Pyx_GIVEREF(__pyx_v_etree_or_element);
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_etree_or_element);
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 390, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 390, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_namespaces, __pyx_v_namespaces) < 0) __PYX_ERR(18, 390, __pyx_L1_error)
 
@@ -180255,7 +180269,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5XPath_4__call__(struct __pyx_obj_4lxml_5
  *         self._xpathCtxt.doc  = document._c_doc
  *         self._xpathCtxt.node = element._c_node
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(18, 435, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(18, 435, __pyx_L1_error)
 
   /* "src/lxml/xpath.pxi":436
  * 
@@ -180425,7 +180439,6 @@ static PyObject *__pyx_pf_4lxml_5etree_5XPath_4__call__(struct __pyx_obj_4lxml_5
  */
         __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__unlock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self));
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -180440,7 +180453,6 @@ static PyObject *__pyx_pf_4lxml_5etree_5XPath_4__call__(struct __pyx_obj_4lxml_5
       __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
       goto __pyx_L1_error;
       __pyx_L10_error:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -180526,7 +180538,7 @@ static PyObject *__pyx_pf_4lxml_5etree_5XPath_4path___get__(struct __pyx_obj_4lx
  */
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(__pyx_v_self->_path == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
     __PYX_ERR(18, 455, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_decode_bytes(__pyx_v_self->_path, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 455, __pyx_L1_error)
@@ -180861,7 +180873,7 @@ static int __pyx_pf_4lxml_5etree_7ETXPath___init__(struct __pyx_obj_4lxml_5etree
   __Pyx_INCREF(__pyx_v_path);
   __Pyx_GIVEREF(__pyx_v_path);
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 482, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 482, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_namespaces, __pyx_v_namespaces) < 0) __PYX_ERR(18, 482, __pyx_L1_error)
 
@@ -180964,7 +180976,7 @@ static PyObject *__pyx_f_4lxml_5etree_7ETXPath__nsextract_path(CYTHON_UNUSED str
  *         cdef list namespace_defs = []
  *         cdef int i
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 488, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 488, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_namespaces = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -181142,7 +181154,7 @@ static PyObject *__pyx_f_4lxml_5etree_7ETXPath__nsextract_path(CYTHON_UNUSED str
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(18, 494, __pyx_L1_error)
         }
         break;
@@ -181191,7 +181203,7 @@ static PyObject *__pyx_f_4lxml_5etree_7ETXPath__nsextract_path(CYTHON_UNUSED str
  *                 namespace = namespace_def[1:-1] # remove '{}'
  *                 namespace = (<bytes>namespace).decode('utf8')
  */
-      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_namespace_defs, __pyx_v_namespace_def); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(18, 498, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_namespace_defs, __pyx_v_namespace_def); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(18, 498, __pyx_L1_error)
 
       /* "src/lxml/xpath.pxi":499
  *                 i += 1
@@ -181200,7 +181212,7 @@ static PyObject *__pyx_f_4lxml_5etree_7ETXPath__nsextract_path(CYTHON_UNUSED str
  *                 namespace = (<bytes>namespace).decode('utf8')
  *                 namespaces[prefix.decode('utf8')] = namespace
  */
-      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_namespace_def, 1, -1L, NULL, NULL, &__pyx_slice__100, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 499, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_namespace_def, 1, -1L, NULL, NULL, &__pyx_slice__102, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 499, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_XDECREF_SET(__pyx_v_namespace, __pyx_t_1);
       __pyx_t_1 = 0;
@@ -181213,7 +181225,7 @@ static PyObject *__pyx_f_4lxml_5etree_7ETXPath__nsextract_path(CYTHON_UNUSED str
  *                 prefix_str = prefix + b':'
  */
       if (unlikely(__pyx_v_namespace == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
         __PYX_ERR(18, 500, __pyx_L1_error)
       }
       __pyx_t_1 = __Pyx_decode_bytes(((PyObject*)__pyx_v_namespace), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 500, __pyx_L1_error)
@@ -181229,7 +181241,7 @@ static PyObject *__pyx_f_4lxml_5etree_7ETXPath__nsextract_path(CYTHON_UNUSED str
  *                 # FIXME: this also replaces {namespaces} within strings!
  */
       if (unlikely(__pyx_v_prefix == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
         __PYX_ERR(18, 501, __pyx_L1_error)
       }
       __pyx_t_1 = __Pyx_decode_bytes(__pyx_v_prefix, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 501, __pyx_L1_error)
@@ -181333,7 +181345,7 @@ static PyObject *__pyx_f_4lxml_5etree_7ETXPath__nsextract_path(CYTHON_UNUSED str
  */
   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_utf, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 505, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_1);
@@ -181677,7 +181689,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *                 return c_return_doc  # 'goto', see 'finally' below
  * 
  */
-            __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc, 1); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(3, 83, __pyx_L6_error)
+            __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 83, __pyx_L6_error)
             __pyx_v_c_return_doc = __pyx_t_2;
 
             /* "src/lxml/xslt.pxi":84
@@ -181863,7 +181875,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *                     doc_ref._data_bytes, doc_ref._filename, context._parser)
  *             elif doc_ref._type == PARSER_DATA_FILENAME:
  */
-            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDoc(__pyx_t_1, __pyx_t_8, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_11)); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(3, 95, __pyx_L6_error)
+            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDoc(__pyx_t_1, __pyx_t_8, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_11)); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 95, __pyx_L6_error)
             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
             __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
@@ -181906,7 +181918,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *                     doc_ref._filename, context._parser)
  *             elif doc_ref._type == PARSER_DATA_FILE:
  */
-            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDocFromFile(__pyx_t_11, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_8)); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(3, 98, __pyx_L6_error)
+            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDocFromFile(__pyx_t_11, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_8)); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 98, __pyx_L6_error)
             __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
             __pyx_v_c_return_doc = __pyx_t_2;
@@ -181950,7 +181962,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *                     doc_ref._file, doc_ref._filename, context._parser)
  *             elif doc_ref._type == PARSER_DATA_EMPTY:
  */
-            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDocFromFilelike(__pyx_t_8, __pyx_t_11, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1)); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(3, 101, __pyx_L6_error)
+            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDocFromFilelike(__pyx_t_8, __pyx_t_11, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 101, __pyx_L6_error)
             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
             __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -181981,7 +181993,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *             if c_return_doc is not NULL and c_return_doc.URL is NULL:
  *                 c_return_doc.URL = tree.xmlStrdup(c_uri)
  */
-            __pyx_t_2 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(3, 104, __pyx_L6_error)
+            __pyx_t_2 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 104, __pyx_L6_error)
             __pyx_v_c_return_doc = __pyx_t_2;
 
             /* "src/lxml/xslt.pxi":103
@@ -182053,7 +182065,6 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       goto __pyx_L11_try_end;
       __pyx_L6_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
@@ -182104,21 +182115,18 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *         if c_doc is not NULL and c_doc.URL is not NULL:
  *             if tree.xmlStrcmp(c_uri, c_doc.URL) == 0:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
       goto __pyx_L4_error;
       __pyx_L10_try_return:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
       goto __pyx_L3_return;
       __pyx_L7_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
@@ -182161,7 +182169,6 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
         goto __pyx_L23_return;
       }
       __pyx_L23_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_13);
@@ -182339,7 +182346,6 @@ static void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(const xmlChar *_
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -182383,14 +182389,12 @@ static void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(const xmlChar *_
  *         message = u"Cannot resolve URI %s" % _decodeFilename(c_uri)
  *         if c_type == xslt.XSLT_LOAD_DOCUMENT:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L4_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -183168,7 +183172,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_7options___get__(stru
  *                 u'write_file': self._optval(xslt.XSLT_SECPREF_WRITE_FILE),
  *                 u'create_dir': self._optval(xslt.XSLT_SECPREF_CREATE_DIRECTORY),
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 229, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 229, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_READ_FILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 229, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
@@ -183431,7 +183435,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_6__repr__(struct __py
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_1 = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
-  __pyx_t_5 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 248, __pyx_L1_error)
+  __pyx_t_5 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 248, __pyx_L1_error)
   __pyx_v_items = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
@@ -183455,7 +183459,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_6__repr__(struct __py
   __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_6, 0, strlen(__pyx_t_6), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 250, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (unlikely(__pyx_t_1 == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "split");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "split");
     __PYX_ERR(3, 250, __pyx_L1_error)
   }
   __pyx_t_4 = PyUnicode_Split(__pyx_t_1, __pyx_kp_u__4, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 250, __pyx_L1_error)
@@ -183495,7 +183499,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_6__repr__(struct __py
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__102, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 251, __pyx_L1_error)
+  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__104, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 251, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
@@ -183890,7 +183894,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
         if (unlikely(!__pyx_t_4)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(3, 279, __pyx_L1_error)
           }
           break;
@@ -184014,7 +184018,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  *                         extensions = extensions.copy()
  *                     ns_utf   = _utf8(ns_name_tuple[0])
  */
-          __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 285, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 285, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           __Pyx_GIVEREF(__pyx_t_4);
           __Pyx_GOTREF(__pyx_v_self->_extension_elements);
@@ -184861,7 +184865,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  * 
  *         # make sure we always have a stylesheet URL
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(3, 380, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 380, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":383
@@ -184978,7 +184982,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *         c_doc._private = <python.PyObject*>self._xslt_resolver_context
  * 
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc, 1); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(3, 392, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 392, __pyx_L1_error)
   __pyx_v_self->_xslt_resolver_context->_c_style_doc = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":393
@@ -185000,7 +185004,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
   /*with:*/ {
     __pyx_t_6 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->_error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 395, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->_error_log); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 395, __pyx_L4_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->_error_log); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 395, __pyx_L4_error)
     /*try:*/ {
       {
         if (__pyx_t_8||__pyx_t_9||__pyx_t_10); else {/*mark used*/}
@@ -185028,7 +185032,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
     /*finally:*/ {
       /*normal exit:*/{
         if (__pyx_t_6) {
-          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__103, NULL);
+          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__105, NULL);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 395, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_10);
@@ -185107,7 +185111,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *             # last error seems to be the most accurate here
  *             if self._error_log.last_error is not None and \
  */
-    __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_self->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self->_xslt_resolver_context)); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 402, __pyx_L1_error)
+    __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_self->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self->_xslt_resolver_context)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 402, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":404
  *             self._xslt_resolver_context._raise_if_stored()
@@ -185693,7 +185697,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_8set_global_max_depth(int __pyx_v_m
  *         xslt.xsltMaxDepth = max_depth
  * 
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 462, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 462, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -185832,7 +185836,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_10apply(struct __pyx_obj_4lxml_5etr
   __Pyx_INCREF(__pyx_v__input);
   __Pyx_GIVEREF(__pyx_v__input);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__input);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 469, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 469, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_profile_run, __pyx_v_profile_run) < 0) __PYX_ERR(3, 469, __pyx_L1_error)
   __pyx_t_2 = __pyx_t_3;
@@ -186283,7 +186287,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_input_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(3, 512, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_input_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 512, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":514
@@ -186815,7 +186819,6 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  */
         __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_input_doc->_c_doc, __pyx_v_c_doc);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_14);
@@ -186830,7 +186833,6 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
       __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9;
       goto __pyx_L1_error;
       __pyx_L18_error:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_XGIVEREF(__pyx_t_14);
@@ -186918,7 +186920,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *             if context._exc._has_raised():
  */
-      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 576, __pyx_L21_error)
+      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 576, __pyx_L21_error)
 
       /* "src/lxml/xslt.pxi":572
  * 
@@ -186983,7 +186985,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *             if c_result is NULL:
  */
-      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->__pyx_base._exc->__pyx_vtab)->_raise_if_stored(__pyx_v_context->__pyx_base._exc); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 582, __pyx_L21_error)
+      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->__pyx_base._exc->__pyx_vtab)->_raise_if_stored(__pyx_v_context->__pyx_base._exc); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 582, __pyx_L21_error)
 
       /* "src/lxml/xslt.pxi":578
  *                 resolver_context._raise_if_stored()
@@ -187279,7 +187281,6 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  */
         }
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -187755,7 +187756,7 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(3, 642, __pyx_L1_error)
   }
-  __pyx_t_2 = PyDict_Size(__pyx_v_parameters); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(3, 642, __pyx_L1_error)
+  __pyx_t_2 = PyDict_Size(__pyx_v_parameters); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 642, __pyx_L1_error)
   __pyx_v_parameter_count = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":643
@@ -187859,7 +187860,7 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
  */
       __pyx_t_2 = 0;
       if (unlikely(__pyx_v_parameters == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
         __PYX_ERR(3, 653, __pyx_L5_error)
       }
       __pyx_t_10 = __Pyx_dict_iterator(__pyx_v_parameters, 1, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 653, __pyx_L5_error)
@@ -187992,7 +187993,7 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
             PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
             __PYX_ERR(3, 664, __pyx_L5_error)
           }
-          __pyx_t_14 = PyBytes_GET_SIZE(__pyx_v_k); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(3, 664, __pyx_L5_error)
+          __pyx_t_14 = PyBytes_GET_SIZE(__pyx_v_k); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(3, 664, __pyx_L5_error)
           (__pyx_v_params[__pyx_v_i]) = ((const char *)xmlDictLookup(__pyx_v_c_dict, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_k), __pyx_t_14));
 
           /* "src/lxml/xslt.pxi":665
@@ -188015,7 +188016,7 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
             PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
             __PYX_ERR(3, 666, __pyx_L5_error)
           }
-          __pyx_t_14 = PyBytes_GET_SIZE(__pyx_v_v); if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(3, 666, __pyx_L5_error)
+          __pyx_t_14 = PyBytes_GET_SIZE(__pyx_v_v); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(3, 666, __pyx_L5_error)
           (__pyx_v_params[__pyx_v_i]) = ((const char *)xmlDictLookup(__pyx_v_c_dict, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_v), __pyx_t_14));
 
           /* "src/lxml/xslt.pxi":667
@@ -188044,7 +188045,6 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     goto __pyx_L10_try_end;
     __pyx_L5_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -188095,7 +188095,6 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
  *         i = 0
  *         for key, value in parameters.iteritems():
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
@@ -188264,7 +188263,7 @@ static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct
  *         stylesheet._xslt_resolver_context._c_style_doc, 1)
  * 
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_stylesheet->_xslt_resolver_context->_c_style_doc, 1); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(3, 684, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_stylesheet->_xslt_resolver_context->_c_style_doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 684, __pyx_L1_error)
   __pyx_v_new_xslt->_xslt_resolver_context->_c_style_doc = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":687
@@ -188274,7 +188273,7 @@ static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct
  *     new_xslt._c_style = xslt.xsltParseStylesheetDoc(c_doc)
  *     if new_xslt._c_style is NULL:
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_stylesheet->_c_style->doc, 1); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(3, 687, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_stylesheet->_c_style->doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 687, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":688
@@ -188550,7 +188549,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_write_output(struct __p
  */
       __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_XSLTSaveError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 729, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 729, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 729, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_Raise(__pyx_t_4, 0, 0, 0);
@@ -188798,7 +188797,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_write_output(struct __p
  *         if r == -1:
  *             python.PyErr_SetFromErrno(XSLTSaveError)  # raises
  */
-    __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(3, 746, __pyx_L1_error)
+    __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 746, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":745
  *             else:
@@ -189307,7 +189306,6 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_2__str__(struct __pyx_o
       {
         xmlFree(__pyx_v_s);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_11);
         __Pyx_XGIVEREF(__pyx_t_12);
@@ -189559,7 +189557,6 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_4__unicode__(struct __p
       {
         xmlFree(__pyx_v_s);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -190538,9 +190535,9 @@ static PyObject *__pyx_f_4lxml_5etree__findStylesheetByID(struct LxmlDocument *_
  *     return __findStylesheetByID(doc, id=id)
  * 
  */
-    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 887, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 887, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 887, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 887, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_xsl, __pyx_kp_u_http_www_w3_org_1999_XSL_Transfo) < 0) __PYX_ERR(3, 887, __pyx_L1_error)
     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_namespaces, __pyx_t_4) < 0) __PYX_ERR(3, 887, __pyx_L1_error)
@@ -190553,7 +190550,7 @@ static PyObject *__pyx_f_4lxml_5etree__findStylesheetByID(struct LxmlDocument *_
  *             u"//xsl:stylesheet[@xml:id = $id]",
  *             namespaces={u"xsl" : u"http://www.w3.org/1999/XSL/Transform"})
  */
-    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPath), __pyx_tuple__106, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPath), __pyx_tuple__108, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_XGOTREF(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID));
@@ -190583,7 +190580,7 @@ static PyObject *__pyx_f_4lxml_5etree__findStylesheetByID(struct LxmlDocument *_
   __Pyx_INCREF(((PyObject *)__pyx_v_doc));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_doc));
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 888, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 888, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_id, __pyx_v_id) < 0) __PYX_ERR(3, 888, __pyx_L1_error)
   __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 888, __pyx_L1_error)
@@ -190718,7 +190715,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *         if self._c_node.content is NULL:
  *             raise ValueError, u"PI lacks content"
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(3, 907, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 907, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":908
  *         cdef xmlAttr* c_attr
@@ -190819,7 +190816,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *             raise ValueError, u"malformed PI attributes"
  *         hrefs = hrefs[0]
  */
-  __pyx_t_9 = PyObject_Length(__pyx_v_hrefs); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 911, __pyx_L1_error)
+  __pyx_t_9 = PyObject_Length(__pyx_v_hrefs); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(3, 911, __pyx_L1_error)
   __pyx_t_2 = ((__pyx_t_9 != 1) != 0);
   if (__pyx_t_2) {
 
@@ -190978,7 +190975,6 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
           {
             xmlFree(((char *)__pyx_v_c_href));
           }
-          __Pyx_PyThreadState_assign
           if (PY_MAJOR_VERSION >= 3) {
             __Pyx_XGIVEREF(__pyx_t_15);
             __Pyx_XGIVEREF(__pyx_t_16);
@@ -191050,7 +191046,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  */
   __pyx_t_5 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._doc);
   __Pyx_INCREF(__pyx_t_5);
-  __pyx_t_10 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_5)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(3, 932, __pyx_L1_error)
+  __pyx_t_10 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_5)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 932, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "src/lxml/xslt.pxi":933
@@ -191185,7 +191181,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *             raise ValueError, u"ambiguous reference to embedded stylesheet"
  *         result_node = root[0]
  */
-  __pyx_t_9 = PyObject_Length(__pyx_v_root); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 943, __pyx_L1_error)
+  __pyx_t_9 = PyObject_Length(__pyx_v_root); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(3, 943, __pyx_L1_error)
   __pyx_t_18 = ((__pyx_t_9 > 1) != 0);
   if (__pyx_t_18) {
 
@@ -191426,7 +191422,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
     __pyx_t_2 = __pyx_t_3;
     goto __pyx_L5_bool_binop_done;
   }
-  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__107, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 959, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__109, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 959, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_3 != 0);
   __pyx_t_2 = __pyx_t_1;
   __pyx_L5_bool_binop_done:;
@@ -191910,7 +191906,7 @@ static PyObject *__pyx_pf_4lxml_5etree_13XSLTExtension_2apply_templates(struct _
  *         #assert c_context_node.doc is context._xsltContext.node.doc, \
  *         #    "switching input documents during transformation is not currently supported"
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_node); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(19, 48, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_node); if (unlikely(__pyx_t_1 == ((xmlNode *)NULL))) __PYX_ERR(19, 48, __pyx_L1_error)
   __pyx_v_c_context_node = __pyx_t_1;
 
   /* "src/lxml/xsltext.pxi":52
@@ -191931,7 +191927,7 @@ static PyObject *__pyx_pf_4lxml_5etree_13XSLTExtension_2apply_templates(struct _
  *         else:
  *             c_parent = tree.xmlNewDocNode(
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__nonRoNodeOf(__pyx_v_output_parent); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(19, 53, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__nonRoNodeOf(__pyx_v_output_parent); if (unlikely(__pyx_t_1 == ((xmlNode *)NULL))) __PYX_ERR(19, 53, __pyx_L1_error)
     __pyx_v_c_parent = __pyx_t_1;
 
     /* "src/lxml/xsltext.pxi":52
@@ -192101,7 +192097,6 @@ static PyObject *__pyx_pf_4lxml_5etree_13XSLTExtension_2apply_templates(struct _
       {
         xmlFreeNode(__pyx_v_c_parent);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_11);
         __Pyx_XGIVEREF(__pyx_t_12);
@@ -192330,7 +192325,7 @@ static PyObject *__pyx_pf_4lxml_5etree_13XSLTExtension_4process_children(struct
  *         else:
  *             c_parent = tree.xmlNewDocNode(
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree__nonRoNodeOf(__pyx_v_output_parent); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(19, 106, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__nonRoNodeOf(__pyx_v_output_parent); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(19, 106, __pyx_L1_error)
     __pyx_v_c_parent = __pyx_t_2;
 
     /* "src/lxml/xsltext.pxi":105
@@ -192490,7 +192485,6 @@ static PyObject *__pyx_pf_4lxml_5etree_13XSLTExtension_4process_children(struct
       {
         xmlFreeNode(__pyx_v_c_parent);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_13);
@@ -192680,7 +192674,7 @@ static PyObject *__pyx_f_4lxml_5etree_13XSLTExtension__collectXSLTResultContent(
  *                     s = None
  *             elif c_node.type == tree.XML_ELEMENT_NODE:
  */
-          __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_s); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(19, 139, __pyx_L1_error)
+          __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_s); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(19, 139, __pyx_L1_error)
 
           /* "src/lxml/xsltext.pxi":138
  *                 if not elements_only:
@@ -192758,7 +192752,7 @@ static PyObject *__pyx_f_4lxml_5etree_13XSLTExtension__collectXSLTResultContent(
  *                 # unlink node and make sure it will be freed later on
  *                 tree.xmlUnlinkNode(c_node)
  */
-      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_results, ((PyObject *)__pyx_v_proxy)); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(19, 144, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_results, ((PyObject *)__pyx_v_proxy)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(19, 144, __pyx_L1_error)
 
       /* "src/lxml/xsltext.pxi":146
  *                 results.append(proxy)
@@ -192914,7 +192908,7 @@ static PyObject *__pyx_f_4lxml_5etree__registerXSLTExtensions(xsltTransformConte
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(19, 157, __pyx_L1_error)
         }
         break;
@@ -193691,7 +193685,6 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
  */
                   }
                 }
-                __Pyx_PyThreadState_assign
                 if (PY_MAJOR_VERSION >= 3) {
                   __Pyx_XGIVEREF(__pyx_t_19);
                   __Pyx_XGIVEREF(__pyx_t_20);
@@ -193706,7 +193699,6 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
                 __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
                 goto __pyx_L14_error;
                 __pyx_L28_error:;
-                __Pyx_PyThreadState_assign
                 if (PY_MAJOR_VERSION >= 3) {
                   __Pyx_XGIVEREF(__pyx_t_19);
                   __Pyx_XGIVEREF(__pyx_t_20);
@@ -193735,7 +193727,6 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
           goto __pyx_L19_try_end;
           __pyx_L14_error:;
-          __Pyx_PyThreadState_assign
           __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -193808,7 +193799,6 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
               __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
               goto __pyx_L39_try_end;
               __pyx_L32_error:;
-              __Pyx_PyThreadState_assign
               __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
               __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
 
@@ -193838,7 +193828,7 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
                 __pyx_t_25 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_encode); if (unlikely(!__pyx_t_25)) __PYX_ERR(19, 224, __pyx_L34_except_error)
                 __Pyx_GOTREF(__pyx_t_25);
                 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
-                __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_25, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_24)) __PYX_ERR(19, 224, __pyx_L34_except_error)
+                __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_25, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_24)) __PYX_ERR(19, 224, __pyx_L34_except_error)
                 __Pyx_GOTREF(__pyx_t_24);
                 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
                 __Pyx_DECREF_SET(__pyx_v_e, __pyx_t_24);
@@ -193857,14 +193847,12 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
  *                 e = unicode(e).encode(u"UTF-8")
  *             except:
  */
-              __Pyx_PyThreadState_assign
               __Pyx_XGIVEREF(__pyx_t_21);
               __Pyx_XGIVEREF(__pyx_t_20);
               __Pyx_XGIVEREF(__pyx_t_19);
               __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
               goto __pyx_L16_except_error;
               __pyx_L33_exception_handled:;
-              __Pyx_PyThreadState_assign
               __Pyx_XGIVEREF(__pyx_t_21);
               __Pyx_XGIVEREF(__pyx_t_20);
               __Pyx_XGIVEREF(__pyx_t_19);
@@ -193891,7 +193879,11 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
  *             context._exc._store_raised()
  *         except:
  */
-            __pyx_t_26 = __Pyx_PyObject_AsWritableString(__pyx_v_message); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(19, 228, __pyx_L16_except_error)
+            if (unlikely(__pyx_v_message == Py_None)) {
+              PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+              __PYX_ERR(19, 228, __pyx_L16_except_error)
+            }
+            __pyx_t_26 = __Pyx_PyBytes_AsWritableString(__pyx_v_message); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(19, 228, __pyx_L16_except_error)
             xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, ((char *)"%s"), __pyx_t_26);
 
             /* "src/lxml/xsltext.pxi":229
@@ -193941,7 +193933,11 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
  *             context._exc._store_raised()
  *     except:
  */
-            __pyx_t_26 = __Pyx_PyObject_AsWritableString(__pyx_v_message); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(19, 234, __pyx_L16_except_error)
+            if (unlikely(__pyx_v_message == Py_None)) {
+              PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+              __PYX_ERR(19, 234, __pyx_L16_except_error)
+            }
+            __pyx_t_26 = __Pyx_PyBytes_AsWritableString(__pyx_v_message); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) __PYX_ERR(19, 234, __pyx_L16_except_error)
             xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, ((char *)"%s"), __pyx_t_26);
 
             /* "src/lxml/xsltext.pxi":235
@@ -193966,14 +193962,12 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
  *             dict_result = python.PyDict_GetItem(
  *                 context._extension_elements, (c_uri, c_inst_node.name))
  */
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_6);
           __Pyx_XGIVEREF(__pyx_t_7);
           __Pyx_XGIVEREF(__pyx_t_8);
           __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
           goto __pyx_L8_error;
           __pyx_L15_exception_handled:;
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_6);
           __Pyx_XGIVEREF(__pyx_t_7);
           __Pyx_XGIVEREF(__pyx_t_8);
@@ -193994,7 +193988,6 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       goto __pyx_L13_try_end;
       __pyx_L8_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
       __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -194049,14 +194042,12 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
  *         try:
  *             dict_result = python.PyDict_GetItem(
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
       goto __pyx_L6_error;
       __pyx_L9_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_XGIVEREF(__pyx_t_4);
       __Pyx_XGIVEREF(__pyx_t_5);
@@ -194099,7 +194090,6 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
         goto __pyx_L46_return;
       }
       __pyx_L46_return:;
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_7);
@@ -194137,7 +194127,7 @@ static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__p
   #endif
 }
 
-/* "lxml/etree.pyx":3529
+/* "lxml/etree.pyx":3532
  *     u"Base class for XML validators."
  *     cdef _ErrorLog _error_log
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -194167,14 +194157,14 @@ static int __pyx_pf_4lxml_5etree_10_Validator___cinit__(struct __pyx_obj_4lxml_5
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "lxml/etree.pyx":3530
+  /* "lxml/etree.pyx":3533
  *     cdef _ErrorLog _error_log
  *     def __cinit__(self):
  *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<<
  * 
  *     def validate(self, etree):
  */
-  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3530, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3533, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_error_log);
@@ -194182,7 +194172,7 @@ static int __pyx_pf_4lxml_5etree_10_Validator___cinit__(struct __pyx_obj_4lxml_5
   __pyx_v_self->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":3529
+  /* "lxml/etree.pyx":3532
  *     u"Base class for XML validators."
  *     cdef _ErrorLog _error_log
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -194202,7 +194192,7 @@ static int __pyx_pf_4lxml_5etree_10_Validator___cinit__(struct __pyx_obj_4lxml_5
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3532
+/* "lxml/etree.pyx":3535
  *         self._error_log = _ErrorLog()
  * 
  *     def validate(self, etree):             # <<<<<<<<<<<<<<
@@ -194234,7 +194224,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_2validate(struct __pyx_obj_4
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("validate", 0);
 
-  /* "lxml/etree.pyx":3539
+  /* "lxml/etree.pyx":3542
  *         Returns true if document is valid, false if not.
  *         """
  *         return self(etree)             # <<<<<<<<<<<<<<
@@ -194254,13 +194244,13 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_2validate(struct __pyx_obj_4
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3539, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3542, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_etree};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3539, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3542, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else
@@ -194268,19 +194258,19 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_2validate(struct __pyx_obj_4
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_etree};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3539, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3542, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else
     #endif
     {
-      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3539, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3542, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_INCREF(__pyx_v_etree);
       __Pyx_GIVEREF(__pyx_v_etree);
       PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_etree);
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3539, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3542, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     }
@@ -194290,7 +194280,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_2validate(struct __pyx_obj_4
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3532
+  /* "lxml/etree.pyx":3535
  *         self._error_log = _ErrorLog()
  * 
  *     def validate(self, etree):             # <<<<<<<<<<<<<<
@@ -194312,7 +194302,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_2validate(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3541
+/* "lxml/etree.pyx":3544
  *         return self(etree)
  * 
  *     def assertValid(self, etree):             # <<<<<<<<<<<<<<
@@ -194346,7 +194336,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_4assertValid(struct __pyx_ob
   int __pyx_t_6;
   __Pyx_RefNannySetupContext("assertValid", 0);
 
-  /* "lxml/etree.pyx":3546
+  /* "lxml/etree.pyx":3549
  *         Raises `DocumentInvalid` if the document does not comply with the schema.
  *         """
  *         if not self(etree):             # <<<<<<<<<<<<<<
@@ -194365,13 +194355,13 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_4assertValid(struct __pyx_ob
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3546, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3549, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_etree};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3546, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3549, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else
@@ -194379,47 +194369,47 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_4assertValid(struct __pyx_ob
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_etree};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3546, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3549, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else
     #endif
     {
-      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3546, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3549, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_INCREF(__pyx_v_etree);
       __Pyx_GIVEREF(__pyx_v_etree);
       PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_etree);
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3546, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3549, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     }
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3546, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3549, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_6 = ((!__pyx_t_5) != 0);
   if (__pyx_t_6) {
 
-    /* "lxml/etree.pyx":3547
+    /* "lxml/etree.pyx":3550
  *         """
  *         if not self(etree):
  *             raise DocumentInvalid(self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<<
  *                     u"Document does not comply with schema"),
  *                                   self._error_log)
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), __pyx_kp_u_Document_does_not_comply_with_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3547, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), __pyx_kp_u_Document_does_not_comply_with_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3550, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
 
-    /* "lxml/etree.pyx":3549
+    /* "lxml/etree.pyx":3552
  *             raise DocumentInvalid(self._error_log._buildExceptionMessage(
  *                     u"Document does not comply with schema"),
  *                                   self._error_log)             # <<<<<<<<<<<<<<
  * 
  *     def assert_(self, etree):
  */
-    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3547, __pyx_L1_error)
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3550, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_GIVEREF(__pyx_t_1);
     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
@@ -194428,21 +194418,21 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_4assertValid(struct __pyx_ob
     PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->_error_log));
     __pyx_t_1 = 0;
 
-    /* "lxml/etree.pyx":3547
+    /* "lxml/etree.pyx":3550
  *         """
  *         if not self(etree):
  *             raise DocumentInvalid(self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<<
  *                     u"Document does not comply with schema"),
  *                                   self._error_log)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_DocumentInvalid), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3547, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_DocumentInvalid), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3550, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3547, __pyx_L1_error)
+    __PYX_ERR(0, 3550, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":3546
+    /* "lxml/etree.pyx":3549
  *         Raises `DocumentInvalid` if the document does not comply with the schema.
  *         """
  *         if not self(etree):             # <<<<<<<<<<<<<<
@@ -194451,7 +194441,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_4assertValid(struct __pyx_ob
  */
   }
 
-  /* "lxml/etree.pyx":3541
+  /* "lxml/etree.pyx":3544
  *         return self(etree)
  * 
  *     def assertValid(self, etree):             # <<<<<<<<<<<<<<
@@ -194475,7 +194465,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_4assertValid(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3551
+/* "lxml/etree.pyx":3554
  *                                   self._error_log)
  * 
  *     def assert_(self, etree):             # <<<<<<<<<<<<<<
@@ -194509,7 +194499,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_6assert_(struct __pyx_obj_4l
   int __pyx_t_6;
   __Pyx_RefNannySetupContext("assert_", 0);
 
-  /* "lxml/etree.pyx":3556
+  /* "lxml/etree.pyx":3559
  *         Raises `AssertionError` if the document does not comply with the schema.
  *         """
  *         if not self(etree):             # <<<<<<<<<<<<<<
@@ -194528,13 +194518,13 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_6assert_(struct __pyx_obj_4l
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3556, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3559, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_etree};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3556, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3559, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else
@@ -194542,43 +194532,43 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_6assert_(struct __pyx_obj_4l
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_etree};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3556, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3559, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else
     #endif
     {
-      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3556, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3559, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_INCREF(__pyx_v_etree);
       __Pyx_GIVEREF(__pyx_v_etree);
       PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_etree);
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3556, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3559, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     }
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3556, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 3559, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_6 = ((!__pyx_t_5) != 0);
   if (__pyx_t_6) {
 
-    /* "lxml/etree.pyx":3557
+    /* "lxml/etree.pyx":3560
  *         """
  *         if not self(etree):
  *             raise AssertionError, self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<<
  *                 u"Document does not comply with schema")
  * 
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), __pyx_kp_u_Document_does_not_comply_with_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3557, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), __pyx_kp_u_Document_does_not_comply_with_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3560, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(0, 3557, __pyx_L1_error)
+    __PYX_ERR(0, 3560, __pyx_L1_error)
 
-    /* "lxml/etree.pyx":3556
+    /* "lxml/etree.pyx":3559
  *         Raises `AssertionError` if the document does not comply with the schema.
  *         """
  *         if not self(etree):             # <<<<<<<<<<<<<<
@@ -194587,7 +194577,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_6assert_(struct __pyx_obj_4l
  */
   }
 
-  /* "lxml/etree.pyx":3551
+  /* "lxml/etree.pyx":3554
  *                                   self._error_log)
  * 
  *     def assert_(self, etree):             # <<<<<<<<<<<<<<
@@ -194611,7 +194601,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_6assert_(struct __pyx_obj_4l
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3560
+/* "lxml/etree.pyx":3563
  *                 u"Document does not comply with schema")
  * 
  *     cpdef _append_log_message(self, int domain, int type, int level, int line,             # <<<<<<<<<<<<<<
@@ -194638,17 +194628,17 @@ static PyObject *__pyx_f_4lxml_5etree_10_Validator__append_log_message(struct __
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_append_log_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3560, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_append_log_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3563, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_4lxml_5etree_10_Validator_9_append_log_message)) {
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3560, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3563, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3560, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3563, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_level); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3560, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_level); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3563, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3560, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3563, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_7 = __pyx_t_1; __pyx_t_8 = NULL;
@@ -194666,7 +194656,7 @@ static PyObject *__pyx_f_4lxml_5etree_10_Validator__append_log_message(struct __
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_7)) {
         PyObject *__pyx_temp[7] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_message, __pyx_v_filename};
-        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 6+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3560, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 6+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3563, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -194678,7 +194668,7 @@ static PyObject *__pyx_f_4lxml_5etree_10_Validator__append_log_message(struct __
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
         PyObject *__pyx_temp[7] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_message, __pyx_v_filename};
-        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 6+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3560, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 6+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3563, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -194688,7 +194678,7 @@ static PyObject *__pyx_f_4lxml_5etree_10_Validator__append_log_message(struct __
       } else
       #endif
       {
-        __pyx_t_10 = PyTuple_New(6+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3560, __pyx_L1_error)
+        __pyx_t_10 = PyTuple_New(6+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3563, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
         if (__pyx_t_8) {
           __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
@@ -194711,7 +194701,7 @@ static PyObject *__pyx_f_4lxml_5etree_10_Validator__append_log_message(struct __
         __pyx_t_4 = 0;
         __pyx_t_5 = 0;
         __pyx_t_6 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3560, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3563, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       }
@@ -194724,7 +194714,7 @@ static PyObject *__pyx_f_4lxml_5etree_10_Validator__append_log_message(struct __
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "lxml/etree.pyx":3562
+  /* "lxml/etree.pyx":3565
  *     cpdef _append_log_message(self, int domain, int type, int level, int line,
  *                               message, filename):
  *         self._error_log._receiveGeneric(domain, type, level, line, message,             # <<<<<<<<<<<<<<
@@ -194733,7 +194723,7 @@ static PyObject *__pyx_f_4lxml_5etree_10_Validator__append_log_message(struct __
  */
   __pyx_f_4lxml_5etree_13_BaseErrorLog__receiveGeneric(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), __pyx_v_domain, __pyx_v_type, __pyx_v_level, __pyx_v_line, __pyx_v_message, __pyx_v_filename);
 
-  /* "lxml/etree.pyx":3560
+  /* "lxml/etree.pyx":3563
  *                 u"Document does not comply with schema")
  * 
  *     cpdef _append_log_message(self, int domain, int type, int level, int line,             # <<<<<<<<<<<<<<
@@ -194806,35 +194796,35 @@ static PyObject *__pyx_pw_4lxml_5etree_10_Validator_9_append_log_message(PyObjec
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, 1); __PYX_ERR(0, 3560, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, 1); __PYX_ERR(0, 3563, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, 2); __PYX_ERR(0, 3560, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, 2); __PYX_ERR(0, 3563, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
         if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, 3); __PYX_ERR(0, 3560, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, 3); __PYX_ERR(0, 3563, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  4:
         if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, 4); __PYX_ERR(0, 3560, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, 4); __PYX_ERR(0, 3563, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  5:
         if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, 5); __PYX_ERR(0, 3560, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, 5); __PYX_ERR(0, 3563, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_append_log_message") < 0)) __PYX_ERR(0, 3560, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_append_log_message") < 0)) __PYX_ERR(0, 3563, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
       goto __pyx_L5_argtuple_error;
@@ -194846,16 +194836,16 @@ static PyObject *__pyx_pw_4lxml_5etree_10_Validator_9_append_log_message(PyObjec
       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
     }
-    __pyx_v_domain = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_domain == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3560, __pyx_L3_error)
-    __pyx_v_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3560, __pyx_L3_error)
-    __pyx_v_level = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3560, __pyx_L3_error)
-    __pyx_v_line = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_line == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3560, __pyx_L3_error)
+    __pyx_v_domain = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_domain == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3563, __pyx_L3_error)
+    __pyx_v_type = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3563, __pyx_L3_error)
+    __pyx_v_level = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3563, __pyx_L3_error)
+    __pyx_v_line = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_line == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3563, __pyx_L3_error)
     __pyx_v_message = values[4];
     __pyx_v_filename = values[5];
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3560, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_append_log_message", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3563, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._Validator._append_log_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -194874,7 +194864,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_8_append_log_message(struct
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("_append_log_message", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_10_Validator__append_log_message(__pyx_v_self, __pyx_v_domain, __pyx_v_type, __pyx_v_level, __pyx_v_line, __pyx_v_message, __pyx_v_filename, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3560, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_10_Validator__append_log_message(__pyx_v_self, __pyx_v_domain, __pyx_v_type, __pyx_v_level, __pyx_v_line, __pyx_v_message, __pyx_v_filename, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3563, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -194891,7 +194881,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_8_append_log_message(struct
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3565
+/* "lxml/etree.pyx":3568
  *                                         filename)
  * 
  *     cpdef _clear_error_log(self):             # <<<<<<<<<<<<<<
@@ -194912,7 +194902,7 @@ static PyObject *__pyx_f_4lxml_5etree_10_Validator__clear_error_log(struct __pyx
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_error_log); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3565, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_error_log); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3568, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_4lxml_5etree_10_Validator_11_clear_error_log)) {
       __Pyx_XDECREF(__pyx_r);
@@ -194928,10 +194918,10 @@ static PyObject *__pyx_f_4lxml_5etree_10_Validator__clear_error_log(struct __pyx
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3565, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3568, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3565, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3568, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -194943,18 +194933,18 @@ static PyObject *__pyx_f_4lxml_5etree_10_Validator__clear_error_log(struct __pyx
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "lxml/etree.pyx":3566
+  /* "lxml/etree.pyx":3569
  * 
  *     cpdef _clear_error_log(self):
  *         self._error_log.clear()             # <<<<<<<<<<<<<<
  * 
  *     property error_log:
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->clear(__pyx_v_self->_error_log, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3566, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->clear(__pyx_v_self->_error_log, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3569, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/etree.pyx":3565
+  /* "lxml/etree.pyx":3568
  *                                         filename)
  * 
  *     cpdef _clear_error_log(self):             # <<<<<<<<<<<<<<
@@ -194998,7 +194988,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_10_clear_error_log(struct __
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("_clear_error_log", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_10_Validator__clear_error_log(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3565, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_10_Validator__clear_error_log(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3568, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -195015,7 +195005,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_10_clear_error_log(struct __
   return __pyx_r;
 }
 
-/* "lxml/etree.pyx":3570
+/* "lxml/etree.pyx":3573
  *     property error_log:
  *         u"The log of validation errors and warnings."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -195043,7 +195033,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_9error_log___get__(struct __
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "lxml/etree.pyx":3571
+  /* "lxml/etree.pyx":3574
  *         u"The log of validation errors and warnings."
  *         def __get__(self):
  *             assert self._error_log is not None, "XPath evaluator not initialised"             # <<<<<<<<<<<<<<
@@ -195055,12 +195045,12 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_9error_log___get__(struct __
     __pyx_t_1 = (((PyObject *)__pyx_v_self->_error_log) != Py_None);
     if (unlikely(!(__pyx_t_1 != 0))) {
       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_XPath_evaluator_not_initialised);
-      __PYX_ERR(0, 3571, __pyx_L1_error)
+      __PYX_ERR(0, 3574, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "lxml/etree.pyx":3572
+  /* "lxml/etree.pyx":3575
  *         def __get__(self):
  *             assert self._error_log is not None, "XPath evaluator not initialised"
  *             return self._error_log.copy()             # <<<<<<<<<<<<<<
@@ -195068,13 +195058,13 @@ static PyObject *__pyx_pf_4lxml_5etree_10_Validator_9error_log___get__(struct __
  * include "dtd.pxi"        # DTD
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3572, __pyx_L1_error)
+  __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3575, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/etree.pyx":3570
+  /* "lxml/etree.pyx":3573
  *     property error_log:
  *         u"The log of validation errors and warnings."
  *         def __get__(self):             # <<<<<<<<<<<<<<
@@ -195310,7 +195300,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_DTDElementContentDecl_4name___get__(st
  *            return funicode(self._c_node.name) if self._c_node.name is not NULL else None
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 33, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 33, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":34
  *        def __get__(self):
@@ -195389,7 +195379,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_DTDElementContentDecl_4type___get__(st
  *            cdef int type = self._c_node.type
  *            if type == tree.XML_ELEMENT_CONTENT_PCDATA:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 38, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 38, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":39
  *        def __get__(self):
@@ -195591,7 +195581,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_DTDElementContentDecl_5occur___get__(s
  *            cdef int occur = self._c_node.ocur
  *            if occur == tree.XML_ELEMENT_CONTENT_ONCE:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 53, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 53, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":54
  *        def __get__(self):
@@ -195797,7 +195787,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_DTDElementContentDecl_4left___get__(st
  *            c1 = self._c_node.c1
  *            if c1:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 68, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 68, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":69
  *        def __get__(self):
@@ -195954,7 +195944,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_DTDElementContentDecl_5right___get__(s
  *            c2 = self._c_node.c2
  *            if c2:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 80, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 80, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":81
  *        def __get__(self):
@@ -196245,7 +196235,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_DTDAttributeDecl_4name___get__(struct
  *            return funicode(self._c_node.name) if self._c_node.name is not NULL else None
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 103, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 103, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":104
  *        def __get__(self):
@@ -196324,7 +196314,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_DTDAttributeDecl_8elemname___get__(str
  *            return funicode(self._c_node.elem) if self._c_node.elem is not NULL else None
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 108, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 108, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":109
  *        def __get__(self):
@@ -196403,7 +196393,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_DTDAttributeDecl_6prefix___get__(struc
  *            return funicode(self._c_node.prefix) if self._c_node.prefix is not NULL else None
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 113, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 113, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":114
  *        def __get__(self):
@@ -196482,7 +196472,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_DTDAttributeDecl_4type___get__(struct
  *            cdef int type = self._c_node.atype
  *            if type == tree.XML_ATTRIBUTE_CDATA:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 118, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 118, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":119
  *        def __get__(self):
@@ -196864,7 +196854,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_DTDAttributeDecl_7default___get__(stru
  *            cdef int default = self._c_node.def_
  *            if default == tree.XML_ATTRIBUTE_NONE:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 145, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 145, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":146
  *        def __get__(self):
@@ -197066,7 +197056,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_DTDAttributeDecl_13default_value___get
  *            return funicode(self._c_node.defaultValue) if self._c_node.defaultValue is not NULL else None
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 160, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 160, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":161
  *        def __get__(self):
@@ -197108,7 +197098,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_DTDAttributeDecl_13default_value___get
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_17_DTDAttributeDecl_4generator11(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_17_DTDAttributeDecl_4generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/dtd.pxi":163
  *            return funicode(self._c_node.defaultValue) if self._c_node.defaultValue is not NULL else None
@@ -197165,7 +197155,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17_DTDAttributeDecl_2itervalues(struct __
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_17_DTDAttributeDecl_4generator11(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_17_DTDAttributeDecl_4generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_11_itervalues *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_11_itervalues *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -197174,7 +197164,7 @@ static PyObject *__pyx_gb_4lxml_5etree_17_DTDAttributeDecl_4generator11(__pyx_Co
   int __pyx_t_3;
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("itervalues", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L6_resume_from_yield;
@@ -197192,7 +197182,7 @@ static PyObject *__pyx_gb_4lxml_5etree_17_DTDAttributeDecl_4generator11(__pyx_Co
  *         cdef tree.xmlEnumeration *c_node = self._c_node.tree
  *         while c_node is not NULL:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 164, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 164, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":165
  *     def itervalues(self):
@@ -197228,6 +197218,7 @@ static PyObject *__pyx_gb_4lxml_5etree_17_DTDAttributeDecl_4generator11(__pyx_Co
     __pyx_t_4 = 0;
     __Pyx_XGIVEREF(__pyx_r);
     __Pyx_RefNannyFinishContext();
+    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
     /* return from generator, yielding value */
     __pyx_generator->resume_label = 1;
     return __pyx_r;
@@ -197262,6 +197253,7 @@ static PyObject *__pyx_gb_4lxml_5etree_17_DTDAttributeDecl_4generator11(__pyx_Co
   __Pyx_AddTraceback("itervalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -197507,7 +197499,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_DTDElementDecl_4name___get__(struct __
  *             return funicode(self._c_node.name) if self._c_node.name is not NULL else None
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 186, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 186, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":187
  *         def __get__(self):
@@ -197586,7 +197578,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_DTDElementDecl_6prefix___get__(struct
  *            return funicode(self._c_node.prefix) if self._c_node.prefix is not NULL else None
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 191, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 191, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":192
  *        def __get__(self):
@@ -197665,7 +197657,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_DTDElementDecl_4type___get__(struct __
  *            cdef int type = self._c_node.etype
  *            if type == tree.XML_ELEMENT_TYPE_UNDEFINED:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 196, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 196, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":197
  *         def __get__(self):
@@ -197901,7 +197893,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_DTDElementDecl_7content___get__(struct
  *            cdef tree.xmlElementContent *content = self._c_node.content
  *            if content:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 213, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 213, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":214
  *        def __get__(self):
@@ -198017,7 +198009,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_DTDElementDecl_7content___get__(struct
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_15_DTDElementDecl_4generator12(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_15_DTDElementDecl_4generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/dtd.pxi":223
  *                return None
@@ -198074,7 +198066,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_DTDElementDecl_2iterattributes(struct
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_15_DTDElementDecl_4generator12(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_15_DTDElementDecl_4generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_12_iterattributes *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_12_iterattributes *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -198084,7 +198076,7 @@ static PyObject *__pyx_gb_4lxml_5etree_15_DTDElementDecl_4generator12(__pyx_Coro
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("iterattributes", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L6_resume_from_yield;
@@ -198102,7 +198094,7 @@ static PyObject *__pyx_gb_4lxml_5etree_15_DTDElementDecl_4generator12(__pyx_Coro
  *         cdef tree.xmlAttribute *c_node = self._c_node.attributes
  *         while c_node:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 224, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 224, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":225
  *     def iterattributes(self):
@@ -198177,6 +198169,7 @@ static PyObject *__pyx_gb_4lxml_5etree_15_DTDElementDecl_4generator12(__pyx_Coro
     __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_node);
     __Pyx_XGIVEREF(__pyx_r);
     __Pyx_RefNannyFinishContext();
+    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
     /* return from generator, yielding value */
     __pyx_generator->resume_label = 1;
     return __pyx_r;
@@ -198212,6 +198205,7 @@ static PyObject *__pyx_gb_4lxml_5etree_15_DTDElementDecl_4generator12(__pyx_Coro
   __Pyx_AddTraceback("iterattributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -198443,7 +198437,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_DTDEntityDecl_4name___get__(struct __p
  *             return funicode(self._c_node.name) if self._c_node.name is not NULL else None
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 248, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 248, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":249
  *         def __get__(self):
@@ -198522,7 +198516,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_DTDEntityDecl_4orig___get__(struct __p
  *             return funicode(self._c_node.orig) if self._c_node.orig is not NULL else None
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 253, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 253, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":254
  *         def __get__(self):
@@ -198601,7 +198595,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_DTDEntityDecl_7content___get__(struct
  *             return funicode(self._c_node.content) if self._c_node.content is not NULL else None
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(20, 258, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidDTDNode(((PyObject *)__pyx_v_self), __pyx_v_self->_c_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(20, 258, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":259
  *         def __get__(self):
@@ -198833,7 +198827,7 @@ static int __pyx_pf_4lxml_5etree_3DTD___init__(struct __pyx_obj_4lxml_5etree_DTD
       /*with:*/ {
         __pyx_t_7 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->__pyx_base._error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 279, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_8 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(20, 279, __pyx_L5_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(20, 279, __pyx_L5_error)
         /*try:*/ {
           {
             if (__pyx_t_9||__pyx_t_10||__pyx_t_11); else {/*mark used*/}
@@ -198861,7 +198855,7 @@ static int __pyx_pf_4lxml_5etree_3DTD___init__(struct __pyx_obj_4lxml_5etree_DTD
         /*finally:*/ {
           /*normal exit:*/{
             if (__pyx_t_7) {
-              __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__109, NULL);
+              __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__111, NULL);
               __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
               if (unlikely(!__pyx_t_11)) __PYX_ERR(20, 279, __pyx_L1_error)
               __Pyx_GOTREF(__pyx_t_11);
@@ -198895,7 +198889,7 @@ static int __pyx_pf_4lxml_5etree_3DTD___init__(struct __pyx_obj_4lxml_5etree_DTD
  *                 self._c_dtd = _parseDtdFromFilelike(file)
  *             else:
  */
-    __pyx_t_6 = __Pyx_HasAttr(__pyx_v_file, __pyx_n_s_read); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(20, 281, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_HasAttr(__pyx_v_file, __pyx_n_s_read); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(20, 281, __pyx_L1_error)
     __pyx_t_5 = (__pyx_t_6 != 0);
     if (__pyx_t_5) {
 
@@ -198906,7 +198900,7 @@ static int __pyx_pf_4lxml_5etree_3DTD___init__(struct __pyx_obj_4lxml_5etree_DTD
  *             else:
  *                 raise DTDParseError, u"file must be a filename or file-like object"
  */
-      __pyx_t_12 = __pyx_f_4lxml_5etree__parseDtdFromFilelike(__pyx_v_file); if (unlikely(__pyx_t_12 == NULL)) __PYX_ERR(20, 282, __pyx_L1_error)
+      __pyx_t_12 = __pyx_f_4lxml_5etree__parseDtdFromFilelike(__pyx_v_file); if (unlikely(__pyx_t_12 == ((xmlDtd *)NULL))) __PYX_ERR(20, 282, __pyx_L1_error)
       __pyx_v_self->_c_dtd = __pyx_t_12;
 
       /* "src/lxml/dtd.pxi":281
@@ -198963,7 +198957,7 @@ static int __pyx_pf_4lxml_5etree_3DTD___init__(struct __pyx_obj_4lxml_5etree_DTD
     /*with:*/ {
       __pyx_t_7 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->__pyx_base._error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 286, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_8 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(20, 286, __pyx_L16_error)
+      __pyx_t_8 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(20, 286, __pyx_L16_error)
       /*try:*/ {
         {
           __Pyx_PyThreadState_declare
@@ -198997,7 +198991,6 @@ static int __pyx_pf_4lxml_5etree_3DTD___init__(struct __pyx_obj_4lxml_5etree_DTD
           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
           goto __pyx_L25_try_end;
           __pyx_L20_error:;
-          __Pyx_PyThreadState_assign
           __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -199033,14 +199026,12 @@ static int __pyx_pf_4lxml_5etree_3DTD___init__(struct __pyx_obj_4lxml_5etree_DTD
             goto __pyx_L21_exception_handled;
           }
           __pyx_L22_except_error:;
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_11);
           __Pyx_XGIVEREF(__pyx_t_10);
           __Pyx_XGIVEREF(__pyx_t_9);
           __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
           goto __pyx_L1_error;
           __pyx_L21_exception_handled:;
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_11);
           __Pyx_XGIVEREF(__pyx_t_10);
           __Pyx_XGIVEREF(__pyx_t_9);
@@ -199051,7 +199042,7 @@ static int __pyx_pf_4lxml_5etree_3DTD___init__(struct __pyx_obj_4lxml_5etree_DTD
       /*finally:*/ {
         /*normal exit:*/{
           if (__pyx_t_7) {
-            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__110, NULL);
+            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__112, NULL);
             __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
             if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 286, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_9);
@@ -199441,7 +199432,7 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_10system_url___get__(struct __pyx_ob
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_3DTD_4generator13(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_3DTD_4generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/dtd.pxi":314
  *            return funicodeOrNone(self._c_dtd.SystemID)
@@ -199498,7 +199489,7 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_2iterelements(struct __pyx_obj_4lxml
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_3DTD_4generator13(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_3DTD_4generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_13_iterelements *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_13_iterelements *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -199506,7 +199497,7 @@ static PyObject *__pyx_gb_4lxml_5etree_3DTD_4generator13(__pyx_CoroutineObject *
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("iterelements", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L7_resume_from_yield;
@@ -199599,6 +199590,7 @@ static PyObject *__pyx_gb_4lxml_5etree_3DTD_4generator13(__pyx_CoroutineObject *
       __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_node);
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -199642,6 +199634,7 @@ static PyObject *__pyx_gb_4lxml_5etree_3DTD_4generator13(__pyx_CoroutineObject *
   __Pyx_AddTraceback("iterelements", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -199733,7 +199726,7 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_5elements(struct __pyx_obj_4lxml_5et
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_5etree_3DTD_9generator14(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_5etree_3DTD_9generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "src/lxml/dtd.pxi":327
  *         return list(self.iterelements())
@@ -199790,7 +199783,7 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_7iterentities(struct __pyx_obj_4lxml
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_5etree_3DTD_9generator14(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_5etree_3DTD_9generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_5etree___pyx_scope_struct_14_iterentities *__pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_14_iterentities *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -199798,7 +199791,7 @@ static PyObject *__pyx_gb_4lxml_5etree_3DTD_9generator14(__pyx_CoroutineObject *
   int __pyx_t_2;
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("iterentities", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L7_resume_from_yield;
@@ -199891,6 +199884,7 @@ static PyObject *__pyx_gb_4lxml_5etree_3DTD_9generator14(__pyx_CoroutineObject *
       __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_node);
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -199934,6 +199928,7 @@ static PyObject *__pyx_gb_4lxml_5etree_3DTD_9generator14(__pyx_CoroutineObject *
   __Pyx_AddTraceback("iterentities", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -200233,7 +200228,7 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_14__call__(struct __pyx_obj_4lxml_5e
  * 
  *         # work around error reporting bug in libxml2 <= 2.9.1 (and later?)
  */
-    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_DTDError), __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 362, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_DTDError), __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 362, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -200285,7 +200280,7 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_14__call__(struct __pyx_obj_4lxml_5e
     /*with:*/ {
       __pyx_t_3 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->__pyx_base._error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 370, __pyx_L5_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(20, 370, __pyx_L7_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(20, 370, __pyx_L7_error)
       /*try:*/ {
         {
           __Pyx_PyThreadState_declare
@@ -200303,7 +200298,7 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_14__call__(struct __pyx_obj_4lxml_5e
  *                 ret = dtdvalid.xmlValidateDtd(valid_ctxt, c_doc, self._c_dtd)
  *                 _destroyFakeDoc(doc._c_doc, c_doc)
  */
-            __pyx_t_8 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_8 == NULL)) __PYX_ERR(20, 371, __pyx_L11_error)
+            __pyx_t_8 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_8 == ((xmlDoc *)NULL))) __PYX_ERR(20, 371, __pyx_L11_error)
             __pyx_v_c_doc = __pyx_t_8;
 
             /* "src/lxml/dtd.pxi":372
@@ -200337,7 +200332,6 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_14__call__(struct __pyx_obj_4lxml_5e
           __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
           goto __pyx_L16_try_end;
           __pyx_L11_error:;
-          __Pyx_PyThreadState_assign
           __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
           /*except:*/ {
             __Pyx_AddTraceback("lxml.etree.DTD.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -200370,14 +200364,12 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_14__call__(struct __pyx_obj_4lxml_5e
             goto __pyx_L12_exception_handled;
           }
           __pyx_L13_except_error:;
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_5);
           __Pyx_XGIVEREF(__pyx_t_6);
           __Pyx_XGIVEREF(__pyx_t_7);
           __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
           goto __pyx_L5_error;
           __pyx_L12_exception_handled:;
-          __Pyx_PyThreadState_assign
           __Pyx_XGIVEREF(__pyx_t_5);
           __Pyx_XGIVEREF(__pyx_t_6);
           __Pyx_XGIVEREF(__pyx_t_7);
@@ -200388,7 +200380,7 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_14__call__(struct __pyx_obj_4lxml_5e
       /*finally:*/ {
         /*normal exit:*/{
           if (__pyx_t_3) {
-            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__112, NULL);
+            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__114, NULL);
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
             if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 370, __pyx_L5_error)
             __Pyx_GOTREF(__pyx_t_7);
@@ -200439,7 +200431,6 @@ static PyObject *__pyx_pf_4lxml_5etree_3DTD_14__call__(struct __pyx_obj_4lxml_5e
       {
         xmlFreeValidCtxt(__pyx_v_valid_ctxt);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_5);
         __Pyx_XGIVEREF(__pyx_t_12);
@@ -200628,7 +200619,7 @@ static xmlDtd *__pyx_f_4lxml_5etree__parseDtdFromFilelike(PyObject *__pyx_v_file
   /*with:*/ {
     __pyx_t_3 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 392, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_error_log); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(20, 392, __pyx_L3_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_error_log); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(20, 392, __pyx_L3_error)
     /*try:*/ {
       {
         if (__pyx_t_5||__pyx_t_6||__pyx_t_7); else {/*mark used*/}
@@ -200656,7 +200647,7 @@ static xmlDtd *__pyx_f_4lxml_5etree__parseDtdFromFilelike(PyObject *__pyx_v_file
     /*finally:*/ {
       /*normal exit:*/{
         if (__pyx_t_3) {
-          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__113, NULL);
+          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__115, NULL);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
           if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 392, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_7);
@@ -200680,7 +200671,7 @@ static xmlDtd *__pyx_f_4lxml_5etree__parseDtdFromFilelike(PyObject *__pyx_v_file
  *     if c_dtd is NULL:
  *         raise DTDParseError(u"error parsing DTD", error_log)
  */
-  __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_exc_context); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(20, 395, __pyx_L1_error)
+  __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_exc_context); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(20, 395, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":396
  * 
@@ -200826,7 +200817,7 @@ static struct __pyx_obj_4lxml_5etree_DTD *__pyx_f_4lxml_5etree__dtdFactory(xmlDt
  *     _Validator.__init__(dtd)
  *     return dtd
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__copyDtd(__pyx_v_c_dtd); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(20, 406, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__copyDtd(__pyx_v_c_dtd); if (unlikely(__pyx_t_3 == ((xmlDtd *)NULL))) __PYX_ERR(20, 406, __pyx_L1_error)
   __pyx_v_dtd->_c_dtd = __pyx_t_3;
 
   /* "src/lxml/dtd.pxi":407
@@ -201516,7 +201507,7 @@ static int __pyx_f_4lxml_5etree__require_rnc2rng(void) {
  *             'compact syntax not supported (please install rnc2rng)')
  *     return 0
  */
-    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_RelaxNGParseError), __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 13, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_RelaxNGParseError), __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 13, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -201823,7 +201814,7 @@ static int __pyx_pf_4lxml_5etree_7RelaxNG_2__init__(struct __pyx_obj_4lxml_5etre
  *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
  *         elif file is not None:
  */
-    __pyx_t_7 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(21, 54, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(21, 54, __pyx_L1_error)
     __pyx_v_fake_c_doc = __pyx_t_7;
 
     /* "src/lxml/relaxng.pxi":55
@@ -201873,7 +201864,7 @@ static int __pyx_pf_4lxml_5etree_7RelaxNG_2__init__(struct __pyx_obj_4lxml_5etre
  *                     _require_rnc2rng()
  *                     rng_data = _rnc2rng.dumps(_rnc2rng.load(file))
  */
-      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_file, -4L, 0, NULL, NULL, &__pyx_slice__115, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 58, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_file, -4L, 0, NULL, NULL, &__pyx_slice__117, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 58, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 58, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
@@ -201907,7 +201898,7 @@ static int __pyx_pf_4lxml_5etree_7RelaxNG_2__init__(struct __pyx_obj_4lxml_5etre
  *                     rng_data = _rnc2rng.dumps(_rnc2rng.load(file))
  *                     doc = _parseMemoryDocument(rng_data, parser=None, url=None)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__require_rnc2rng(); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(21, 59, __pyx_L1_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__require_rnc2rng(); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(21, 59, __pyx_L1_error)
 
         /* "src/lxml/relaxng.pxi":60
  *                 if file[-4:].lower() == '.rnc':
@@ -202044,7 +202035,7 @@ static int __pyx_pf_4lxml_5etree_7RelaxNG_2__init__(struct __pyx_obj_4lxml_5etre
  *                     parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
  *                 else:
  */
-        __pyx_t_7 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(21, 63, __pyx_L1_error)
+        __pyx_t_7 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(21, 63, __pyx_L1_error)
         __pyx_v_fake_c_doc = __pyx_t_7;
 
         /* "src/lxml/relaxng.pxi":64
@@ -202099,7 +202090,7 @@ static int __pyx_pf_4lxml_5etree_7RelaxNG_2__init__(struct __pyx_obj_4lxml_5etre
         /*with:*/ {
           __pyx_t_11 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->__pyx_base._error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(21, 68, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_11);
-          __pyx_t_8 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(21, 68, __pyx_L6_error)
+          __pyx_t_8 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(21, 68, __pyx_L6_error)
           /*try:*/ {
             {
               if (__pyx_t_12||__pyx_t_13||__pyx_t_14); else {/*mark used*/}
@@ -202127,7 +202118,7 @@ static int __pyx_pf_4lxml_5etree_7RelaxNG_2__init__(struct __pyx_obj_4lxml_5etre
           /*finally:*/ {
             /*normal exit:*/{
               if (__pyx_t_11) {
-                __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__116, NULL);
+                __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__118, NULL);
                 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                 if (unlikely(!__pyx_t_14)) __PYX_ERR(21, 68, __pyx_L1_error)
                 __Pyx_GOTREF(__pyx_t_14);
@@ -202177,7 +202168,7 @@ static int __pyx_pf_4lxml_5etree_7RelaxNG_2__init__(struct __pyx_obj_4lxml_5etre
     __Pyx_INCREF(__pyx_kp_s__16);
     __pyx_t_4 = __pyx_kp_s__16;
     __pyx_L17_bool_binop_done:;
-    __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_t_4, -4L, 0, NULL, NULL, &__pyx_slice__117, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(21, 70, __pyx_L1_error)
+    __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_t_4, -4L, 0, NULL, NULL, &__pyx_slice__119, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(21, 70, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 70, __pyx_L1_error)
@@ -202212,7 +202203,7 @@ static int __pyx_pf_4lxml_5etree_7RelaxNG_2__init__(struct __pyx_obj_4lxml_5etre
  *                 rng_data = _rnc2rng.dumps(_rnc2rng.load(file))
  *                 doc = _parseMemoryDocument(rng_data, parser=None, url=None)
  */
-      __pyx_t_8 = __pyx_f_4lxml_5etree__require_rnc2rng(); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(21, 71, __pyx_L1_error)
+      __pyx_t_8 = __pyx_f_4lxml_5etree__require_rnc2rng(); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(21, 71, __pyx_L1_error)
 
       /* "src/lxml/relaxng.pxi":72
  *             elif (_getFilenameForFile(file) or '')[-4:].lower() == '.rnc':
@@ -202349,7 +202340,7 @@ static int __pyx_pf_4lxml_5etree_7RelaxNG_2__init__(struct __pyx_obj_4lxml_5etre
  *                 parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
  *             else:
  */
-      __pyx_t_7 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(21, 75, __pyx_L1_error)
+      __pyx_t_7 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(21, 75, __pyx_L1_error)
       __pyx_v_fake_c_doc = __pyx_t_7;
 
       /* "src/lxml/relaxng.pxi":76
@@ -202940,7 +202931,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7RelaxNG_6__call__(struct __pyx_obj_4lxml
  *             with nogil:
  *                 ret = relaxng.xmlRelaxNGValidateDoc(valid_ctxt, c_doc)
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(21, 136, __pyx_L5_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_4 == ((xmlDoc *)NULL))) __PYX_ERR(21, 136, __pyx_L5_error)
     __pyx_v_c_doc = __pyx_t_4;
 
     /* "src/lxml/relaxng.pxi":137
@@ -203053,7 +203044,6 @@ static PyObject *__pyx_pf_4lxml_5etree_7RelaxNG_6__call__(struct __pyx_obj_4lxml
  */
         xmlRelaxNGFreeValidCtxt(__pyx_v_valid_ctxt);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_11);
         __Pyx_XGIVEREF(__pyx_t_12);
@@ -203274,7 +203264,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7RelaxNG_8from_rnc_string(PyTypeObject *_
  *         rng_str = _rnc2rng.dumps(_rnc2rng.loads(src))
  *         return cls(_parseMemoryDocument(rng_str, parser=None, url=base_url))
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__require_rnc2rng(); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(21, 162, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__require_rnc2rng(); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(21, 162, __pyx_L1_error)
 
   /* "src/lxml/relaxng.pxi":163
  *         """
@@ -203695,7 +203685,7 @@ static int __pyx_pf_4lxml_5etree_9XMLSchema_2__init__(struct __pyx_obj_4lxml_5et
  *             self._doc = _documentFactory(c_doc, doc._parser)
  *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(c_doc)
  */
-    __pyx_t_7 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(22, 55, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(22, 55, __pyx_L1_error)
     __pyx_v_c_doc = __pyx_t_7;
 
     /* "src/lxml/xmlschema.pxi":56
@@ -204428,7 +204418,7 @@ static PyObject *__pyx_pf_4lxml_5etree_9XMLSchema_6__call__(struct __pyx_obj_4lx
  *             with nogil:
  *                 ret = xmlschema.xmlSchemaValidateDoc(valid_ctxt, c_doc)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(22, 128, __pyx_L5_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(22, 128, __pyx_L5_error)
     __pyx_v_c_doc = __pyx_t_3;
 
     /* "src/lxml/xmlschema.pxi":129
@@ -204515,7 +204505,6 @@ static PyObject *__pyx_pf_4lxml_5etree_9XMLSchema_6__call__(struct __pyx_obj_4lx
       {
         xmlSchemaFreeValidCtxt(__pyx_v_valid_ctxt);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -205662,7 +205651,7 @@ static int __pyx_pf_4lxml_5etree_10Schematron_2__init__(struct __pyx_obj_4lxml_5
  *             parser_ctxt = schematron.xmlSchematronNewDocParserCtxt(self._c_schema_doc)
  *         elif file is not None:
  */
-    __pyx_t_7 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(23, 89, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_7 == ((xmlDoc *)NULL))) __PYX_ERR(23, 89, __pyx_L1_error)
     __pyx_v_self->_c_schema_doc = __pyx_t_7;
 
     /* "src/lxml/schematron.pxi":90
@@ -205759,7 +205748,7 @@ static int __pyx_pf_4lxml_5etree_10Schematron_2__init__(struct __pyx_obj_4lxml_5
     /*with:*/ {
       __pyx_t_8 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->__pyx_base._error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 97, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_9 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(23, 97, __pyx_L6_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(23, 97, __pyx_L6_error)
       /*try:*/ {
         {
           if (__pyx_t_10||__pyx_t_11||__pyx_t_12); else {/*mark used*/}
@@ -205787,7 +205776,7 @@ static int __pyx_pf_4lxml_5etree_10Schematron_2__init__(struct __pyx_obj_4lxml_5
       /*finally:*/ {
         /*normal exit:*/{
           if (__pyx_t_8) {
-            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__118, NULL);
+            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__120, NULL);
             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
             if (unlikely(!__pyx_t_12)) __PYX_ERR(23, 97, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_12);
@@ -205911,7 +205900,7 @@ static int __pyx_pf_4lxml_5etree_10Schematron_2__init__(struct __pyx_obj_4lxml_5
     /*with:*/ {
       __pyx_t_8 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->__pyx_base._error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 109, __pyx_L20_error)
       __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_9 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(23, 109, __pyx_L22_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->__pyx_base._error_log); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(23, 109, __pyx_L22_error)
       /*try:*/ {
         {
           if (__pyx_t_12||__pyx_t_11||__pyx_t_10); else {/*mark used*/}
@@ -205939,7 +205928,7 @@ static int __pyx_pf_4lxml_5etree_10Schematron_2__init__(struct __pyx_obj_4lxml_5
       /*finally:*/ {
         /*normal exit:*/{
           if (__pyx_t_8) {
-            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__119, NULL);
+            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__121, NULL);
             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
             if (unlikely(!__pyx_t_10)) __PYX_ERR(23, 109, __pyx_L20_error)
             __Pyx_GOTREF(__pyx_t_10);
@@ -205990,7 +205979,6 @@ static int __pyx_pf_4lxml_5etree_10Schematron_2__init__(struct __pyx_obj_4lxml_5
       {
         xmlSchematronFreeParserCtxt(__pyx_v_parser_ctxt);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_12);
         __Pyx_XGIVEREF(__pyx_t_15);
@@ -206346,7 +206334,7 @@ static PyObject *__pyx_pf_4lxml_5etree_10Schematron_6__call__(struct __pyx_obj_4
  *             with nogil:
  *                 ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(23, 149, __pyx_L5_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(23, 149, __pyx_L5_error)
     __pyx_v_c_doc = __pyx_t_3;
 
     /* "src/lxml/schematron.pxi":150
@@ -206433,7 +206421,6 @@ static PyObject *__pyx_pf_4lxml_5etree_10Schematron_6__call__(struct __pyx_obj_4
       {
         xmlSchematronFreeValidCtxt(__pyx_v_valid_ctxt);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_XGIVEREF(__pyx_t_11);
@@ -206580,7 +206567,7 @@ struct LxmlElement *deepcopyNodeToDocument(struct LxmlDocument *__pyx_v_doc, xml
  *     return _elementFactory(doc, c_node)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_root, __pyx_v_doc->_c_doc); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(24, 6, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_root, __pyx_v_doc->_c_doc); if (unlikely(__pyx_t_1 == ((xmlNode *)NULL))) __PYX_ERR(24, 6, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_1;
 
   /* "src/lxml/public-api.pxi":7
@@ -206638,7 +206625,7 @@ struct LxmlElementTree *elementTreeFactory(struct LxmlElement *__pyx_v_context_n
  *     return newElementTree(context_node, _ElementTree)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_context_node); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(24, 10, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_context_node); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 10, __pyx_L1_error)
 
   /* "src/lxml/public-api.pxi":11
  * cdef public api _ElementTree elementTreeFactory(_Element context_node):
@@ -206737,7 +206724,7 @@ struct LxmlElementTree *newElementTree(struct LxmlElement *__pyx_v_context_node,
  *     return _newElementTree(context_node._doc, context_node, subclass)
  * 
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_context_node); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(24, 17, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_context_node); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(24, 17, __pyx_L1_error)
 
   /* "src/lxml/public-api.pxi":18
  *         raise TypeError
@@ -207030,7 +207017,7 @@ struct LxmlElement *makeSubElement(struct LxmlElement *__pyx_v_parent, PyObject
  *     return _makeSubElement(parent, tag, text, tail, attrib, nsmap, None)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_parent); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(24, 37, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_parent); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 37, __pyx_L1_error)
 
   /* "src/lxml/public-api.pxi":38
  *                                         attrib, nsmap):
@@ -207685,7 +207672,7 @@ int setNodeText(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_text) {
  * 
  * cdef public api int setTailText(xmlNode* c_node, text) except -1:
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(24, 84, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(24, 84, __pyx_L1_error)
   __pyx_r = __pyx_t_2;
   goto __pyx_L0;
 
@@ -207757,7 +207744,7 @@ int setTailText(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_text) {
  * 
  * cdef public api object attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(24, 89, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(24, 89, __pyx_L1_error)
   __pyx_r = __pyx_t_2;
   goto __pyx_L0;
 
@@ -207894,7 +207881,7 @@ PyObject *getAttributeValue(struct LxmlElement *__pyx_v_element, PyObject *__pyx
  *     return _getAttributeValue(element, key, default)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(24, 99, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 99, __pyx_L1_error)
 
   /* "src/lxml/public-api.pxi":100
  * cdef public api object getAttributeValue(_Element element, key, default):
@@ -207951,7 +207938,7 @@ PyObject *iterattributes(struct LxmlElement *__pyx_v_element, int __pyx_v_keysva
  *     return _attributeIteratorFactory(element, keysvalues)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(24, 103, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 103, __pyx_L1_error)
 
   /* "src/lxml/public-api.pxi":104
  * cdef public api object iterattributes(_Element element, int keysvalues):
@@ -208054,7 +208041,7 @@ int setAttributeValue(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_key
  *     return _setAttributeValue(element, key, value)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(24, 110, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 110, __pyx_L1_error)
 
   /* "src/lxml/public-api.pxi":111
  * cdef public api int setAttributeValue(_Element element, key, value) except -1:
@@ -208063,7 +208050,7 @@ int setAttributeValue(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_key
  * 
  * cdef public api int delAttribute(_Element element, key) except -1:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__setAttributeValue(__pyx_v_element, __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(24, 111, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__setAttributeValue(__pyx_v_element, __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 111, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -208105,7 +208092,7 @@ int delAttribute(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_key) {
  *     return _delAttribute(element, key)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(24, 114, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 114, __pyx_L1_error)
 
   /* "src/lxml/public-api.pxi":115
  * cdef public api int delAttribute(_Element element, key) except -1:
@@ -208114,7 +208101,7 @@ int delAttribute(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_key) {
  * 
  * cdef public api int delAttributeFromNsName(tree.xmlNode* c_element,
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__delAttribute(__pyx_v_element, __pyx_v_key); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(24, 115, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__delAttribute(__pyx_v_element, __pyx_v_key); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 115, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -208414,7 +208401,7 @@ void appendChild(struct LxmlElement *__pyx_v_parent, struct LxmlElement *__pyx_v
  * 
  * cdef public api int appendChildToElement(_Element parent, _Element child) except -1:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_child); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(24, 141, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_child); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 141, __pyx_L1_error)
 
   /* "src/lxml/public-api.pxi":139
  *     return _previousElement(c_node)
@@ -208453,7 +208440,7 @@ int appendChildToElement(struct LxmlElement *__pyx_v_parent, struct LxmlElement
  * 
  * cdef public api object pyunicode(const_xmlChar* s):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_child); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(24, 144, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_child); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 144, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -208910,7 +208897,7 @@ xmlNs *findOrBuildNodeNsPrefix(struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_
  *         raise TypeError
  *     return doc._findOrBuildNodeNs(c_node, href, prefix, 0)             # <<<<<<<<<<<<<<
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_node, __pyx_v_href, __pyx_v_prefix, 0); if (unlikely(__pyx_t_3 == NULL)) __PYX_ERR(24, 178, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_node, __pyx_v_href, __pyx_v_prefix, 0); if (unlikely(__pyx_t_3 == ((xmlNs *)NULL))) __PYX_ERR(24, 178, __pyx_L1_error)
   __pyx_r = __pyx_t_3;
   goto __pyx_L0;
 
@@ -209605,7 +209592,6 @@ static PyObject *__pyx_pf_4lxml_5etree_9_MemDebug_6dump(CYTHON_UNUSED struct __p
       {
         fclose(__pyx_v_f);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_16);
         __Pyx_XGIVEREF(__pyx_t_17);
@@ -210060,7 +210046,6 @@ static PyObject *__pyx_pf_4lxml_5etree_9_MemDebug_8show(CYTHON_UNUSED struct __p
       {
         fclose(__pyx_v_f);
       }
-      __Pyx_PyThreadState_assign
       if (PY_MAJOR_VERSION >= 3) {
         __Pyx_XGIVEREF(__pyx_t_15);
         __Pyx_XGIVEREF(__pyx_t_16);
@@ -210111,7 +210096,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_Error(PyTypeObject *t, PyObject *a, P
 }
 
 static void __pyx_tp_dealloc_4lxml_5etree_Error(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -210440,7 +210425,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__ExceptionContext(PyTypeObject *t, CY
 
 static void __pyx_tp_dealloc_4lxml_5etree__ExceptionContext(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__ExceptionContext *p = (struct __pyx_obj_4lxml_5etree__ExceptionContext *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -210704,7 +210689,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__BaseErrorLog(PyTypeObject *t, CYTHON
 
 static void __pyx_tp_dealloc_4lxml_5etree__BaseErrorLog(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__BaseErrorLog *p = (struct __pyx_obj_4lxml_5etree__BaseErrorLog *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -210818,7 +210803,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__ListErrorLog(PyTypeObject *t, PyObje
 
 static void __pyx_tp_dealloc_4lxml_5etree__ListErrorLog(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__ListErrorLog *p = (struct __pyx_obj_4lxml_5etree__ListErrorLog *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -211089,7 +211074,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__ErrorLog(PyTypeObject *t, PyObject *
 
 static void __pyx_tp_dealloc_4lxml_5etree__ErrorLog(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__ErrorLog *p = (struct __pyx_obj_4lxml_5etree__ErrorLog *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -211359,7 +211344,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_PyErrorLog(PyTypeObject *t, PyObject
 
 static void __pyx_tp_dealloc_4lxml_5etree_PyErrorLog(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_PyErrorLog *p = (struct __pyx_obj_4lxml_5etree_PyErrorLog *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -211615,7 +211600,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_DocInfo(PyTypeObject *t, PyObject *a,
 
 static void __pyx_tp_dealloc_4lxml_5etree_DocInfo(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_DocInfo *p = (struct __pyx_obj_4lxml_5etree_DocInfo *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -211804,7 +211789,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__Element(PyTypeObject *t, CYTHON_UNUS
 
 static void __pyx_tp_dealloc_4lxml_5etree__Element(PyObject *o) {
   struct LxmlElement *p = (struct LxmlElement *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -212593,7 +212578,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_QName(PyTypeObject *t, CYTHON_UNUSED
 
 static void __pyx_tp_dealloc_4lxml_5etree_QName(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_QName *p = (struct __pyx_obj_4lxml_5etree_QName *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -212704,7 +212689,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__ElementTree(PyTypeObject *t, CYTHON_
 
 static void __pyx_tp_dealloc_4lxml_5etree__ElementTree(PyObject *o) {
   struct LxmlElementTree *p = (struct LxmlElementTree *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -213165,7 +213150,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__ElementTagMatcher(PyTypeObject *t, C
 
 static void __pyx_tp_dealloc_4lxml_5etree__ElementTagMatcher(PyObject *o) {
   struct LxmlElementTagMatcher *p = (struct LxmlElementTagMatcher *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -213261,7 +213246,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__ElementIterator(PyTypeObject *t, PyO
 
 static void __pyx_tp_dealloc_4lxml_5etree__ElementIterator(PyObject *o) {
   struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -213485,7 +213470,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__ElementMatchIterator(PyTypeObject *t
 
 static void __pyx_tp_dealloc_4lxml_5etree__ElementMatchIterator(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__ElementMatchIterator *p = (struct __pyx_obj_4lxml_5etree__ElementMatchIterator *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -213854,7 +213839,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_ElementDepthFirstIterator(PyTypeObjec
 
 static void __pyx_tp_dealloc_4lxml_5etree_ElementDepthFirstIterator(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -213973,7 +213958,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_ElementTextIterator(PyTypeObject *t,
 
 static void __pyx_tp_dealloc_4lxml_5etree_ElementTextIterator(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_ElementTextIterator *p = (struct __pyx_obj_4lxml_5etree_ElementTextIterator *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -214086,7 +214071,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_CDATA(PyTypeObject *t, PyObject *a, P
 
 static void __pyx_tp_dealloc_4lxml_5etree_CDATA(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_CDATA *p = (struct __pyx_obj_4lxml_5etree_CDATA *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -214180,7 +214165,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__ReadOnlyProxy(PyTypeObject *t, CYTHO
 
 static void __pyx_tp_dealloc_4lxml_5etree__ReadOnlyProxy(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *p = (struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -214684,7 +214669,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__OpaqueNodeWrapper(PyTypeObject *t, C
 }
 
 static void __pyx_tp_dealloc_4lxml_5etree__OpaqueNodeWrapper(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -215540,15 +215525,11 @@ static PyObject *__pyx_tp_new_4lxml_5etree_ElementClassLookup(PyTypeObject *t, C
     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
   }
   if (unlikely(!o)) return 0;
-  if (unlikely(__pyx_pw_4lxml_5etree_18ElementClassLookup_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
   return o;
-  bad:
-  Py_DECREF(o); o = 0;
-  return NULL;
 }
 
 static void __pyx_tp_dealloc_4lxml_5etree_ElementClassLookup(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -215556,10 +215537,6 @@ static void __pyx_tp_dealloc_4lxml_5etree_ElementClassLookup(PyObject *o) {
   (*Py_TYPE(o)->tp_free)(o);
 }
 
-static PyMethodDef __pyx_methods_4lxml_5etree_ElementClassLookup[] = {
-  {0, 0, 0, 0}
-};
-
 DL_EXPORT(PyTypeObject) LxmlElementClassLookupType = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.ElementClassLookup", /*tp_name*/
@@ -215593,7 +215570,7 @@ DL_EXPORT(PyTypeObject) LxmlElementClassLookupType = {
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
   0, /*tp_iternext*/
-  __pyx_methods_4lxml_5etree_ElementClassLookup, /*tp_methods*/
+  0, /*tp_methods*/
   0, /*tp_members*/
   0, /*tp_getset*/
   0, /*tp_base*/
@@ -215635,7 +215612,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_FallbackElementClassLookup(PyTypeObje
 
 static void __pyx_tp_dealloc_4lxml_5etree_FallbackElementClassLookup(PyObject *o) {
   struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -215756,7 +215733,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_ElementDefaultClassLookup(PyTypeObjec
 
 static void __pyx_tp_dealloc_4lxml_5etree_ElementDefaultClassLookup(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -215906,7 +215883,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_AttributeBasedElementClassLookup(PyTy
 
 static void __pyx_tp_dealloc_4lxml_5etree_AttributeBasedElementClassLookup(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -216403,7 +216380,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__NamespaceRegistry(PyTypeObject *t, P
 
 static void __pyx_tp_dealloc_4lxml_5etree__NamespaceRegistry(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__NamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -216457,6 +216434,7 @@ static PyMethodDef __pyx_methods_4lxml_5etree__NamespaceRegistry[] = {
   {"items", (PyCFunction)__pyx_pw_4lxml_5etree_18_NamespaceRegistry_11items, METH_NOARGS, 0},
   {"iteritems", (PyCFunction)__pyx_pw_4lxml_5etree_18_NamespaceRegistry_13iteritems, METH_NOARGS, 0},
   {"clear", (PyCFunction)__pyx_pw_4lxml_5etree_18_NamespaceRegistry_15clear, METH_NOARGS, 0},
+  {"__deco", (PyCFunction)__pyx_pw_4lxml_5etree_18_NamespaceRegistry_19__deco, METH_VARARGS|METH_KEYWORDS, 0},
   {0, 0, 0, 0}
 };
 
@@ -216499,7 +216477,7 @@ static PyTypeObject __pyx_type_4lxml_5etree__NamespaceRegistry = {
   &__pyx_tp_as_sequence__NamespaceRegistry, /*tp_as_sequence*/
   &__pyx_tp_as_mapping__NamespaceRegistry, /*tp_as_mapping*/
   0, /*tp_hash*/
-  0, /*tp_call*/
+  __pyx_pw_4lxml_5etree_18_NamespaceRegistry_17__call__, /*tp_call*/
   0, /*tp_str*/
   0, /*tp_getattro*/
   0, /*tp_setattro*/
@@ -216594,7 +216572,11 @@ static PyTypeObject __pyx_type_4lxml_5etree__ClassNamespaceRegistry = {
   0, /*tp_as_sequence*/
   &__pyx_tp_as_mapping__ClassNamespaceRegistry, /*tp_as_mapping*/
   0, /*tp_hash*/
+  #if CYTHON_COMPILING_IN_PYPY
+  __pyx_pw_4lxml_5etree_18_NamespaceRegistry_17__call__, /*tp_call*/
+  #else
   0, /*tp_call*/
+  #endif
   0, /*tp_str*/
   0, /*tp_getattro*/
   0, /*tp_setattro*/
@@ -216653,7 +216635,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_ElementNamespaceClassLookup(PyTypeObj
 
 static void __pyx_tp_dealloc_4lxml_5etree_ElementNamespaceClassLookup(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -216712,7 +216694,7 @@ static PyTypeObject __pyx_type_4lxml_5etree_ElementNamespaceClassLookup = {
   0, /*tp_setattro*/
   0, /*tp_as_buffer*/
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  "ElementNamespaceClassLookup(self, fallback=None)\n\n    Element class lookup scheme that searches the Element class in the\n    Namespace registry.\n    ", /*tp_doc*/
+  "ElementNamespaceClassLookup(self, fallback=None)\n\n    Element class lookup scheme that searches the Element class in the\n    Namespace registry.\n\n    Usage:\n\n    >>> lookup = ElementNamespaceClassLookup()\n    >>> ns_elements = lookup.get_namespace(\"http://schema.org/Movie\")\n\n    >>> @ns_elements\n    ... class movie(ElementBase):\n    ...     \"Element implementation for 'movie' tag (using class name) in schema namespace.\"\n\n    >>> @ns_elements(\"movie\")\n    ... class MovieElement(ElementBase):\n    ...     \"Element implementation for 'movie' tag (explicit tag name) in schema namespace.\"\n    ", /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree_ElementNamespaceClassLookup, /*tp_traverse*/
   __pyx_tp_clear_4lxml_5etree_ElementNamespaceClassLookup, /*tp_clear*/
   0, /*tp_richcompare*/
@@ -216801,7 +216783,11 @@ static PyTypeObject __pyx_type_4lxml_5etree__FunctionNamespaceRegistry = {
   0, /*tp_as_sequence*/
   &__pyx_tp_as_mapping__FunctionNamespaceRegistry, /*tp_as_mapping*/
   0, /*tp_hash*/
+  #if CYTHON_COMPILING_IN_PYPY
+  __pyx_pw_4lxml_5etree_18_NamespaceRegistry_17__call__, /*tp_call*/
+  #else
   0, /*tp_call*/
+  #endif
   0, /*tp_str*/
   0, /*tp_getattro*/
   0, /*tp_setattro*/
@@ -216923,7 +216909,11 @@ static PyTypeObject __pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry = {
   0, /*tp_as_sequence*/
   0, /*tp_as_mapping*/
   0, /*tp_hash*/
+  #if CYTHON_COMPILING_IN_PYPY
+  __pyx_pw_4lxml_5etree_18_NamespaceRegistry_17__call__, /*tp_call*/
+  #else
   0, /*tp_call*/
+  #endif
   0, /*tp_str*/
   0, /*tp_getattro*/
   0, /*tp_setattro*/
@@ -217083,7 +217073,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_Resolver(PyTypeObject *t, CYTHON_UNUS
 }
 
 static void __pyx_tp_dealloc_4lxml_5etree_Resolver(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -217282,7 +217272,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__ResolverContext(PyTypeObject *t, PyO
 
 static void __pyx_tp_dealloc_4lxml_5etree__ResolverContext(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__ResolverContext *p = (struct __pyx_obj_4lxml_5etree__ResolverContext *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -217392,7 +217382,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__ParserContext(PyTypeObject *t, PyObj
 
 static void __pyx_tp_dealloc_4lxml_5etree__ParserContext(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__ParserContext *p = (struct __pyx_obj_4lxml_5etree__ParserContext *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -217523,7 +217513,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__SaxParserContext(PyTypeObject *t, Py
 
 static void __pyx_tp_dealloc_4lxml_5etree__SaxParserContext(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__SaxParserContext *p = (struct __pyx_obj_4lxml_5etree__SaxParserContext *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -217867,7 +217857,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__Validator(PyTypeObject *t, CYTHON_UN
 
 static void __pyx_tp_dealloc_4lxml_5etree__Validator(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__Validator *p = (struct __pyx_obj_4lxml_5etree__Validator *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -217983,7 +217973,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_XMLSchema(PyTypeObject *t, PyObject *
 
 static void __pyx_tp_dealloc_4lxml_5etree_XMLSchema(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_XMLSchema *p = (struct __pyx_obj_4lxml_5etree_XMLSchema *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -218413,7 +218403,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__BaseParser(PyTypeObject *t, CYTHON_U
 
 static void __pyx_tp_dealloc_4lxml_5etree__BaseParser(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__BaseParser *p = (struct __pyx_obj_4lxml_5etree__BaseParser *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -219031,7 +219021,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__SaxParserTarget(PyTypeObject *t, CYT
 }
 
 static void __pyx_tp_dealloc_4lxml_5etree__SaxParserTarget(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -219218,7 +219208,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_TreeBuilder(PyTypeObject *t, PyObject
 
 static void __pyx_tp_dealloc_4lxml_5etree_TreeBuilder(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_TreeBuilder *p = (struct __pyx_obj_4lxml_5etree_TreeBuilder *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -219682,7 +219672,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_xmlfile(PyTypeObject *t, CYTHON_UNUSE
 
 static void __pyx_tp_dealloc_4lxml_5etree_xmlfile(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_xmlfile *p = (struct __pyx_obj_4lxml_5etree_xmlfile *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -220561,7 +220551,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_iterparse(PyTypeObject *t, CYTHON_UNU
 
 static void __pyx_tp_dealloc_4lxml_5etree_iterparse(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_iterparse *p = (struct __pyx_obj_4lxml_5etree_iterparse *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -220726,7 +220716,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_iterwalk(PyTypeObject *t, CYTHON_UNUS
 
 static void __pyx_tp_dealloc_4lxml_5etree_iterwalk(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_iterwalk *p = (struct __pyx_obj_4lxml_5etree_iterwalk *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -220854,7 +220844,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__IDDict(PyTypeObject *t, PyObject *a,
 
 static void __pyx_tp_dealloc_4lxml_5etree__IDDict(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__IDDict *p = (struct __pyx_obj_4lxml_5etree__IDDict *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -221070,7 +221060,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_XInclude(PyTypeObject *t, CYTHON_UNUS
 
 static void __pyx_tp_dealloc_4lxml_5etree_XInclude(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_XInclude *p = (struct __pyx_obj_4lxml_5etree_XInclude *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -221573,7 +221563,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__BaseContext(PyTypeObject *t, CYTHON_
 
 static void __pyx_tp_dealloc_4lxml_5etree__BaseContext(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__BaseContext *p = (struct __pyx_obj_4lxml_5etree__BaseContext *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -221975,7 +221965,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree__XPathEvaluatorBase(PyTypeObject *t,
 
 static void __pyx_tp_dealloc_4lxml_5etree__XPathEvaluatorBase(PyObject *o) {
   struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -222098,7 +222088,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_XPathElementEvaluator(PyTypeObject *t
 
 static void __pyx_tp_dealloc_4lxml_5etree_XPathElementEvaluator(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *p = (struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -222279,7 +222269,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_XPath(PyTypeObject *t, PyObject *a, P
 
 static void __pyx_tp_dealloc_4lxml_5etree_XPath(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_XPath *p = (struct __pyx_obj_4lxml_5etree_XPath *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -222835,7 +222825,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_XSLTAccessControl(PyTypeObject *t, CY
 }
 
 static void __pyx_tp_dealloc_4lxml_5etree_XSLTAccessControl(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -223150,7 +223140,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_XSLT(PyTypeObject *t, CYTHON_UNUSED P
 
 static void __pyx_tp_dealloc_4lxml_5etree_XSLT(PyObject *o) {
   struct __pyx_obj_4lxml_5etree_XSLT *p = (struct __pyx_obj_4lxml_5etree_XSLT *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -223510,7 +223500,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_XSLTExtension(PyTypeObject *t, CYTHON
 }
 
 static void __pyx_tp_dealloc_4lxml_5etree_XSLTExtension(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -224408,7 +224398,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_DTD(PyTypeObject *t, PyObject *a, PyO
 }
 
 static void __pyx_tp_dealloc_4lxml_5etree_DTD(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -224730,7 +224720,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_RelaxNG(PyTypeObject *t, PyObject *a,
 }
 
 static void __pyx_tp_dealloc_4lxml_5etree_RelaxNG(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -225234,7 +225224,7 @@ static PyObject *__pyx_tp_new_4lxml_5etree_Schematron(PyTypeObject *t, PyObject
 }
 
 static void __pyx_tp_dealloc_4lxml_5etree_Schematron(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -225429,12 +225419,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct____aenter__(PyObjec
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct____aenter__(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct____aenter__ *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct____aenter__ *)o;
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct____aenter__ = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct____aenter__", /*tp_name*/
@@ -225463,7 +225447,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct____aenter__ = {
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct____aenter__, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct____aenter__, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -225550,17 +225534,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_1___aexit__(PyObjec
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_1___aexit__(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_1___aexit__ *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_1___aexit__ *)o;
-  Py_CLEAR(p->__pyx_v_exc_tb);
-  Py_CLEAR(p->__pyx_v_exc_type);
-  Py_CLEAR(p->__pyx_v_exc_val);
-  Py_CLEAR(p->__pyx_v_old_writer);
-  Py_CLEAR(p->__pyx_v_raise_on_error);
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_1___aexit__ = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_1___aexit__", /*tp_name*/
@@ -225589,7 +225562,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_1___aexit__ = {
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_1___aexit__, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_1___aexit__, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -225657,12 +225630,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_2_flush(PyObject *o
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_2_flush(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_2_flush *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_2_flush *)o;
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_2_flush = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_2_flush", /*tp_name*/
@@ -225691,7 +225658,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_2_flush = {
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_2_flush, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_2_flush, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -225771,15 +225738,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_3_write_declaration
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_3_write_declaration(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_3_write_declaration *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_3_write_declaration *)o;
-  Py_CLEAR(p->__pyx_v_doctype);
-  Py_CLEAR(p->__pyx_v_self);
-  Py_CLEAR(p->__pyx_v_standalone);
-  Py_CLEAR(p->__pyx_v_version);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_3_write_declaration = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_3_write_declaration", /*tp_name*/
@@ -225808,7 +225766,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_3_write_declarati
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_3_write_declaration, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_3_write_declaration, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -225880,13 +225838,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_4_write_doctype(PyO
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_4_write_doctype(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_4_write_doctype *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_4_write_doctype *)o;
-  Py_CLEAR(p->__pyx_v_doctype);
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_4_write_doctype = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_4_write_doctype", /*tp_name*/
@@ -225915,7 +225866,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_4_write_doctype =
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_4_write_doctype, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_4_write_doctype, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -225999,16 +225950,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_5_write(PyObject *o
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_5_write(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_5_write *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_5_write *)o;
-  Py_CLEAR(p->__pyx_v_args);
-  Py_CLEAR(p->__pyx_v_method);
-  Py_CLEAR(p->__pyx_v_pretty_print);
-  Py_CLEAR(p->__pyx_v_self);
-  Py_CLEAR(p->__pyx_v_with_tail);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_5_write = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_5_write", /*tp_name*/
@@ -226037,7 +225978,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_5_write = {
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_5_write, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_5_write, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -226105,12 +226046,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_6__close(PyObject *
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_6__close(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_6__close *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_6__close *)o;
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_6__close = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_6__close", /*tp_name*/
@@ -226139,7 +226074,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_6__close = {
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_6__close, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_6__close, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -226207,12 +226142,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_7___aenter__(PyObje
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_7___aenter__(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_7___aenter__ *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_7___aenter__ *)o;
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_7___aenter__ = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_7___aenter__", /*tp_name*/
@@ -226241,7 +226170,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_7___aenter__ = {
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_7___aenter__, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_7___aenter__, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -226313,13 +226242,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_8___aexit__(PyObjec
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_8___aexit__(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_8___aexit__ *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_8___aexit__ *)o;
-  Py_CLEAR(p->__pyx_v_args);
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_8___aexit__ = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_8___aexit__", /*tp_name*/
@@ -226348,7 +226270,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_8___aexit__ = {
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_8___aexit__, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_8___aexit__, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -226415,12 +226337,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_9___aenter__(PyObje
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_9___aenter__(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_9___aenter__ *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_9___aenter__ *)o;
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_9___aenter__ = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_9___aenter__", /*tp_name*/
@@ -226449,7 +226365,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_9___aenter__ = {
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_9___aenter__, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_9___aenter__, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -226520,13 +226436,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_10___aexit__(PyObje
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_10___aexit__(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_10___aexit__ *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_10___aexit__ *)o;
-  Py_CLEAR(p->__pyx_v_args);
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_10___aexit__ = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_10___aexit__", /*tp_name*/
@@ -226555,7 +226464,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_10___aexit__ = {
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_10___aexit__, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_10___aexit__, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -226622,12 +226531,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_11_itervalues(PyObj
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_11_itervalues(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_11_itervalues *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_11_itervalues *)o;
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_11_itervalues = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_11_itervalues", /*tp_name*/
@@ -226656,7 +226559,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_11_itervalues = {
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_11_itervalues, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_11_itervalues, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -226727,13 +226630,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_12_iterattributes(P
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_12_iterattributes(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_12_iterattributes *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_12_iterattributes *)o;
-  Py_CLEAR(p->__pyx_v_node);
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_12_iterattributes = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_12_iterattributes", /*tp_name*/
@@ -226762,7 +226658,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_12_iterattributes
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_12_iterattributes, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_12_iterattributes, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -226833,13 +226729,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_13_iterelements(PyO
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_13_iterelements(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_13_iterelements *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_13_iterelements *)o;
-  Py_CLEAR(p->__pyx_v_node);
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_13_iterelements = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_13_iterelements", /*tp_name*/
@@ -226868,7 +226757,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_13_iterelements =
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_13_iterelements, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_13_iterelements, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -226939,13 +226828,6 @@ static int __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_14_iterentities(PyO
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_14_iterentities(PyObject *o) {
-  struct __pyx_obj_4lxml_5etree___pyx_scope_struct_14_iterentities *p = (struct __pyx_obj_4lxml_5etree___pyx_scope_struct_14_iterentities *)o;
-  Py_CLEAR(p->__pyx_v_node);
-  Py_CLEAR(p->__pyx_v_self);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_14_iterentities = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.etree.__pyx_scope_struct_14_iterentities", /*tp_name*/
@@ -226974,7 +226856,7 @@ static PyTypeObject __pyx_type_4lxml_5etree___pyx_scope_struct_14_iterentities =
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree___pyx_scope_struct_14_iterentities, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_5etree___pyx_scope_struct_14_iterentities, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -227009,17 +226891,31 @@ static PyMethodDef __pyx_methods[] = {
 };
 
 #if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec_etree(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+  {Py_mod_create, (void*)__pyx_pymod_create},
+  {Py_mod_exec, (void*)__pyx_pymod_exec_etree},
+  {0, NULL}
+};
+#endif
+
 static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
     PyModuleDef_HEAD_INIT,
-  #endif
     "etree",
     __pyx_k_The_lxml_etree_module_implement, /* m_doc */
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    0, /* m_size */
+  #else
     -1, /* m_size */
+  #endif
     __pyx_methods /* m_methods */,
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    __pyx_moduledef_slots, /* m_slots */
+  #else
     NULL, /* m_reload */
+  #endif
     NULL, /* m_traverse */
     NULL, /* m_clear */
     (freefunc)__pyx_module_cleanup /* m_free */
@@ -227248,6 +227144,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_kp_u_File_or_filename_expected_got_s, __pyx_k_File_or_filename_expected_got_s, sizeof(__pyx_k_File_or_filename_expected_got_s), 0, 1, 0, 0},
   {&__pyx_kp_b_Forbidden_variable, __pyx_k_Forbidden_variable, sizeof(__pyx_k_Forbidden_variable), 0, 0, 0, 0},
   {&__pyx_n_s_FunctionNamespace, __pyx_k_FunctionNamespace, sizeof(__pyx_k_FunctionNamespace), 0, 0, 1, 1},
+  {&__pyx_kp_u_FunctionNamespace_line_207, __pyx_k_FunctionNamespace_line_207, sizeof(__pyx_k_FunctionNamespace_line_207), 0, 1, 0, 0},
+  {&__pyx_kp_u_FunctionNamespace_ns_uri_Retriev, __pyx_k_FunctionNamespace_ns_uri_Retriev, sizeof(__pyx_k_FunctionNamespace_ns_uri_Retriev), 0, 1, 0, 0},
   {&__pyx_kp_u_FunctionNamespace_r, __pyx_k_FunctionNamespace_r, sizeof(__pyx_k_FunctionNamespace_r), 0, 1, 0, 0},
   {&__pyx_n_s_FutureWarning, __pyx_k_FutureWarning, sizeof(__pyx_k_FutureWarning), 0, 0, 1, 1},
   {&__pyx_n_u_GlobalErrorLog, __pyx_k_GlobalErrorLog, sizeof(__pyx_k_GlobalErrorLog), 0, 1, 0, 1},
@@ -227360,6 +227258,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_kp_u_NONE_0_WARNING_1_ERROR_2_FATAL_3, __pyx_k_NONE_0_WARNING_1_ERROR_2_FATAL_3, sizeof(__pyx_k_NONE_0_WARNING_1_ERROR_2_FATAL_3), 0, 1, 0, 0},
   {&__pyx_kp_u_Name_not_registered, __pyx_k_Name_not_registered, sizeof(__pyx_k_Name_not_registered), 0, 1, 0, 0},
   {&__pyx_n_s_NamespaceRegistryError, __pyx_k_NamespaceRegistryError, sizeof(__pyx_k_NamespaceRegistryError), 0, 0, 1, 1},
+  {&__pyx_n_s_NamespaceRegistry___deco, __pyx_k_NamespaceRegistry___deco, sizeof(__pyx_k_NamespaceRegistry___deco), 0, 0, 1, 1},
   {&__pyx_n_s_NamespaceRegistry_clear, __pyx_k_NamespaceRegistry_clear, sizeof(__pyx_k_NamespaceRegistry_clear), 0, 0, 1, 1},
   {&__pyx_n_s_NamespaceRegistry_items, __pyx_k_NamespaceRegistry_items, sizeof(__pyx_k_NamespaceRegistry_items), 0, 0, 1, 1},
   {&__pyx_n_s_NamespaceRegistry_iteritems, __pyx_k_NamespaceRegistry_iteritems, sizeof(__pyx_k_NamespaceRegistry_iteritems), 0, 0, 1, 1},
@@ -227538,7 +227437,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_XMLSyntaxError, __pyx_k_XMLSyntaxError, sizeof(__pyx_k_XMLSyntaxError), 0, 0, 1, 1},
   {&__pyx_n_s_XMLTreeBuilder, __pyx_k_XMLTreeBuilder, sizeof(__pyx_k_XMLTreeBuilder), 0, 0, 1, 1},
   {&__pyx_kp_s_XML_declaration_already_written, __pyx_k_XML_declaration_already_written, sizeof(__pyx_k_XML_declaration_already_written), 0, 0, 1, 0},
-  {&__pyx_kp_u_XML_line_3181, __pyx_k_XML_line_3181, sizeof(__pyx_k_XML_line_3181), 0, 1, 0, 0},
+  {&__pyx_kp_u_XML_line_3184, __pyx_k_XML_line_3184, sizeof(__pyx_k_XML_line_3184), 0, 1, 0, 0},
   {&__pyx_kp_u_XML_text_parser_None_base_url_No, __pyx_k_XML_text_parser_None_base_url_No, sizeof(__pyx_k_XML_text_parser_None_base_url_No), 0, 1, 0, 0},
   {&__pyx_n_u_XPATH_LOCATIONSET, __pyx_k_XPATH_LOCATIONSET, sizeof(__pyx_k_XPATH_LOCATIONSET), 0, 1, 0, 1},
   {&__pyx_n_u_XPATH_POINT, __pyx_k_XPATH_POINT, sizeof(__pyx_k_XPATH_POINT), 0, 1, 0, 1},
@@ -227583,8 +227482,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_XSLT_strparam, __pyx_k_XSLT_strparam, sizeof(__pyx_k_XSLT_strparam), 0, 0, 1, 1},
   {&__pyx_kp_s_XSLT_stylesheet_not_initialised, __pyx_k_XSLT_stylesheet_not_initialised, sizeof(__pyx_k_XSLT_stylesheet_not_initialised), 0, 0, 1, 0},
   {&__pyx_n_s_XSLT_tostring, __pyx_k_XSLT_tostring, sizeof(__pyx_k_XSLT_tostring), 0, 0, 1, 1},
-  {&__pyx_kp_u__102, __pyx_k__102, sizeof(__pyx_k__102), 0, 1, 0, 0},
-  {&__pyx_kp_u__107, __pyx_k__107, sizeof(__pyx_k__107), 0, 1, 0, 0},
+  {&__pyx_kp_u__104, __pyx_k__104, sizeof(__pyx_k__104), 0, 1, 0, 0},
+  {&__pyx_kp_u__109, __pyx_k__109, sizeof(__pyx_k__109), 0, 1, 0, 0},
   {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0},
   {&__pyx_kp_b__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 0, 0},
   {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0},
@@ -227598,24 +227497,24 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_kp_b__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 0, 0},
   {&__pyx_kp_s__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 1, 0},
   {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0},
-  {&__pyx_kp_b__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 0, 0},
-  {&__pyx_kp_u__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 1, 0, 0},
   {&__pyx_kp_b__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 0, 0},
   {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0},
-  {&__pyx_kp_s__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 1, 0},
+  {&__pyx_kp_b__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 0, 0},
+  {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0},
+  {&__pyx_kp_s__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 0, 1, 0},
   {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0},
   {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0},
   {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
-  {&__pyx_kp_b__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 0, 0, 0},
-  {&__pyx_kp_s__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 0, 1, 0},
-  {&__pyx_kp_s__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 0, 1, 0},
-  {&__pyx_kp_b__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 0, 0, 0},
-  {&__pyx_kp_b__49, __pyx_k__49, sizeof(__pyx_k__49), 0, 0, 0, 0},
+  {&__pyx_kp_b__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 0, 0, 0},
+  {&__pyx_kp_s__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 0, 1, 0},
+  {&__pyx_kp_s__45, __pyx_k__45, sizeof(__pyx_k__45), 0, 0, 1, 0},
+  {&__pyx_kp_b__48, __pyx_k__48, sizeof(__pyx_k__48), 0, 0, 0, 0},
   {&__pyx_kp_b__51, __pyx_k__51, sizeof(__pyx_k__51), 0, 0, 0, 0},
-  {&__pyx_kp_b__618, __pyx_k__618, sizeof(__pyx_k__618), 0, 0, 0, 0},
-  {&__pyx_n_s__62, __pyx_k__62, sizeof(__pyx_k__62), 0, 0, 1, 1},
-  {&__pyx_n_u__62, __pyx_k__62, sizeof(__pyx_k__62), 0, 1, 0, 1},
-  {&__pyx_kp_b__620, __pyx_k__620, sizeof(__pyx_k__620), 0, 0, 0, 0},
+  {&__pyx_kp_b__53, __pyx_k__53, sizeof(__pyx_k__53), 0, 0, 0, 0},
+  {&__pyx_kp_b__626, __pyx_k__626, sizeof(__pyx_k__626), 0, 0, 0, 0},
+  {&__pyx_kp_b__628, __pyx_k__628, sizeof(__pyx_k__628), 0, 0, 0, 0},
+  {&__pyx_n_s__64, __pyx_k__64, sizeof(__pyx_k__64), 0, 0, 1, 1},
+  {&__pyx_n_u__64, __pyx_k__64, sizeof(__pyx_k__64), 0, 1, 0, 1},
   {&__pyx_n_s_abspath, __pyx_k_abspath, sizeof(__pyx_k_abspath), 0, 0, 1, 1},
   {&__pyx_n_s_accepted_domains, __pyx_k_accepted_domains, sizeof(__pyx_k_accepted_domains), 0, 0, 1, 1},
   {&__pyx_n_s_access_control, __pyx_k_access_control, sizeof(__pyx_k_access_control), 0, 0, 1, 1},
@@ -227745,6 +227644,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_ctxt, __pyx_k_ctxt, sizeof(__pyx_k_ctxt), 0, 0, 1, 1},
   {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
   {&__pyx_n_b_dc, __pyx_k_dc, sizeof(__pyx_k_dc), 0, 0, 0, 1},
+  {&__pyx_n_s_deco, __pyx_k_deco, sizeof(__pyx_k_deco), 0, 0, 1, 1},
   {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
   {&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1},
   {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
@@ -227864,6 +227764,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_function_mapping, __pyx_k_function_mapping, sizeof(__pyx_k_function_mapping), 0, 0, 1, 1},
   {&__pyx_n_s_function_name, __pyx_k_function_name, sizeof(__pyx_k_function_name), 0, 0, 1, 1},
   {&__pyx_n_s_functions, __pyx_k_functions, sizeof(__pyx_k_functions), 0, 0, 1, 1},
+  {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1},
   {&__pyx_n_u_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 1, 0, 1},
   {&__pyx_kp_u_g_1_g_2, __pyx_k_g_1_g_2, sizeof(__pyx_k_g_1_g_2), 0, 1, 0, 0},
   {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
@@ -228063,6 +227964,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_ns_uri, __pyx_k_ns_uri, sizeof(__pyx_k_ns_uri), 0, 0, 1, 1},
   {&__pyx_n_s_ns_utf, __pyx_k_ns_utf, sizeof(__pyx_k_ns_utf), 0, 0, 1, 1},
   {&__pyx_n_s_nsmap, __pyx_k_nsmap, sizeof(__pyx_k_nsmap), 0, 0, 1, 1},
+  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
   {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
   {&__pyx_n_s_occur, __pyx_k_occur, sizeof(__pyx_k_occur), 0, 0, 1, 1},
   {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
@@ -228088,6 +227990,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_parseid, __pyx_k_parseid, sizeof(__pyx_k_parseid), 0, 0, 1, 1},
   {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
   {&__pyx_kp_u_parser_locking_failed, __pyx_k_parser_locking_failed, sizeof(__pyx_k_parser_locking_failed), 0, 1, 0, 0},
+  {&__pyx_n_s_partial, __pyx_k_partial, sizeof(__pyx_k_partial), 0, 0, 1, 1},
   {&__pyx_kp_s_passing_a_single_string_into_fro, __pyx_k_passing_a_single_string_into_fro, sizeof(__pyx_k_passing_a_single_string_into_fro), 0, 0, 1, 0},
   {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
   {&__pyx_n_s_path_2, __pyx_k_path_2, sizeof(__pyx_k_path_2), 0, 0, 1, 1},
@@ -228365,13 +228268,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
 static int __Pyx_InitCachedBuiltins(void) {
   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 64, __pyx_L1_error)
   __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 71, __pyx_L1_error)
-  __pyx_builtin_SyntaxError = __Pyx_GetBuiltinName(__pyx_n_s_SyntaxError); if (!__pyx_builtin_SyntaxError) __PYX_ERR(0, 228, __pyx_L1_error)
+  __pyx_builtin_SyntaxError = __Pyx_GetBuiltinName(__pyx_n_s_SyntaxError); if (!__pyx_builtin_SyntaxError) __PYX_ERR(0, 231, __pyx_L1_error)
   __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(1, 772, __pyx_L1_error)
   __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(2, 25, __pyx_L1_error)
   __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(3, 431, __pyx_L1_error)
-  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 113, __pyx_L1_error)
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 199, __pyx_L1_error)
-  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 218, __pyx_L1_error)
+  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 116, __pyx_L1_error)
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 202, __pyx_L1_error)
+  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 221, __pyx_L1_error)
   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(4, 234, __pyx_L1_error)
   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(4, 362, __pyx_L1_error)
   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(5, 19, __pyx_L1_error)
@@ -228384,18 +228287,18 @@ static int __Pyx_InitCachedBuiltins(void) {
   __pyx_builtin_UnicodeEncodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeEncodeError); if (!__pyx_builtin_UnicodeEncodeError) __PYX_ERR(5, 1495, __pyx_L1_error)
   __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(5, 1513, __pyx_L1_error)
   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 311, __pyx_L1_error)
-  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 753, __pyx_L1_error)
-  __pyx_builtin_FutureWarning = __Pyx_GetBuiltinName(__pyx_n_s_FutureWarning); if (!__pyx_builtin_FutureWarning) __PYX_ERR(0, 1195, __pyx_L1_error)
-  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 1853, __pyx_L1_error)
-  __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) __PYX_ERR(0, 2044, __pyx_L1_error)
-  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 2558, __pyx_L1_error)
-  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 3480, __pyx_L1_error)
+  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 756, __pyx_L1_error)
+  __pyx_builtin_FutureWarning = __Pyx_GetBuiltinName(__pyx_n_s_FutureWarning); if (!__pyx_builtin_FutureWarning) __PYX_ERR(0, 1197, __pyx_L1_error)
+  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 1856, __pyx_L1_error)
+  __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) __PYX_ERR(0, 2047, __pyx_L1_error)
+  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 2561, __pyx_L1_error)
+  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 3483, __pyx_L1_error)
   __pyx_builtin_ReferenceError = __Pyx_GetBuiltinName(__pyx_n_s_ReferenceError); if (!__pyx_builtin_ReferenceError) __PYX_ERR(6, 18, __pyx_L1_error)
   __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(2, 636, __pyx_L1_error)
   __pyx_builtin_LookupError = __Pyx_GetBuiltinName(__pyx_n_s_LookupError); if (!__pyx_builtin_LookupError) __PYX_ERR(2, 821, __pyx_L1_error)
   __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(7, 699, __pyx_L1_error)
   __pyx_builtin_BaseException = __Pyx_GetBuiltinName(__pyx_n_s_BaseException); if (!__pyx_builtin_BaseException) __PYX_ERR(3, 122, __pyx_L1_error)
-  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 3557, __pyx_L1_error)
+  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 3560, __pyx_L1_error)
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -228405,100 +228308,100 @@ static int __Pyx_InitCachedConstants(void) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
 
-  /* "lxml/etree.pyx":199
+  /* "lxml/etree.pyx":202
  *     prefix_utf, uri_utf = _utf8(prefix), _utf8(uri)
  *     if _check_internal_prefix(prefix_utf):
  *         raise ValueError("Prefix format reserved for internal use")             # <<<<<<<<<<<<<<
  *     _tagValidOrRaise(prefix_utf)
  *     _uriValidOrRaise(uri_utf)
  */
-  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Prefix_format_reserved_for_inter); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 199, __pyx_L1_error)
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Prefix_format_reserved_for_inter); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 202, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple_);
   __Pyx_GIVEREF(__pyx_tuple_);
 
-  /* "lxml/etree.pyx":239
+  /* "lxml/etree.pyx":242
  * cdef __unpackDottedVersion(version):
  *     version_list = []
  *     l = (version.decode("ascii").replace(u'-', u'.').split(u'.') + [0]*4)[:4]             # <<<<<<<<<<<<<<
  *     for item in l:
  *         try:
  */
-  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__2);
   __Pyx_GIVEREF(__pyx_tuple__2);
-  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_kp_u__3, __pyx_kp_u__4); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_kp_u__3, __pyx_kp_u__4); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__5);
   __Pyx_GIVEREF(__pyx_tuple__5);
-  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u__4); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u__4); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__6);
   __Pyx_GIVEREF(__pyx_tuple__6);
-  __pyx_slice__7 = PySlice_New(Py_None, __pyx_int_4, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_slice__7 = PySlice_New(Py_None, __pyx_int_4, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 242, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_slice__7);
   __Pyx_GIVEREF(__pyx_slice__7);
 
-  /* "lxml/etree.pyx":244
+  /* "lxml/etree.pyx":247
  *             item = int(item)
  *         except ValueError:
  *             if item.startswith(u'dev'):             # <<<<<<<<<<<<<<
  *                 count = item[3:]
  *                 item = -300
  */
-  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_u_dev); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 244, __pyx_L1_error)
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_u_dev); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 247, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__8);
   __Pyx_GIVEREF(__pyx_tuple__8);
 
-  /* "lxml/etree.pyx":245
+  /* "lxml/etree.pyx":248
  *         except ValueError:
  *             if item.startswith(u'dev'):
  *                 count = item[3:]             # <<<<<<<<<<<<<<
  *                 item = -300
  *             elif item.startswith(u'alpha'):
  */
-  __pyx_slice__9 = PySlice_New(__pyx_int_3, Py_None, Py_None); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 245, __pyx_L1_error)
+  __pyx_slice__9 = PySlice_New(__pyx_int_3, Py_None, Py_None); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 248, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_slice__9);
   __Pyx_GIVEREF(__pyx_slice__9);
 
-  /* "lxml/etree.pyx":247
+  /* "lxml/etree.pyx":250
  *                 count = item[3:]
  *                 item = -300
  *             elif item.startswith(u'alpha'):             # <<<<<<<<<<<<<<
  *                 count = item[5:]
  *                 item = -200
  */
-  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_u_alpha); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 247, __pyx_L1_error)
+  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_u_alpha); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 250, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__10);
   __Pyx_GIVEREF(__pyx_tuple__10);
 
-  /* "lxml/etree.pyx":248
+  /* "lxml/etree.pyx":251
  *                 item = -300
  *             elif item.startswith(u'alpha'):
  *                 count = item[5:]             # <<<<<<<<<<<<<<
  *                 item = -200
  *             elif item.startswith(u'beta'):
  */
-  __pyx_slice__11 = PySlice_New(__pyx_int_5, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 248, __pyx_L1_error)
+  __pyx_slice__11 = PySlice_New(__pyx_int_5, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) __PYX_ERR(0, 251, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_slice__11);
   __Pyx_GIVEREF(__pyx_slice__11);
 
-  /* "lxml/etree.pyx":250
+  /* "lxml/etree.pyx":253
  *                 count = item[5:]
  *                 item = -200
  *             elif item.startswith(u'beta'):             # <<<<<<<<<<<<<<
  *                 count = item[4:]
  *                 item = -100
  */
-  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_u_beta); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 250, __pyx_L1_error)
+  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_u_beta); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 253, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__12);
   __Pyx_GIVEREF(__pyx_tuple__12);
 
-  /* "lxml/etree.pyx":251
+  /* "lxml/etree.pyx":254
  *                 item = -200
  *             elif item.startswith(u'beta'):
  *                 count = item[4:]             # <<<<<<<<<<<<<<
  *                 item = -100
  *             else:
  */
-  __pyx_slice__13 = PySlice_New(__pyx_int_4, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 251, __pyx_L1_error)
+  __pyx_slice__13 = PySlice_New(__pyx_int_4, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 254, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_slice__13);
   __Pyx_GIVEREF(__pyx_slice__13);
 
@@ -228612,225 +228515,247 @@ static int __Pyx_InitCachedConstants(void) {
   __Pyx_GOTREF(__pyx_tuple__27);
   __Pyx_GIVEREF(__pyx_tuple__27);
 
-  /* "lxml/etree.pyx":571
+  /* "lxml/etree.pyx":574
  *                 match = _find_invalid_public_id_characters(value)
  *                 if match:
  *                     raise ValueError('Invalid character(s) %r in public_id.' % match.group(0))             # <<<<<<<<<<<<<<
  *                 value = _utf8(value)
  *                 c_value = tree.xmlStrdup(_xcstr(value))
  */
-  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 571, __pyx_L1_error)
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 574, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__28);
   __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "lxml/etree.pyx":602
+  /* "lxml/etree.pyx":605
  *                 # enclosed in single quotes or quotes.
  *                 if b"'" in bvalue and b'"' in bvalue:
  *                     raise ValueError(             # <<<<<<<<<<<<<<
  *                         'System URL may not contain both single (\') and double quotes (").')
  *                 c_value = tree.xmlStrdup(_xcstr(bvalue))
  */
-  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_System_URL_may_not_contain_both); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_System_URL_may_not_contain_both); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 605, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__31);
   __Pyx_GIVEREF(__pyx_tuple__31);
 
-  /* "lxml/etree.pyx":2008
+  /* "lxml/etree.pyx":1194
+ *         #u"__nonzero__(self)" # currently fails in Py3.1
+ *         import warnings
+ *         warnings.warn(             # <<<<<<<<<<<<<<
+ *             u"The behavior of this method will change in future versions. "
+ *             u"Use specific 'len(elem)' or 'elem is not None' test instead.",
+ */
+  __pyx_tuple__32 = PyTuple_Pack(2, __pyx_kp_u_The_behavior_of_this_method_will, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1194, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__32);
+  __Pyx_GIVEREF(__pyx_tuple__32);
+
+  /* "lxml/etree.pyx":2011
  *         if method == 'c14n':
  *             if encoding is not None:
  *                 raise ValueError("Cannot specify encoding with C14N")             # <<<<<<<<<<<<<<
  *             if xml_declaration:
  *                 raise ValueError("Cannot enable XML declaration in C14N")
  */
-  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Cannot_specify_encoding_with_C14); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2008, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
+  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Cannot_specify_encoding_with_C14); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2011, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
 
-  /* "lxml/etree.pyx":2010
+  /* "lxml/etree.pyx":2013
  *                 raise ValueError("Cannot specify encoding with C14N")
  *             if xml_declaration:
  *                 raise ValueError("Cannot enable XML declaration in C14N")             # <<<<<<<<<<<<<<
  * 
  *             _tofilelikeC14N(file, self._context_node, exclusive, with_comments,
  */
-  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Cannot_enable_XML_declaration_in); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2010, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__35);
-  __Pyx_GIVEREF(__pyx_tuple__35);
+  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Cannot_enable_XML_declaration_in); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2013, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__36);
+  __Pyx_GIVEREF(__pyx_tuple__36);
 
-  /* "lxml/etree.pyx":2016
+  /* "lxml/etree.pyx":2019
  *             return
  *         if not with_comments:
  *             raise ValueError("Can only discard comments in C14N serialisation")             # <<<<<<<<<<<<<<
  *         # suppress decl. in default case (purely for ElementTree compatibility)
  *         if xml_declaration is not None:
  */
-  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Can_only_discard_comments_in_C14); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 2016, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__36);
-  __Pyx_GIVEREF(__pyx_tuple__36);
+  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Can_only_discard_comments_in_C14); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 2019, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
 
-  /* "lxml/etree.pyx":2208
+  /* "lxml/etree.pyx":2045
+ *         if docstring is not None and doctype is None:
+ *             import warnings
+ *             warnings.warn(             # <<<<<<<<<<<<<<
+ *                 "The 'docstring' option is deprecated. Use 'doctype' instead.",
+ *                 DeprecationWarning)
+ */
+  __pyx_tuple__38 = PyTuple_Pack(2, __pyx_kp_s_The_docstring_option_is_deprecat, __pyx_builtin_DeprecationWarning); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 2045, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__38);
+  __Pyx_GIVEREF(__pyx_tuple__38);
+
+  /* "lxml/etree.pyx":2211
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
  *                 path = "." + path
  *         return root.find(path, namespaces)
  */
-  __pyx_slice__38 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__38)) __PYX_ERR(0, 2208, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__38);
-  __Pyx_GIVEREF(__pyx_slice__38);
+  __pyx_slice__40 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__40)) __PYX_ERR(0, 2211, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__40);
+  __Pyx_GIVEREF(__pyx_slice__40);
 
-  /* "lxml/etree.pyx":2225
+  /* "lxml/etree.pyx":2228
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
  *                 path = "." + path
  *         return root.findtext(path, default, namespaces)
  */
-  __pyx_slice__39 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(0, 2225, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__39);
-  __Pyx_GIVEREF(__pyx_slice__39);
+  __pyx_slice__41 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__41)) __PYX_ERR(0, 2228, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__41);
+  __Pyx_GIVEREF(__pyx_slice__41);
 
-  /* "lxml/etree.pyx":2242
+  /* "lxml/etree.pyx":2245
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
  *                 path = "." + path
  *         return root.findall(path, namespaces)
  */
-  __pyx_slice__40 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__40)) __PYX_ERR(0, 2242, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__40);
-  __Pyx_GIVEREF(__pyx_slice__40);
+  __pyx_slice__42 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__42)) __PYX_ERR(0, 2245, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__42);
+  __Pyx_GIVEREF(__pyx_slice__42);
 
-  /* "lxml/etree.pyx":2259
+  /* "lxml/etree.pyx":2262
  *         root = self.getroot()
  *         if _isString(path):
  *             if path[:1] == "/":             # <<<<<<<<<<<<<<
  *                 path = "." + path
  *         return root.iterfind(path, namespaces)
  */
-  __pyx_slice__41 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__41)) __PYX_ERR(0, 2259, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__41);
-  __Pyx_GIVEREF(__pyx_slice__41);
+  __pyx_slice__43 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__43)) __PYX_ERR(0, 2262, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__43);
+  __Pyx_GIVEREF(__pyx_slice__43);
 
-  /* "lxml/etree.pyx":2960
+  /* "lxml/etree.pyx":2963
  *         _assertValidNode(element)
  *         if with_tail:
  *             events = (u"start", u"end")             # <<<<<<<<<<<<<<
  *         else:
  *             events = (u"start",)
  */
-  __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_u_start, __pyx_n_u_end); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 2960, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__44);
-  __Pyx_GIVEREF(__pyx_tuple__44);
+  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_u_start, __pyx_n_u_end); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 2963, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__46);
+  __Pyx_GIVEREF(__pyx_tuple__46);
 
-  /* "lxml/etree.pyx":2962
+  /* "lxml/etree.pyx":2965
  *             events = (u"start", u"end")
  *         else:
  *             events = (u"start",)             # <<<<<<<<<<<<<<
  *         self._start_element = element
  *         self._nextEvent = iterwalk(element, events=events, tag=tag).__next__
  */
-  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_u_start); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 2962, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__45);
-  __Pyx_GIVEREF(__pyx_tuple__45);
+  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_u_start); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 2965, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
 
-  /* "lxml/etree.pyx":3030
+  /* "lxml/etree.pyx":3033
  *     else:
  *         text = _utf8(text)
  *         if b'--' in text or text.endswith(b'-'):             # <<<<<<<<<<<<<<
  *             raise ValueError("Comment may not contain '--' or end with '-'")
  * 
  */
-  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_b__3); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 3030, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__47);
-  __Pyx_GIVEREF(__pyx_tuple__47);
+  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_b__3); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3033, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
 
-  /* "lxml/etree.pyx":3031
+  /* "lxml/etree.pyx":3034
  *         text = _utf8(text)
  *         if b'--' in text or text.endswith(b'-'):
  *             raise ValueError("Comment may not contain '--' or end with '-'")             # <<<<<<<<<<<<<<
  * 
  *     c_doc = _newXMLDoc()
  */
-  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_Comment_may_not_contain_or_end_w); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 3031, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__48);
-  __Pyx_GIVEREF(__pyx_tuple__48);
+  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Comment_may_not_contain_or_end_w); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 3034, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__50);
+  __Pyx_GIVEREF(__pyx_tuple__50);
 
-  /* "lxml/etree.pyx":3060
+  /* "lxml/etree.pyx":3063
  *         text = _utf8(text)
  *         if b'?>' in text:
  *             raise ValueError("PI text must not contain '?>'")             # <<<<<<<<<<<<<<
  * 
  *     c_doc = _newXMLDoc()
  */
-  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_PI_text_must_not_contain); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 3060, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__50);
-  __Pyx_GIVEREF(__pyx_tuple__50);
+  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_PI_text_must_not_contain); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 3063, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__52);
+  __Pyx_GIVEREF(__pyx_tuple__52);
 
-  /* "lxml/etree.pyx":3089
+  /* "lxml/etree.pyx":3092
  *         _utf8_data = _utf8(data)
  *         if b']]>' in _utf8_data:
  *             raise ValueError("']]>' not allowed inside CDATA")             # <<<<<<<<<<<<<<
  *         self._utf8_data = _utf8_data
  * 
  */
-  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_not_allowed_inside_CDATA); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 3089, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__52);
-  __Pyx_GIVEREF(__pyx_tuple__52);
+  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_not_allowed_inside_CDATA); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 3092, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__54);
+  __Pyx_GIVEREF(__pyx_tuple__54);
 
-  /* "lxml/etree.pyx":3244
+  /* "lxml/etree.pyx":3247
  *     cdef _Document doc
  *     if isinstance(strings, (bytes, unicode)):
  *         raise ValueError("passing a single string into fromstringlist() is not"             # <<<<<<<<<<<<<<
  *                          " efficient, use fromstring() instead")
  *     if parser is None:
  */
-  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_passing_a_single_string_into_fro); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 3244, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__53);
-  __Pyx_GIVEREF(__pyx_tuple__53);
+  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_passing_a_single_string_into_fro); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 3247, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__55);
+  __Pyx_GIVEREF(__pyx_tuple__55);
 
-  /* "lxml/etree.pyx":3326
+  /* "lxml/etree.pyx":3329
  *     if method == 'c14n':
  *         if encoding is not None:
  *             raise ValueError("Cannot specify encoding with C14N")             # <<<<<<<<<<<<<<
  *         if xml_declaration:
  *             raise ValueError("Cannot enable XML declaration in C14N")
  */
-  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_Cannot_specify_encoding_with_C14); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 3326, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__54);
-  __Pyx_GIVEREF(__pyx_tuple__54);
+  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Cannot_specify_encoding_with_C14); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 3329, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__56);
+  __Pyx_GIVEREF(__pyx_tuple__56);
 
-  /* "lxml/etree.pyx":3328
+  /* "lxml/etree.pyx":3331
  *             raise ValueError("Cannot specify encoding with C14N")
  *         if xml_declaration:
  *             raise ValueError("Cannot enable XML declaration in C14N")             # <<<<<<<<<<<<<<
  *         return _tostringC14N(element_or_tree, exclusive, with_comments, inclusive_ns_prefixes)
  *     if not with_comments:
  */
-  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Cannot_enable_XML_declaration_in); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 3328, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__55);
-  __Pyx_GIVEREF(__pyx_tuple__55);
+  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Cannot_enable_XML_declaration_in); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 3331, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__57);
+  __Pyx_GIVEREF(__pyx_tuple__57);
 
-  /* "lxml/etree.pyx":3331
+  /* "lxml/etree.pyx":3334
  *         return _tostringC14N(element_or_tree, exclusive, with_comments, inclusive_ns_prefixes)
  *     if not with_comments:
  *         raise ValueError("Can only discard comments in C14N serialisation")             # <<<<<<<<<<<<<<
  *     if encoding is _unicode or (encoding is not None and encoding.lower() == 'unicode'):
  *         if xml_declaration:
  */
-  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_Can_only_discard_comments_in_C14); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 3331, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__56);
-  __Pyx_GIVEREF(__pyx_tuple__56);
+  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_Can_only_discard_comments_in_C14); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 3334, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__58);
+  __Pyx_GIVEREF(__pyx_tuple__58);
 
-  /* "lxml/etree.pyx":3480
+  /* "lxml/etree.pyx":3483
  *     """
  *     if python.PY_VERSION_HEX < 0x02070000:
  *         raise NotImplementedError("PyCapsule usage requires Python 2.7+")             # <<<<<<<<<<<<<<
  * 
  *     cdef xmlDoc* c_doc
  */
-  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_PyCapsule_usage_requires_Python); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 3480, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__57);
-  __Pyx_GIVEREF(__pyx_tuple__57);
+  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_PyCapsule_usage_requires_Python); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 3483, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__59);
+  __Pyx_GIVEREF(__pyx_tuple__59);
 
   /* "src/lxml/readonlytree.pxi":18
  *         """
@@ -228839,9 +228764,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         return 0
  * 
  */
-  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_Proxy_invalidated); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(6, 18, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__58);
-  __Pyx_GIVEREF(__pyx_tuple__58);
+  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_Proxy_invalidated); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(6, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__60);
+  __Pyx_GIVEREF(__pyx_tuple__60);
 
   /* "src/lxml/readonlytree.pxi":196
  *             children = [ el for el in children if el.tag == tag ]
@@ -228850,9 +228775,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         return iter(children)
  * 
  */
-  __pyx_slice__59 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__59)) __PYX_ERR(6, 196, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__59);
-  __Pyx_GIVEREF(__pyx_slice__59);
+  __pyx_slice__61 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__61)) __PYX_ERR(6, 196, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__61);
+  __Pyx_GIVEREF(__pyx_slice__61);
 
   /* "src/lxml/classlookup.pxi":61
  *             tag = _utf8(_getattr(_getattr(self, '__class__'), '__name__'))
@@ -228861,9 +228786,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         try:
  *             parser = _getattr(self, 'PARSER')
  */
-  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_b__4); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(8, 61, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__60);
-  __Pyx_GIVEREF(__pyx_tuple__60);
+  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_b__4); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(8, 61, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__62);
+  __Pyx_GIVEREF(__pyx_tuple__62);
 
   /* "src/lxml/nsclasses.pxi":44
  *             class_dict_iterable = class_dict_iterable.items()
@@ -228872,9 +228797,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 self[name] = item
  * 
  */
-  __pyx_slice__61 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__61)) __PYX_ERR(9, 44, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__61);
-  __Pyx_GIVEREF(__pyx_slice__61);
+  __pyx_slice__63 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__63)) __PYX_ERR(9, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__63);
+  __Pyx_GIVEREF(__pyx_slice__63);
 
   /* "src/lxml/parser.pxi":467
  *             elif not isinstance(filename, bytes):
@@ -228883,9 +228808,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 if not isinstance(filename, bytes):
  *                     filename = None
  */
-  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(2, 467, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__63);
-  __Pyx_GIVEREF(__pyx_tuple__63);
+  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(2, 467, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__65);
+  __Pyx_GIVEREF(__pyx_tuple__65);
 
   /* "src/lxml/parser.pxi":1544
  *         XMLParser.__init__(self, **kwargs)
@@ -228894,9 +228819,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._setBaseURL(base_url)
  *         self._collectEvents(events, tag)
  */
-  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_end); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 1544, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__64);
-  __Pyx_GIVEREF(__pyx_tuple__64);
+  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_end); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(2, 1544, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__66);
+  __Pyx_GIVEREF(__pyx_tuple__66);
 
   /* "src/lxml/parser.pxi":1713
  *         HTMLParser.__init__(self, **kwargs)
@@ -228905,9 +228830,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._setBaseURL(base_url)
  *         self._collectEvents(events, tag)
  */
-  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_end); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(2, 1713, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__65);
-  __Pyx_GIVEREF(__pyx_tuple__65);
+  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_end); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(2, 1713, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__67);
+  __Pyx_GIVEREF(__pyx_tuple__67);
 
   /* "src/lxml/parser.pxi":1866
  *     if isinstance(text, unicode):
@@ -228916,9 +228841,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 u"Unicode strings with encoding declaration are not supported. "
  *                 u"Please use bytes input or XML fragments without declaration.")
  */
-  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_u_Unicode_strings_with_encoding_de); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(2, 1866, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__66);
-  __Pyx_GIVEREF(__pyx_tuple__66);
+  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_u_Unicode_strings_with_encoding_de); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(2, 1866, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__68);
+  __Pyx_GIVEREF(__pyx_tuple__68);
 
   /* "src/lxml/serializer.pxi":117
  *     if enchandler is NULL and c_enc is not NULL:
@@ -228927,9 +228852,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         raise LookupError, u"unknown encoding: '%s'" % encoding
  *     c_buffer = tree.xmlAllocOutputBuffer(enchandler)
  */
-  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(7, 117, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__67);
-  __Pyx_GIVEREF(__pyx_tuple__67);
+  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(7, 117, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__69);
+  __Pyx_GIVEREF(__pyx_tuple__69);
 
   /* "src/lxml/serializer.pxi":832
  *             writer   = _FilelikeWriter(f, compression=compression)
@@ -228938,9 +228863,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 bytes_count = c14n.xmlC14NDocSaveTo(
  *                     c_doc, NULL, exclusive, c_inclusive_ns_prefixes,
  */
-  __pyx_tuple__68 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(7, 832, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__68);
-  __Pyx_GIVEREF(__pyx_tuple__68);
+  __pyx_tuple__70 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(7, 832, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__70);
+  __Pyx_GIVEREF(__pyx_tuple__70);
 
   /* "src/lxml/serializer.pxi":932
  *         assert self.output_file is not None
@@ -228949,9 +228874,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         if not hasattr(self.output_file, 'write'):
  *             raise TypeError("Output file needs an async .write() method")
  */
-  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_Cannot_asynchronously_write_to_a); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(7, 932, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__69);
-  __Pyx_GIVEREF(__pyx_tuple__69);
+  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Cannot_asynchronously_write_to_a); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(7, 932, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__71);
+  __Pyx_GIVEREF(__pyx_tuple__71);
 
   /* "src/lxml/serializer.pxi":934
  *             raise TypeError("Cannot asynchronously write to a plain file")
@@ -228960,9 +228885,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         self.async_writer = _AsyncIncrementalFileWriter(
  *             self.output_file, self.encoding, self.compresslevel,
  */
-  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_Output_file_needs_an_async_write); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(7, 934, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__70);
-  __Pyx_GIVEREF(__pyx_tuple__70);
+  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_Output_file_needs_an_async_write); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(7, 934, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__72);
+  __Pyx_GIVEREF(__pyx_tuple__72);
 
   /* "src/lxml/serializer.pxi":1006
  *         cdef int c_standalone
@@ -228971,9 +228896,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self._status >= WRITER_DECL_WRITTEN:
  *             raise LxmlSyntaxError("XML declaration already written")
  */
-  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_only_XML_documents_have_declarat); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(7, 1006, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__71);
-  __Pyx_GIVEREF(__pyx_tuple__71);
+  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_only_XML_documents_have_declarat); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(7, 1006, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__73);
+  __Pyx_GIVEREF(__pyx_tuple__73);
 
   /* "src/lxml/serializer.pxi":1008
  *             raise LxmlSyntaxError("only XML documents have declarations")
@@ -228982,9 +228907,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         version = _utf8orNone(version)
  *         c_version = _xcstr(version) if version is not None else NULL
  */
-  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_XML_declaration_already_written); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(7, 1008, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__72);
-  __Pyx_GIVEREF(__pyx_tuple__72);
+  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_XML_declaration_already_written); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(7, 1008, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__74);
+  __Pyx_GIVEREF(__pyx_tuple__74);
 
   /* "src/lxml/serializer.pxi":1035
  *             return
@@ -228993,9 +228918,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         doctype = _utf8(doctype)
  *         _writeDoctype(self._c_out, _xcstr(doctype))
  */
-  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_DOCTYPE_already_written_or_canno); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(7, 1035, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__73);
-  __Pyx_GIVEREF(__pyx_tuple__73);
+  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_DOCTYPE_already_written_or_canno); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(7, 1035, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__75);
+  __Pyx_GIVEREF(__pyx_tuple__75);
 
   /* "src/lxml/serializer.pxi":1091
  *     cdef _write_start_element(self, element_config):
@@ -229004,9 +228929,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         ns, name, attributes, nsmap = element_config
  *         flat_namespace_map, new_namespaces = self._collect_namespaces(nsmap)
  */
-  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_cannot_append_trailing_element_t); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(7, 1091, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__74);
-  __Pyx_GIVEREF(__pyx_tuple__74);
+  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_cannot_append_trailing_element_t); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(7, 1091, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__76);
+  __Pyx_GIVEREF(__pyx_tuple__76);
 
   /* "src/lxml/serializer.pxi":1134
  *     cdef _write_end_element(self, element_config):
@@ -229015,9 +228940,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         if not self._element_stack or self._element_stack[-1][:2] != element_config[:2]:
  *             raise LxmlSyntaxError("inconsistent exit action in context manager")
  */
-  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_not_in_an_element); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(7, 1134, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__75);
-  __Pyx_GIVEREF(__pyx_tuple__75);
+  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_not_in_an_element); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(7, 1134, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__77);
+  __Pyx_GIVEREF(__pyx_tuple__77);
 
   /* "src/lxml/serializer.pxi":1135
  *         if self._status != WRITER_IN_ELEMENT:
@@ -229026,12 +228951,12 @@ static int __Pyx_InitCachedConstants(void) {
  *             raise LxmlSyntaxError("inconsistent exit action in context manager")
  * 
  */
-  __pyx_slice__76 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__76)) __PYX_ERR(7, 1135, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__76);
-  __Pyx_GIVEREF(__pyx_slice__76);
-  __pyx_slice__77 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__77)) __PYX_ERR(7, 1135, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__77);
-  __Pyx_GIVEREF(__pyx_slice__77);
+  __pyx_slice__78 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__78)) __PYX_ERR(7, 1135, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__78);
+  __Pyx_GIVEREF(__pyx_slice__78);
+  __pyx_slice__79 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__79)) __PYX_ERR(7, 1135, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__79);
+  __Pyx_GIVEREF(__pyx_slice__79);
 
   /* "src/lxml/serializer.pxi":1136
  *             raise LxmlSyntaxError("not in an element")
@@ -229040,9 +228965,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *         # If previous write operations failed, the context manager exit might still call us.
  */
-  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_inconsistent_exit_action_in_cont); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(7, 1136, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__78);
-  __Pyx_GIVEREF(__pyx_tuple__78);
+  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_inconsistent_exit_action_in_cont); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(7, 1136, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__80);
+  __Pyx_GIVEREF(__pyx_tuple__80);
 
   /* "src/lxml/serializer.pxi":1143
  *         ok_to_write = self._c_out.error == xmlerror.XML_ERR_OK
@@ -229051,9 +228976,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         if ok_to_write:
  *             tree.xmlOutputBufferWrite(self._c_out, 2, '</')
  */
-  __pyx_slice__79 = PySlice_New(__pyx_int_1, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__79)) __PYX_ERR(7, 1143, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__79);
-  __Pyx_GIVEREF(__pyx_slice__79);
+  __pyx_slice__81 = PySlice_New(__pyx_int_1, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__81)) __PYX_ERR(7, 1143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__81);
+  __Pyx_GIVEREF(__pyx_slice__81);
 
   /* "src/lxml/serializer.pxi":1205
  *                 if self._status != WRITER_IN_ELEMENT:
@@ -229062,9 +228987,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 bstring = _utf8(content)
  *                 if not bstring:
  */
-  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_not_in_an_element); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(7, 1205, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__80);
-  __Pyx_GIVEREF(__pyx_tuple__80);
+  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_not_in_an_element); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(7, 1205, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__82);
+  __Pyx_GIVEREF(__pyx_tuple__82);
 
   /* "src/lxml/serializer.pxi":1221
  *             elif iselement(content):
@@ -229073,9 +228998,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 _writeNodeToBuffer(self._c_out, (<_Element>content)._c_node,
  *                                    self._c_encoding, NULL, c_method,
  */
-  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_cannot_append_trailing_element_t); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(7, 1221, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__81);
-  __Pyx_GIVEREF(__pyx_tuple__81);
+  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_cannot_append_trailing_element_t); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(7, 1221, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__83);
+  __Pyx_GIVEREF(__pyx_tuple__83);
 
   /* "src/lxml/serializer.pxi":1248
  *         if raise_on_error:
@@ -229084,9 +229009,9 @@ static int __Pyx_InitCachedConstants(void) {
  *             if self._element_stack:
  *                 raise LxmlSyntaxError("pending open tags on close")
  */
-  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_no_content_written); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(7, 1248, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__82);
-  __Pyx_GIVEREF(__pyx_tuple__82);
+  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_no_content_written); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(7, 1248, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__84);
+  __Pyx_GIVEREF(__pyx_tuple__84);
 
   /* "src/lxml/serializer.pxi":1250
  *                 raise LxmlSyntaxError("no content written")
@@ -229095,9 +229020,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         error_result = self._c_out.error
  *         if error_result == xmlerror.XML_ERR_OK:
  */
-  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_pending_open_tags_on_close); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(7, 1250, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__83);
-  __Pyx_GIVEREF(__pyx_tuple__83);
+  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_pending_open_tags_on_close); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(7, 1250, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__85);
+  __Pyx_GIVEREF(__pyx_tuple__85);
 
   /* "src/lxml/serializer.pxi":1422
  *     def __enter__(self):
@@ -229106,9 +229031,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._writer._method = self._new_method
  *         self._entered = True
  */
-  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_Inconsistent_enter_action_in_con); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(7, 1422, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__84);
-  __Pyx_GIVEREF(__pyx_tuple__84);
+  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_Inconsistent_enter_action_in_con); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(7, 1422, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__86);
+  __Pyx_GIVEREF(__pyx_tuple__86);
 
   /* "src/lxml/serializer.pxi":1428
  *     def __exit__(self, exc_type, exc_val, exc_tb):
@@ -229117,9 +229042,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self._writer._method != self._new_method:
  *             raise LxmlSyntaxError("Method changed outside of context manager")
  */
-  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_Inconsistent_exit_action_in_cont); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(7, 1428, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__85);
-  __Pyx_GIVEREF(__pyx_tuple__85);
+  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_Inconsistent_exit_action_in_cont); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(7, 1428, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__87);
+  __Pyx_GIVEREF(__pyx_tuple__87);
 
   /* "src/lxml/serializer.pxi":1430
  *             raise LxmlSyntaxError("Inconsistent exit action in context manager")
@@ -229128,9 +229053,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._writer._method = self._old_method
  *         self._exited = True
  */
-  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_Method_changed_outside_of_contex); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(7, 1430, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__86);
-  __Pyx_GIVEREF(__pyx_tuple__86);
+  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_Method_changed_outside_of_contex); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(7, 1430, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__88);
+  __Pyx_GIVEREF(__pyx_tuple__88);
 
   /* "src/lxml/iterparse.pxi":66
  *     cdef bint _close_source_after_read
@@ -229139,9 +229064,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                  attribute_defaults=False, dtd_validation=False,
  *                  load_dtd=False, no_network=True, remove_blank_text=False,
  */
-  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_u_end); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(13, 66, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__87);
-  __Pyx_GIVEREF(__pyx_tuple__87);
+  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_u_end); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(13, 66, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__89);
+  __Pyx_GIVEREF(__pyx_tuple__89);
 
   /* "src/lxml/iterparse.pxi":218
  *     @cython.final
@@ -229150,9 +229075,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         if not isinstance(data, bytes):
  *             self._close_source()
  */
-  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_int_32768); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(13, 218, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__88);
-  __Pyx_GIVEREF(__pyx_tuple__88);
+  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_int_32768); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(13, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__90);
+  __Pyx_GIVEREF(__pyx_tuple__90);
 
   /* "src/lxml/iterparse.pxi":221
  *         if not isinstance(data, bytes):
@@ -229161,9 +229086,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         if not data:
  *             try:
  */
-  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_reading_file_objects_must_return); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(13, 221, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__89);
-  __Pyx_GIVEREF(__pyx_tuple__89);
+  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_reading_file_objects_must_return); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(13, 221, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__91);
+  __Pyx_GIVEREF(__pyx_tuple__91);
 
   /* "src/lxml/iterparse.pxi":257
  *     cdef _IterwalkSkipStates _skip_state
@@ -229172,9 +229097,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         cdef _Element root
  *         cdef int ns_count
  */
-  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_u_end); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(13, 257, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__90);
-  __Pyx_GIVEREF(__pyx_tuple__90);
+  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_n_u_end); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(13, 257, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__92);
+  __Pyx_GIVEREF(__pyx_tuple__92);
 
   /* "src/lxml/iterparse.pxi":332
  *             if self._events[0][0] in ('start', 'start-ns'):
@@ -229183,9 +229108,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     def skip_subtree(self):
  */
-  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(13, 332, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__91);
-  __Pyx_GIVEREF(__pyx_tuple__91);
+  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(13, 332, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__93);
+  __Pyx_GIVEREF(__pyx_tuple__93);
 
   /* "src/lxml/iterparse.pxi":370
  *                 self._events.append( (u"end", node) )
@@ -229194,9 +229119,9 @@ static int __Pyx_InitCachedConstants(void) {
  *             for i in range(ns_count):
  *                 self._events.append(event)
  */
-  __pyx_tuple__92 = PyTuple_Pack(2, __pyx_kp_u_end_ns, Py_None); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(13, 370, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__92);
-  __Pyx_GIVEREF(__pyx_tuple__92);
+  __pyx_tuple__94 = PyTuple_Pack(2, __pyx_kp_u_end_ns, Py_None); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(13, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__94);
+  __Pyx_GIVEREF(__pyx_tuple__94);
 
   /* "src/lxml/xmlid.pxi":15
  *     global _find_id_attributes
@@ -229205,9 +229130,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     # ElementTree compatible implementation: parse and look for 'id' attributes
  */
-  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_u_string_id); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(14, 15, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__93);
-  __Pyx_GIVEREF(__pyx_tuple__93);
+  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_u_string_id); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(14, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__95);
+  __Pyx_GIVEREF(__pyx_tuple__95);
 
   /* "src/lxml/xmlid.pxi":21
  *     dic = {}
@@ -229216,9 +229141,9 @@ static int __Pyx_InitCachedConstants(void) {
  *     return (root, dic)
  * 
  */
-  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_n_u_id); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(14, 21, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__94);
-  __Pyx_GIVEREF(__pyx_tuple__94);
+  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_n_u_id); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(14, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__96);
+  __Pyx_GIVEREF(__pyx_tuple__96);
 
   /* "src/lxml/xmlid.pxi":114
  *         if self._keys is None:
@@ -229227,9 +229152,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     def __iter__(self):
  */
-  __pyx_slice__95 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__95)) __PYX_ERR(14, 114, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__95);
-  __Pyx_GIVEREF(__pyx_slice__95);
+  __pyx_slice__97 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__97)) __PYX_ERR(14, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__97);
+  __Pyx_GIVEREF(__pyx_slice__97);
 
   /* "src/lxml/xmlid.pxi":132
  *         if self._items is None:
@@ -229238,9 +229163,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *     def iteritems(self):
  */
-  __pyx_slice__96 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__96)) __PYX_ERR(14, 132, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__96);
-  __Pyx_GIVEREF(__pyx_slice__96);
+  __pyx_slice__98 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__98)) __PYX_ERR(14, 132, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__98);
+  __Pyx_GIVEREF(__pyx_slice__98);
 
   /* "src/lxml/extensions.pxi":446
  *         if function_mapping is None:
@@ -229249,9 +229174,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         for function_name in function_mapping:
  *             functions[(ns, function_name)] = getattr(module, function_name)
  */
-  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_n_u__62); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(17, 446, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__97);
-  __Pyx_GIVEREF(__pyx_tuple__97);
+  __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_u__64); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(17, 446, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__99);
+  __Pyx_GIVEREF(__pyx_tuple__99);
 
   /* "src/lxml/extensions.pxi":521
  *                 return ()
@@ -229260,9 +229185,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         result_list = []
  *         root = Element(u'matches')
  */
-  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_u__16); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(17, 521, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__98);
-  __Pyx_GIVEREF(__pyx_tuple__98);
+  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_u__16); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(17, 521, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__100);
+  __Pyx_GIVEREF(__pyx_tuple__100);
 
   /* "src/lxml/extensions.pxi":523
  *             results.extend( result.groups(u'') )
@@ -229271,9 +229196,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         join_groups = u''.join
  *         for s_match in results:
  */
-  __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_u_matches); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(17, 523, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__99);
-  __Pyx_GIVEREF(__pyx_tuple__99);
+  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_n_u_matches); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(17, 523, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__101);
+  __Pyx_GIVEREF(__pyx_tuple__101);
 
   /* "src/lxml/xpath.pxi":499
  *                 i += 1
@@ -229282,9 +229207,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 namespace = (<bytes>namespace).decode('utf8')
  *                 namespaces[prefix.decode('utf8')] = namespace
  */
-  __pyx_slice__100 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__100)) __PYX_ERR(18, 499, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__100);
-  __Pyx_GIVEREF(__pyx_slice__100);
+  __pyx_slice__102 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__102)) __PYX_ERR(18, 499, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__102);
+  __Pyx_GIVEREF(__pyx_slice__102);
 
   /* "src/lxml/xpath.pxi":505
  *                 # FIXME: this also replaces {namespaces} within strings!
@@ -229292,9 +229217,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         path = path_utf.decode('utf8')             # <<<<<<<<<<<<<<
  *         return path, namespaces
  */
-  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(18, 505, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__101);
-  __Pyx_GIVEREF(__pyx_tuple__101);
+  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_n_s_utf8); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(18, 505, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__103);
+  __Pyx_GIVEREF(__pyx_tuple__103);
 
   /* "src/lxml/xslt.pxi":395
  *         c_doc._private = <python.PyObject*>self._xslt_resolver_context
@@ -229303,9 +229228,9 @@ static int __Pyx_InitCachedConstants(void) {
  *             c_style = xslt.xsltParseStylesheetDoc(c_doc)
  * 
  */
-  __pyx_tuple__103 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(3, 395, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__103);
-  __Pyx_GIVEREF(__pyx_tuple__103);
+  __pyx_tuple__105 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(3, 395, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__105);
+  __Pyx_GIVEREF(__pyx_tuple__105);
 
   /* "src/lxml/xslt.pxi":462
  *         """
@@ -229314,9 +229239,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         xslt.xsltMaxDepth = max_depth
  * 
  */
-  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_cannot_set_a_maximum_stylesheet); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(3, 462, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__104);
-  __Pyx_GIVEREF(__pyx_tuple__104);
+  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_cannot_set_a_maximum_stylesheet); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(3, 462, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__106);
+  __Pyx_GIVEREF(__pyx_tuple__106);
 
   /* "src/lxml/xslt.pxi":729
  *             doc = self._doc
@@ -229325,9 +229250,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         c_compression = compression or 0
  *         if _isString(file):
  */
-  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_No_document_to_serialise); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(3, 729, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__105);
-  __Pyx_GIVEREF(__pyx_tuple__105);
+  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_No_document_to_serialise); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(3, 729, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__107);
+  __Pyx_GIVEREF(__pyx_tuple__107);
 
   /* "src/lxml/xslt.pxi":885
  *     global __findStylesheetByID
@@ -229336,9 +229261,9 @@ static int __Pyx_InitCachedConstants(void) {
  *             u"//xsl:stylesheet[@xml:id = $id]",
  *             namespaces={u"xsl" : u"http://www.w3.org/1999/XSL/Transform"})
  */
-  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_u_xsl_stylesheet_xml_id_id); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(3, 885, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__106);
-  __Pyx_GIVEREF(__pyx_tuple__106);
+  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_u_xsl_stylesheet_xml_id_id); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(3, 885, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__108);
+  __Pyx_GIVEREF(__pyx_tuple__108);
 
   /* "src/lxml/xsltext.pxi":224
  *                 e = unicode(e).encode(u"UTF-8")
@@ -229347,9 +229272,9 @@ static int __Pyx_InitCachedConstants(void) {
  *             message = python.PyBytes_FromFormat(
  *                 "Error executing extension element '%s': %s",
  */
-  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_u_UTF_8); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(19, 224, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__108);
-  __Pyx_GIVEREF(__pyx_tuple__108);
+  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_u_UTF_8); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(19, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__110);
+  __Pyx_GIVEREF(__pyx_tuple__110);
 
   /* "src/lxml/dtd.pxi":279
  *             if _isString(file):
@@ -229358,9 +229283,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                     self._c_dtd = xmlparser.xmlParseDTD(NULL, _xcstr(file))
  *             elif hasattr(file, 'read'):
  */
-  __pyx_tuple__109 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(20, 279, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__109);
-  __Pyx_GIVEREF(__pyx_tuple__109);
+  __pyx_tuple__111 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(20, 279, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__111);
+  __Pyx_GIVEREF(__pyx_tuple__111);
 
   /* "src/lxml/dtd.pxi":286
  *                 raise DTDParseError, u"file must be a filename or file-like object"
@@ -229369,9 +229294,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 self._c_dtd = xmlparser.xmlParseDTD(<const_xmlChar*>external_id, NULL)
  *         else:
  */
-  __pyx_tuple__110 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(20, 286, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__110);
-  __Pyx_GIVEREF(__pyx_tuple__110);
+  __pyx_tuple__112 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(20, 286, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__112);
+  __Pyx_GIVEREF(__pyx_tuple__112);
 
   /* "src/lxml/dtd.pxi":362
  *         valid_ctxt = dtdvalid.xmlNewValidCtxt()
@@ -229380,9 +229305,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  *         # work around error reporting bug in libxml2 <= 2.9.1 (and later?)
  */
-  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_u_Failed_to_create_validation_cont); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(20, 362, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__111);
-  __Pyx_GIVEREF(__pyx_tuple__111);
+  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_u_Failed_to_create_validation_cont); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(20, 362, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__113);
+  __Pyx_GIVEREF(__pyx_tuple__113);
 
   /* "src/lxml/dtd.pxi":370
  * 
@@ -229391,9 +229316,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
  *                 ret = dtdvalid.xmlValidateDtd(valid_ctxt, c_doc, self._c_dtd)
  */
-  __pyx_tuple__112 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(20, 370, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__112);
-  __Pyx_GIVEREF(__pyx_tuple__112);
+  __pyx_tuple__114 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(20, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__114);
+  __Pyx_GIVEREF(__pyx_tuple__114);
 
   /* "src/lxml/dtd.pxi":392
  *     error_log = _ErrorLog()
@@ -229402,9 +229327,9 @@ static int __Pyx_InitCachedConstants(void) {
  *         c_dtd = dtd_parser._readDtd()
  * 
  */
-  __pyx_tuple__113 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(20, 392, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__113);
-  __Pyx_GIVEREF(__pyx_tuple__113);
+  __pyx_tuple__115 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(20, 392, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__115);
+  __Pyx_GIVEREF(__pyx_tuple__115);
 
   /* "src/lxml/relaxng.pxi":13
  * cdef int _require_rnc2rng() except -1:
@@ -229413,9 +229338,9 @@ static int __Pyx_InitCachedConstants(void) {
  *             'compact syntax not supported (please install rnc2rng)')
  *     return 0
  */
-  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_compact_syntax_not_supported_ple); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(21, 13, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__114);
-  __Pyx_GIVEREF(__pyx_tuple__114);
+  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_compact_syntax_not_supported_ple); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(21, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__116);
+  __Pyx_GIVEREF(__pyx_tuple__116);
 
   /* "src/lxml/relaxng.pxi":58
  *         elif file is not None:
@@ -229424,9 +229349,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                     _require_rnc2rng()
  *                     rng_data = _rnc2rng.dumps(_rnc2rng.load(file))
  */
-  __pyx_slice__115 = PySlice_New(__pyx_int_neg_4, Py_None, Py_None); if (unlikely(!__pyx_slice__115)) __PYX_ERR(21, 58, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__115);
-  __Pyx_GIVEREF(__pyx_slice__115);
+  __pyx_slice__117 = PySlice_New(__pyx_int_neg_4, Py_None, Py_None); if (unlikely(!__pyx_slice__117)) __PYX_ERR(21, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__117);
+  __Pyx_GIVEREF(__pyx_slice__117);
 
   /* "src/lxml/relaxng.pxi":68
  *                     doc = None
@@ -229435,9 +229360,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                         parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))
  *             elif (_getFilenameForFile(file) or '')[-4:].lower() == '.rnc':
  */
-  __pyx_tuple__116 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(21, 68, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__116);
-  __Pyx_GIVEREF(__pyx_tuple__116);
+  __pyx_tuple__118 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(21, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__118);
+  __Pyx_GIVEREF(__pyx_tuple__118);
 
   /* "src/lxml/relaxng.pxi":70
  *                     with self._error_log:
@@ -229446,9 +229371,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 _require_rnc2rng()
  *                 rng_data = _rnc2rng.dumps(_rnc2rng.load(file))
  */
-  __pyx_slice__117 = PySlice_New(__pyx_int_neg_4, Py_None, Py_None); if (unlikely(!__pyx_slice__117)) __PYX_ERR(21, 70, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_slice__117);
-  __Pyx_GIVEREF(__pyx_slice__117);
+  __pyx_slice__119 = PySlice_New(__pyx_int_neg_4, Py_None, Py_None); if (unlikely(!__pyx_slice__119)) __PYX_ERR(21, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_slice__119);
+  __Pyx_GIVEREF(__pyx_slice__119);
 
   /* "src/lxml/schematron.pxi":97
  *                 filename = file
@@ -229457,9 +229382,9 @@ static int __Pyx_InitCachedConstants(void) {
  *                 parser_ctxt = schematron.xmlSchematronNewParserCtxt(_cstr(filename))
  *         else:
  */
-  __pyx_tuple__118 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(23, 97, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__118);
-  __Pyx_GIVEREF(__pyx_tuple__118);
+  __pyx_tuple__120 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(23, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__120);
+  __Pyx_GIVEREF(__pyx_tuple__120);
 
   /* "src/lxml/schematron.pxi":109
  * 
@@ -229468,126 +229393,126 @@ static int __Pyx_InitCachedConstants(void) {
  *                 self._c_schema = schematron.xmlSchematronParse(parser_ctxt)
  *         finally:
  */
-  __pyx_tuple__119 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(23, 109, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__119);
-  __Pyx_GIVEREF(__pyx_tuple__119);
+  __pyx_tuple__121 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(23, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__121);
+  __Pyx_GIVEREF(__pyx_tuple__121);
 
-  /* "lxml/etree.pyx":112
+  /* "lxml/etree.pyx":115
  * 
  * class _ImmutableMapping(MutableMapping):
  *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
  *         raise KeyError, key
  * 
  */
-  __pyx_tuple__120 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 112, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__120);
-  __Pyx_GIVEREF(__pyx_tuple__120);
-  __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getitem, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 112, __pyx_L1_error)
-
-  /* "lxml/etree.pyx":115
- *         raise KeyError, key
- * 
- *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
- *         raise KeyError, key
- * 
- */
-  __pyx_tuple__122 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __pyx_tuple__122 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 115, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__122);
   __Pyx_GIVEREF(__pyx_tuple__122);
-  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_setitem, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getitem, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 115, __pyx_L1_error)
 
   /* "lxml/etree.pyx":118
  *         raise KeyError, key
  * 
- *     def __delitem__(self, key):             # <<<<<<<<<<<<<<
+ *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
  *         raise KeyError, key
  * 
  */
-  __pyx_tuple__124 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 118, __pyx_L1_error)
+  __pyx_tuple__124 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 118, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__124);
   __Pyx_GIVEREF(__pyx_tuple__124);
-  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_delitem, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 118, __pyx_L1_error)
+  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_setitem, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 118, __pyx_L1_error)
 
   /* "lxml/etree.pyx":121
  *         raise KeyError, key
  * 
- *     def __contains__(self, key):             # <<<<<<<<<<<<<<
- *         return False
+ *     def __delitem__(self, key):             # <<<<<<<<<<<<<<
+ *         raise KeyError, key
  * 
  */
   __pyx_tuple__126 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 121, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__126);
   __Pyx_GIVEREF(__pyx_tuple__126);
-  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_contains, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_delitem, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 121, __pyx_L1_error)
 
   /* "lxml/etree.pyx":124
- *         return False
+ *         raise KeyError, key
  * 
- *     def __len__(self):             # <<<<<<<<<<<<<<
- *         return 0
+ *     def __contains__(self, key):             # <<<<<<<<<<<<<<
+ *         return False
  * 
  */
-  __pyx_tuple__128 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __pyx_tuple__128 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 124, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__128);
   __Pyx_GIVEREF(__pyx_tuple__128);
-  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_len, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_contains, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 124, __pyx_L1_error)
 
   /* "lxml/etree.pyx":127
+ *         return False
+ * 
+ *     def __len__(self):             # <<<<<<<<<<<<<<
  *         return 0
  * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return ITER_EMPTY
- *     iterkeys = itervalues = iteritems = __iter__
  */
   __pyx_tuple__130 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 127, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__130);
   __Pyx_GIVEREF(__pyx_tuple__130);
-  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iter_2, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 127, __pyx_L1_error)
+  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_len, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 127, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":170
+  /* "lxml/etree.pyx":130
+ *         return 0
+ * 
+ *     def __iter__(self):             # <<<<<<<<<<<<<<
+ *         return ITER_EMPTY
+ *     iterkeys = itervalues = iteritems = __iter__
+ */
+  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 130, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__132);
+  __Pyx_GIVEREF(__pyx_tuple__132);
+  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iter_2, 130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 130, __pyx_L1_error)
+
+  /* "lxml/etree.pyx":173
  * 
  * # filename encoding
  * cdef bytes _FILENAME_ENCODING = (sys.getfilesystemencoding() or sys.getdefaultencoding() or 'ascii').encode("UTF-8")             # <<<<<<<<<<<<<<
  * cdef char* _C_FILENAME_ENCODING = _cstr(_FILENAME_ENCODING)
  * 
  */
-  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 170, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__132);
-  __Pyx_GIVEREF(__pyx_tuple__132);
+  __pyx_tuple__134 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 173, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__134);
+  __Pyx_GIVEREF(__pyx_tuple__134);
 
-  /* "lxml/etree.pyx":189
+  /* "lxml/etree.pyx":192
  * }
  * 
  * cdef object _check_internal_prefix = re.compile(b"ns\d+$").match             # <<<<<<<<<<<<<<
  * 
  * def register_namespace(prefix, uri):
  */
-  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_kp_b_ns_d_2); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 189, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__133);
-  __Pyx_GIVEREF(__pyx_tuple__133);
+  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_b_ns_d_2); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 192, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__135);
+  __Pyx_GIVEREF(__pyx_tuple__135);
 
-  /* "lxml/etree.pyx":191
+  /* "lxml/etree.pyx":194
  * cdef object _check_internal_prefix = re.compile(b"ns\d+$").match
  * 
  * def register_namespace(prefix, uri):             # <<<<<<<<<<<<<<
  *     u"""Registers a namespace prefix that newly created Elements in that
  *     namespace will use.  The registry is global, and any existing
  */
-  __pyx_tuple__134 = PyTuple_Pack(6, __pyx_n_s_prefix, __pyx_n_s_uri, __pyx_n_s_prefix_utf, __pyx_n_s_uri_utf, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 191, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__134);
-  __Pyx_GIVEREF(__pyx_tuple__134);
-  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_register_namespace, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 191, __pyx_L1_error)
+  __pyx_tuple__136 = PyTuple_Pack(6, __pyx_n_s_prefix, __pyx_n_s_uri, __pyx_n_s_prefix_utf, __pyx_n_s_uri_utf, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 194, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__136);
+  __Pyx_GIVEREF(__pyx_tuple__136);
+  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_register_namespace, 194, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 194, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":270
+  /* "lxml/etree.pyx":273
  * try:
  *     _LIBXML_VERSION_INT = int(
  *         re.match(u'[0-9]+', (<unsigned char*>tree.xmlParserVersion).decode("ascii")).group(0))             # <<<<<<<<<<<<<<
  * except Exception:
  *     print u"Unknown libxml2 version: %s" % (<unsigned char*>tree.xmlParserVersion).decode("latin1")
  */
-  __pyx_tuple__136 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 270, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__136);
-  __Pyx_GIVEREF(__pyx_tuple__136);
+  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 273, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__138);
+  __Pyx_GIVEREF(__pyx_tuple__138);
 
   /* "src/lxml/xmlerror.pxi":8
  * # module level API functions
@@ -229596,7 +229521,7 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""clear_error_log()
  * 
  */
-  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_clear_error_log_2, 8, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(1, 8, __pyx_L1_error)
+  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_clear_error_log_2, 8, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(1, 8, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":186
  *         self.last_error = last_error
@@ -229605,10 +229530,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return _BaseErrorLog(self._first_error, self.last_error)
  * 
  */
-  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(1, 186, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__138);
-  __Pyx_GIVEREF(__pyx_tuple__138);
-  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_copy, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(1, 186, __pyx_L1_error)
+  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(1, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__140);
+  __Pyx_GIVEREF(__pyx_tuple__140);
+  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_copy, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(1, 186, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":192
  *         return u''
@@ -229617,10 +229542,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         pass
  * 
  */
-  __pyx_tuple__140 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(1, 192, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__140);
-  __Pyx_GIVEREF(__pyx_tuple__140);
-  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_receive, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(1, 192, __pyx_L1_error)
+  __pyx_tuple__142 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(1, 192, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__142);
+  __Pyx_GIVEREF(__pyx_tuple__142);
+  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_receive, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(1, 192, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":283
  *         self._entries = entries
@@ -229629,10 +229554,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Creates a shallow copy of this error log.  Reuses the list of
  *         entries.
  */
-  __pyx_tuple__142 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(1, 283, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__142);
-  __Pyx_GIVEREF(__pyx_tuple__142);
-  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_copy, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(1, 283, __pyx_L1_error)
+  __pyx_tuple__144 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(1, 283, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__144);
+  __Pyx_GIVEREF(__pyx_tuple__144);
+  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_copy, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(1, 283, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":321
  *         return len(self._entries) > self._offset
@@ -229641,10 +229566,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Filter the errors by the given domains and return a new error log
  *         containing the matches.
  */
-  __pyx_tuple__144 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_entry, __pyx_n_s_filtered); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(1, 321, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__144);
-  __Pyx_GIVEREF(__pyx_tuple__144);
-  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_domains, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(1, 321, __pyx_L1_error)
+  __pyx_tuple__146 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_entry, __pyx_n_s_filtered); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(1, 321, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__146);
+  __Pyx_GIVEREF(__pyx_tuple__146);
+  __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_domains, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(1, 321, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":331
  *         return _ListErrorLog(filtered, None, None)
@@ -229653,10 +229578,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""filter_types(self, types)
  * 
  */
-  __pyx_tuple__146 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_types, __pyx_n_s_entry, __pyx_n_s_filtered); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(1, 331, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__146);
-  __Pyx_GIVEREF(__pyx_tuple__146);
-  __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_types, 331, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(1, 331, __pyx_L1_error)
+  __pyx_tuple__148 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_types, __pyx_n_s_entry, __pyx_n_s_filtered); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(1, 331, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__148);
+  __Pyx_GIVEREF(__pyx_tuple__148);
+  __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_types, 331, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(1, 331, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":343
  *         return _ListErrorLog(filtered, None, None)
@@ -229665,10 +229590,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""filter_levels(self, levels)
  * 
  */
-  __pyx_tuple__148 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_levels, __pyx_n_s_entry, __pyx_n_s_filtered); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(1, 343, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__148);
-  __Pyx_GIVEREF(__pyx_tuple__148);
-  __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_levels, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(1, 343, __pyx_L1_error)
+  __pyx_tuple__150 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_levels, __pyx_n_s_entry, __pyx_n_s_filtered); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(1, 343, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__150);
+  __Pyx_GIVEREF(__pyx_tuple__150);
+  __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_levels, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(1, 343, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":355
  *         return _ListErrorLog(filtered, None, None)
@@ -229677,10 +229602,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""filter_from_level(self, level)
  * 
  */
-  __pyx_tuple__150 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_level, __pyx_n_s_entry, __pyx_n_s_filtered); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(1, 355, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__150);
-  __Pyx_GIVEREF(__pyx_tuple__150);
-  __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_from_level, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(1, 355, __pyx_L1_error)
+  __pyx_tuple__152 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_level, __pyx_n_s_entry, __pyx_n_s_filtered); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(1, 355, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__152);
+  __Pyx_GIVEREF(__pyx_tuple__152);
+  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_from_level, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(1, 355, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":364
  *         return _ListErrorLog(filtered, None, None)
@@ -229689,10 +229614,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""filter_from_fatals(self)
  * 
  */
-  __pyx_tuple__152 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(1, 364, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__152);
-  __Pyx_GIVEREF(__pyx_tuple__152);
-  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_from_fatals, 364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(1, 364, __pyx_L1_error)
+  __pyx_tuple__154 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(1, 364, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__154);
+  __Pyx_GIVEREF(__pyx_tuple__154);
+  __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_from_fatals, 364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(1, 364, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":371
  *         return self.filter_from_level(ErrorLevels.FATAL)
@@ -229701,10 +229626,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""filter_from_errors(self)
  * 
  */
-  __pyx_tuple__154 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(1, 371, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__154);
-  __Pyx_GIVEREF(__pyx_tuple__154);
-  __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__154, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_from_errors, 371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(1, 371, __pyx_L1_error)
+  __pyx_tuple__156 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(1, 371, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__156);
+  __Pyx_GIVEREF(__pyx_tuple__156);
+  __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_from_errors, 371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(1, 371, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":378
  *         return self.filter_from_level(ErrorLevels.ERROR)
@@ -229713,10 +229638,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""filter_from_warnings(self)
  * 
  */
-  __pyx_tuple__156 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(1, 378, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__156);
-  __Pyx_GIVEREF(__pyx_tuple__156);
-  __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__156, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_from_warnings, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(1, 378, __pyx_L1_error)
+  __pyx_tuple__158 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(1, 378, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__158);
+  __Pyx_GIVEREF(__pyx_tuple__158);
+  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_filter_from_warnings, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(1, 378, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":408
  *         return self.connect()
@@ -229725,10 +229650,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         #  TODO: make this a cdef function when Cython supports it
  *         self.disconnect()
  */
-  __pyx_tuple__158 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(1, 408, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__158);
-  __Pyx_GIVEREF(__pyx_tuple__158);
-  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_exit, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(1, 408, __pyx_L1_error)
+  __pyx_tuple__160 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(1, 408, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__160);
+  __Pyx_GIVEREF(__pyx_tuple__160);
+  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_exit, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(1, 408, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":432
  *         return 0
@@ -229737,10 +229662,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._first_error = None
  *         self.last_error = None
  */
-  __pyx_tuple__160 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(1, 432, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__160);
-  __Pyx_GIVEREF(__pyx_tuple__160);
-  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_clear, 432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(1, 432, __pyx_L1_error)
+  __pyx_tuple__162 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(1, 432, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__162);
+  __Pyx_GIVEREF(__pyx_tuple__162);
+  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_clear, 432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(1, 432, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":438
  *         del self._entries[:]
@@ -229749,10 +229674,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Creates a shallow copy of this error log and the list of entries.
  *         """
  */
-  __pyx_tuple__162 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(1, 438, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__162);
-  __Pyx_GIVEREF(__pyx_tuple__162);
-  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_copy, 438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(1, 438, __pyx_L1_error)
+  __pyx_tuple__164 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(1, 438, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__164);
+  __Pyx_GIVEREF(__pyx_tuple__164);
+  __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_copy, 438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(1, 438, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":448
  *         return iter(self._entries[self._offset:])
@@ -229761,10 +229686,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self._first_error is None and entry.level >= xmlerror.XML_ERR_ERROR:
  *             self._first_error = entry
  */
-  __pyx_tuple__164 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(1, 448, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__164);
-  __Pyx_GIVEREF(__pyx_tuple__164);
-  __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_receive, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(1, 448, __pyx_L1_error)
+  __pyx_tuple__166 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(1, 448, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__166);
+  __Pyx_GIVEREF(__pyx_tuple__166);
+  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_receive, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(1, 448, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":458
  *         self._accepted_domains = tuple(domains)
@@ -229773,10 +229698,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if entry.domain in self._accepted_domains:
  *             _ErrorLog.receive(self, entry)
  */
-  __pyx_tuple__166 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(1, 458, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__166);
-  __Pyx_GIVEREF(__pyx_tuple__166);
-  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_receive, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(1, 458, __pyx_L1_error)
+  __pyx_tuple__168 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(1, 458, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__168);
+  __Pyx_GIVEREF(__pyx_tuple__168);
+  __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_receive, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(1, 458, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":468
  *         self._max_len = max_len
@@ -229785,10 +229710,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self._first_error is None and entry.level >= xmlerror.XML_ERR_ERROR:
  *             self._first_error = entry
  */
-  __pyx_tuple__168 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(1, 468, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__168);
-  __Pyx_GIVEREF(__pyx_tuple__168);
-  __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_receive, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(1, 468, __pyx_L1_error)
+  __pyx_tuple__170 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(1, 468, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__170);
+  __Pyx_GIVEREF(__pyx_tuple__170);
+  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_receive, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(1, 468, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":519
  *         self._log = logger.log
@@ -229797,10 +229722,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Dummy method that returns an empty error log.
  *         """
  */
-  __pyx_tuple__170 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(1, 519, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__170);
-  __Pyx_GIVEREF(__pyx_tuple__170);
-  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_copy, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(1, 519, __pyx_L1_error)
+  __pyx_tuple__172 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(1, 519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__172);
+  __Pyx_GIVEREF(__pyx_tuple__172);
+  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_copy, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(1, 519, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":524
  *         return _ListErrorLog([], None, None)
@@ -229809,10 +229734,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""log(self, log_entry, message, *args)
  * 
  */
-  __pyx_tuple__172 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_log_entry, __pyx_n_s_message, __pyx_n_s_args); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(1, 524, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__172);
-  __Pyx_GIVEREF(__pyx_tuple__172);
-  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_log, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(1, 524, __pyx_L1_error)
+  __pyx_tuple__174 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_log_entry, __pyx_n_s_message, __pyx_n_s_args); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(1, 524, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__174);
+  __Pyx_GIVEREF(__pyx_tuple__174);
+  __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_log, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(1, 524, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":541
  *             )
@@ -229821,10 +229746,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""receive(self, log_entry)
  * 
  */
-  __pyx_tuple__174 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_log_entry); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(1, 541, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__174);
-  __Pyx_GIVEREF(__pyx_tuple__174);
-  __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_receive, 541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(1, 541, __pyx_L1_error)
+  __pyx_tuple__176 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_log_entry); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(1, 541, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__176);
+  __Pyx_GIVEREF(__pyx_tuple__176);
+  __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_receive, 541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(1, 541, __pyx_L1_error)
 
   /* "src/lxml/xmlerror.pxi":558
  * 
@@ -229833,9 +229758,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  * cdef _BaseErrorLog _getGlobalErrorLog():
  */
-  __pyx_tuple__176 = PyTuple_Pack(1, __pyx_int_100); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(1, 558, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__176);
-  __Pyx_GIVEREF(__pyx_tuple__176);
+  __pyx_tuple__178 = PyTuple_Pack(1, __pyx_int_100); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(1, 558, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__178);
+  __Pyx_GIVEREF(__pyx_tuple__178);
 
   /* "src/lxml/xmlerror.pxi":587
  *     return _getGlobalErrorLog().copy()
@@ -229844,10 +229769,54 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""use_global_python_log(log)
  * 
  */
-  __pyx_tuple__177 = PyTuple_Pack(1, __pyx_n_s_log); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(1, 587, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__177);
-  __Pyx_GIVEREF(__pyx_tuple__177);
-  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_use_global_python_log, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(1, 587, __pyx_L1_error)
+  __pyx_tuple__179 = PyTuple_Pack(1, __pyx_n_s_log); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(1, 587, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__179);
+  __Pyx_GIVEREF(__pyx_tuple__179);
+  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlerror_pxi, __pyx_n_s_use_global_python_log, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(1, 587, __pyx_L1_error)
+
+  /* "src/lxml/xmlerror.pxi":772
+ * 
+ * 
+ * class ErrorLevels(object):             # <<<<<<<<<<<<<<
+ *     u"Libxml2 error levels"
+ * 
+ */
+  __pyx_tuple__181 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(1, 772, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__181);
+  __Pyx_GIVEREF(__pyx_tuple__181);
+
+  /* "src/lxml/xmlerror.pxi":775
+ *     u"Libxml2 error levels"
+ * 
+ * class ErrorDomains(object):             # <<<<<<<<<<<<<<
+ *     u"Libxml2 error domains"
+ * 
+ */
+  __pyx_tuple__182 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(1, 775, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__182);
+  __Pyx_GIVEREF(__pyx_tuple__182);
+
+  /* "src/lxml/xmlerror.pxi":778
+ *     u"Libxml2 error domains"
+ * 
+ * class ErrorTypes(object):             # <<<<<<<<<<<<<<
+ *     u"Libxml2 error types"
+ * 
+ */
+  __pyx_tuple__183 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(1, 778, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__183);
+  __Pyx_GIVEREF(__pyx_tuple__183);
+
+  /* "src/lxml/xmlerror.pxi":781
+ *     u"Libxml2 error types"
+ * 
+ * class RelaxNGErrorTypes(object):             # <<<<<<<<<<<<<<
+ *     u"Libxml2 RelaxNG error types"
+ * 
+ */
+  __pyx_tuple__184 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(1, 781, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__184);
+  __Pyx_GIVEREF(__pyx_tuple__184);
 
   /* "src/lxml/xmlerror.pxi":794
  * # cannot handle strings that are a few thousand bytes in length.
@@ -229856,9 +229825,9 @@ static int __Pyx_InitCachedConstants(void) {
  * NONE=0
  * WARNING=1
  */
-  __pyx_tuple__179 = PyTuple_Pack(1, __pyx_kp_u_NONE_0_WARNING_1_ERROR_2_FATAL_3); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(1, 794, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__179);
-  __Pyx_GIVEREF(__pyx_tuple__179);
+  __pyx_tuple__185 = PyTuple_Pack(1, __pyx_kp_u_NONE_0_WARNING_1_ERROR_2_FATAL_3); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(1, 794, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__185);
+  __Pyx_GIVEREF(__pyx_tuple__185);
 
   /* "src/lxml/xmlerror.pxi":801
  * """,)
@@ -229867,9 +229836,9 @@ static int __Pyx_InitCachedConstants(void) {
  * NONE=0
  * PARSER=1
  */
-  __pyx_tuple__180 = PyTuple_Pack(1, __pyx_kp_u_NONE_0_PARSER_1_TREE_2_NAMESPACE); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(1, 801, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__180);
-  __Pyx_GIVEREF(__pyx_tuple__180);
+  __pyx_tuple__186 = PyTuple_Pack(1, __pyx_kp_u_NONE_0_PARSER_1_TREE_2_NAMESPACE); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(1, 801, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__186);
+  __Pyx_GIVEREF(__pyx_tuple__186);
 
   /* "src/lxml/xmlerror.pxi":835
  * """,)
@@ -229878,9 +229847,9 @@ static int __Pyx_InitCachedConstants(void) {
  * ERR_OK=0
  * ERR_INTERNAL_ERROR=1
  */
-  __pyx_tuple__181 = PyTuple_Pack(11, __pyx_kp_u_ERR_OK_0_ERR_INTERNAL_ERROR_1_ER, __pyx_kp_u_ERR_ENCODING_NAME_79_ERR_HYPHEN, __pyx_kp_u_RNGP_ATTRIBUTE_CONTENT_1003_RNGP, __pyx_kp_u_RNGP_PAT_DATA_EXCEPT_ONEMORE_107, __pyx_kp_u_TREE_NOT_UTF8_1303_SAVE_NOT_UTF8, __pyx_kp_u_SCHEMAP_EXTENSION_NO_BASE_1707_S, __pyx_kp_u_SCHEMAP_DEF_AND_PREFIX_1768_SCHE, __pyx_kp_u_SCHEMAV_CVC_MINLENGTH_VALID_1831, __pyx_kp_u_SCHEMAP_SRC_RESOLVE_3004_SCHEMAP, __pyx_kp_u_SCHEMAP_CVC_SIMPLE_TYPE_3062_SCH, __pyx_kp_u_I18N_NO_OUTPUT_6004_BUF_OVERFLOW); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(1, 835, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__181);
-  __Pyx_GIVEREF(__pyx_tuple__181);
+  __pyx_tuple__187 = PyTuple_Pack(11, __pyx_kp_u_ERR_OK_0_ERR_INTERNAL_ERROR_1_ER, __pyx_kp_u_ERR_ENCODING_NAME_79_ERR_HYPHEN, __pyx_kp_u_RNGP_ATTRIBUTE_CONTENT_1003_RNGP, __pyx_kp_u_RNGP_PAT_DATA_EXCEPT_ONEMORE_107, __pyx_kp_u_TREE_NOT_UTF8_1303_SAVE_NOT_UTF8, __pyx_kp_u_SCHEMAP_EXTENSION_NO_BASE_1707_S, __pyx_kp_u_SCHEMAP_DEF_AND_PREFIX_1768_SCHE, __pyx_kp_u_SCHEMAV_CVC_MINLENGTH_VALID_1831, __pyx_kp_u_SCHEMAP_SRC_RESOLVE_3004_SCHEMAP, __pyx_kp_u_SCHEMAP_CVC_SIMPLE_TYPE_3062_SCH, __pyx_kp_u_I18N_NO_OUTPUT_6004_BUF_OVERFLOW); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(1, 835, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__187);
+  __Pyx_GIVEREF(__pyx_tuple__187);
 
   /* "src/lxml/xmlerror.pxi":1592
  * """,)
@@ -229889,1205 +229858,1205 @@ static int __Pyx_InitCachedConstants(void) {
  * RELAXNG_OK=0
  * RELAXNG_ERR_MEMORY=1
  */
-  __pyx_tuple__182 = PyTuple_Pack(1, __pyx_kp_u_RELAXNG_OK_0_RELAXNG_ERR_MEMORY); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(1, 1592, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__182);
-  __Pyx_GIVEREF(__pyx_tuple__182);
+  __pyx_tuple__188 = PyTuple_Pack(1, __pyx_kp_u_RELAXNG_OK_0_RELAXNG_ERR_MEMORY); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(1, 1592, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__188);
+  __Pyx_GIVEREF(__pyx_tuple__188);
 
-  /* "lxml/etree.pyx":513
+  /* "lxml/etree.pyx":516
  * 
  * 
  * cdef object _find_invalid_public_id_characters = re.compile(             # <<<<<<<<<<<<<<
  *     ur"[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#@$_%-]+").search
  * 
  */
-  __pyx_tuple__183 = PyTuple_Pack(1, __pyx_kp_u_x20_x0D_x0Aa_zA_Z0_9); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 513, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__183);
-  __Pyx_GIVEREF(__pyx_tuple__183);
+  __pyx_tuple__189 = PyTuple_Pack(1, __pyx_kp_u_x20_x0D_x0Aa_zA_Z0_9); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 516, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__189);
+  __Pyx_GIVEREF(__pyx_tuple__189);
 
-  /* "lxml/etree.pyx":547
+  /* "lxml/etree.pyx":550
  *         return  tree.xmlCreateIntSubset(c_doc, c_name, NULL, NULL)
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
  *         u"""Removes DOCTYPE and internal subset from the document."""
  *         cdef xmlDoc* c_doc = self._doc._c_doc
  */
-  __pyx_tuple__184 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_doc, __pyx_n_s_c_dtd); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 547, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__184);
-  __Pyx_GIVEREF(__pyx_tuple__184);
-  __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_clear, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(0, 547, __pyx_L1_error)
+  __pyx_tuple__190 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_doc, __pyx_n_s_c_dtd); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 550, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__190);
+  __Pyx_GIVEREF(__pyx_tuple__190);
+  __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_clear, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 550, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":707
+  /* "lxml/etree.pyx":710
  *     cdef object _tag
  * 
  *     def _init(self):             # <<<<<<<<<<<<<<
  *         u"""_init(self)
  * 
  */
-  __pyx_tuple__186 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 707, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__186);
-  __Pyx_GIVEREF(__pyx_tuple__186);
-  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_init_2, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 707, __pyx_L1_error)
+  __pyx_tuple__192 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 710, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__192);
+  __Pyx_GIVEREF(__pyx_tuple__192);
+  __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_init_2, 710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 710, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":794
+  /* "lxml/etree.pyx":797
  *             _removeNode(self._doc, c_node)
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
  *         u"__deepcopy__(self, memo)"
  *         return self.__copy__()
  */
-  __pyx_tuple__188 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(0, 794, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__188);
-  __Pyx_GIVEREF(__pyx_tuple__188);
-  __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_deepcopy, 794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(0, 794, __pyx_L1_error)
+  __pyx_tuple__194 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 797, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__194);
+  __Pyx_GIVEREF(__pyx_tuple__194);
+  __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__194, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_deepcopy, 797, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(0, 797, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":798
+  /* "lxml/etree.pyx":801
  *         return self.__copy__()
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
  *         u"__copy__(self)"
  *         cdef xmlDoc* c_doc
  */
-  __pyx_tuple__190 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_c_doc, __pyx_n_s_c_node, __pyx_n_s_new_doc, __pyx_n_s_root); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 798, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__190);
-  __Pyx_GIVEREF(__pyx_tuple__190);
-  __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_copy_2, 798, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 798, __pyx_L1_error)
+  __pyx_tuple__196 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_c_doc, __pyx_n_s_c_node, __pyx_n_s_new_doc, __pyx_n_s_root); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 801, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__196);
+  __Pyx_GIVEREF(__pyx_tuple__196);
+  __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_copy_2, 801, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(0, 801, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":817
+  /* "lxml/etree.pyx":820
  *         return _elementFactory(new_doc, c_node)
  * 
  *     def set(self, key, value):             # <<<<<<<<<<<<<<
  *         u"""set(self, key, value)
  * 
  */
-  __pyx_tuple__192 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 817, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__192);
-  __Pyx_GIVEREF(__pyx_tuple__192);
-  __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_set, 817, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 817, __pyx_L1_error)
+  __pyx_tuple__198 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 820, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__198);
+  __Pyx_GIVEREF(__pyx_tuple__198);
+  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_set, 820, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 820, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":825
+  /* "lxml/etree.pyx":828
  *         _setAttributeValue(self, key, value)
  * 
  *     def append(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""append(self, element)
  * 
  */
-  __pyx_tuple__194 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_element); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 825, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__194);
-  __Pyx_GIVEREF(__pyx_tuple__194);
-  __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__194, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_append, 825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(0, 825, __pyx_L1_error)
+  __pyx_tuple__200 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_element); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 828, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__200);
+  __Pyx_GIVEREF(__pyx_tuple__200);
+  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_append, 828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(0, 828, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":834
+  /* "lxml/etree.pyx":837
  *         _appendChild(self, element)
  * 
  *     def addnext(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""addnext(self, element)
  * 
  */
-  __pyx_tuple__196 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_element); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 834, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__196);
-  __Pyx_GIVEREF(__pyx_tuple__196);
-  __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_addnext, 834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(0, 834, __pyx_L1_error)
+  __pyx_tuple__202 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_element); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 837, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__202);
+  __Pyx_GIVEREF(__pyx_tuple__202);
+  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_addnext, 837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 837, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":853
+  /* "lxml/etree.pyx":856
  *         _appendSibling(self, element)
  * 
  *     def addprevious(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""addprevious(self, element)
  * 
  */
-  __pyx_tuple__198 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_element); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 853, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__198);
-  __Pyx_GIVEREF(__pyx_tuple__198);
-  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_addprevious, 853, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 853, __pyx_L1_error)
+  __pyx_tuple__204 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_element); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 856, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__204);
+  __Pyx_GIVEREF(__pyx_tuple__204);
+  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_addprevious, 856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 856, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":872
+  /* "lxml/etree.pyx":875
  *         _prependSibling(self, element)
  * 
  *     def extend(self, elements):             # <<<<<<<<<<<<<<
  *         u"""extend(self, elements)
  * 
  */
-  __pyx_tuple__200 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_element); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 872, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__200);
-  __Pyx_GIVEREF(__pyx_tuple__200);
-  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_extend, 872, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(0, 872, __pyx_L1_error)
+  __pyx_tuple__206 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_element); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 875, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__206);
+  __Pyx_GIVEREF(__pyx_tuple__206);
+  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_extend, 875, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 875, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":885
+  /* "lxml/etree.pyx":888
  *             _appendChild(self, element)
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
  *         u"""clear(self)
  * 
  */
-  __pyx_tuple__202 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_c_attr, __pyx_n_s_c_attr_next, __pyx_n_s_c_node, __pyx_n_s_c_node_next); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 885, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__202);
-  __Pyx_GIVEREF(__pyx_tuple__202);
-  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_clear, 885, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 885, __pyx_L1_error)
+  __pyx_tuple__208 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_c_attr, __pyx_n_s_c_attr_next, __pyx_n_s_c_node, __pyx_n_s_c_node_next); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 888, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__208);
+  __Pyx_GIVEREF(__pyx_tuple__208);
+  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_clear, 888, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 888, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":916
+  /* "lxml/etree.pyx":919
  *                 c_node = c_node_next
  * 
  *     def insert(self, index, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""insert(self, index, element)
  * 
  */
-  __pyx_tuple__204 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_element, __pyx_n_s_c_node, __pyx_n_s_c_next, __pyx_n_s_c_source_doc); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 916, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__204);
-  __Pyx_GIVEREF(__pyx_tuple__204);
-  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_insert, 916, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 916, __pyx_L1_error)
+  __pyx_tuple__210 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_element, __pyx_n_s_c_node, __pyx_n_s_c_next, __pyx_n_s_c_source_doc); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 919, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__210);
+  __Pyx_GIVEREF(__pyx_tuple__210);
+  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_insert, 919, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 919, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":936
+  /* "lxml/etree.pyx":939
  *         moveNodeToDocument(self._doc, c_source_doc, element._c_node)
  * 
  *     def remove(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""remove(self, element)
  * 
  */
-  __pyx_tuple__206 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_element, __pyx_n_s_c_node, __pyx_n_s_c_next); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 936, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__206);
-  __Pyx_GIVEREF(__pyx_tuple__206);
-  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_remove, 936, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 936, __pyx_L1_error)
+  __pyx_tuple__212 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_element, __pyx_n_s_c_node, __pyx_n_s_c_next); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 939, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__212);
+  __Pyx_GIVEREF(__pyx_tuple__212);
+  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_remove, 939, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 939, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":956
+  /* "lxml/etree.pyx":959
  *         moveNodeToDocument(self._doc, c_node.doc, c_node)
  * 
  *     def replace(self, _Element old_element not None,             # <<<<<<<<<<<<<<
  *                 _Element new_element not None):
  *         u"""replace(self, old_element, new_element)
  */
-  __pyx_tuple__208 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_old_element, __pyx_n_s_new_element, __pyx_n_s_c_old_node, __pyx_n_s_c_old_next, __pyx_n_s_c_new_node, __pyx_n_s_c_new_next, __pyx_n_s_c_source_doc); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 956, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__208);
-  __Pyx_GIVEREF(__pyx_tuple__208);
-  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_replace, 956, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 956, __pyx_L1_error)
+  __pyx_tuple__214 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_old_element, __pyx_n_s_new_element, __pyx_n_s_c_old_node, __pyx_n_s_c_old_next, __pyx_n_s_c_new_node, __pyx_n_s_c_new_next, __pyx_n_s_c_source_doc); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 959, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__214);
+  __Pyx_GIVEREF(__pyx_tuple__214);
+  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_replace, 959, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(0, 959, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1213
+  /* "lxml/etree.pyx":1216
  *         return ElementChildIterator(self)
  * 
  *     def __reversed__(self):             # <<<<<<<<<<<<<<
  *         u"__reversed__(self)"
  *         return ElementChildIterator(self, reversed=True)
  */
-  __pyx_tuple__210 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 1213, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__210);
-  __Pyx_GIVEREF(__pyx_tuple__210);
-  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_reversed_2, 1213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 1213, __pyx_L1_error)
+  __pyx_tuple__216 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 1216, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__216);
+  __Pyx_GIVEREF(__pyx_tuple__216);
+  __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_reversed_2, 1216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(0, 1216, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1217
+  /* "lxml/etree.pyx":1220
  *         return ElementChildIterator(self, reversed=True)
  * 
  *     def index(self, _Element child not None, start=None, stop=None):             # <<<<<<<<<<<<<<
  *         u"""index(self, child, start=None, stop=None)
  * 
  */
-  __pyx_tuple__212 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_child, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_k, __pyx_n_s_l, __pyx_n_s_c_start, __pyx_n_s_c_stop, __pyx_n_s_c_child, __pyx_n_s_c_start_node); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 1217, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__212);
-  __Pyx_GIVEREF(__pyx_tuple__212);
-  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_index, 1217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 1217, __pyx_L1_error)
+  __pyx_tuple__218 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_child, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_k, __pyx_n_s_l, __pyx_n_s_c_start, __pyx_n_s_c_stop, __pyx_n_s_c_child, __pyx_n_s_c_start_node); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 1220, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__218);
+  __Pyx_GIVEREF(__pyx_tuple__218);
+  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_index, 1220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 1220, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1304
+  /* "lxml/etree.pyx":1307
  *             raise ValueError, u"list.index(x): x not in list"
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
  *         u"""get(self, key, default=None)
  * 
  */
-  __pyx_tuple__214 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 1304, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__214);
-  __Pyx_GIVEREF(__pyx_tuple__214);
-  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_get, 1304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(0, 1304, __pyx_L1_error)
+  __pyx_tuple__220 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 1307, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__220);
+  __Pyx_GIVEREF(__pyx_tuple__220);
+  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_get, 1307, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 1307, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1312
+  /* "lxml/etree.pyx":1315
  *         return _getAttributeValue(self, key, default)
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
  *         u"""keys(self)
  * 
  */
-  __pyx_tuple__216 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 1312, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__216);
-  __Pyx_GIVEREF(__pyx_tuple__216);
-  __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_keys, 1312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(0, 1312, __pyx_L1_error)
+  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 1315, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__222);
+  __Pyx_GIVEREF(__pyx_tuple__222);
+  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_keys, 1315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 1315, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1321
+  /* "lxml/etree.pyx":1324
  *         return _collectAttributes(self._c_node, 1)
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
  *         u"""values(self)
  * 
  */
-  __pyx_tuple__218 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 1321, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__218);
-  __Pyx_GIVEREF(__pyx_tuple__218);
-  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_values, 1321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 1321, __pyx_L1_error)
+  __pyx_tuple__224 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 1324, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__224);
+  __Pyx_GIVEREF(__pyx_tuple__224);
+  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_values, 1324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 1324, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1330
+  /* "lxml/etree.pyx":1333
  *         return _collectAttributes(self._c_node, 2)
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
  *         u"""items(self)
  * 
  */
-  __pyx_tuple__220 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 1330, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__220);
-  __Pyx_GIVEREF(__pyx_tuple__220);
-  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_items, 1330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 1330, __pyx_L1_error)
+  __pyx_tuple__226 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 1333, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__226);
+  __Pyx_GIVEREF(__pyx_tuple__226);
+  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_items, 1333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 1333, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1339
+  /* "lxml/etree.pyx":1342
  *         return _collectAttributes(self._c_node, 3)
  * 
  *     def getchildren(self):             # <<<<<<<<<<<<<<
  *         u"""getchildren(self)
  * 
  */
-  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 1339, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__222);
-  __Pyx_GIVEREF(__pyx_tuple__222);
-  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getchildren, 1339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 1339, __pyx_L1_error)
+  __pyx_tuple__228 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 1342, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__228);
+  __Pyx_GIVEREF(__pyx_tuple__228);
+  __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getchildren, 1342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 1342, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1352
+  /* "lxml/etree.pyx":1355
  *         return _collectChildren(self)
  * 
  *     def getparent(self):             # <<<<<<<<<<<<<<
  *         u"""getparent(self)
  * 
  */
-  __pyx_tuple__224 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 1352, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__224);
-  __Pyx_GIVEREF(__pyx_tuple__224);
-  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getparent, 1352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 1352, __pyx_L1_error)
+  __pyx_tuple__230 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 1355, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__230);
+  __Pyx_GIVEREF(__pyx_tuple__230);
+  __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getparent, 1355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(0, 1355, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1364
+  /* "lxml/etree.pyx":1367
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def getnext(self):             # <<<<<<<<<<<<<<
  *         u"""getnext(self)
  * 
  */
-  __pyx_tuple__226 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 1364, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__226);
-  __Pyx_GIVEREF(__pyx_tuple__226);
-  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getnext, 1364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 1364, __pyx_L1_error)
+  __pyx_tuple__232 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 1367, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__232);
+  __Pyx_GIVEREF(__pyx_tuple__232);
+  __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getnext, 1367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 1367, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1376
+  /* "lxml/etree.pyx":1379
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def getprevious(self):             # <<<<<<<<<<<<<<
  *         u"""getprevious(self)
  * 
  */
-  __pyx_tuple__228 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 1376, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__228);
-  __Pyx_GIVEREF(__pyx_tuple__228);
-  __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getprevious, 1376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 1376, __pyx_L1_error)
+  __pyx_tuple__234 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 1379, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__234);
+  __Pyx_GIVEREF(__pyx_tuple__234);
+  __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getprevious, 1379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(0, 1379, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1388
+  /* "lxml/etree.pyx":1391
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def itersiblings(self, tag=None, *tags, preceding=False):             # <<<<<<<<<<<<<<
  *         u"""itersiblings(self, tag=None, *tags, preceding=False)
  * 
  */
-  __pyx_tuple__230 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_preceding, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 1388, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__230);
-  __Pyx_GIVEREF(__pyx_tuple__230);
-  __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_itersiblings, 1388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(0, 1388, __pyx_L1_error)
+  __pyx_tuple__236 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_preceding, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 1391, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__236);
+  __Pyx_GIVEREF(__pyx_tuple__236);
+  __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_itersiblings, 1391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 1391, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1406
+  /* "lxml/etree.pyx":1409
  *         return SiblingsIterator(self, tags, preceding=preceding)
  * 
  *     def iterancestors(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""iterancestors(self, tag=None, *tags)
  * 
  */
-  __pyx_tuple__232 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 1406, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__232);
-  __Pyx_GIVEREF(__pyx_tuple__232);
-  __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterancestors, 1406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 1406, __pyx_L1_error)
+  __pyx_tuple__238 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 1409, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__238);
+  __Pyx_GIVEREF(__pyx_tuple__238);
+  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterancestors, 1409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 1409, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1418
+  /* "lxml/etree.pyx":1421
  *         return AncestorsIterator(self, tags)
  * 
  *     def iterdescendants(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""iterdescendants(self, tag=None, *tags)
  * 
  */
-  __pyx_tuple__234 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 1418, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__234);
-  __Pyx_GIVEREF(__pyx_tuple__234);
-  __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterdescendants, 1418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(0, 1418, __pyx_L1_error)
+  __pyx_tuple__240 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(0, 1421, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__240);
+  __Pyx_GIVEREF(__pyx_tuple__240);
+  __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterdescendants, 1421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(0, 1421, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1431
+  /* "lxml/etree.pyx":1434
  *         return ElementDepthFirstIterator(self, tags, inclusive=False)
  * 
  *     def iterchildren(self, tag=None, *tags, reversed=False):             # <<<<<<<<<<<<<<
  *         u"""iterchildren(self, tag=None, *tags, reversed=False)
  * 
  */
-  __pyx_tuple__236 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_reversed, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 1431, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__236);
-  __Pyx_GIVEREF(__pyx_tuple__236);
-  __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterchildren, 1431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 1431, __pyx_L1_error)
+  __pyx_tuple__242 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_reversed, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(0, 1434, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__242);
+  __Pyx_GIVEREF(__pyx_tuple__242);
+  __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterchildren, 1434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) __PYX_ERR(0, 1434, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1444
+  /* "lxml/etree.pyx":1447
  *         return ElementChildIterator(self, tags, reversed=reversed)
  * 
  *     def getroottree(self):             # <<<<<<<<<<<<<<
  *         u"""getroottree(self)
  * 
  */
-  __pyx_tuple__238 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 1444, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__238);
-  __Pyx_GIVEREF(__pyx_tuple__238);
-  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getroottree, 1444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 1444, __pyx_L1_error)
+  __pyx_tuple__244 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(0, 1447, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__244);
+  __Pyx_GIVEREF(__pyx_tuple__244);
+  __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getroottree, 1447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(0, 1447, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1456
+  /* "lxml/etree.pyx":1459
  *         return _elementTreeFactory(self._doc, None)
  * 
  *     def getiterator(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""getiterator(self, tag=None, *tags)
  * 
  */
-  __pyx_tuple__240 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(0, 1456, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__240);
-  __Pyx_GIVEREF(__pyx_tuple__240);
-  __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getiterator, 1456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(0, 1456, __pyx_L1_error)
+  __pyx_tuple__246 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 1459, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__246);
+  __Pyx_GIVEREF(__pyx_tuple__246);
+  __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getiterator, 1459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) __PYX_ERR(0, 1459, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1478
+  /* "lxml/etree.pyx":1481
  *         return ElementDepthFirstIterator(self, tags)
  * 
  *     def iter(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""iter(self, tag=None, *tags)
  * 
  */
-  __pyx_tuple__242 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(0, 1478, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__242);
-  __Pyx_GIVEREF(__pyx_tuple__242);
-  __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iter, 1478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) __PYX_ERR(0, 1478, __pyx_L1_error)
+  __pyx_tuple__248 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(0, 1481, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__248);
+  __Pyx_GIVEREF(__pyx_tuple__248);
+  __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__248, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iter, 1481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(0, 1481, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1501
+  /* "lxml/etree.pyx":1504
  *         return ElementDepthFirstIterator(self, tags)
  * 
  *     def itertext(self, tag=None, *tags, with_tail=True):             # <<<<<<<<<<<<<<
  *         u"""itertext(self, tag=None, *tags, with_tail=True)
  * 
  */
-  __pyx_tuple__244 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_with_tail, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(0, 1501, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__244);
-  __Pyx_GIVEREF(__pyx_tuple__244);
-  __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_itertext, 1501, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(0, 1501, __pyx_L1_error)
+  __pyx_tuple__250 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_with_tail, __pyx_n_s_tags); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(0, 1504, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__250);
+  __Pyx_GIVEREF(__pyx_tuple__250);
+  __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__250, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_itertext, 1504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(0, 1504, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1516
+  /* "lxml/etree.pyx":1519
  *         return ElementTextIterator(self, tags, with_tail=with_tail)
  * 
  *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
  *         u"""makeelement(self, _tag, attrib=None, nsmap=None, **_extra)
  * 
  */
-  __pyx_tuple__246 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 1516, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__246);
-  __Pyx_GIVEREF(__pyx_tuple__246);
-  __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_makeelement, 1516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) __PYX_ERR(0, 1516, __pyx_L1_error)
+  __pyx_tuple__252 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(0, 1519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__252);
+  __Pyx_GIVEREF(__pyx_tuple__252);
+  __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_makeelement, 1519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(0, 1519, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1525
+  /* "lxml/etree.pyx":1528
  *                             attrib, nsmap, _extra)
  * 
  *     def find(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""find(self, path, namespaces=None)
  * 
  */
-  __pyx_tuple__248 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(0, 1525, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__248);
-  __Pyx_GIVEREF(__pyx_tuple__248);
-  __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__248, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_find, 1525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(0, 1525, __pyx_L1_error)
+  __pyx_tuple__254 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(0, 1528, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__254);
+  __Pyx_GIVEREF(__pyx_tuple__254);
+  __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_find, 1528, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(0, 1528, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1538
+  /* "lxml/etree.pyx":1541
  *         return _elementpath.find(self, path, namespaces)
  * 
  *     def findtext(self, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""findtext(self, path, default=None, namespaces=None)
  * 
  */
-  __pyx_tuple__250 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_default, __pyx_n_s_namespaces); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(0, 1538, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__250);
-  __Pyx_GIVEREF(__pyx_tuple__250);
-  __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__250, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_findtext, 1538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(0, 1538, __pyx_L1_error)
+  __pyx_tuple__256 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_default, __pyx_n_s_namespaces); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 1541, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__256);
+  __Pyx_GIVEREF(__pyx_tuple__256);
+  __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_findtext, 1541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(0, 1541, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1551
+  /* "lxml/etree.pyx":1554
  *         return _elementpath.findtext(self, path, default, namespaces)
  * 
  *     def findall(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""findall(self, path, namespaces=None)
  * 
  */
-  __pyx_tuple__252 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(0, 1551, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__252);
-  __Pyx_GIVEREF(__pyx_tuple__252);
-  __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_findall, 1551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(0, 1551, __pyx_L1_error)
+  __pyx_tuple__258 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(0, 1554, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__258);
+  __Pyx_GIVEREF(__pyx_tuple__258);
+  __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__258, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_findall, 1554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(0, 1554, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1564
+  /* "lxml/etree.pyx":1567
  *         return _elementpath.findall(self, path, namespaces)
  * 
  *     def iterfind(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""iterfind(self, path, namespaces=None)
  * 
  */
-  __pyx_tuple__254 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(0, 1564, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__254);
-  __Pyx_GIVEREF(__pyx_tuple__254);
-  __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterfind, 1564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(0, 1564, __pyx_L1_error)
+  __pyx_tuple__260 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(0, 1567, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__260);
+  __Pyx_GIVEREF(__pyx_tuple__260);
+  __pyx_codeobj__261 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__260, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterfind, 1567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(0, 1567, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1577
+  /* "lxml/etree.pyx":1580
  *         return _elementpath.iterfind(self, path, namespaces)
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
  *               smart_strings=True, **_variables):
  *         u"""xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables)
  */
-  __pyx_tuple__256 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_path_2, __pyx_n_s_namespaces, __pyx_n_s_extensions, __pyx_n_s_smart_strings, __pyx_n_s_variables_2, __pyx_n_s_evaluator); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 1577, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__256);
-  __Pyx_GIVEREF(__pyx_tuple__256);
-  __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(2, 3, 7, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_xpath, 1577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(0, 1577, __pyx_L1_error)
+  __pyx_tuple__262 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_path_2, __pyx_n_s_namespaces, __pyx_n_s_extensions, __pyx_n_s_smart_strings, __pyx_n_s_variables_2, __pyx_n_s_evaluator); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(0, 1580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__262);
+  __Pyx_GIVEREF(__pyx_tuple__262);
+  __pyx_codeobj__263 = (PyObject*)__Pyx_PyCode_New(2, 3, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__262, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_xpath, 1580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) __PYX_ERR(0, 1580, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1588
+  /* "lxml/etree.pyx":1591
  *         return evaluator(_path, **_variables)
  * 
  *     def cssselect(self, expr, *, translator='xml'):             # <<<<<<<<<<<<<<
  *         """
  *         Run the CSS expression on this element and its children,
  */
-  __pyx_tuple__258 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_expr, __pyx_n_s_translator, __pyx_n_s_CSSSelector); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(0, 1588, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__258);
-  __Pyx_GIVEREF(__pyx_tuple__258);
-  __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__258, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_cssselect, 1588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(0, 1588, __pyx_L1_error)
+  __pyx_tuple__264 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_expr, __pyx_n_s_translator, __pyx_n_s_CSSSelector); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 1591, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__264);
+  __Pyx_GIVEREF(__pyx_tuple__264);
+  __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__264, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_cssselect, 1591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 1591, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1638
+  /* "lxml/etree.pyx":1641
  *         raise TypeError, u"this element does not have children or attributes"
  * 
  *     def set(self, key, value):             # <<<<<<<<<<<<<<
  *         u"set(self, key, value)"
  *         self._raiseImmutable()
  */
-  __pyx_tuple__260 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(0, 1638, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__260);
-  __Pyx_GIVEREF(__pyx_tuple__260);
-  __pyx_codeobj__261 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__260, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_set, 1638, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(0, 1638, __pyx_L1_error)
+  __pyx_tuple__266 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(0, 1641, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__266);
+  __Pyx_GIVEREF(__pyx_tuple__266);
+  __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__266, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_set, 1641, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) __PYX_ERR(0, 1641, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1642
+  /* "lxml/etree.pyx":1645
  *         self._raiseImmutable()
  * 
  *     def append(self, value):             # <<<<<<<<<<<<<<
  *         u"append(self, value)"
  *         self._raiseImmutable()
  */
-  __pyx_tuple__262 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(0, 1642, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__262);
-  __Pyx_GIVEREF(__pyx_tuple__262);
-  __pyx_codeobj__263 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__262, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_append, 1642, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) __PYX_ERR(0, 1642, __pyx_L1_error)
+  __pyx_tuple__268 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(0, 1645, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__268);
+  __Pyx_GIVEREF(__pyx_tuple__268);
+  __pyx_codeobj__269 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_append, 1645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__269)) __PYX_ERR(0, 1645, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1646
+  /* "lxml/etree.pyx":1649
  *         self._raiseImmutable()
  * 
  *     def insert(self, index, value):             # <<<<<<<<<<<<<<
  *         u"insert(self, index, value)"
  *         self._raiseImmutable()
  */
-  __pyx_tuple__264 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_value); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 1646, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__264);
-  __Pyx_GIVEREF(__pyx_tuple__264);
-  __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__264, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_insert, 1646, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 1646, __pyx_L1_error)
+  __pyx_tuple__270 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_value); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(0, 1649, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__270);
+  __Pyx_GIVEREF(__pyx_tuple__270);
+  __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__270, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_insert, 1649, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(0, 1649, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1685
+  /* "lxml/etree.pyx":1688
  *         return 0
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
  *         u"get(self, key, default=None)"
  *         return None
  */
-  __pyx_tuple__266 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(0, 1685, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__266);
-  __Pyx_GIVEREF(__pyx_tuple__266);
-  __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__266, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_get, 1685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) __PYX_ERR(0, 1685, __pyx_L1_error)
+  __pyx_tuple__272 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(0, 1688, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__272);
+  __Pyx_GIVEREF(__pyx_tuple__272);
+  __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_get, 1688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(0, 1688, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1689
+  /* "lxml/etree.pyx":1692
  *         return None
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
  *         u"keys(self)"
  *         return []
  */
-  __pyx_tuple__268 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(0, 1689, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__268);
-  __Pyx_GIVEREF(__pyx_tuple__268);
-  __pyx_codeobj__269 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_keys, 1689, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__269)) __PYX_ERR(0, 1689, __pyx_L1_error)
+  __pyx_tuple__274 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(0, 1692, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__274);
+  __Pyx_GIVEREF(__pyx_tuple__274);
+  __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__274, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_keys, 1692, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(0, 1692, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1693
+  /* "lxml/etree.pyx":1696
  *         return []
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
  *         u"items(self)"
  *         return []
  */
-  __pyx_tuple__270 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(0, 1693, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__270);
-  __Pyx_GIVEREF(__pyx_tuple__270);
-  __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__270, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_items, 1693, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(0, 1693, __pyx_L1_error)
+  __pyx_tuple__276 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(0, 1696, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__276);
+  __Pyx_GIVEREF(__pyx_tuple__276);
+  __pyx_codeobj__277 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_items, 1696, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(0, 1696, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1697
+  /* "lxml/etree.pyx":1700
  *         return []
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
  *         u"values(self)"
  *         return []
  */
-  __pyx_tuple__272 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(0, 1697, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__272);
-  __Pyx_GIVEREF(__pyx_tuple__272);
-  __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_values, 1697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(0, 1697, __pyx_L1_error)
+  __pyx_tuple__278 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(0, 1700, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__278);
+  __Pyx_GIVEREF(__pyx_tuple__278);
+  __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__278, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_values, 1700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(0, 1700, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1734
+  /* "lxml/etree.pyx":1737
  *             return "<?%s?>" % strrepr(self.target)
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
  *         u"""get(self, key, default=None)
  * 
  */
-  __pyx_tuple__274 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(0, 1734, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__274);
-  __Pyx_GIVEREF(__pyx_tuple__274);
-  __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__274, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_get, 1734, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(0, 1734, __pyx_L1_error)
+  __pyx_tuple__280 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(0, 1737, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__280);
+  __Pyx_GIVEREF(__pyx_tuple__280);
+  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__280, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_get, 1737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(0, 1737, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1877
+  /* "lxml/etree.pyx":1880
  *         return 0
  * 
  *     def parse(self, source, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
  *         u"""parse(self, source, parser=None, base_url=None)
  * 
  */
-  __pyx_tuple__276 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_source, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(0, 1877, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__276);
-  __Pyx_GIVEREF(__pyx_tuple__276);
-  __pyx_codeobj__277 = (PyObject*)__Pyx_PyCode_New(3, 1, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_parse, 1877, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(0, 1877, __pyx_L1_error)
+  __pyx_tuple__282 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_source, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(0, 1880, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__282);
+  __Pyx_GIVEREF(__pyx_tuple__282);
+  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(3, 1, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_parse, 1880, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(0, 1880, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1893
+  /* "lxml/etree.pyx":1896
  *         return self._context_node
  * 
  *     def _setroot(self, _Element root not None):             # <<<<<<<<<<<<<<
  *         u"""_setroot(self, root)
  * 
  */
-  __pyx_tuple__278 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_root); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(0, 1893, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__278);
-  __Pyx_GIVEREF(__pyx_tuple__278);
-  __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__278, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_setroot, 1893, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(0, 1893, __pyx_L1_error)
+  __pyx_tuple__284 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_root); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 1896, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__284);
+  __Pyx_GIVEREF(__pyx_tuple__284);
+  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_setroot, 1896, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(0, 1896, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1904
+  /* "lxml/etree.pyx":1907
  *         self._doc = None
  * 
  *     def getroot(self):             # <<<<<<<<<<<<<<
  *         u"""getroot(self)
  * 
  */
-  __pyx_tuple__280 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(0, 1904, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__280);
-  __Pyx_GIVEREF(__pyx_tuple__280);
-  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__280, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getroot, 1904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(0, 1904, __pyx_L1_error)
+  __pyx_tuple__286 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 1907, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__286);
+  __Pyx_GIVEREF(__pyx_tuple__286);
+  __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__286, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getroot, 1907, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(0, 1907, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1911
+  /* "lxml/etree.pyx":1914
  *         return self._context_node
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
  *         return _elementTreeFactory(self._doc, self._context_node)
  * 
  */
-  __pyx_tuple__282 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(0, 1911, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__282);
-  __Pyx_GIVEREF(__pyx_tuple__282);
-  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_copy_2, 1911, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(0, 1911, __pyx_L1_error)
+  __pyx_tuple__288 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(0, 1914, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__288);
+  __Pyx_GIVEREF(__pyx_tuple__288);
+  __pyx_codeobj__289 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_copy_2, 1914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__289)) __PYX_ERR(0, 1914, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1914
+  /* "lxml/etree.pyx":1917
  *         return _elementTreeFactory(self._doc, self._context_node)
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
  *         cdef _Element root
  *         cdef _Document doc
  */
-  __pyx_tuple__284 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_memo, __pyx_n_s_root, __pyx_n_s_doc_2, __pyx_n_s_c_doc); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 1914, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__284);
-  __Pyx_GIVEREF(__pyx_tuple__284);
-  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_deepcopy, 1914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(0, 1914, __pyx_L1_error)
+  __pyx_tuple__290 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_memo, __pyx_n_s_root, __pyx_n_s_doc_2, __pyx_n_s_c_doc); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(0, 1917, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__290);
+  __Pyx_GIVEREF(__pyx_tuple__290);
+  __pyx_codeobj__291 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__290, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_deepcopy, 1917, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__291)) __PYX_ERR(0, 1917, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":1954
+  /* "lxml/etree.pyx":1957
  *             return None
  * 
  *     def write(self, file, *, encoding=None, method=u"xml",             # <<<<<<<<<<<<<<
  *               pretty_print=False, xml_declaration=None, with_tail=True,
  *               standalone=None, doctype=None, compression=0,
  */
-  __pyx_tuple__286 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_file, __pyx_n_s_encoding, __pyx_n_s_method, __pyx_n_s_pretty_print, __pyx_n_s_xml_declaration, __pyx_n_s_with_tail, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_compression, __pyx_n_s_exclusive, __pyx_n_s_with_comments, __pyx_n_s_inclusive_ns_prefixes, __pyx_n_s_docstring, __pyx_n_s_write_declaration, __pyx_n_s_is_standalone, __pyx_n_s_warnings); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 1954, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__286);
-  __Pyx_GIVEREF(__pyx_tuple__286);
-  __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(2, 12, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__286, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_write, 1954, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(0, 1954, __pyx_L1_error)
+  __pyx_tuple__292 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_file, __pyx_n_s_encoding, __pyx_n_s_method, __pyx_n_s_pretty_print, __pyx_n_s_xml_declaration, __pyx_n_s_with_tail, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_compression, __pyx_n_s_exclusive, __pyx_n_s_with_comments, __pyx_n_s_inclusive_ns_prefixes, __pyx_n_s_docstring, __pyx_n_s_write_declaration, __pyx_n_s_is_standalone, __pyx_n_s_warnings); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(0, 1957, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__292);
+  __Pyx_GIVEREF(__pyx_tuple__292);
+  __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(2, 12, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__292, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_write, 1957, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(0, 1957, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2051
+  /* "lxml/etree.pyx":2054
  *                     is_standalone, compression)
  * 
  *     def getpath(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""getpath(self, element)
  * 
  */
-  __pyx_tuple__288 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_element, __pyx_n_s_doc_2, __pyx_n_s_root, __pyx_n_s_c_doc, __pyx_n_s_c_path, __pyx_n_s_path); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(0, 2051, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__288);
-  __Pyx_GIVEREF(__pyx_tuple__288);
-  __pyx_codeobj__289 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getpath, 2051, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__289)) __PYX_ERR(0, 2051, __pyx_L1_error)
+  __pyx_tuple__294 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_element, __pyx_n_s_doc_2, __pyx_n_s_root, __pyx_n_s_c_doc, __pyx_n_s_c_path, __pyx_n_s_path); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(0, 2054, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__294);
+  __Pyx_GIVEREF(__pyx_tuple__294);
+  __pyx_codeobj__295 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__294, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getpath, 2054, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) __PYX_ERR(0, 2054, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2089
+  /* "lxml/etree.pyx":2092
  *         return path
  * 
  *     def getelementpath(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""getelementpath(self, element)
  * 
  */
-  __pyx_tuple__290 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_element, __pyx_n_s_root, __pyx_n_s_count, __pyx_n_s_path, __pyx_n_s_c_element, __pyx_n_s_c_name, __pyx_n_s_c_href, __pyx_n_s_tag, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(0, 2089, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__290);
-  __Pyx_GIVEREF(__pyx_tuple__290);
-  __pyx_codeobj__291 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__290, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getelementpath, 2089, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__291)) __PYX_ERR(0, 2089, __pyx_L1_error)
+  __pyx_tuple__296 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_element, __pyx_n_s_root, __pyx_n_s_count, __pyx_n_s_path, __pyx_n_s_c_element, __pyx_n_s_c_name, __pyx_n_s_c_href, __pyx_n_s_tag, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(0, 2092, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__296);
+  __Pyx_GIVEREF(__pyx_tuple__296);
+  __pyx_codeobj__297 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__296, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getelementpath, 2092, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) __PYX_ERR(0, 2092, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2153
+  /* "lxml/etree.pyx":2156
  *         return '/'.join(path)
  * 
  *     def getiterator(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""getiterator(self, *tags, tag=None)
  * 
  */
-  __pyx_tuple__292 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags, __pyx_n_s_root); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(0, 2153, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__292);
-  __Pyx_GIVEREF(__pyx_tuple__292);
-  __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__292, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getiterator, 2153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(0, 2153, __pyx_L1_error)
+  __pyx_tuple__298 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags, __pyx_n_s_root); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(0, 2156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__298);
+  __Pyx_GIVEREF(__pyx_tuple__298);
+  __pyx_codeobj__299 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__298, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_getiterator, 2156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__299)) __PYX_ERR(0, 2156, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2177
+  /* "lxml/etree.pyx":2180
  *         return root.getiterator(*tags)
  * 
  *     def iter(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""iter(self, tag=None, *tags)
  * 
  */
-  __pyx_tuple__294 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags, __pyx_n_s_root); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(0, 2177, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__294);
-  __Pyx_GIVEREF(__pyx_tuple__294);
-  __pyx_codeobj__295 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__294, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iter, 2177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) __PYX_ERR(0, 2177, __pyx_L1_error)
+  __pyx_tuple__300 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_tags, __pyx_n_s_root); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(0, 2180, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__300);
+  __Pyx_GIVEREF(__pyx_tuple__300);
+  __pyx_codeobj__301 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__300, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iter, 2180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) __PYX_ERR(0, 2180, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2195
+  /* "lxml/etree.pyx":2198
  *         return root.iter(*tags)
  * 
  *     def find(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""find(self, path, namespaces=None)
  * 
  */
-  __pyx_tuple__296 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_root); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(0, 2195, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__296);
-  __Pyx_GIVEREF(__pyx_tuple__296);
-  __pyx_codeobj__297 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__296, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_find, 2195, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) __PYX_ERR(0, 2195, __pyx_L1_error)
+  __pyx_tuple__302 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_root); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(0, 2198, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__302);
+  __Pyx_GIVEREF(__pyx_tuple__302);
+  __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__302, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_find, 2198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(0, 2198, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2212
+  /* "lxml/etree.pyx":2215
  *         return root.find(path, namespaces)
  * 
  *     def findtext(self, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""findtext(self, path, default=None, namespaces=None)
  * 
  */
-  __pyx_tuple__298 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_default, __pyx_n_s_namespaces, __pyx_n_s_root); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(0, 2212, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__298);
-  __Pyx_GIVEREF(__pyx_tuple__298);
-  __pyx_codeobj__299 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__298, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_findtext, 2212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__299)) __PYX_ERR(0, 2212, __pyx_L1_error)
+  __pyx_tuple__304 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_default, __pyx_n_s_namespaces, __pyx_n_s_root); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(0, 2215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__304);
+  __Pyx_GIVEREF(__pyx_tuple__304);
+  __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_findtext, 2215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) __PYX_ERR(0, 2215, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2229
+  /* "lxml/etree.pyx":2232
  *         return root.findtext(path, default, namespaces)
  * 
  *     def findall(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""findall(self, path, namespaces=None)
  * 
  */
-  __pyx_tuple__300 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_root); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(0, 2229, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__300);
-  __Pyx_GIVEREF(__pyx_tuple__300);
-  __pyx_codeobj__301 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__300, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_findall, 2229, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) __PYX_ERR(0, 2229, __pyx_L1_error)
+  __pyx_tuple__306 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_root); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(0, 2232, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__306);
+  __Pyx_GIVEREF(__pyx_tuple__306);
+  __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_findall, 2232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) __PYX_ERR(0, 2232, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2246
+  /* "lxml/etree.pyx":2249
  *         return root.findall(path, namespaces)
  * 
  *     def iterfind(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""iterfind(self, path, namespaces=None)
  * 
  */
-  __pyx_tuple__302 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_root); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(0, 2246, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__302);
-  __Pyx_GIVEREF(__pyx_tuple__302);
-  __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__302, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterfind, 2246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(0, 2246, __pyx_L1_error)
+  __pyx_tuple__308 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_namespaces, __pyx_n_s_root); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(0, 2249, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__308);
+  __Pyx_GIVEREF(__pyx_tuple__308);
+  __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterfind, 2249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) __PYX_ERR(0, 2249, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2263
+  /* "lxml/etree.pyx":2266
  *         return root.iterfind(path, namespaces)
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
  *               smart_strings=True, **_variables):
  *         u"""xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables)
  */
-  __pyx_tuple__304 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_path_2, __pyx_n_s_namespaces, __pyx_n_s_extensions, __pyx_n_s_smart_strings, __pyx_n_s_variables_2, __pyx_n_s_evaluator); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(0, 2263, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__304);
-  __Pyx_GIVEREF(__pyx_tuple__304);
-  __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(2, 3, 7, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_xpath, 2263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) __PYX_ERR(0, 2263, __pyx_L1_error)
+  __pyx_tuple__310 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_path_2, __pyx_n_s_namespaces, __pyx_n_s_extensions, __pyx_n_s_smart_strings, __pyx_n_s_variables_2, __pyx_n_s_evaluator); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(0, 2266, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__310);
+  __Pyx_GIVEREF(__pyx_tuple__310);
+  __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(2, 3, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__310, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_xpath, 2266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) __PYX_ERR(0, 2266, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2288
+  /* "lxml/etree.pyx":2291
  *         return evaluator(_path, **_variables)
  * 
  *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):             # <<<<<<<<<<<<<<
  *         u"""xslt(self, _xslt, extensions=None, access_control=None, **_kw)
  * 
  */
-  __pyx_tuple__306 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_xslt, __pyx_n_s_extensions, __pyx_n_s_access_control, __pyx_n_s_kw, __pyx_n_s_style); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(0, 2288, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__306);
-  __Pyx_GIVEREF(__pyx_tuple__306);
-  __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__306, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_xslt_2, 2288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) __PYX_ERR(0, 2288, __pyx_L1_error)
+  __pyx_tuple__312 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_xslt, __pyx_n_s_extensions, __pyx_n_s_access_control, __pyx_n_s_kw, __pyx_n_s_style); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(0, 2291, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__312);
+  __Pyx_GIVEREF(__pyx_tuple__312);
+  __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__312, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_xslt_2, 2291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(0, 2291, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2307
+  /* "lxml/etree.pyx":2310
  *         return style(self, **_kw)
  * 
  *     def relaxng(self, relaxng):             # <<<<<<<<<<<<<<
  *         u"""relaxng(self, relaxng)
  * 
  */
-  __pyx_tuple__308 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_relaxng, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__308)) __PYX_ERR(0, 2307, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__308);
-  __Pyx_GIVEREF(__pyx_tuple__308);
-  __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__308, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_relaxng, 2307, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) __PYX_ERR(0, 2307, __pyx_L1_error)
+  __pyx_tuple__314 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_relaxng, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(0, 2310, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__314);
+  __Pyx_GIVEREF(__pyx_tuple__314);
+  __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__314, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_relaxng, 2310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) __PYX_ERR(0, 2310, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2325
+  /* "lxml/etree.pyx":2328
  *         return schema.validate(self)
  * 
  *     def xmlschema(self, xmlschema):             # <<<<<<<<<<<<<<
  *         u"""xmlschema(self, xmlschema)
  * 
  */
-  __pyx_tuple__310 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xmlschema, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(0, 2325, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__310);
-  __Pyx_GIVEREF(__pyx_tuple__310);
-  __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__310, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_xmlschema, 2325, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) __PYX_ERR(0, 2325, __pyx_L1_error)
+  __pyx_tuple__316 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xmlschema, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(0, 2328, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__316);
+  __Pyx_GIVEREF(__pyx_tuple__316);
+  __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__316, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_xmlschema, 2328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(0, 2328, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2343
+  /* "lxml/etree.pyx":2346
  *         return schema.validate(self)
  * 
  *     def xinclude(self):             # <<<<<<<<<<<<<<
  *         u"""xinclude(self)
  * 
  */
-  __pyx_tuple__312 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(0, 2343, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__312);
-  __Pyx_GIVEREF(__pyx_tuple__312);
-  __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__312, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_xinclude, 2343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(0, 2343, __pyx_L1_error)
+  __pyx_tuple__318 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(0, 2346, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__318);
+  __Pyx_GIVEREF(__pyx_tuple__318);
+  __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__318, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_xinclude, 2346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) __PYX_ERR(0, 2346, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2358
+  /* "lxml/etree.pyx":2361
  *         XInclude()(self._context_node)
  * 
  *     def write_c14n(self, file, *, exclusive=False, with_comments=True,             # <<<<<<<<<<<<<<
  *                    compression=0, inclusive_ns_prefixes=None):
  *         u"""write_c14n(self, file, exclusive=False, with_comments=True,
  */
-  __pyx_tuple__314 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_file, __pyx_n_s_exclusive, __pyx_n_s_with_comments, __pyx_n_s_compression, __pyx_n_s_inclusive_ns_prefixes); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(0, 2358, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__314);
-  __Pyx_GIVEREF(__pyx_tuple__314);
-  __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(2, 4, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__314, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_write_c14n, 2358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) __PYX_ERR(0, 2358, __pyx_L1_error)
+  __pyx_tuple__320 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_file, __pyx_n_s_exclusive, __pyx_n_s_with_comments, __pyx_n_s_compression, __pyx_n_s_inclusive_ns_prefixes); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(0, 2361, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__320);
+  __Pyx_GIVEREF(__pyx_tuple__320);
+  __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(2, 4, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__320, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_write_c14n, 2361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) __PYX_ERR(0, 2361, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2422
+  /* "lxml/etree.pyx":2425
  *         _delAttribute(self._element, key)
  * 
  *     def update(self, sequence_or_dict):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         if isinstance(sequence_or_dict, (dict, _Attrib)):
  */
-  __pyx_tuple__316 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_sequence_or_dict, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(0, 2422, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__316);
-  __Pyx_GIVEREF(__pyx_tuple__316);
-  __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__316, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_update, 2422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(0, 2422, __pyx_L1_error)
+  __pyx_tuple__322 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_sequence_or_dict, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(0, 2425, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__322);
+  __Pyx_GIVEREF(__pyx_tuple__322);
+  __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__322, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_update, 2425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(0, 2425, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2429
+  /* "lxml/etree.pyx":2432
  *             _setAttributeValue(self._element, key, value)
  * 
  *     def pop(self, key, *default):             # <<<<<<<<<<<<<<
  *         if len(default) > 1:
  *             raise TypeError, u"pop expected at most 2 arguments, got %d" % (
  */
-  __pyx_tuple__318 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default, __pyx_n_s_result); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(0, 2429, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__318);
-  __Pyx_GIVEREF(__pyx_tuple__318);
-  __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__318, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_pop, 2429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) __PYX_ERR(0, 2429, __pyx_L1_error)
+  __pyx_tuple__324 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default, __pyx_n_s_result); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(0, 2432, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__324);
+  __Pyx_GIVEREF(__pyx_tuple__324);
+  __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__324, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_pop, 2432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) __PYX_ERR(0, 2432, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2443
+  /* "lxml/etree.pyx":2446
  *         return result
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         cdef xmlNode* c_node = self._element._c_node
  */
-  __pyx_tuple__320 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(0, 2443, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__320);
-  __Pyx_GIVEREF(__pyx_tuple__320);
-  __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__320, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_clear, 2443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) __PYX_ERR(0, 2443, __pyx_L1_error)
+  __pyx_tuple__326 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(0, 2446, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__326);
+  __Pyx_GIVEREF(__pyx_tuple__326);
+  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_clear, 2446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) __PYX_ERR(0, 2446, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2454
+  /* "lxml/etree.pyx":2457
  *         return repr(dict( _collectAttributes(self._element._c_node, 3) ))
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return dict(_collectAttributes(self._element._c_node, 3))
  */
-  __pyx_tuple__322 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(0, 2454, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__322);
-  __Pyx_GIVEREF(__pyx_tuple__322);
-  __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__322, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_copy_2, 2454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(0, 2454, __pyx_L1_error)
+  __pyx_tuple__328 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(0, 2457, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__328);
+  __Pyx_GIVEREF(__pyx_tuple__328);
+  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_copy_2, 2457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) __PYX_ERR(0, 2457, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2458
+  /* "lxml/etree.pyx":2461
  *         return dict(_collectAttributes(self._element._c_node, 3))
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return dict(_collectAttributes(self._element._c_node, 3))
  */
-  __pyx_tuple__324 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(0, 2458, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__324);
-  __Pyx_GIVEREF(__pyx_tuple__324);
-  __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__324, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_deepcopy, 2458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) __PYX_ERR(0, 2458, __pyx_L1_error)
+  __pyx_tuple__330 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(0, 2461, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__330);
+  __Pyx_GIVEREF(__pyx_tuple__330);
+  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_deepcopy, 2461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) __PYX_ERR(0, 2461, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2488
+  /* "lxml/etree.pyx":2491
  *         return c
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return _getAttributeValue(self._element, key, default)
  */
-  __pyx_tuple__326 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(0, 2488, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__326);
-  __Pyx_GIVEREF(__pyx_tuple__326);
-  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_get, 2488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) __PYX_ERR(0, 2488, __pyx_L1_error)
+  __pyx_tuple__332 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(0, 2491, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__332);
+  __Pyx_GIVEREF(__pyx_tuple__332);
+  __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__332, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_get, 2491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) __PYX_ERR(0, 2491, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2492
+  /* "lxml/etree.pyx":2495
  *         return _getAttributeValue(self._element, key, default)
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return _collectAttributes(self._element._c_node, 1)
  */
-  __pyx_tuple__328 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(0, 2492, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__328);
-  __Pyx_GIVEREF(__pyx_tuple__328);
-  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_keys, 2492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) __PYX_ERR(0, 2492, __pyx_L1_error)
+  __pyx_tuple__334 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(0, 2495, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__334);
+  __Pyx_GIVEREF(__pyx_tuple__334);
+  __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__334, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_keys, 2495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) __PYX_ERR(0, 2495, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2500
+  /* "lxml/etree.pyx":2503
  *         return iter(_collectAttributes(self._element._c_node, 1))
  * 
  *     def iterkeys(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return iter(_collectAttributes(self._element._c_node, 1))
  */
-  __pyx_tuple__330 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(0, 2500, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__330);
-  __Pyx_GIVEREF(__pyx_tuple__330);
-  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterkeys, 2500, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) __PYX_ERR(0, 2500, __pyx_L1_error)
+  __pyx_tuple__336 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(0, 2503, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__336);
+  __Pyx_GIVEREF(__pyx_tuple__336);
+  __pyx_codeobj__337 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__336, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iterkeys, 2503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) __PYX_ERR(0, 2503, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2504
+  /* "lxml/etree.pyx":2507
  *         return iter(_collectAttributes(self._element._c_node, 1))
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return _collectAttributes(self._element._c_node, 2)
  */
-  __pyx_tuple__332 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(0, 2504, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__332);
-  __Pyx_GIVEREF(__pyx_tuple__332);
-  __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__332, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_values, 2504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) __PYX_ERR(0, 2504, __pyx_L1_error)
+  __pyx_tuple__338 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(0, 2507, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__338);
+  __Pyx_GIVEREF(__pyx_tuple__338);
+  __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__338, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_values, 2507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) __PYX_ERR(0, 2507, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2508
+  /* "lxml/etree.pyx":2511
  *         return _collectAttributes(self._element._c_node, 2)
  * 
  *     def itervalues(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return iter(_collectAttributes(self._element._c_node, 2))
  */
-  __pyx_tuple__334 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(0, 2508, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__334);
-  __Pyx_GIVEREF(__pyx_tuple__334);
-  __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__334, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_itervalues, 2508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) __PYX_ERR(0, 2508, __pyx_L1_error)
+  __pyx_tuple__340 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(0, 2511, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__340);
+  __Pyx_GIVEREF(__pyx_tuple__340);
+  __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__340, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_itervalues, 2511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) __PYX_ERR(0, 2511, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2512
+  /* "lxml/etree.pyx":2515
  *         return iter(_collectAttributes(self._element._c_node, 2))
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return _collectAttributes(self._element._c_node, 3)
  */
-  __pyx_tuple__336 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(0, 2512, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__336);
-  __Pyx_GIVEREF(__pyx_tuple__336);
-  __pyx_codeobj__337 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__336, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_items, 2512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) __PYX_ERR(0, 2512, __pyx_L1_error)
+  __pyx_tuple__342 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(0, 2515, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__342);
+  __Pyx_GIVEREF(__pyx_tuple__342);
+  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_items, 2515, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(0, 2515, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2516
+  /* "lxml/etree.pyx":2519
  *         return _collectAttributes(self._element._c_node, 3)
  * 
  *     def iteritems(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return iter(_collectAttributes(self._element._c_node, 3))
  */
-  __pyx_tuple__338 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(0, 2516, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__338);
-  __Pyx_GIVEREF(__pyx_tuple__338);
-  __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__338, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iteritems, 2516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) __PYX_ERR(0, 2516, __pyx_L1_error)
+  __pyx_tuple__344 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(0, 2519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__344);
+  __Pyx_GIVEREF(__pyx_tuple__344);
+  __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iteritems, 2519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) __PYX_ERR(0, 2519, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":2520
+  /* "lxml/etree.pyx":2523
  *         return iter(_collectAttributes(self._element._c_node, 3))
  * 
  *     def has_key(self, key):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return key in self
  */
-  __pyx_tuple__340 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(0, 2520, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__340);
-  __Pyx_GIVEREF(__pyx_tuple__340);
-  __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__340, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_has_key, 2520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) __PYX_ERR(0, 2520, __pyx_L1_error)
+  __pyx_tuple__346 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(0, 2523, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__346);
+  __Pyx_GIVEREF(__pyx_tuple__346);
+  __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__346, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_has_key, 2523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) __PYX_ERR(0, 2523, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3002
+  /* "lxml/etree.pyx":3005
  * # module-level API for ElementTree
  * 
  * def Element(_tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
  *     u"""Element(_tag, attrib=None, nsmap=None, **_extra)
  * 
  */
-  __pyx_tuple__342 = PyTuple_Pack(4, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(0, 3002, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__342);
-  __Pyx_GIVEREF(__pyx_tuple__342);
-  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_Element, 3002, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(0, 3002, __pyx_L1_error)
-  __pyx_tuple__344 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(0, 3002, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__344);
-  __Pyx_GIVEREF(__pyx_tuple__344);
+  __pyx_tuple__348 = PyTuple_Pack(4, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(0, 3005, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__348);
+  __Pyx_GIVEREF(__pyx_tuple__348);
+  __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__348, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_Element, 3005, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) __PYX_ERR(0, 3005, __pyx_L1_error)
+  __pyx_tuple__350 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(0, 3005, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__350);
+  __Pyx_GIVEREF(__pyx_tuple__350);
 
-  /* "lxml/etree.pyx":3016
+  /* "lxml/etree.pyx":3019
  * 
  * 
  * def Comment(text=None):             # <<<<<<<<<<<<<<
  *     u"""Comment(text=None)
  * 
  */
-  __pyx_tuple__345 = PyTuple_Pack(4, __pyx_n_s_text, __pyx_n_s_doc_2, __pyx_n_s_c_node, __pyx_n_s_c_doc); if (unlikely(!__pyx_tuple__345)) __PYX_ERR(0, 3016, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__345);
-  __Pyx_GIVEREF(__pyx_tuple__345);
-  __pyx_codeobj__346 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__345, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_Comment, 3016, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__346)) __PYX_ERR(0, 3016, __pyx_L1_error)
-  __pyx_tuple__347 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(0, 3016, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__347);
-  __Pyx_GIVEREF(__pyx_tuple__347);
+  __pyx_tuple__351 = PyTuple_Pack(4, __pyx_n_s_text, __pyx_n_s_doc_2, __pyx_n_s_c_node, __pyx_n_s_c_doc); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(0, 3019, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__351);
+  __Pyx_GIVEREF(__pyx_tuple__351);
+  __pyx_codeobj__352 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__351, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_Comment, 3019, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__352)) __PYX_ERR(0, 3019, __pyx_L1_error)
+  __pyx_tuple__353 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(0, 3019, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__353);
+  __Pyx_GIVEREF(__pyx_tuple__353);
 
-  /* "lxml/etree.pyx":3040
+  /* "lxml/etree.pyx":3043
  * 
  * 
  * def ProcessingInstruction(target, text=None):             # <<<<<<<<<<<<<<
  *     u"""ProcessingInstruction(target, text=None)
  * 
  */
-  __pyx_tuple__348 = PyTuple_Pack(5, __pyx_n_s_target, __pyx_n_s_text, __pyx_n_s_doc_2, __pyx_n_s_c_node, __pyx_n_s_c_doc); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(0, 3040, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__348);
-  __Pyx_GIVEREF(__pyx_tuple__348);
-  __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__348, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_ProcessingInstruction, 3040, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) __PYX_ERR(0, 3040, __pyx_L1_error)
-  __pyx_tuple__350 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(0, 3040, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__350);
-  __Pyx_GIVEREF(__pyx_tuple__350);
+  __pyx_tuple__354 = PyTuple_Pack(5, __pyx_n_s_target, __pyx_n_s_text, __pyx_n_s_doc_2, __pyx_n_s_c_node, __pyx_n_s_c_doc); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(0, 3043, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__354);
+  __Pyx_GIVEREF(__pyx_tuple__354);
+  __pyx_codeobj__355 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__354, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_ProcessingInstruction, 3043, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__355)) __PYX_ERR(0, 3043, __pyx_L1_error)
+  __pyx_tuple__356 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(0, 3043, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__356);
+  __Pyx_GIVEREF(__pyx_tuple__356);
 
-  /* "lxml/etree.pyx":3093
+  /* "lxml/etree.pyx":3096
  * 
  * 
  * def Entity(name):             # <<<<<<<<<<<<<<
  *     u"""Entity(name)
  * 
  */
-  __pyx_tuple__351 = PyTuple_Pack(6, __pyx_n_s_name_2, __pyx_n_s_doc_2, __pyx_n_s_c_node, __pyx_n_s_c_doc, __pyx_n_s_name_utf, __pyx_n_s_c_name); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(0, 3093, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__351);
-  __Pyx_GIVEREF(__pyx_tuple__351);
-  __pyx_codeobj__352 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__351, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_Entity, 3093, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__352)) __PYX_ERR(0, 3093, __pyx_L1_error)
+  __pyx_tuple__357 = PyTuple_Pack(6, __pyx_n_s_name_2, __pyx_n_s_doc_2, __pyx_n_s_c_node, __pyx_n_s_c_doc, __pyx_n_s_name_utf, __pyx_n_s_c_name); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(0, 3096, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__357);
+  __Pyx_GIVEREF(__pyx_tuple__357);
+  __pyx_codeobj__358 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__357, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_Entity, 3096, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__358)) __PYX_ERR(0, 3096, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3119
+  /* "lxml/etree.pyx":3122
  * 
  * 
  * def SubElement(_Element _parent not None, _tag,             # <<<<<<<<<<<<<<
  *                attrib=None, nsmap=None, **_extra):
  *     u"""SubElement(_parent, _tag, attrib=None, nsmap=None, **_extra)
  */
-  __pyx_tuple__353 = PyTuple_Pack(5, __pyx_n_s_parent, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(0, 3119, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__353);
-  __Pyx_GIVEREF(__pyx_tuple__353);
-  __pyx_codeobj__354 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_SubElement, 3119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__354)) __PYX_ERR(0, 3119, __pyx_L1_error)
-  __pyx_tuple__355 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(0, 3119, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__355);
-  __Pyx_GIVEREF(__pyx_tuple__355);
+  __pyx_tuple__359 = PyTuple_Pack(5, __pyx_n_s_parent, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(0, 3122, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__359);
+  __Pyx_GIVEREF(__pyx_tuple__359);
+  __pyx_codeobj__360 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__359, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_SubElement, 3122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__360)) __PYX_ERR(0, 3122, __pyx_L1_error)
+  __pyx_tuple__361 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(0, 3122, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__361);
+  __Pyx_GIVEREF(__pyx_tuple__361);
 
-  /* "lxml/etree.pyx":3129
+  /* "lxml/etree.pyx":3132
  * 
  * 
  * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):             # <<<<<<<<<<<<<<
  *     u"""ElementTree(element=None, file=None, parser=None)
  * 
  */
-  __pyx_tuple__356 = PyTuple_Pack(10, __pyx_n_s_element, __pyx_n_s_file, __pyx_n_s_parser, __pyx_n_s_c_next, __pyx_n_s_c_node, __pyx_n_s_c_node_copy, __pyx_n_s_c_doc, __pyx_n_s_etree, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(0, 3129, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__356);
-  __Pyx_GIVEREF(__pyx_tuple__356);
-  __pyx_codeobj__357 = (PyObject*)__Pyx_PyCode_New(1, 2, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__356, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_ElementTree, 3129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__357)) __PYX_ERR(0, 3129, __pyx_L1_error)
-  __pyx_tuple__358 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(0, 3129, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__358);
-  __Pyx_GIVEREF(__pyx_tuple__358);
+  __pyx_tuple__362 = PyTuple_Pack(10, __pyx_n_s_element, __pyx_n_s_file, __pyx_n_s_parser, __pyx_n_s_c_next, __pyx_n_s_c_node, __pyx_n_s_c_node_copy, __pyx_n_s_c_doc, __pyx_n_s_etree, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(0, 3132, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__362);
+  __Pyx_GIVEREF(__pyx_tuple__362);
+  __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(1, 2, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_ElementTree, 3132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) __PYX_ERR(0, 3132, __pyx_L1_error)
+  __pyx_tuple__364 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(0, 3132, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__364);
+  __Pyx_GIVEREF(__pyx_tuple__364);
 
-  /* "lxml/etree.pyx":3155
+  /* "lxml/etree.pyx":3158
  * 
  * 
  * def HTML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
  *     u"""HTML(text, parser=None, base_url=None)
  * 
  */
-  __pyx_tuple__359 = PyTuple_Pack(5, __pyx_n_s_text, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__359)) __PYX_ERR(0, 3155, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__359);
-  __Pyx_GIVEREF(__pyx_tuple__359);
-  __pyx_codeobj__360 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__359, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_HTML, 3155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__360)) __PYX_ERR(0, 3155, __pyx_L1_error)
-  __pyx_tuple__361 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(0, 3155, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__361);
-  __Pyx_GIVEREF(__pyx_tuple__361);
+  __pyx_tuple__365 = PyTuple_Pack(5, __pyx_n_s_text, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 3158, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__365);
+  __Pyx_GIVEREF(__pyx_tuple__365);
+  __pyx_codeobj__366 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_HTML, 3158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__366)) __PYX_ERR(0, 3158, __pyx_L1_error)
+  __pyx_tuple__367 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(0, 3158, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__367);
+  __Pyx_GIVEREF(__pyx_tuple__367);
 
-  /* "lxml/etree.pyx":3181
+  /* "lxml/etree.pyx":3184
  * 
  * 
  * def XML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
  *     u"""XML(text, parser=None, base_url=None)
  * 
  */
-  __pyx_tuple__362 = PyTuple_Pack(5, __pyx_n_s_text, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__362)) __PYX_ERR(0, 3181, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__362);
-  __Pyx_GIVEREF(__pyx_tuple__362);
-  __pyx_codeobj__363 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__362, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_XML, 3181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__363)) __PYX_ERR(0, 3181, __pyx_L1_error)
-  __pyx_tuple__364 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__364)) __PYX_ERR(0, 3181, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__364);
-  __Pyx_GIVEREF(__pyx_tuple__364);
+  __pyx_tuple__368 = PyTuple_Pack(5, __pyx_n_s_text, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(0, 3184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__368);
+  __Pyx_GIVEREF(__pyx_tuple__368);
+  __pyx_codeobj__369 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__368, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_XML, 3184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__369)) __PYX_ERR(0, 3184, __pyx_L1_error)
+  __pyx_tuple__370 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(0, 3184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__370);
+  __Pyx_GIVEREF(__pyx_tuple__370);
 
-  /* "lxml/etree.pyx":3212
+  /* "lxml/etree.pyx":3215
  * 
  * 
  * def fromstring(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
  *     u"""fromstring(text, parser=None, base_url=None)
  * 
  */
-  __pyx_tuple__365 = PyTuple_Pack(5, __pyx_n_s_text, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 3212, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__365);
-  __Pyx_GIVEREF(__pyx_tuple__365);
-  __pyx_codeobj__366 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_fromstring, 3212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__366)) __PYX_ERR(0, 3212, __pyx_L1_error)
-  __pyx_tuple__367 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(0, 3212, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__367);
-  __Pyx_GIVEREF(__pyx_tuple__367);
+  __pyx_tuple__371 = PyTuple_Pack(5, __pyx_n_s_text, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(0, 3215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__371);
+  __Pyx_GIVEREF(__pyx_tuple__371);
+  __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_fromstring, 3215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) __PYX_ERR(0, 3215, __pyx_L1_error)
+  __pyx_tuple__373 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(0, 3215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__373);
+  __Pyx_GIVEREF(__pyx_tuple__373);
 
-  /* "lxml/etree.pyx":3233
+  /* "lxml/etree.pyx":3236
  * 
  * 
  * def fromstringlist(strings, _BaseParser parser=None):             # <<<<<<<<<<<<<<
  *     u"""fromstringlist(strings, parser=None)
  * 
  */
-  __pyx_tuple__368 = PyTuple_Pack(5, __pyx_n_s_strings, __pyx_n_s_parser, __pyx_n_s_doc_2, __pyx_n_s_feed, __pyx_n_s_data); if (unlikely(!__pyx_tuple__368)) __PYX_ERR(0, 3233, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__368);
-  __Pyx_GIVEREF(__pyx_tuple__368);
-  __pyx_codeobj__369 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__368, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_fromstringlist, 3233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__369)) __PYX_ERR(0, 3233, __pyx_L1_error)
-  __pyx_tuple__370 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(0, 3233, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__370);
-  __Pyx_GIVEREF(__pyx_tuple__370);
+  __pyx_tuple__374 = PyTuple_Pack(5, __pyx_n_s_strings, __pyx_n_s_parser, __pyx_n_s_doc_2, __pyx_n_s_feed, __pyx_n_s_data); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(0, 3236, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__374);
+  __Pyx_GIVEREF(__pyx_tuple__374);
+  __pyx_codeobj__375 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__374, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_fromstringlist, 3236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__375)) __PYX_ERR(0, 3236, __pyx_L1_error)
+  __pyx_tuple__376 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(0, 3236, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__376);
+  __Pyx_GIVEREF(__pyx_tuple__376);
 
-  /* "lxml/etree.pyx":3254
+  /* "lxml/etree.pyx":3257
  * 
  * 
  * def iselement(element):             # <<<<<<<<<<<<<<
  *     u"""iselement(element)
  * 
  */
-  __pyx_tuple__371 = PyTuple_Pack(1, __pyx_n_s_element); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(0, 3254, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__371);
-  __Pyx_GIVEREF(__pyx_tuple__371);
-  __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iselement, 3254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) __PYX_ERR(0, 3254, __pyx_L1_error)
+  __pyx_tuple__377 = PyTuple_Pack(1, __pyx_n_s_element); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(0, 3257, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__377);
+  __Pyx_GIVEREF(__pyx_tuple__377);
+  __pyx_codeobj__378 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__377, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_iselement, 3257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__378)) __PYX_ERR(0, 3257, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3262
+  /* "lxml/etree.pyx":3265
  * 
  * 
  * def dump(_Element elem not None, *, bint pretty_print=True, with_tail=True):             # <<<<<<<<<<<<<<
  *     u"""dump(elem, pretty_print=True, with_tail=True)
  * 
  */
-  __pyx_tuple__373 = PyTuple_Pack(4, __pyx_n_s_elem, __pyx_n_s_pretty_print, __pyx_n_s_with_tail, __pyx_n_s_xml); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(0, 3262, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__373);
-  __Pyx_GIVEREF(__pyx_tuple__373);
-  __pyx_codeobj__374 = (PyObject*)__Pyx_PyCode_New(1, 2, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__373, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_dump, 3262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__374)) __PYX_ERR(0, 3262, __pyx_L1_error)
+  __pyx_tuple__379 = PyTuple_Pack(4, __pyx_n_s_elem, __pyx_n_s_pretty_print, __pyx_n_s_with_tail, __pyx_n_s_xml); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(0, 3265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__379);
+  __Pyx_GIVEREF(__pyx_tuple__379);
+  __pyx_codeobj__380 = (PyObject*)__Pyx_PyCode_New(1, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__379, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_dump, 3265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__380)) __PYX_ERR(0, 3265, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3275
+  /* "lxml/etree.pyx":3278
  * 
  * 
  * def tostring(element_or_tree, *, encoding=None, method="xml",             # <<<<<<<<<<<<<<
  *              xml_declaration=None, bint pretty_print=False, bint with_tail=True,
  *              standalone=None, doctype=None,
  */
-  __pyx_tuple__375 = PyTuple_Pack(13, __pyx_n_s_element_or_tree, __pyx_n_s_encoding, __pyx_n_s_method, __pyx_n_s_xml_declaration, __pyx_n_s_pretty_print, __pyx_n_s_with_tail, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_exclusive, __pyx_n_s_with_comments, __pyx_n_s_inclusive_ns_prefixes, __pyx_n_s_write_declaration, __pyx_n_s_is_standalone); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(0, 3275, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__375);
-  __Pyx_GIVEREF(__pyx_tuple__375);
-  __pyx_codeobj__376 = (PyObject*)__Pyx_PyCode_New(1, 10, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__375, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_tostring, 3275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__376)) __PYX_ERR(0, 3275, __pyx_L1_error)
+  __pyx_tuple__381 = PyTuple_Pack(13, __pyx_n_s_element_or_tree, __pyx_n_s_encoding, __pyx_n_s_method, __pyx_n_s_xml_declaration, __pyx_n_s_pretty_print, __pyx_n_s_with_tail, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_exclusive, __pyx_n_s_with_comments, __pyx_n_s_inclusive_ns_prefixes, __pyx_n_s_write_declaration, __pyx_n_s_is_standalone); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(0, 3278, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__381);
+  __Pyx_GIVEREF(__pyx_tuple__381);
+  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(1, 10, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_tostring, 3278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(0, 3278, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3368
+  /* "lxml/etree.pyx":3371
  * 
  * 
  * def tostringlist(element_or_tree, *args, **kwargs):             # <<<<<<<<<<<<<<
  *     u"""tostringlist(element_or_tree, *args, **kwargs)
  * 
  */
-  __pyx_tuple__377 = PyTuple_Pack(3, __pyx_n_s_element_or_tree, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(0, 3368, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__377);
-  __Pyx_GIVEREF(__pyx_tuple__377);
-  __pyx_codeobj__378 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__377, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_tostringlist, 3368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__378)) __PYX_ERR(0, 3368, __pyx_L1_error)
+  __pyx_tuple__383 = PyTuple_Pack(3, __pyx_n_s_element_or_tree, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(0, 3371, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__383);
+  __Pyx_GIVEREF(__pyx_tuple__383);
+  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_tostringlist, 3371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) __PYX_ERR(0, 3371, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3380
+  /* "lxml/etree.pyx":3383
  * 
  * 
  * def tounicode(element_or_tree, *, method=u"xml", bint pretty_print=False,             # <<<<<<<<<<<<<<
  *               bint with_tail=True, doctype=None):
  *     u"""tounicode(element_or_tree, method="xml", pretty_print=False,
  */
-  __pyx_tuple__379 = PyTuple_Pack(5, __pyx_n_s_element_or_tree, __pyx_n_s_method, __pyx_n_s_pretty_print, __pyx_n_s_with_tail, __pyx_n_s_doctype); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(0, 3380, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__379);
-  __Pyx_GIVEREF(__pyx_tuple__379);
-  __pyx_codeobj__380 = (PyObject*)__Pyx_PyCode_New(1, 4, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__379, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_tounicode, 3380, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__380)) __PYX_ERR(0, 3380, __pyx_L1_error)
+  __pyx_tuple__385 = PyTuple_Pack(5, __pyx_n_s_element_or_tree, __pyx_n_s_method, __pyx_n_s_pretty_print, __pyx_n_s_with_tail, __pyx_n_s_doctype); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(0, 3383, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__385);
+  __Pyx_GIVEREF(__pyx_tuple__385);
+  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(1, 4, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_tounicode, 3383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) __PYX_ERR(0, 3383, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3415
+  /* "lxml/etree.pyx":3418
  * 
  * 
  * def parse(source, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
  *     u"""parse(source, parser=None, base_url=None)
  * 
  */
-  __pyx_tuple__381 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(0, 3415, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__381);
-  __Pyx_GIVEREF(__pyx_tuple__381);
-  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_parse, 3415, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(0, 3415, __pyx_L1_error)
-  __pyx_tuple__383 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(0, 3415, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__383);
-  __Pyx_GIVEREF(__pyx_tuple__383);
+  __pyx_tuple__387 = PyTuple_Pack(5, __pyx_n_s_source, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2, __pyx_n_s_result_container); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(0, 3418, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__387);
+  __Pyx_GIVEREF(__pyx_tuple__387);
+  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_parse, 3418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(0, 3418, __pyx_L1_error)
+  __pyx_tuple__389 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(0, 3418, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__389);
+  __Pyx_GIVEREF(__pyx_tuple__389);
 
-  /* "lxml/etree.pyx":3447
+  /* "lxml/etree.pyx":3450
  * 
  * 
  * def adopt_external_document(capsule, _BaseParser parser=None):             # <<<<<<<<<<<<<<
  *     """adopt_external_document(capsule, parser=None)
  * 
  */
-  __pyx_tuple__384 = PyTuple_Pack(5, __pyx_n_s_capsule, __pyx_n_s_parser, __pyx_n_s_c_doc, __pyx_n_s_is_owned, __pyx_n_s_doc_2); if (unlikely(!__pyx_tuple__384)) __PYX_ERR(0, 3447, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__384);
-  __Pyx_GIVEREF(__pyx_tuple__384);
-  __pyx_codeobj__385 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__384, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_adopt_external_document, 3447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__385)) __PYX_ERR(0, 3447, __pyx_L1_error)
-  __pyx_tuple__386 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__386)) __PYX_ERR(0, 3447, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__386);
-  __Pyx_GIVEREF(__pyx_tuple__386);
+  __pyx_tuple__390 = PyTuple_Pack(5, __pyx_n_s_capsule, __pyx_n_s_parser, __pyx_n_s_c_doc, __pyx_n_s_is_owned, __pyx_n_s_doc_2); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(0, 3450, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__390);
+  __Pyx_GIVEREF(__pyx_tuple__390);
+  __pyx_codeobj__391 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__390, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_adopt_external_document, 3450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__391)) __PYX_ERR(0, 3450, __pyx_L1_error)
+  __pyx_tuple__392 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__392)) __PYX_ERR(0, 3450, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__392);
+  __Pyx_GIVEREF(__pyx_tuple__392);
 
   /* "src/lxml/readonlytree.pxi":160
  *         return c_node != NULL
@@ -231096,10 +231065,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"__deepcopy__(self, memo)"
  *         return self.__copy__()
  */
-  __pyx_tuple__387 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(6, 160, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__387);
-  __Pyx_GIVEREF(__pyx_tuple__387);
-  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_deepcopy, 160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(6, 160, __pyx_L1_error)
+  __pyx_tuple__393 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(6, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__393);
+  __Pyx_GIVEREF(__pyx_tuple__393);
+  __pyx_codeobj__394 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_deepcopy, 160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__394)) __PYX_ERR(6, 160, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":164
  *         return self.__copy__()
@@ -231108,10 +231077,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"__copy__(self)"
  *         cdef xmlDoc* c_doc
  */
-  __pyx_tuple__389 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(6, 164, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__389);
-  __Pyx_GIVEREF(__pyx_tuple__389);
-  __pyx_codeobj__390 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__389, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_copy_2, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__390)) __PYX_ERR(6, 164, __pyx_L1_error)
+  __pyx_tuple__395 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(6, 164, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__395);
+  __Pyx_GIVEREF(__pyx_tuple__395);
+  __pyx_codeobj__396 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_copy_2, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__396)) __PYX_ERR(6, 164, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":187
  *         return iter(self.getchildren())
@@ -231120,10 +231089,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""iterchildren(self, tag=None, reversed=False)
  * 
  */
-  __pyx_tuple__391 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_reversed, __pyx_n_s_children, __pyx_n_s_el); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(6, 187, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__391);
-  __Pyx_GIVEREF(__pyx_tuple__391);
-  __pyx_codeobj__392 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_iterchildren, 187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__392)) __PYX_ERR(6, 187, __pyx_L1_error)
+  __pyx_tuple__397 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_reversed, __pyx_n_s_children, __pyx_n_s_el); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(6, 187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__397);
+  __Pyx_GIVEREF(__pyx_tuple__397);
+  __pyx_codeobj__398 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__397, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_iterchildren, 187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__398)) __PYX_ERR(6, 187, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":199
  *         return iter(children)
@@ -231132,10 +231101,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Returns all subelements. The elements are returned in document
  *         order.
  */
-  __pyx_tuple__393 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(6, 199, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__393);
-  __Pyx_GIVEREF(__pyx_tuple__393);
-  __pyx_codeobj__394 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getchildren, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__394)) __PYX_ERR(6, 199, __pyx_L1_error)
+  __pyx_tuple__399 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(6, 199, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__399);
+  __Pyx_GIVEREF(__pyx_tuple__399);
+  __pyx_codeobj__400 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__399, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getchildren, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__400)) __PYX_ERR(6, 199, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":214
  *         return result
@@ -231144,10 +231113,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Returns the parent of this element or None for the root element.
  *         """
  */
-  __pyx_tuple__395 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_parent); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(6, 214, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__395);
-  __Pyx_GIVEREF(__pyx_tuple__395);
-  __pyx_codeobj__396 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getparent, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__396)) __PYX_ERR(6, 214, __pyx_L1_error)
+  __pyx_tuple__401 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_parent); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(6, 214, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__401);
+  __Pyx_GIVEREF(__pyx_tuple__401);
+  __pyx_codeobj__402 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__401, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getparent, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__402)) __PYX_ERR(6, 214, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":225
  *             return _newReadOnlyProxy(self._source_proxy, c_parent)
@@ -231156,10 +231125,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Returns the following sibling of this element or None.
  *         """
  */
-  __pyx_tuple__397 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(6, 225, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__397);
-  __Pyx_GIVEREF(__pyx_tuple__397);
-  __pyx_codeobj__398 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__397, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getnext, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__398)) __PYX_ERR(6, 225, __pyx_L1_error)
+  __pyx_tuple__403 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(6, 225, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__403);
+  __Pyx_GIVEREF(__pyx_tuple__403);
+  __pyx_codeobj__404 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__403, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getnext, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__404)) __PYX_ERR(6, 225, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":235
  *         return None
@@ -231168,10 +231137,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Returns the preceding sibling of this element or None.
  *         """
  */
-  __pyx_tuple__399 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(6, 235, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__399);
-  __Pyx_GIVEREF(__pyx_tuple__399);
-  __pyx_codeobj__400 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__399, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getprevious, 235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__400)) __PYX_ERR(6, 235, __pyx_L1_error)
+  __pyx_tuple__405 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(6, 235, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__405);
+  __Pyx_GIVEREF(__pyx_tuple__405);
+  __pyx_codeobj__406 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__405, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getprevious, 235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__406)) __PYX_ERR(6, 235, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":293
  *             return None
@@ -231180,10 +231149,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Gets an element attribute.
  *         """
  */
-  __pyx_tuple__401 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(6, 293, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__401);
-  __Pyx_GIVEREF(__pyx_tuple__401);
-  __pyx_codeobj__402 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__401, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_get, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__402)) __PYX_ERR(6, 293, __pyx_L1_error)
+  __pyx_tuple__407 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(6, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__407);
+  __Pyx_GIVEREF(__pyx_tuple__407);
+  __pyx_codeobj__408 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_get, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__408)) __PYX_ERR(6, 293, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":299
  *         return _getNodeAttributeValue(self._c_node, key, default)
@@ -231192,10 +231161,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Gets a list of attribute names. The names are returned in an
  *         arbitrary order (just like for an ordinary Python dictionary).
  */
-  __pyx_tuple__403 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(6, 299, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__403);
-  __Pyx_GIVEREF(__pyx_tuple__403);
-  __pyx_codeobj__404 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__403, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_keys, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__404)) __PYX_ERR(6, 299, __pyx_L1_error)
+  __pyx_tuple__409 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(6, 299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__409);
+  __Pyx_GIVEREF(__pyx_tuple__409);
+  __pyx_codeobj__410 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__409, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_keys, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__410)) __PYX_ERR(6, 299, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":306
  *         return _collectAttributes(self._c_node, 1)
@@ -231204,10 +231173,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Gets element attributes, as a sequence. The attributes are returned
  *         in an arbitrary order.
  */
-  __pyx_tuple__405 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(6, 306, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__405);
-  __Pyx_GIVEREF(__pyx_tuple__405);
-  __pyx_codeobj__406 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__405, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_values, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__406)) __PYX_ERR(6, 306, __pyx_L1_error)
+  __pyx_tuple__411 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(6, 306, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__411);
+  __Pyx_GIVEREF(__pyx_tuple__411);
+  __pyx_codeobj__412 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__411, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_values, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__412)) __PYX_ERR(6, 306, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":313
  *         return _collectAttributes(self._c_node, 2)
@@ -231216,10 +231185,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Gets element attributes, as a sequence. The attributes are returned
  *         in an arbitrary order.
  */
-  __pyx_tuple__407 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(6, 313, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__407);
-  __Pyx_GIVEREF(__pyx_tuple__407);
-  __pyx_codeobj__408 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_items, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__408)) __PYX_ERR(6, 313, __pyx_L1_error)
+  __pyx_tuple__413 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(6, 313, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__413);
+  __Pyx_GIVEREF(__pyx_tuple__413);
+  __pyx_codeobj__414 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__413, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_items, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__414)) __PYX_ERR(6, 313, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":379
  *         return 0
@@ -231228,10 +231197,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Append a copy of an Element to the list of children.
  *         """
  */
-  __pyx_tuple__409 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_element); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(6, 379, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__409);
-  __Pyx_GIVEREF(__pyx_tuple__409);
-  __pyx_codeobj__410 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__409, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_append, 379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__410)) __PYX_ERR(6, 379, __pyx_L1_error)
+  __pyx_tuple__415 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_element); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(6, 379, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__415);
+  __Pyx_GIVEREF(__pyx_tuple__415);
+  __pyx_codeobj__416 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__415, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_append, 379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__416)) __PYX_ERR(6, 379, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":396
  *         _moveTail(c_next, c_node)
@@ -231240,10 +231209,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Append a copy of all Elements from a sequence to the list of
  *         children.
  */
-  __pyx_tuple__411 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_element); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(6, 396, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__411);
-  __Pyx_GIVEREF(__pyx_tuple__411);
-  __pyx_codeobj__412 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__411, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_extend, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__412)) __PYX_ERR(6, 396, __pyx_L1_error)
+  __pyx_tuple__417 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_element); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(6, 396, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__417);
+  __Pyx_GIVEREF(__pyx_tuple__417);
+  __pyx_codeobj__418 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__417, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_extend, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__418)) __PYX_ERR(6, 396, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":476
  *     text content (i.e. everything that adds to the subtree).
@@ -231252,10 +231221,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Append a copy of an Element to the list of children.
  *         """
  */
-  __pyx_tuple__413 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_element); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(6, 476, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__413);
-  __Pyx_GIVEREF(__pyx_tuple__413);
-  __pyx_codeobj__414 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__413, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_append, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__414)) __PYX_ERR(6, 476, __pyx_L1_error)
+  __pyx_tuple__419 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_element); if (unlikely(!__pyx_tuple__419)) __PYX_ERR(6, 476, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__419);
+  __Pyx_GIVEREF(__pyx_tuple__419);
+  __pyx_codeobj__420 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__419, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_append, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__420)) __PYX_ERR(6, 476, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":488
  *         _moveTail(c_next, c_node)
@@ -231264,61 +231233,61 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Append a copy of all Elements from a sequence to the list of
  *         children.
  */
-  __pyx_tuple__415 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_element); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(6, 488, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__415);
-  __Pyx_GIVEREF(__pyx_tuple__415);
-  __pyx_codeobj__416 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__415, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_extend, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__416)) __PYX_ERR(6, 488, __pyx_L1_error)
+  __pyx_tuple__421 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_element); if (unlikely(!__pyx_tuple__421)) __PYX_ERR(6, 488, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__421);
+  __Pyx_GIVEREF(__pyx_tuple__421);
+  __pyx_codeobj__422 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__421, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_extend, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__422)) __PYX_ERR(6, 488, __pyx_L1_error)
 
-  /* "src/lxml/classlookup.pxi":250
+  /* "src/lxml/classlookup.pxi":249
  *             self._fallback_function = _lookupDefaultElementClass
  * 
  *     def set_fallback(self, ElementClassLookup lookup not None):             # <<<<<<<<<<<<<<
  *         u"""set_fallback(self, lookup)
  * 
  */
-  __pyx_tuple__417 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(8, 250, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__417);
-  __Pyx_GIVEREF(__pyx_tuple__417);
-  __pyx_codeobj__418 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__417, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_set_fallback, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__418)) __PYX_ERR(8, 250, __pyx_L1_error)
+  __pyx_tuple__423 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__423)) __PYX_ERR(8, 249, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__423);
+  __Pyx_GIVEREF(__pyx_tuple__423);
+  __pyx_codeobj__424 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__423, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_set_fallback, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__424)) __PYX_ERR(8, 249, __pyx_L1_error)
 
-  /* "src/lxml/classlookup.pxi":432
+  /* "src/lxml/classlookup.pxi":431
  *         self._lookup_function = _custom_class_lookup
  * 
  *     def lookup(self, type, doc, namespace, name):             # <<<<<<<<<<<<<<
  *         u"lookup(self, type, doc, namespace, name)"
  *         return None
  */
-  __pyx_tuple__419 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_doc_2, __pyx_n_s_namespace, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__419)) __PYX_ERR(8, 432, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__419);
-  __Pyx_GIVEREF(__pyx_tuple__419);
-  __pyx_codeobj__420 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__419, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_lookup, 432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__420)) __PYX_ERR(8, 432, __pyx_L1_error)
+  __pyx_tuple__425 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_doc_2, __pyx_n_s_namespace, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__425)) __PYX_ERR(8, 431, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__425);
+  __Pyx_GIVEREF(__pyx_tuple__425);
+  __pyx_codeobj__426 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__425, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_lookup, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__426)) __PYX_ERR(8, 431, __pyx_L1_error)
 
-  /* "src/lxml/classlookup.pxi":514
+  /* "src/lxml/classlookup.pxi":513
  *         self._lookup_function = _python_class_lookup
  * 
  *     def lookup(self, doc, element):             # <<<<<<<<<<<<<<
  *         u"""lookup(self, doc, element)
  * 
  */
-  __pyx_tuple__421 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doc_2, __pyx_n_s_element); if (unlikely(!__pyx_tuple__421)) __PYX_ERR(8, 514, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__421);
-  __Pyx_GIVEREF(__pyx_tuple__421);
-  __pyx_codeobj__422 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__421, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_lookup, 514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__422)) __PYX_ERR(8, 514, __pyx_L1_error)
+  __pyx_tuple__427 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doc_2, __pyx_n_s_element); if (unlikely(!__pyx_tuple__427)) __PYX_ERR(8, 513, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__427);
+  __Pyx_GIVEREF(__pyx_tuple__427);
+  __pyx_codeobj__428 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__427, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_lookup, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__428)) __PYX_ERR(8, 513, __pyx_L1_error)
 
-  /* "src/lxml/classlookup.pxi":551
+  /* "src/lxml/classlookup.pxi":550
  *     LOOKUP_ELEMENT_CLASS = function
  * 
  * def set_element_class_lookup(ElementClassLookup lookup = None):             # <<<<<<<<<<<<<<
  *     u"""set_element_class_lookup(lookup = None)
  * 
  */
-  __pyx_tuple__423 = PyTuple_Pack(1, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__423)) __PYX_ERR(8, 551, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__423);
-  __Pyx_GIVEREF(__pyx_tuple__423);
-  __pyx_codeobj__424 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__423, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_set_element_class_lookup, 551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__424)) __PYX_ERR(8, 551, __pyx_L1_error)
-  __pyx_tuple__425 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__425)) __PYX_ERR(8, 551, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__425);
-  __Pyx_GIVEREF(__pyx_tuple__425);
+  __pyx_tuple__429 = PyTuple_Pack(1, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__429)) __PYX_ERR(8, 550, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__429);
+  __Pyx_GIVEREF(__pyx_tuple__429);
+  __pyx_codeobj__430 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__429, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_set_element_class_lookup, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__430)) __PYX_ERR(8, 550, __pyx_L1_error)
+  __pyx_tuple__431 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__431)) __PYX_ERR(8, 550, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__431);
+  __Pyx_GIVEREF(__pyx_tuple__431);
 
   /* "src/lxml/nsclasses.pxi":29
  *         self._entries = {}
@@ -231327,10 +231296,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""update(self, class_dict_iterable)
  * 
  */
-  __pyx_tuple__426 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_class_dict_iterable, __pyx_n_s_name_2, __pyx_n_s_item); if (unlikely(!__pyx_tuple__426)) __PYX_ERR(9, 29, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__426);
-  __Pyx_GIVEREF(__pyx_tuple__426);
-  __pyx_codeobj__427 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__426, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_update, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__427)) __PYX_ERR(9, 29, __pyx_L1_error)
+  __pyx_tuple__432 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_class_dict_iterable, __pyx_n_s_name_2, __pyx_n_s_item); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(9, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__432);
+  __Pyx_GIVEREF(__pyx_tuple__432);
+  __pyx_codeobj__433 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__432, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_update, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__433)) __PYX_ERR(9, 29, __pyx_L1_error)
 
   /* "src/lxml/nsclasses.pxi":74
  *         return iter(self._entries)
@@ -231339,10 +231308,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return list(self._entries.items())
  * 
  */
-  __pyx_tuple__428 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__428)) __PYX_ERR(9, 74, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__428);
-  __Pyx_GIVEREF(__pyx_tuple__428);
-  __pyx_codeobj__429 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__428, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_items, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__429)) __PYX_ERR(9, 74, __pyx_L1_error)
+  __pyx_tuple__434 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(9, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__434);
+  __Pyx_GIVEREF(__pyx_tuple__434);
+  __pyx_codeobj__435 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__434, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_items, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__435)) __PYX_ERR(9, 74, __pyx_L1_error)
 
   /* "src/lxml/nsclasses.pxi":77
  *         return list(self._entries.items())
@@ -231351,10 +231320,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return iter(self._entries.items())
  * 
  */
-  __pyx_tuple__430 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__430)) __PYX_ERR(9, 77, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__430);
-  __Pyx_GIVEREF(__pyx_tuple__430);
-  __pyx_codeobj__431 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__430, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_iteritems, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__431)) __PYX_ERR(9, 77, __pyx_L1_error)
+  __pyx_tuple__436 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(9, 77, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__436);
+  __Pyx_GIVEREF(__pyx_tuple__436);
+  __pyx_codeobj__437 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__436, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_iteritems, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__437)) __PYX_ERR(9, 77, __pyx_L1_error)
 
   /* "src/lxml/nsclasses.pxi":80
  *         return iter(self._entries.items())
@@ -231363,34 +231332,46 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._entries.clear()
  * 
  */
-  __pyx_tuple__432 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__432)) __PYX_ERR(9, 80, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__432);
-  __Pyx_GIVEREF(__pyx_tuple__432);
-  __pyx_codeobj__433 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__432, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_clear, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__433)) __PYX_ERR(9, 80, __pyx_L1_error)
+  __pyx_tuple__438 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(9, 80, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__438);
+  __Pyx_GIVEREF(__pyx_tuple__438);
+  __pyx_codeobj__439 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__438, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_clear, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__439)) __PYX_ERR(9, 80, __pyx_L1_error)
+
+  /* "src/lxml/nsclasses.pxi":99
+ *         return obj
+ * 
+ *     def __deco(self, name, obj):             # <<<<<<<<<<<<<<
+ *         self[name] = obj
+ *         return obj
+ */
+  __pyx_tuple__440 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name_2, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__440)) __PYX_ERR(9, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__440);
+  __Pyx_GIVEREF(__pyx_tuple__440);
+  __pyx_codeobj__441 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__440, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_deco, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__441)) __PYX_ERR(9, 99, __pyx_L1_error)
 
-  /* "src/lxml/nsclasses.pxi":113
+  /* "src/lxml/nsclasses.pxi":147
  *         self._lookup_function = _find_nselement_class
  * 
  *     def get_namespace(self, ns_uri):             # <<<<<<<<<<<<<<
  *         u"""get_namespace(self, ns_uri)
  * 
  */
-  __pyx_tuple__434 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ns_uri, __pyx_n_s_ns_utf, __pyx_n_s_registry); if (unlikely(!__pyx_tuple__434)) __PYX_ERR(9, 113, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__434);
-  __Pyx_GIVEREF(__pyx_tuple__434);
-  __pyx_codeobj__435 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__434, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_get_namespace, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__435)) __PYX_ERR(9, 113, __pyx_L1_error)
+  __pyx_tuple__442 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ns_uri, __pyx_n_s_ns_utf, __pyx_n_s_registry); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(9, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__442);
+  __Pyx_GIVEREF(__pyx_tuple__442);
+  __pyx_codeobj__443 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__442, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_get_namespace, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__443)) __PYX_ERR(9, 147, __pyx_L1_error)
 
-  /* "src/lxml/nsclasses.pxi":173
+  /* "src/lxml/nsclasses.pxi":207
  * __FUNCTION_NAMESPACE_REGISTRIES = {}
  * 
  * def FunctionNamespace(ns_uri):             # <<<<<<<<<<<<<<
  *     u"""FunctionNamespace(ns_uri)
  * 
  */
-  __pyx_tuple__436 = PyTuple_Pack(3, __pyx_n_s_ns_uri, __pyx_n_s_ns_utf, __pyx_n_s_registry); if (unlikely(!__pyx_tuple__436)) __PYX_ERR(9, 173, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__436);
-  __Pyx_GIVEREF(__pyx_tuple__436);
-  __pyx_codeobj__437 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__436, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_FunctionNamespace, 173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__437)) __PYX_ERR(9, 173, __pyx_L1_error)
+  __pyx_tuple__444 = PyTuple_Pack(3, __pyx_n_s_ns_uri, __pyx_n_s_ns_utf, __pyx_n_s_registry); if (unlikely(!__pyx_tuple__444)) __PYX_ERR(9, 207, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__444);
+  __Pyx_GIVEREF(__pyx_tuple__444);
+  __pyx_codeobj__445 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__444, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_nsclasses_pxi, __pyx_n_s_FunctionNamespace, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__445)) __PYX_ERR(9, 207, __pyx_L1_error)
 
   /* "src/lxml/docloader.pxi":25
  * cdef class Resolver:
@@ -231399,10 +231380,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""resolve(self, system_url, public_id, context)
  * 
  */
-  __pyx_tuple__438 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_system_url, __pyx_n_s_public_id, __pyx_n_s_context); if (unlikely(!__pyx_tuple__438)) __PYX_ERR(10, 25, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__438);
-  __Pyx_GIVEREF(__pyx_tuple__438);
-  __pyx_codeobj__439 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__438, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__439)) __PYX_ERR(10, 25, __pyx_L1_error)
+  __pyx_tuple__446 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_system_url, __pyx_n_s_public_id, __pyx_n_s_context); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(10, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__446);
+  __Pyx_GIVEREF(__pyx_tuple__446);
+  __pyx_codeobj__447 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__447)) __PYX_ERR(10, 25, __pyx_L1_error)
 
   /* "src/lxml/docloader.pxi":36
  *         return None
@@ -231411,10 +231392,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""resolve_empty(self, context)
  * 
  */
-  __pyx_tuple__440 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_doc_ref); if (unlikely(!__pyx_tuple__440)) __PYX_ERR(10, 36, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__440);
-  __Pyx_GIVEREF(__pyx_tuple__440);
-  __pyx_codeobj__441 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__440, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve_empty, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__441)) __PYX_ERR(10, 36, __pyx_L1_error)
+  __pyx_tuple__448 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_doc_ref); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(10, 36, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__448);
+  __Pyx_GIVEREF(__pyx_tuple__448);
+  __pyx_codeobj__449 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__448, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve_empty, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__449)) __PYX_ERR(10, 36, __pyx_L1_error)
 
   /* "src/lxml/docloader.pxi":48
  *         return doc_ref
@@ -231423,10 +231404,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""resolve_string(self, string, context, base_url=None)
  * 
  */
-  __pyx_tuple__442 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_string_2, __pyx_n_s_context, __pyx_n_s_base_url, __pyx_n_s_doc_ref); if (unlikely(!__pyx_tuple__442)) __PYX_ERR(10, 48, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__442);
-  __Pyx_GIVEREF(__pyx_tuple__442);
-  __pyx_codeobj__443 = (PyObject*)__Pyx_PyCode_New(3, 1, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__442, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve_string, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__443)) __PYX_ERR(10, 48, __pyx_L1_error)
+  __pyx_tuple__450 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_string_2, __pyx_n_s_context, __pyx_n_s_base_url, __pyx_n_s_doc_ref); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(10, 48, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__450);
+  __Pyx_GIVEREF(__pyx_tuple__450);
+  __pyx_codeobj__451 = (PyObject*)__Pyx_PyCode_New(3, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__450, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve_string, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__451)) __PYX_ERR(10, 48, __pyx_L1_error)
 
   /* "src/lxml/docloader.pxi":69
  *         return doc_ref
@@ -231435,10 +231416,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""resolve_filename(self, filename, context)
  * 
  */
-  __pyx_tuple__444 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_context, __pyx_n_s_doc_ref); if (unlikely(!__pyx_tuple__444)) __PYX_ERR(10, 69, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__444);
-  __Pyx_GIVEREF(__pyx_tuple__444);
-  __pyx_codeobj__445 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__444, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve_filename, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__445)) __PYX_ERR(10, 69, __pyx_L1_error)
+  __pyx_tuple__452 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_context, __pyx_n_s_doc_ref); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(10, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__452);
+  __Pyx_GIVEREF(__pyx_tuple__452);
+  __pyx_codeobj__453 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__452, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve_filename, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__453)) __PYX_ERR(10, 69, __pyx_L1_error)
 
   /* "src/lxml/docloader.pxi":83
  *         return doc_ref
@@ -231447,10 +231428,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""resolve_file(self, f, context, base_url=None, close=True)
  * 
  */
-  __pyx_tuple__446 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_f, __pyx_n_s_context, __pyx_n_s_base_url, __pyx_n_s_close, __pyx_n_s_doc_ref); if (unlikely(!__pyx_tuple__446)) __PYX_ERR(10, 83, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__446);
-  __Pyx_GIVEREF(__pyx_tuple__446);
-  __pyx_codeobj__447 = (PyObject*)__Pyx_PyCode_New(3, 2, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__446, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve_file, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__447)) __PYX_ERR(10, 83, __pyx_L1_error)
+  __pyx_tuple__454 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_f, __pyx_n_s_context, __pyx_n_s_base_url, __pyx_n_s_close, __pyx_n_s_doc_ref); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(10, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__454);
+  __Pyx_GIVEREF(__pyx_tuple__454);
+  __pyx_codeobj__455 = (PyObject*)__Pyx_PyCode_New(3, 2, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__454, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve_file, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__455)) __PYX_ERR(10, 83, __pyx_L1_error)
 
   /* "src/lxml/docloader.pxi":120
  *         self._default_resolver = default_resolver
@@ -231459,10 +231440,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""add(self, resolver)
  * 
  */
-  __pyx_tuple__448 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_resolver); if (unlikely(!__pyx_tuple__448)) __PYX_ERR(10, 120, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__448);
-  __Pyx_GIVEREF(__pyx_tuple__448);
-  __pyx_codeobj__449 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__448, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_add, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__449)) __PYX_ERR(10, 120, __pyx_L1_error)
+  __pyx_tuple__456 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_resolver); if (unlikely(!__pyx_tuple__456)) __PYX_ERR(10, 120, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__456);
+  __Pyx_GIVEREF(__pyx_tuple__456);
+  __pyx_codeobj__457 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__456, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_add, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__457)) __PYX_ERR(10, 120, __pyx_L1_error)
 
   /* "src/lxml/docloader.pxi":133
  *         self._resolvers.add(resolver)
@@ -231471,10 +231452,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"remove(self, resolver)"
  *         self._resolvers.discard(resolver)
  */
-  __pyx_tuple__450 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_resolver); if (unlikely(!__pyx_tuple__450)) __PYX_ERR(10, 133, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__450);
-  __Pyx_GIVEREF(__pyx_tuple__450);
-  __pyx_codeobj__451 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__450, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_remove, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__451)) __PYX_ERR(10, 133, __pyx_L1_error)
+  __pyx_tuple__458 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_resolver); if (unlikely(!__pyx_tuple__458)) __PYX_ERR(10, 133, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__458);
+  __Pyx_GIVEREF(__pyx_tuple__458);
+  __pyx_codeobj__459 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__458, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_remove, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__459)) __PYX_ERR(10, 133, __pyx_L1_error)
 
   /* "src/lxml/docloader.pxi":143
  *         return registry
@@ -231483,10 +231464,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"copy(self)"
  *         return self._copy()
  */
-  __pyx_tuple__452 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__452)) __PYX_ERR(10, 143, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__452);
-  __Pyx_GIVEREF(__pyx_tuple__452);
-  __pyx_codeobj__453 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__452, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_copy, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__453)) __PYX_ERR(10, 143, __pyx_L1_error)
+  __pyx_tuple__460 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__460)) __PYX_ERR(10, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__460);
+  __Pyx_GIVEREF(__pyx_tuple__460);
+  __pyx_codeobj__461 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__460, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_copy, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__461)) __PYX_ERR(10, 143, __pyx_L1_error)
 
   /* "src/lxml/docloader.pxi":147
  *         return self._copy()
@@ -231495,10 +231476,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"resolve(self, system_url, public_id, context)"
  *         for resolver in self._resolvers:
  */
-  __pyx_tuple__454 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_system_url, __pyx_n_s_public_id, __pyx_n_s_context, __pyx_n_s_resolver, __pyx_n_s_result); if (unlikely(!__pyx_tuple__454)) __PYX_ERR(10, 147, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__454);
-  __Pyx_GIVEREF(__pyx_tuple__454);
-  __pyx_codeobj__455 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__454, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__455)) __PYX_ERR(10, 147, __pyx_L1_error)
+  __pyx_tuple__462 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_system_url, __pyx_n_s_public_id, __pyx_n_s_context, __pyx_n_s_resolver, __pyx_n_s_result); if (unlikely(!__pyx_tuple__462)) __PYX_ERR(10, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__462);
+  __Pyx_GIVEREF(__pyx_tuple__462);
+  __pyx_codeobj__463 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__462, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_docloader_pxi, __pyx_n_s_resolve, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__463)) __PYX_ERR(10, 147, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":19
  *     For compatibility with ElementTree 1.3 and later.
@@ -231507,13 +231488,13 @@ static int __Pyx_InitCachedConstants(void) {
  *         super(_ParseError, self).__init__(message)
  *         self.lineno, self.offset = (line, column - 1)
  */
-  __pyx_tuple__456 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_code, __pyx_n_s_line, __pyx_n_s_column, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__456)) __PYX_ERR(2, 19, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__456);
-  __Pyx_GIVEREF(__pyx_tuple__456);
-  __pyx_codeobj__457 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__456, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_init, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__457)) __PYX_ERR(2, 19, __pyx_L1_error)
-  __pyx_tuple__458 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__458)) __PYX_ERR(2, 19, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__458);
-  __Pyx_GIVEREF(__pyx_tuple__458);
+  __pyx_tuple__464 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_code, __pyx_n_s_line, __pyx_n_s_column, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__464)) __PYX_ERR(2, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__464);
+  __Pyx_GIVEREF(__pyx_tuple__464);
+  __pyx_codeobj__465 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__464, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_init, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__465)) __PYX_ERR(2, 19, __pyx_L1_error)
+  __pyx_tuple__466 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__466)) __PYX_ERR(2, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__466);
+  __Pyx_GIVEREF(__pyx_tuple__466);
 
   /* "src/lxml/parser.pxi":26
  * 
@@ -231522,10 +231503,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return self.lineno, self.offset + 1
  * 
  */
-  __pyx_tuple__459 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__459)) __PYX_ERR(2, 26, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__459);
-  __Pyx_GIVEREF(__pyx_tuple__459);
-  __pyx_codeobj__460 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__459, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_position, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__460)) __PYX_ERR(2, 26, __pyx_L1_error)
+  __pyx_tuple__467 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__467)) __PYX_ERR(2, 26, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__467);
+  __Pyx_GIVEREF(__pyx_tuple__467);
+  __pyx_codeobj__468 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__467, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_position, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__468)) __PYX_ERR(2, 26, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":30
  * 
@@ -231534,10 +231515,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self.lineno, column = new_pos
  *         self.offset = column - 1
  */
-  __pyx_tuple__461 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_new_pos, __pyx_n_s_column); if (unlikely(!__pyx_tuple__461)) __PYX_ERR(2, 30, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__461);
-  __Pyx_GIVEREF(__pyx_tuple__461);
-  __pyx_codeobj__462 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__461, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_position, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__462)) __PYX_ERR(2, 30, __pyx_L1_error)
+  __pyx_tuple__469 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_new_pos, __pyx_n_s_column); if (unlikely(!__pyx_tuple__469)) __PYX_ERR(2, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__469);
+  __Pyx_GIVEREF(__pyx_tuple__469);
+  __pyx_codeobj__470 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__469, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_position, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__470)) __PYX_ERR(2, 30, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":959
  *             return u"libxml2 %d.%d.%d" % LIBXML_VERSION
@@ -231546,10 +231527,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u":deprecated: use ``parser.set_element_class_lookup(lookup)`` instead."
  *         self.set_element_class_lookup(lookup)
  */
-  __pyx_tuple__463 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__463)) __PYX_ERR(2, 959, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__463);
-  __Pyx_GIVEREF(__pyx_tuple__463);
-  __pyx_codeobj__464 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__463, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_setElementClassLookup, 959, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__464)) __PYX_ERR(2, 959, __pyx_L1_error)
+  __pyx_tuple__471 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__471)) __PYX_ERR(2, 959, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__471);
+  __Pyx_GIVEREF(__pyx_tuple__471);
+  __pyx_codeobj__472 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__471, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_setElementClassLookup, 959, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__472)) __PYX_ERR(2, 959, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":963
  *         self.set_element_class_lookup(lookup)
@@ -231558,10 +231539,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""set_element_class_lookup(self, lookup = None)
  * 
  */
-  __pyx_tuple__465 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__465)) __PYX_ERR(2, 963, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__465);
-  __Pyx_GIVEREF(__pyx_tuple__465);
-  __pyx_codeobj__466 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__465, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_set_element_class_lookup, 963, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__466)) __PYX_ERR(2, 963, __pyx_L1_error)
+  __pyx_tuple__473 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__473)) __PYX_ERR(2, 963, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__473);
+  __Pyx_GIVEREF(__pyx_tuple__473);
+  __pyx_codeobj__474 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__473, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_set_element_class_lookup, 963, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__474)) __PYX_ERR(2, 963, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":990
  *         return parser
@@ -231570,10 +231551,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""copy(self)
  * 
  */
-  __pyx_tuple__467 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__467)) __PYX_ERR(2, 990, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__467);
-  __Pyx_GIVEREF(__pyx_tuple__467);
-  __pyx_codeobj__468 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__467, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_copy, 990, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__468)) __PYX_ERR(2, 990, __pyx_L1_error)
+  __pyx_tuple__475 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__475)) __PYX_ERR(2, 990, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__475);
+  __Pyx_GIVEREF(__pyx_tuple__475);
+  __pyx_codeobj__476 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__475, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_copy, 990, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__476)) __PYX_ERR(2, 990, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":997
  *         return self._copy()
@@ -231582,10 +231563,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""makeelement(self, _tag, attrib=None, nsmap=None, **_extra)
  * 
  */
-  __pyx_tuple__469 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__469)) __PYX_ERR(2, 997, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__469);
-  __Pyx_GIVEREF(__pyx_tuple__469);
-  __pyx_codeobj__470 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__469, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_makeelement, 997, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__470)) __PYX_ERR(2, 997, __pyx_L1_error)
+  __pyx_tuple__477 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(2, 997, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__477);
+  __Pyx_GIVEREF(__pyx_tuple__477);
+  __pyx_codeobj__478 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__477, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_makeelement, 997, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__478)) __PYX_ERR(2, 997, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1240
  *             return self._getPushParserContext()._error_log.copy()
@@ -231594,10 +231575,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""feed(self, data)
  * 
  */
-  __pyx_tuple__471 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__471)) __PYX_ERR(2, 1240, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__471);
-  __Pyx_GIVEREF(__pyx_tuple__471);
-  __pyx_codeobj__472 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__471, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_feed, 1240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__472)) __PYX_ERR(2, 1240, __pyx_L1_error)
+  __pyx_tuple__479 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(2, 1240, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__479);
+  __Pyx_GIVEREF(__pyx_tuple__479);
+  __pyx_codeobj__480 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__479, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_feed, 1240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__480)) __PYX_ERR(2, 1240, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1366
  *                 context.cleanup()
@@ -231606,10 +231587,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""close(self)
  * 
  */
-  __pyx_tuple__473 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__473)) __PYX_ERR(2, 1366, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__473);
-  __Pyx_GIVEREF(__pyx_tuple__473);
-  __pyx_codeobj__474 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__473, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_close, 1366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__474)) __PYX_ERR(2, 1366, __pyx_L1_error)
+  __pyx_tuple__481 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(2, 1366, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__481);
+  __Pyx_GIVEREF(__pyx_tuple__481);
+  __pyx_codeobj__482 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__481, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_close, 1366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__482)) __PYX_ERR(2, 1366, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1548
  *         self._collectEvents(events, tag)
@@ -231618,10 +231599,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return (<_SaxParserContext?>self._getPushParserContext()).events_iterator
  * 
  */
-  __pyx_tuple__475 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__475)) __PYX_ERR(2, 1548, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__475);
-  __Pyx_GIVEREF(__pyx_tuple__475);
-  __pyx_codeobj__476 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__475, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_read_events, 1548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__476)) __PYX_ERR(2, 1548, __pyx_L1_error)
+  __pyx_tuple__483 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(2, 1548, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__483);
+  __Pyx_GIVEREF(__pyx_tuple__483);
+  __pyx_codeobj__484 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__483, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_read_events, 1548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__484)) __PYX_ERR(2, 1548, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1600
  * __GLOBAL_PARSER_CONTEXT.setDefaultParser(__DEFAULT_XML_PARSER)
@@ -231630,13 +231611,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""set_default_parser(parser=None)
  * 
  */
-  __pyx_tuple__477 = PyTuple_Pack(1, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(2, 1600, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__477);
-  __Pyx_GIVEREF(__pyx_tuple__477);
-  __pyx_codeobj__478 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__477, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_set_default_parser, 1600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__478)) __PYX_ERR(2, 1600, __pyx_L1_error)
-  __pyx_tuple__479 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(2, 1600, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__479);
-  __Pyx_GIVEREF(__pyx_tuple__479);
+  __pyx_tuple__485 = PyTuple_Pack(1, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__485)) __PYX_ERR(2, 1600, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__485);
+  __Pyx_GIVEREF(__pyx_tuple__485);
+  __pyx_codeobj__486 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__485, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_set_default_parser, 1600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__486)) __PYX_ERR(2, 1600, __pyx_L1_error)
+  __pyx_tuple__487 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__487)) __PYX_ERR(2, 1600, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__487);
+  __Pyx_GIVEREF(__pyx_tuple__487);
 
   /* "src/lxml/parser.pxi":1616
  *     __GLOBAL_PARSER_CONTEXT.setDefaultParser(parser)
@@ -231645,7 +231626,7 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"get_default_parser()"
  *     return __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  */
-  __pyx_codeobj__480 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_get_default_parser, 1616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__480)) __PYX_ERR(2, 1616, __pyx_L1_error)
+  __pyx_codeobj__488 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_get_default_parser, 1616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__488)) __PYX_ERR(2, 1616, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":1717
  *         self._collectEvents(events, tag)
@@ -231654,10 +231635,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return (<_SaxParserContext?>self._getPushParserContext()).events_iterator
  * 
  */
-  __pyx_tuple__481 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(2, 1717, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__481);
-  __Pyx_GIVEREF(__pyx_tuple__481);
-  __pyx_codeobj__482 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__481, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_read_events, 1717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__482)) __PYX_ERR(2, 1717, __pyx_L1_error)
+  __pyx_tuple__489 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__489)) __PYX_ERR(2, 1717, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__489);
+  __Pyx_GIVEREF(__pyx_tuple__489);
+  __pyx_codeobj__490 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__489, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_read_events, 1717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__490)) __PYX_ERR(2, 1717, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":469
  * 
@@ -231666,9 +231647,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  * 
  */
-  __pyx_tuple__483 = PyTuple_Pack(2, __pyx_kp_s_end_ns, Py_None); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(11, 469, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__483);
-  __Pyx_GIVEREF(__pyx_tuple__483);
+  __pyx_tuple__491 = PyTuple_Pack(2, __pyx_kp_s_end_ns, Py_None); if (unlikely(!__pyx_tuple__491)) __PYX_ERR(11, 469, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__491);
+  __Pyx_GIVEREF(__pyx_tuple__491);
 
   /* "src/lxml/saxparser.pxi":721
  *     # Python level event handlers
@@ -231677,10 +231658,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""close(self)
  * 
  */
-  __pyx_tuple__484 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__484)) __PYX_ERR(11, 721, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__484);
-  __Pyx_GIVEREF(__pyx_tuple__484);
-  __pyx_codeobj__485 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__484, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_close, 721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__485)) __PYX_ERR(11, 721, __pyx_L1_error)
+  __pyx_tuple__492 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__492)) __PYX_ERR(11, 721, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__492);
+  __Pyx_GIVEREF(__pyx_tuple__492);
+  __pyx_codeobj__493 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__492, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_close, 721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__493)) __PYX_ERR(11, 721, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":731
  *         return self._last
@@ -231689,10 +231670,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""data(self, data)
  * 
  */
-  __pyx_tuple__486 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__486)) __PYX_ERR(11, 731, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__486);
-  __Pyx_GIVEREF(__pyx_tuple__486);
-  __pyx_codeobj__487 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__486, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_data, 731, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__487)) __PYX_ERR(11, 731, __pyx_L1_error)
+  __pyx_tuple__494 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__494)) __PYX_ERR(11, 731, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__494);
+  __Pyx_GIVEREF(__pyx_tuple__494);
+  __pyx_codeobj__495 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__494, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_data, 731, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__495)) __PYX_ERR(11, 731, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":739
  *         self._handleSaxData(data)
@@ -231701,10 +231682,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""start(self, tag, attrs, nsmap=None)
  * 
  */
-  __pyx_tuple__488 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrs, __pyx_n_s_nsmap); if (unlikely(!__pyx_tuple__488)) __PYX_ERR(11, 739, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__488);
-  __Pyx_GIVEREF(__pyx_tuple__488);
-  __pyx_codeobj__489 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__488, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_start, 739, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__489)) __PYX_ERR(11, 739, __pyx_L1_error)
+  __pyx_tuple__496 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrs, __pyx_n_s_nsmap); if (unlikely(!__pyx_tuple__496)) __PYX_ERR(11, 739, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__496);
+  __Pyx_GIVEREF(__pyx_tuple__496);
+  __pyx_codeobj__497 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__496, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_start, 739, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__497)) __PYX_ERR(11, 739, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":748
  *         return self._handleSaxStart(tag, attrs, nsmap)
@@ -231713,10 +231694,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""end(self, tag)
  * 
  */
-  __pyx_tuple__490 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_element); if (unlikely(!__pyx_tuple__490)) __PYX_ERR(11, 748, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__490);
-  __Pyx_GIVEREF(__pyx_tuple__490);
-  __pyx_codeobj__491 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__490, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_end, 748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__491)) __PYX_ERR(11, 748, __pyx_L1_error)
+  __pyx_tuple__498 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_element); if (unlikely(!__pyx_tuple__498)) __PYX_ERR(11, 748, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__498);
+  __Pyx_GIVEREF(__pyx_tuple__498);
+  __pyx_codeobj__499 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__498, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_end, 748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__499)) __PYX_ERR(11, 748, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":759
  *         return element
@@ -231725,10 +231706,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""pi(self, target, data)
  *         """
  */
-  __pyx_tuple__492 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_target, __pyx_n_s_data); if (unlikely(!__pyx_tuple__492)) __PYX_ERR(11, 759, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__492);
-  __Pyx_GIVEREF(__pyx_tuple__492);
-  __pyx_codeobj__493 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__492, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_pi, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__493)) __PYX_ERR(11, 759, __pyx_L1_error)
+  __pyx_tuple__500 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_target, __pyx_n_s_data); if (unlikely(!__pyx_tuple__500)) __PYX_ERR(11, 759, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__500);
+  __Pyx_GIVEREF(__pyx_tuple__500);
+  __pyx_codeobj__501 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__500, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_pi, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__501)) __PYX_ERR(11, 759, __pyx_L1_error)
 
   /* "src/lxml/saxparser.pxi":764
  *         return self._handleSaxPi(target, data)
@@ -231737,10 +231718,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""comment(self, comment)
  *         """
  */
-  __pyx_tuple__494 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_comment); if (unlikely(!__pyx_tuple__494)) __PYX_ERR(11, 764, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__494);
-  __Pyx_GIVEREF(__pyx_tuple__494);
-  __pyx_codeobj__495 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__494, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_comment, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__495)) __PYX_ERR(11, 764, __pyx_L1_error)
+  __pyx_tuple__502 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_comment); if (unlikely(!__pyx_tuple__502)) __PYX_ERR(11, 764, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__502);
+  __Pyx_GIVEREF(__pyx_tuple__502);
+  __pyx_codeobj__503 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__502, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_comment, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__503)) __PYX_ERR(11, 764, __pyx_L1_error)
 
   /* "src/lxml/parsertarget.pxi":14
  *     # to push the Python level parser result through the parser
@@ -231749,10 +231730,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self.result = result
  * 
  */
-  __pyx_tuple__496 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__496)) __PYX_ERR(12, 14, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__496);
-  __Pyx_GIVEREF(__pyx_tuple__496);
-  __pyx_codeobj__497 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__496, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parsertarget_pxi, __pyx_n_s_init, 14, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__497)) __PYX_ERR(12, 14, __pyx_L1_error)
+  __pyx_tuple__504 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(12, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__504);
+  __Pyx_GIVEREF(__pyx_tuple__504);
+  __pyx_codeobj__505 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__504, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parsertarget_pxi, __pyx_n_s_init, 14, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__505)) __PYX_ERR(12, 14, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":914
  *         self.method = OUTPUT_METHOD_XML
@@ -231761,10 +231742,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         assert self.output_file is not None
  *         self.writer = _IncrementalFileWriter(
  */
-  __pyx_tuple__498 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__498)) __PYX_ERR(7, 914, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__498);
-  __Pyx_GIVEREF(__pyx_tuple__498);
-  __pyx_codeobj__499 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__498, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__499)) __PYX_ERR(7, 914, __pyx_L1_error)
+  __pyx_tuple__506 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(7, 914, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__506);
+  __Pyx_GIVEREF(__pyx_tuple__506);
+  __pyx_codeobj__507 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__506, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__507)) __PYX_ERR(7, 914, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":921
  *         return self.writer
@@ -231773,10 +231754,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self.writer is not None:
  *             old_writer, self.writer = self.writer, None
  */
-  __pyx_tuple__500 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb, __pyx_n_s_old_writer, __pyx_n_s_raise_on_error); if (unlikely(!__pyx_tuple__500)) __PYX_ERR(7, 921, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__500);
-  __Pyx_GIVEREF(__pyx_tuple__500);
-  __pyx_codeobj__501 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__500, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 921, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__501)) __PYX_ERR(7, 921, __pyx_L1_error)
+  __pyx_tuple__508 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb, __pyx_n_s_old_writer, __pyx_n_s_raise_on_error); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(7, 921, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__508);
+  __Pyx_GIVEREF(__pyx_tuple__508);
+  __pyx_codeobj__509 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__508, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 921, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__509)) __PYX_ERR(7, 921, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":929
  *                 self.output_file = None
@@ -231785,10 +231766,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         assert self.output_file is not None
  *         if isinstance(self.output_file, basestring):
  */
-  __pyx_tuple__502 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__502)) __PYX_ERR(7, 929, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__502);
-  __Pyx_GIVEREF(__pyx_tuple__502);
-  __pyx_codeobj__503 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__502, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 929, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__503)) __PYX_ERR(7, 929, __pyx_L1_error)
+  __pyx_tuple__510 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(7, 929, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__510);
+  __Pyx_GIVEREF(__pyx_tuple__510);
+  __pyx_codeobj__511 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__510, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 929, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__511)) __PYX_ERR(7, 929, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":940
  *         return self.async_writer
@@ -231797,10 +231778,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self.async_writer is not None:
  *             old_writer, self.async_writer = self.async_writer, None
  */
-  __pyx_tuple__504 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb, __pyx_n_s_old_writer, __pyx_n_s_raise_on_error); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(7, 940, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__504);
-  __Pyx_GIVEREF(__pyx_tuple__504);
-  __pyx_codeobj__505 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__504, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__505)) __PYX_ERR(7, 940, __pyx_L1_error)
+  __pyx_tuple__512 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb, __pyx_n_s_old_writer, __pyx_n_s_raise_on_error); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(7, 940, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__512);
+  __Pyx_GIVEREF(__pyx_tuple__512);
+  __pyx_codeobj__513 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__512, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__513)) __PYX_ERR(7, 940, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":997
  *             tree.xmlOutputBufferClose(self._c_out)
@@ -231809,10 +231790,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """write_declaration(self, version=None, standalone=None, doctype=None)
  * 
  */
-  __pyx_tuple__506 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_version, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_c_version, __pyx_n_s_c_standalone); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(7, 997, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__506);
-  __Pyx_GIVEREF(__pyx_tuple__506);
-  __pyx_codeobj__507 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__506, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_declaration, 997, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__507)) __PYX_ERR(7, 997, __pyx_L1_error)
+  __pyx_tuple__514 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_version, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_c_version, __pyx_n_s_c_standalone); if (unlikely(!__pyx_tuple__514)) __PYX_ERR(7, 997, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__514);
+  __Pyx_GIVEREF(__pyx_tuple__514);
+  __pyx_codeobj__515 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_declaration, 997, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__515)) __PYX_ERR(7, 997, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1026
  *         self._handle_error(self._c_out.error)
@@ -231821,10 +231802,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """write_doctype(self, doctype)
  * 
  */
-  __pyx_tuple__508 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_doctype); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(7, 1026, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__508);
-  __Pyx_GIVEREF(__pyx_tuple__508);
-  __pyx_codeobj__509 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__508, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_doctype, 1026, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__509)) __PYX_ERR(7, 1026, __pyx_L1_error)
+  __pyx_tuple__516 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_doctype); if (unlikely(!__pyx_tuple__516)) __PYX_ERR(7, 1026, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__516);
+  __Pyx_GIVEREF(__pyx_tuple__516);
+  __pyx_codeobj__517 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__516, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_doctype, 1026, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__517)) __PYX_ERR(7, 1026, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1043
  *         self._handle_error(self._c_out.error)
@@ -231833,10 +231814,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """method(self, method)
  * 
  */
-  __pyx_tuple__510 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_c_method); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(7, 1043, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__510);
-  __Pyx_GIVEREF(__pyx_tuple__510);
-  __pyx_codeobj__511 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__510, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_method, 1043, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__511)) __PYX_ERR(7, 1043, __pyx_L1_error)
+  __pyx_tuple__518 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_c_method); if (unlikely(!__pyx_tuple__518)) __PYX_ERR(7, 1043, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__518);
+  __Pyx_GIVEREF(__pyx_tuple__518);
+  __pyx_codeobj__519 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__518, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_method, 1043, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__519)) __PYX_ERR(7, 1043, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1053
  *         return _MethodChanger(self, c_method)
@@ -231845,10 +231826,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """element(self, tag, attrib=None, nsmap=None, method, **_extra)
  * 
  */
-  __pyx_tuple__512 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_method, __pyx_n_s_extra, __pyx_n_s_attributes, __pyx_n_s_name_2, __pyx_n_s_value, __pyx_n_s_ns, __pyx_n_s_reversed_nsmap, __pyx_n_s_prefix, __pyx_n_s_c_method); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(7, 1053, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__512);
-  __Pyx_GIVEREF(__pyx_tuple__512);
-  __pyx_codeobj__513 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__512, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_element, 1053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__513)) __PYX_ERR(7, 1053, __pyx_L1_error)
+  __pyx_tuple__520 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_method, __pyx_n_s_extra, __pyx_n_s_attributes, __pyx_n_s_name_2, __pyx_n_s_value, __pyx_n_s_ns, __pyx_n_s_reversed_nsmap, __pyx_n_s_prefix, __pyx_n_s_c_method); if (unlikely(!__pyx_tuple__520)) __PYX_ERR(7, 1053, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__520);
+  __Pyx_GIVEREF(__pyx_tuple__520);
+  __pyx_codeobj__521 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__520, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_element, 1053, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__521)) __PYX_ERR(7, 1053, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1190
  *         return flat_namespaces_map, new_namespaces
@@ -231857,10 +231838,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """write(self, *args, with_tail=True, pretty_print=False, method=None)
  * 
  */
-  __pyx_tuple__514 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_with_tail, __pyx_n_s_pretty_print, __pyx_n_s_method, __pyx_n_s_args, __pyx_n_s_c_method, __pyx_n_s_content, __pyx_n_s_bstring, __pyx_n_s_ns, __pyx_n_s_name_2, __pyx_n_s__62); if (unlikely(!__pyx_tuple__514)) __PYX_ERR(7, 1190, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__514);
-  __Pyx_GIVEREF(__pyx_tuple__514);
-  __pyx_codeobj__515 = (PyObject*)__Pyx_PyCode_New(1, 3, 11, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__515)) __PYX_ERR(7, 1190, __pyx_L1_error)
+  __pyx_tuple__522 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_with_tail, __pyx_n_s_pretty_print, __pyx_n_s_method, __pyx_n_s_args, __pyx_n_s_c_method, __pyx_n_s_content, __pyx_n_s_bstring, __pyx_n_s_ns, __pyx_n_s_name_2, __pyx_n_s__64); if (unlikely(!__pyx_tuple__522)) __PYX_ERR(7, 1190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__522);
+  __Pyx_GIVEREF(__pyx_tuple__522);
+  __pyx_codeobj__523 = (PyObject*)__Pyx_PyCode_New(1, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__523)) __PYX_ERR(7, 1190, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1236
  *             self._handle_error(self._c_out.error)
@@ -231869,10 +231850,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """flush(self)
  * 
  */
-  __pyx_tuple__516 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__516)) __PYX_ERR(7, 1236, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__516);
-  __Pyx_GIVEREF(__pyx_tuple__516);
-  __pyx_codeobj__517 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__516, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_flush, 1236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__517)) __PYX_ERR(7, 1236, __pyx_L1_error)
+  __pyx_tuple__524 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__524)) __PYX_ERR(7, 1236, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__524);
+  __Pyx_GIVEREF(__pyx_tuple__524);
+  __pyx_codeobj__525 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__524, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_flush, 1236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__525)) __PYX_ERR(7, 1236, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1283
  *         return data
@@ -231881,10 +231862,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._data.append(data)
  * 
  */
-  __pyx_tuple__518 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__518)) __PYX_ERR(7, 1283, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__518);
-  __Pyx_GIVEREF(__pyx_tuple__518);
-  __pyx_codeobj__519 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__518, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__519)) __PYX_ERR(7, 1283, __pyx_L1_error)
+  __pyx_tuple__526 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__526)) __PYX_ERR(7, 1283, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__526);
+  __Pyx_GIVEREF(__pyx_tuple__526);
+  __pyx_codeobj__527 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__526, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__527)) __PYX_ERR(7, 1283, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1286
  *         self._data.append(data)
@@ -231893,10 +231874,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         pass
  * 
  */
-  __pyx_tuple__520 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__520)) __PYX_ERR(7, 1286, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__520);
-  __Pyx_GIVEREF(__pyx_tuple__520);
-  __pyx_codeobj__521 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__520, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_close, 1286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__521)) __PYX_ERR(7, 1286, __pyx_L1_error)
+  __pyx_tuple__528 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__528)) __PYX_ERR(7, 1286, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__528);
+  __Pyx_GIVEREF(__pyx_tuple__528);
+  __pyx_codeobj__529 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__528, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_close, 1286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__529)) __PYX_ERR(7, 1286, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1315
  *         return None
@@ -231905,10 +231886,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._writer.flush()
  *         data = self._buffer.collect()
  */
-  __pyx_tuple__522 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__522)) __PYX_ERR(7, 1315, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__522);
-  __Pyx_GIVEREF(__pyx_tuple__522);
-  __pyx_codeobj__523 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_flush, 1315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__523)) __PYX_ERR(7, 1315, __pyx_L1_error)
+  __pyx_tuple__530 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__530)) __PYX_ERR(7, 1315, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__530);
+  __Pyx_GIVEREF(__pyx_tuple__530);
+  __pyx_codeobj__531 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__530, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_flush, 1315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__531)) __PYX_ERR(7, 1315, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1321
  *             await self._async_outfile.write(data)
@@ -231917,10 +231898,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._writer.write_declaration(version, standalone, doctype)
  *         data = self._flush()
  */
-  __pyx_tuple__524 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_version, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_data); if (unlikely(!__pyx_tuple__524)) __PYX_ERR(7, 1321, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__524);
-  __Pyx_GIVEREF(__pyx_tuple__524);
-  __pyx_codeobj__525 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__524, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_declaration, 1321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__525)) __PYX_ERR(7, 1321, __pyx_L1_error)
+  __pyx_tuple__532 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_version, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_data); if (unlikely(!__pyx_tuple__532)) __PYX_ERR(7, 1321, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__532);
+  __Pyx_GIVEREF(__pyx_tuple__532);
+  __pyx_codeobj__533 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__532, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_declaration, 1321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__533)) __PYX_ERR(7, 1321, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1327
  *             await self._async_outfile.write(data)
@@ -231929,10 +231910,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._writer.write_doctype(doctype)
  *         data = self._flush()
  */
-  __pyx_tuple__526 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doctype, __pyx_n_s_data); if (unlikely(!__pyx_tuple__526)) __PYX_ERR(7, 1327, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__526);
-  __Pyx_GIVEREF(__pyx_tuple__526);
-  __pyx_codeobj__527 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__526, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_doctype, 1327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__527)) __PYX_ERR(7, 1327, __pyx_L1_error)
+  __pyx_tuple__534 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doctype, __pyx_n_s_data); if (unlikely(!__pyx_tuple__534)) __PYX_ERR(7, 1327, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__534);
+  __Pyx_GIVEREF(__pyx_tuple__534);
+  __pyx_codeobj__535 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__534, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_doctype, 1327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__535)) __PYX_ERR(7, 1327, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1333
  *             await self._async_outfile.write(data)
@@ -231941,10 +231922,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._writer.write(*args, with_tail=with_tail, pretty_print=pretty_print, method=method)
  *         data = self._flush()
  */
-  __pyx_tuple__528 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_with_tail, __pyx_n_s_pretty_print, __pyx_n_s_method, __pyx_n_s_args, __pyx_n_s_data); if (unlikely(!__pyx_tuple__528)) __PYX_ERR(7, 1333, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__528);
-  __Pyx_GIVEREF(__pyx_tuple__528);
-  __pyx_codeobj__529 = (PyObject*)__Pyx_PyCode_New(1, 3, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__528, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__529)) __PYX_ERR(7, 1333, __pyx_L1_error)
+  __pyx_tuple__536 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_with_tail, __pyx_n_s_pretty_print, __pyx_n_s_method, __pyx_n_s_args, __pyx_n_s_data); if (unlikely(!__pyx_tuple__536)) __PYX_ERR(7, 1333, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__536);
+  __Pyx_GIVEREF(__pyx_tuple__536);
+  __pyx_codeobj__537 = (PyObject*)__Pyx_PyCode_New(1, 3, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__536, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__537)) __PYX_ERR(7, 1333, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1339
  *             await self._async_outfile.write(data)
@@ -231953,10 +231934,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return self._writer.method(method)
  * 
  */
-  __pyx_tuple__530 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_method); if (unlikely(!__pyx_tuple__530)) __PYX_ERR(7, 1339, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__530);
-  __Pyx_GIVEREF(__pyx_tuple__530);
-  __pyx_codeobj__531 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__530, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_method, 1339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__531)) __PYX_ERR(7, 1339, __pyx_L1_error)
+  __pyx_tuple__538 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_method); if (unlikely(!__pyx_tuple__538)) __PYX_ERR(7, 1339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__538);
+  __Pyx_GIVEREF(__pyx_tuple__538);
+  __pyx_codeobj__539 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__538, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_method, 1339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__539)) __PYX_ERR(7, 1339, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1342
  *         return self._writer.method(method)
@@ -231965,10 +231946,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         element_writer = self._writer.element(tag, attrib, nsmap, method, **_extra)
  *         return _AsyncFileWriterElement(element_writer, self)
  */
-  __pyx_tuple__532 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_method, __pyx_n_s_extra, __pyx_n_s_element_writer); if (unlikely(!__pyx_tuple__532)) __PYX_ERR(7, 1342, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__532);
-  __Pyx_GIVEREF(__pyx_tuple__532);
-  __pyx_codeobj__533 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__532, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_element, 1342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__533)) __PYX_ERR(7, 1342, __pyx_L1_error)
+  __pyx_tuple__540 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_method, __pyx_n_s_extra, __pyx_n_s_element_writer); if (unlikely(!__pyx_tuple__540)) __PYX_ERR(7, 1342, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__540);
+  __Pyx_GIVEREF(__pyx_tuple__540);
+  __pyx_codeobj__541 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__540, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_element, 1342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__541)) __PYX_ERR(7, 1342, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1346
  *         return _AsyncFileWriterElement(element_writer, self)
@@ -231977,10 +231958,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._writer._close(raise_on_error)
  *         data = self._buffer.collect()
  */
-  __pyx_tuple__534 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_raise_on_error, __pyx_n_s_raise_on_error, __pyx_n_s_data); if (unlikely(!__pyx_tuple__534)) __PYX_ERR(7, 1346, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__534);
-  __Pyx_GIVEREF(__pyx_tuple__534);
-  __pyx_codeobj__535 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__534, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_close_2, 1346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__535)) __PYX_ERR(7, 1346, __pyx_L1_error)
+  __pyx_tuple__542 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_raise_on_error, __pyx_n_s_raise_on_error, __pyx_n_s_data); if (unlikely(!__pyx_tuple__542)) __PYX_ERR(7, 1346, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__542);
+  __Pyx_GIVEREF(__pyx_tuple__542);
+  __pyx_codeobj__543 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__542, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_close_2, 1346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__543)) __PYX_ERR(7, 1346, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1366
  *         self._writer = writer
@@ -231989,10 +231970,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._element_writer.__enter__()
  *         data = self._writer._flush()
  */
-  __pyx_tuple__536 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__536)) __PYX_ERR(7, 1366, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__536);
-  __Pyx_GIVEREF(__pyx_tuple__536);
-  __pyx_codeobj__537 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__536, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 1366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__537)) __PYX_ERR(7, 1366, __pyx_L1_error)
+  __pyx_tuple__544 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__544)) __PYX_ERR(7, 1366, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__544);
+  __Pyx_GIVEREF(__pyx_tuple__544);
+  __pyx_codeobj__545 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__544, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 1366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__545)) __PYX_ERR(7, 1366, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1372
  *             await self._writer._async_outfile.write(data)
@@ -232001,10 +231982,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._element_writer.__exit__(*args)
  *         data = self._writer._flush()
  */
-  __pyx_tuple__538 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_data); if (unlikely(!__pyx_tuple__538)) __PYX_ERR(7, 1372, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__538);
-  __Pyx_GIVEREF(__pyx_tuple__538);
-  __pyx_codeobj__539 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__538, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 1372, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__539)) __PYX_ERR(7, 1372, __pyx_L1_error)
+  __pyx_tuple__546 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_data); if (unlikely(!__pyx_tuple__546)) __PYX_ERR(7, 1372, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__546);
+  __Pyx_GIVEREF(__pyx_tuple__546);
+  __pyx_codeobj__547 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__546, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 1372, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__547)) __PYX_ERR(7, 1372, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1394
  *         self._old_method = writer._method
@@ -232013,10 +231994,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._writer._method = self._new_method
  *         self._writer._write_start_element(self._element)
  */
-  __pyx_tuple__540 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__540)) __PYX_ERR(7, 1394, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__540);
-  __Pyx_GIVEREF(__pyx_tuple__540);
-  __pyx_codeobj__541 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__540, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 1394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__541)) __PYX_ERR(7, 1394, __pyx_L1_error)
+  __pyx_tuple__548 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__548)) __PYX_ERR(7, 1394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__548);
+  __Pyx_GIVEREF(__pyx_tuple__548);
+  __pyx_codeobj__549 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__548, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 1394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__549)) __PYX_ERR(7, 1394, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1398
  *         self._writer._write_start_element(self._element)
@@ -232025,10 +232006,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._writer._write_end_element(self._element)
  *         self._writer._method = self._old_method
  */
-  __pyx_tuple__542 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__542)) __PYX_ERR(7, 1398, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__542);
-  __Pyx_GIVEREF(__pyx_tuple__542);
-  __pyx_codeobj__543 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__542, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 1398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__543)) __PYX_ERR(7, 1398, __pyx_L1_error)
+  __pyx_tuple__550 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__550)) __PYX_ERR(7, 1398, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__550);
+  __Pyx_GIVEREF(__pyx_tuple__550);
+  __pyx_codeobj__551 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__550, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 1398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__551)) __PYX_ERR(7, 1398, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1420
  *         self._exited = False
@@ -232037,10 +232018,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self._entered:
  *             raise LxmlSyntaxError("Inconsistent enter action in context manager")
  */
-  __pyx_tuple__544 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__544)) __PYX_ERR(7, 1420, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__544);
-  __Pyx_GIVEREF(__pyx_tuple__544);
-  __pyx_codeobj__545 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__544, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 1420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__545)) __PYX_ERR(7, 1420, __pyx_L1_error)
+  __pyx_tuple__552 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__552)) __PYX_ERR(7, 1420, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__552);
+  __Pyx_GIVEREF(__pyx_tuple__552);
+  __pyx_codeobj__553 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__552, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 1420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__553)) __PYX_ERR(7, 1420, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1426
  *         self._entered = True
@@ -232049,10 +232030,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self._exited:
  *             raise LxmlSyntaxError("Inconsistent exit action in context manager")
  */
-  __pyx_tuple__546 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__546)) __PYX_ERR(7, 1426, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__546);
-  __Pyx_GIVEREF(__pyx_tuple__546);
-  __pyx_codeobj__547 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__546, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 1426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__547)) __PYX_ERR(7, 1426, __pyx_L1_error)
+  __pyx_tuple__554 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__554)) __PYX_ERR(7, 1426, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__554);
+  __Pyx_GIVEREF(__pyx_tuple__554);
+  __pyx_codeobj__555 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__554, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 1426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__555)) __PYX_ERR(7, 1426, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1434
  *         self._exited = True
@@ -232061,10 +232042,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         # for your async convenience
  *         return self.__enter__()
  */
-  __pyx_tuple__548 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__548)) __PYX_ERR(7, 1434, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__548);
-  __Pyx_GIVEREF(__pyx_tuple__548);
-  __pyx_codeobj__549 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__548, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 1434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__549)) __PYX_ERR(7, 1434, __pyx_L1_error)
+  __pyx_tuple__556 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__556)) __PYX_ERR(7, 1434, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__556);
+  __Pyx_GIVEREF(__pyx_tuple__556);
+  __pyx_codeobj__557 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__556, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 1434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__557)) __PYX_ERR(7, 1434, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1438
  *         return self.__enter__()
@@ -232073,10 +232054,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         # for your async convenience
  *         return self.__exit__(*args)
  */
-  __pyx_tuple__550 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__550)) __PYX_ERR(7, 1438, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__550);
-  __Pyx_GIVEREF(__pyx_tuple__550);
-  __pyx_codeobj__551 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__550, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 1438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__551)) __PYX_ERR(7, 1438, __pyx_L1_error)
+  __pyx_tuple__558 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__558)) __PYX_ERR(7, 1438, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__558);
+  __Pyx_GIVEREF(__pyx_tuple__558);
+  __pyx_codeobj__559 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__558, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 1438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__559)) __PYX_ERR(7, 1438, __pyx_L1_error)
 
   /* "src/lxml/iterparse.pxi":147
  *             return self._parser.version
@@ -232085,10 +232066,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""set_element_class_lookup(self, lookup = None)
  * 
  */
-  __pyx_tuple__552 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__552)) __PYX_ERR(13, 147, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__552);
-  __Pyx_GIVEREF(__pyx_tuple__552);
-  __pyx_codeobj__553 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__552, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_iterparse_pxi, __pyx_n_s_set_element_class_lookup, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__553)) __PYX_ERR(13, 147, __pyx_L1_error)
+  __pyx_tuple__560 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__560)) __PYX_ERR(13, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__560);
+  __Pyx_GIVEREF(__pyx_tuple__560);
+  __pyx_codeobj__561 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__560, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_iterparse_pxi, __pyx_n_s_set_element_class_lookup, 147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__561)) __PYX_ERR(13, 147, __pyx_L1_error)
 
   /* "src/lxml/iterparse.pxi":156
  *         self._parser.set_element_class_lookup(lookup)
@@ -232097,10 +232078,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""makeelement(self, _tag, attrib=None, nsmap=None, **_extra)
  * 
  */
-  __pyx_tuple__554 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__554)) __PYX_ERR(13, 156, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__554);
-  __Pyx_GIVEREF(__pyx_tuple__554);
-  __pyx_codeobj__555 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__554, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_iterparse_pxi, __pyx_n_s_makeelement, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__555)) __PYX_ERR(13, 156, __pyx_L1_error)
+  __pyx_tuple__562 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__562)) __PYX_ERR(13, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__562);
+  __Pyx_GIVEREF(__pyx_tuple__562);
+  __pyx_codeobj__563 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__562, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_iterparse_pxi, __pyx_n_s_makeelement, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__563)) __PYX_ERR(13, 156, __pyx_L1_error)
 
   /* "src/lxml/iterparse.pxi":334
  *         return self._pop_event(0)
@@ -232109,10 +232090,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """Prevent descending into the current subtree.
  *         Instead, the next returned event will be the 'end' event of the current element
  */
-  __pyx_tuple__556 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__556)) __PYX_ERR(13, 334, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__556);
-  __Pyx_GIVEREF(__pyx_tuple__556);
-  __pyx_codeobj__557 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__556, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_iterparse_pxi, __pyx_n_s_skip_subtree, 334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__557)) __PYX_ERR(13, 334, __pyx_L1_error)
+  __pyx_tuple__564 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__564)) __PYX_ERR(13, 334, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__564);
+  __Pyx_GIVEREF(__pyx_tuple__564);
+  __pyx_codeobj__565 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__564, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_iterparse_pxi, __pyx_n_s_skip_subtree, 334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__565)) __PYX_ERR(13, 334, __pyx_L1_error)
 
   /* "src/lxml/xmlid.pxi":3
  * cdef object _find_id_attributes
@@ -232121,13 +232102,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""XMLID(text, parser=None, base_url=None)
  * 
  */
-  __pyx_tuple__558 = PyTuple_Pack(6, __pyx_n_s_text, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_dic, __pyx_n_s_root, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__558)) __PYX_ERR(14, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__558);
-  __Pyx_GIVEREF(__pyx_tuple__558);
-  __pyx_codeobj__559 = (PyObject*)__Pyx_PyCode_New(2, 1, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__558, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_XMLID, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__559)) __PYX_ERR(14, 3, __pyx_L1_error)
-  __pyx_tuple__560 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__560)) __PYX_ERR(14, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__560);
-  __Pyx_GIVEREF(__pyx_tuple__560);
+  __pyx_tuple__566 = PyTuple_Pack(6, __pyx_n_s_text, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_dic, __pyx_n_s_root, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__566)) __PYX_ERR(14, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__566);
+  __Pyx_GIVEREF(__pyx_tuple__566);
+  __pyx_codeobj__567 = (PyObject*)__Pyx_PyCode_New(2, 1, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__566, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_XMLID, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__567)) __PYX_ERR(14, 3, __pyx_L1_error)
+  __pyx_tuple__568 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__568)) __PYX_ERR(14, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__568);
+  __Pyx_GIVEREF(__pyx_tuple__568);
 
   /* "src/lxml/xmlid.pxi":24
  *     return (root, dic)
@@ -232136,13 +232117,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""XMLDTDID(text, parser=None, base_url=None)
  * 
  */
-  __pyx_tuple__561 = PyTuple_Pack(4, __pyx_n_s_text, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_root); if (unlikely(!__pyx_tuple__561)) __PYX_ERR(14, 24, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__561);
-  __Pyx_GIVEREF(__pyx_tuple__561);
-  __pyx_codeobj__562 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__561, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_XMLDTDID, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__562)) __PYX_ERR(14, 24, __pyx_L1_error)
-  __pyx_tuple__563 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__563)) __PYX_ERR(14, 24, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__563);
-  __Pyx_GIVEREF(__pyx_tuple__563);
+  __pyx_tuple__569 = PyTuple_Pack(4, __pyx_n_s_text, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_root); if (unlikely(!__pyx_tuple__569)) __PYX_ERR(14, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__569);
+  __Pyx_GIVEREF(__pyx_tuple__569);
+  __pyx_codeobj__570 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__569, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_XMLDTDID, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__570)) __PYX_ERR(14, 24, __pyx_L1_error)
+  __pyx_tuple__571 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__571)) __PYX_ERR(14, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__571);
+  __Pyx_GIVEREF(__pyx_tuple__571);
 
   /* "src/lxml/xmlid.pxi":44
  *         return (root, _IDDict(root))
@@ -232151,13 +232132,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""parseid(source, parser=None)
  * 
  */
-  __pyx_tuple__564 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2); if (unlikely(!__pyx_tuple__564)) __PYX_ERR(14, 44, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__564);
-  __Pyx_GIVEREF(__pyx_tuple__564);
-  __pyx_codeobj__565 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__564, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_parseid, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__565)) __PYX_ERR(14, 44, __pyx_L1_error)
-  __pyx_tuple__566 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__566)) __PYX_ERR(14, 44, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__566);
-  __Pyx_GIVEREF(__pyx_tuple__566);
+  __pyx_tuple__572 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_parser, __pyx_n_s_base_url, __pyx_n_s_doc_2); if (unlikely(!__pyx_tuple__572)) __PYX_ERR(14, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__572);
+  __Pyx_GIVEREF(__pyx_tuple__572);
+  __pyx_codeobj__573 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__572, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_parseid, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__573)) __PYX_ERR(14, 44, __pyx_L1_error)
+  __pyx_tuple__574 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__574)) __PYX_ERR(14, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__574);
+  __Pyx_GIVEREF(__pyx_tuple__574);
 
   /* "src/lxml/xmlid.pxi":78
  *         self._items = None
@@ -232166,10 +232147,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return _IDDict(self._doc)
  * 
  */
-  __pyx_tuple__567 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__567)) __PYX_ERR(14, 78, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__567);
-  __Pyx_GIVEREF(__pyx_tuple__567);
-  __pyx_codeobj__568 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__567, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_copy, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__568)) __PYX_ERR(14, 78, __pyx_L1_error)
+  __pyx_tuple__575 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__575)) __PYX_ERR(14, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__575);
+  __Pyx_GIVEREF(__pyx_tuple__575);
+  __pyx_codeobj__576 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__575, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_copy, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__576)) __PYX_ERR(14, 78, __pyx_L1_error)
 
   /* "src/lxml/xmlid.pxi":95
  *         return _elementFactory(self._doc, c_attr.parent)
@@ -232178,10 +232159,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return self[id_name]
  * 
  */
-  __pyx_tuple__569 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_id_name); if (unlikely(!__pyx_tuple__569)) __PYX_ERR(14, 95, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__569);
-  __Pyx_GIVEREF(__pyx_tuple__569);
-  __pyx_codeobj__570 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__569, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_get, 95, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__570)) __PYX_ERR(14, 95, __pyx_L1_error)
+  __pyx_tuple__577 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_id_name); if (unlikely(!__pyx_tuple__577)) __PYX_ERR(14, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__577);
+  __Pyx_GIVEREF(__pyx_tuple__577);
+  __pyx_codeobj__578 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__577, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_get, 95, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__578)) __PYX_ERR(14, 95, __pyx_L1_error)
 
   /* "src/lxml/xmlid.pxi":105
  *         return c_id is not NULL
@@ -232190,10 +232171,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return id_name in self
  * 
  */
-  __pyx_tuple__571 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_id_name); if (unlikely(!__pyx_tuple__571)) __PYX_ERR(14, 105, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__571);
-  __Pyx_GIVEREF(__pyx_tuple__571);
-  __pyx_codeobj__572 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__571, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_has_key, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__572)) __PYX_ERR(14, 105, __pyx_L1_error)
+  __pyx_tuple__579 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_id_name); if (unlikely(!__pyx_tuple__579)) __PYX_ERR(14, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__579);
+  __Pyx_GIVEREF(__pyx_tuple__579);
+  __pyx_codeobj__580 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__579, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_has_key, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__580)) __PYX_ERR(14, 105, __pyx_L1_error)
 
   /* "src/lxml/xmlid.pxi":111
  *         return repr(dict(self))
@@ -232202,10 +232183,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self._keys is None:
  *             self._keys = self._build_keys()
  */
-  __pyx_tuple__573 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__573)) __PYX_ERR(14, 111, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__573);
-  __Pyx_GIVEREF(__pyx_tuple__573);
-  __pyx_codeobj__574 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__573, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_keys, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__574)) __PYX_ERR(14, 111, __pyx_L1_error)
+  __pyx_tuple__581 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__581)) __PYX_ERR(14, 111, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__581);
+  __Pyx_GIVEREF(__pyx_tuple__581);
+  __pyx_codeobj__582 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__581, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_keys, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__582)) __PYX_ERR(14, 111, __pyx_L1_error)
 
   /* "src/lxml/xmlid.pxi":121
  *         return iter(self._keys)
@@ -232214,10 +232195,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return self
  * 
  */
-  __pyx_tuple__575 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__575)) __PYX_ERR(14, 121, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__575);
-  __Pyx_GIVEREF(__pyx_tuple__575);
-  __pyx_codeobj__576 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__575, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_iterkeys, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__576)) __PYX_ERR(14, 121, __pyx_L1_error)
+  __pyx_tuple__583 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__583)) __PYX_ERR(14, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__583);
+  __Pyx_GIVEREF(__pyx_tuple__583);
+  __pyx_codeobj__584 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__583, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_iterkeys, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__584)) __PYX_ERR(14, 121, __pyx_L1_error)
 
   /* "src/lxml/xmlid.pxi":129
  *         return len(self._keys)
@@ -232226,10 +232207,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self._items is None:
  *             self._items = self._build_items()
  */
-  __pyx_tuple__577 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__577)) __PYX_ERR(14, 129, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__577);
-  __Pyx_GIVEREF(__pyx_tuple__577);
-  __pyx_codeobj__578 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__577, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_items, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__578)) __PYX_ERR(14, 129, __pyx_L1_error)
+  __pyx_tuple__585 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__585)) __PYX_ERR(14, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__585);
+  __Pyx_GIVEREF(__pyx_tuple__585);
+  __pyx_codeobj__586 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__585, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_items, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__586)) __PYX_ERR(14, 129, __pyx_L1_error)
 
   /* "src/lxml/xmlid.pxi":134
  *         return self._items[:]
@@ -232238,10 +232219,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if self._items is None:
  *             self._items = self._build_items()
  */
-  __pyx_tuple__579 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__579)) __PYX_ERR(14, 134, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__579);
-  __Pyx_GIVEREF(__pyx_tuple__579);
-  __pyx_codeobj__580 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__579, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_iteritems, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__580)) __PYX_ERR(14, 134, __pyx_L1_error)
+  __pyx_tuple__587 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__587)) __PYX_ERR(14, 134, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__587);
+  __Pyx_GIVEREF(__pyx_tuple__587);
+  __pyx_codeobj__588 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__587, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_iteritems, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__588)) __PYX_ERR(14, 134, __pyx_L1_error)
 
   /* "src/lxml/xmlid.pxi":139
  *         return iter(self._items)
@@ -232250,10 +232231,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         cdef list values = []
  *         if self._items is None:
  */
-  __pyx_tuple__581 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_values, __pyx_n_s_item, __pyx_n_s_value); if (unlikely(!__pyx_tuple__581)) __PYX_ERR(14, 139, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__581);
-  __Pyx_GIVEREF(__pyx_tuple__581);
-  __pyx_codeobj__582 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__581, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_values, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__582)) __PYX_ERR(14, 139, __pyx_L1_error)
+  __pyx_tuple__589 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_values, __pyx_n_s_item, __pyx_n_s_value); if (unlikely(!__pyx_tuple__589)) __PYX_ERR(14, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__589);
+  __Pyx_GIVEREF(__pyx_tuple__589);
+  __pyx_codeobj__590 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__589, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_values, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__590)) __PYX_ERR(14, 139, __pyx_L1_error)
 
   /* "src/lxml/xmlid.pxi":149
  *         return values
@@ -232262,10 +232243,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return iter(self.values())
  * 
  */
-  __pyx_tuple__583 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__583)) __PYX_ERR(14, 149, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__583);
-  __Pyx_GIVEREF(__pyx_tuple__583);
-  __pyx_codeobj__584 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__583, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_itervalues, 149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__584)) __PYX_ERR(14, 149, __pyx_L1_error)
+  __pyx_tuple__591 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__591)) __PYX_ERR(14, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__591);
+  __Pyx_GIVEREF(__pyx_tuple__591);
+  __pyx_codeobj__592 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__591, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xmlid_pxi, __pyx_n_s_itervalues, 149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__592)) __PYX_ERR(14, 149, __pyx_L1_error)
 
   /* "src/lxml/cleanup.pxi":3
  * # functions for tree cleanup and removing elements from subtrees
@@ -232274,13 +232255,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""cleanup_namespaces(tree_or_element, top_nsmap=None, keep_ns_prefixes=None)
  * 
  */
-  __pyx_tuple__585 = PyTuple_Pack(7, __pyx_n_s_tree_or_element, __pyx_n_s_top_nsmap, __pyx_n_s_keep_ns_prefixes, __pyx_n_s_element, __pyx_n_s_c_element, __pyx_n_s_doc_2, __pyx_n_s_prefix); if (unlikely(!__pyx_tuple__585)) __PYX_ERR(16, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__585);
-  __Pyx_GIVEREF(__pyx_tuple__585);
-  __pyx_codeobj__586 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__585, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_cleanup_pxi, __pyx_n_s_cleanup_namespaces, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__586)) __PYX_ERR(16, 3, __pyx_L1_error)
-  __pyx_tuple__587 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__587)) __PYX_ERR(16, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__587);
-  __Pyx_GIVEREF(__pyx_tuple__587);
+  __pyx_tuple__593 = PyTuple_Pack(7, __pyx_n_s_tree_or_element, __pyx_n_s_top_nsmap, __pyx_n_s_keep_ns_prefixes, __pyx_n_s_element, __pyx_n_s_c_element, __pyx_n_s_doc_2, __pyx_n_s_prefix); if (unlikely(!__pyx_tuple__593)) __PYX_ERR(16, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__593);
+  __Pyx_GIVEREF(__pyx_tuple__593);
+  __pyx_codeobj__594 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__593, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_cleanup_pxi, __pyx_n_s_cleanup_namespaces, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__594)) __PYX_ERR(16, 3, __pyx_L1_error)
+  __pyx_tuple__595 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__595)) __PYX_ERR(16, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__595);
+  __Pyx_GIVEREF(__pyx_tuple__595);
 
   /* "src/lxml/cleanup.pxi":33
  * 
@@ -232289,10 +232270,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""strip_attributes(tree_or_element, *attribute_names)
  * 
  */
-  __pyx_tuple__588 = PyTuple_Pack(4, __pyx_n_s_tree_or_element, __pyx_n_s_attribute_names, __pyx_n_s_matcher, __pyx_n_s_element); if (unlikely(!__pyx_tuple__588)) __PYX_ERR(16, 33, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__588);
-  __Pyx_GIVEREF(__pyx_tuple__588);
-  __pyx_codeobj__589 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__588, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_cleanup_pxi, __pyx_n_s_strip_attributes, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__589)) __PYX_ERR(16, 33, __pyx_L1_error)
+  __pyx_tuple__596 = PyTuple_Pack(4, __pyx_n_s_tree_or_element, __pyx_n_s_attribute_names, __pyx_n_s_matcher, __pyx_n_s_element); if (unlikely(!__pyx_tuple__596)) __PYX_ERR(16, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__596);
+  __Pyx_GIVEREF(__pyx_tuple__596);
+  __pyx_codeobj__597 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__596, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_cleanup_pxi, __pyx_n_s_strip_attributes, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__597)) __PYX_ERR(16, 33, __pyx_L1_error)
 
   /* "src/lxml/cleanup.pxi":74
  * 
@@ -232301,10 +232282,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""strip_elements(tree_or_element, *tag_names, with_tail=True)
  * 
  */
-  __pyx_tuple__590 = PyTuple_Pack(6, __pyx_n_s_tree_or_element, __pyx_n_s_with_tail, __pyx_n_s_tag_names, __pyx_n_s_matcher, __pyx_n_s_doc_2, __pyx_n_s_element); if (unlikely(!__pyx_tuple__590)) __PYX_ERR(16, 74, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__590);
-  __Pyx_GIVEREF(__pyx_tuple__590);
-  __pyx_codeobj__591 = (PyObject*)__Pyx_PyCode_New(1, 1, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__590, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_cleanup_pxi, __pyx_n_s_strip_elements, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__591)) __PYX_ERR(16, 74, __pyx_L1_error)
+  __pyx_tuple__598 = PyTuple_Pack(6, __pyx_n_s_tree_or_element, __pyx_n_s_with_tail, __pyx_n_s_tag_names, __pyx_n_s_matcher, __pyx_n_s_doc_2, __pyx_n_s_element); if (unlikely(!__pyx_tuple__598)) __PYX_ERR(16, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__598);
+  __Pyx_GIVEREF(__pyx_tuple__598);
+  __pyx_codeobj__599 = (PyObject*)__Pyx_PyCode_New(1, 1, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__598, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_cleanup_pxi, __pyx_n_s_strip_elements, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__599)) __PYX_ERR(16, 74, __pyx_L1_error)
 
   /* "src/lxml/cleanup.pxi":145
  * 
@@ -232313,10 +232294,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""strip_tags(tree_or_element, *tag_names)
  * 
  */
-  __pyx_tuple__592 = PyTuple_Pack(5, __pyx_n_s_tree_or_element, __pyx_n_s_tag_names, __pyx_n_s_matcher, __pyx_n_s_doc_2, __pyx_n_s_element); if (unlikely(!__pyx_tuple__592)) __PYX_ERR(16, 145, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__592);
-  __Pyx_GIVEREF(__pyx_tuple__592);
-  __pyx_codeobj__593 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__592, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_cleanup_pxi, __pyx_n_s_strip_tags, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__593)) __PYX_ERR(16, 145, __pyx_L1_error)
+  __pyx_tuple__600 = PyTuple_Pack(5, __pyx_n_s_tree_or_element, __pyx_n_s_tag_names, __pyx_n_s_matcher, __pyx_n_s_doc_2, __pyx_n_s_element); if (unlikely(!__pyx_tuple__600)) __PYX_ERR(16, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__600);
+  __Pyx_GIVEREF(__pyx_tuple__600);
+  __pyx_codeobj__601 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__600, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_cleanup_pxi, __pyx_n_s_strip_tags, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__601)) __PYX_ERR(16, 145, __pyx_L1_error)
 
   /* "src/lxml/extensions.pxi":368
  * 
@@ -232325,9 +232306,9 @@ static int __Pyx_InitCachedConstants(void) {
  *     b"Number encoding",
  *     b"Unfinished literal",
  */
-  __pyx_tuple__594 = PyTuple_Pack(26, __pyx_n_b_Ok, __pyx_kp_b_Number_encoding, __pyx_kp_b_Unfinished_literal, __pyx_kp_b_Start_of_literal, __pyx_kp_b_Expected_for_variable_reference, __pyx_kp_b_Undefined_variable, __pyx_kp_b_Invalid_predicate, __pyx_kp_b_Invalid_expression, __pyx_kp_b_Missing_closing_curly_brace, __pyx_kp_b_Unregistered_function, __pyx_kp_b_Invalid_operand, __pyx_kp_b_Invalid_type, __pyx_kp_b_Invalid_number_of_arguments, __pyx_kp_b_Invalid_context_size, __pyx_kp_b_Invalid_context_position, __pyx_kp_b_Memory_allocation_error, __pyx_kp_b_Syntax_error, __pyx_kp_b_Resource_error, __pyx_kp_b_Sub_resource_error, __pyx_kp_b_Undefined_namespace_prefix, __pyx_kp_b_Encoding_error, __pyx_kp_b_Char_out_of_XML_range, __pyx_kp_b_Invalid_or_incomplete_context, __pyx_kp_b_Stack_usage_error, __pyx_kp_b_Forbidden_variable, __pyx_kp_b_Unknown_error); if (unlikely(!__pyx_tuple__594)) __PYX_ERR(17, 368, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__594);
-  __Pyx_GIVEREF(__pyx_tuple__594);
+  __pyx_tuple__602 = PyTuple_Pack(26, __pyx_n_b_Ok, __pyx_kp_b_Number_encoding, __pyx_kp_b_Unfinished_literal, __pyx_kp_b_Start_of_literal, __pyx_kp_b_Expected_for_variable_reference, __pyx_kp_b_Undefined_variable, __pyx_kp_b_Invalid_predicate, __pyx_kp_b_Invalid_expression, __pyx_kp_b_Missing_closing_curly_brace, __pyx_kp_b_Unregistered_function, __pyx_kp_b_Invalid_operand, __pyx_kp_b_Invalid_type, __pyx_kp_b_Invalid_number_of_arguments, __pyx_kp_b_Invalid_context_size, __pyx_kp_b_Invalid_context_position, __pyx_kp_b_Memory_allocation_error, __pyx_kp_b_Syntax_error, __pyx_kp_b_Resource_error, __pyx_kp_b_Sub_resource_error, __pyx_kp_b_Undefined_namespace_prefix, __pyx_kp_b_Encoding_error, __pyx_kp_b_Char_out_of_XML_range, __pyx_kp_b_Invalid_or_incomplete_context, __pyx_kp_b_Stack_usage_error, __pyx_kp_b_Forbidden_variable, __pyx_kp_b_Unknown_error); if (unlikely(!__pyx_tuple__602)) __PYX_ERR(17, 368, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__602);
+  __Pyx_GIVEREF(__pyx_tuple__602);
 
   /* "src/lxml/extensions.pxi":426
  * 
@@ -232336,13 +232317,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""Extension(module, function_mapping=None, ns=None)
  * 
  */
-  __pyx_tuple__595 = PyTuple_Pack(7, __pyx_n_s_module, __pyx_n_s_function_mapping, __pyx_n_s_ns, __pyx_n_s_functions, __pyx_n_s_function_name, __pyx_n_s_xpath_name, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__595)) __PYX_ERR(17, 426, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__595);
-  __Pyx_GIVEREF(__pyx_tuple__595);
-  __pyx_codeobj__596 = (PyObject*)__Pyx_PyCode_New(2, 1, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__595, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_Extension, 426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__596)) __PYX_ERR(17, 426, __pyx_L1_error)
-  __pyx_tuple__597 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__597)) __PYX_ERR(17, 426, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__597);
-  __Pyx_GIVEREF(__pyx_tuple__597);
+  __pyx_tuple__603 = PyTuple_Pack(7, __pyx_n_s_module, __pyx_n_s_function_mapping, __pyx_n_s_ns, __pyx_n_s_functions, __pyx_n_s_function_name, __pyx_n_s_xpath_name, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__603)) __PYX_ERR(17, 426, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__603);
+  __Pyx_GIVEREF(__pyx_tuple__603);
+  __pyx_codeobj__604 = (PyObject*)__Pyx_PyCode_New(2, 1, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__603, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_Extension, 426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__604)) __PYX_ERR(17, 426, __pyx_L1_error)
+  __pyx_tuple__605 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__605)) __PYX_ERR(17, 426, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__605);
+  __Pyx_GIVEREF(__pyx_tuple__605);
 
   /* "src/lxml/extensions.pxi":498
  *         return rexp_compiled
@@ -232351,10 +232332,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         flags = self._make_string(flags)
  *         s = self._make_string(s)
  */
-  __pyx_tuple__598 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_ctxt, __pyx_n_s_s_6, __pyx_n_s_rexp, __pyx_n_s_flags, __pyx_n_s_rexpc); if (unlikely(!__pyx_tuple__598)) __PYX_ERR(17, 498, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__598);
-  __Pyx_GIVEREF(__pyx_tuple__598);
-  __pyx_codeobj__599 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__598, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_test, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__599)) __PYX_ERR(17, 498, __pyx_L1_error)
+  __pyx_tuple__606 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_ctxt, __pyx_n_s_s_6, __pyx_n_s_rexp, __pyx_n_s_flags, __pyx_n_s_rexpc); if (unlikely(!__pyx_tuple__606)) __PYX_ERR(17, 498, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__606);
+  __Pyx_GIVEREF(__pyx_tuple__606);
+  __pyx_codeobj__607 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__606, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_test, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__607)) __PYX_ERR(17, 498, __pyx_L1_error)
 
   /* "src/lxml/extensions.pxi":507
  *             return True
@@ -232363,10 +232344,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         cdef list result_list
  *         flags = self._make_string(flags)
  */
-  __pyx_tuple__600 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_ctxt, __pyx_n_s_s_6, __pyx_n_s_rexp, __pyx_n_s_flags, __pyx_n_s_result_list, __pyx_n_s_rexpc, __pyx_n_s_results, __pyx_n_s_result, __pyx_n_s_root, __pyx_n_s_join_groups, __pyx_n_s_s_match, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__600)) __PYX_ERR(17, 507, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__600);
-  __Pyx_GIVEREF(__pyx_tuple__600);
-  __pyx_codeobj__601 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__600, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_match, 507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__601)) __PYX_ERR(17, 507, __pyx_L1_error)
+  __pyx_tuple__608 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_ctxt, __pyx_n_s_s_6, __pyx_n_s_rexp, __pyx_n_s_flags, __pyx_n_s_result_list, __pyx_n_s_rexpc, __pyx_n_s_results, __pyx_n_s_result, __pyx_n_s_root, __pyx_n_s_join_groups, __pyx_n_s_s_match, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__608)) __PYX_ERR(17, 507, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__608);
+  __Pyx_GIVEREF(__pyx_tuple__608);
+  __pyx_codeobj__609 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__608, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_match, 507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__609)) __PYX_ERR(17, 507, __pyx_L1_error)
 
   /* "src/lxml/extensions.pxi":533
  *         return result_list
@@ -232375,10 +232356,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         replacement = self._make_string(replacement)
  *         flags = self._make_string(flags)
  */
-  __pyx_tuple__602 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_ctxt, __pyx_n_s_s_6, __pyx_n_s_rexp, __pyx_n_s_flags, __pyx_n_s_replacement, __pyx_n_s_rexpc, __pyx_n_s_count); if (unlikely(!__pyx_tuple__602)) __PYX_ERR(17, 533, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__602);
-  __Pyx_GIVEREF(__pyx_tuple__602);
-  __pyx_codeobj__603 = (PyObject*)__Pyx_PyCode_New(6, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__602, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_replace, 533, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__603)) __PYX_ERR(17, 533, __pyx_L1_error)
+  __pyx_tuple__610 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_ctxt, __pyx_n_s_s_6, __pyx_n_s_rexp, __pyx_n_s_flags, __pyx_n_s_replacement, __pyx_n_s_rexpc, __pyx_n_s_count); if (unlikely(!__pyx_tuple__610)) __PYX_ERR(17, 533, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__610);
+  __Pyx_GIVEREF(__pyx_tuple__610);
+  __pyx_codeobj__611 = (PyObject*)__Pyx_PyCode_New(6, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__610, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_replace, 533, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__611)) __PYX_ERR(17, 533, __pyx_L1_error)
 
   /* "src/lxml/extensions.pxi":731
  *     cdef readonly bint is_attribute
@@ -232387,10 +232368,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return self._parent
  * 
  */
-  __pyx_tuple__604 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__604)) __PYX_ERR(17, 731, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__604);
-  __Pyx_GIVEREF(__pyx_tuple__604);
-  __pyx_codeobj__605 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__604, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_getparent, 731, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__605)) __PYX_ERR(17, 731, __pyx_L1_error)
+  __pyx_tuple__612 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__612)) __PYX_ERR(17, 731, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__612);
+  __Pyx_GIVEREF(__pyx_tuple__612);
+  __pyx_codeobj__613 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__612, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_getparent, 731, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__613)) __PYX_ERR(17, 731, __pyx_L1_error)
 
   /* "src/lxml/extensions.pxi":739
  *         # we need to use a Python class here, or PyPy will crash on creation
@@ -232399,10 +232380,10 @@ static int __Pyx_InitCachedConstants(void) {
  *             return self._parent
  * 
  */
-  __pyx_tuple__606 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__606)) __PYX_ERR(17, 739, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__606);
-  __Pyx_GIVEREF(__pyx_tuple__606);
-  __pyx_codeobj__607 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__606, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_getparent, 739, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__607)) __PYX_ERR(17, 739, __pyx_L1_error)
+  __pyx_tuple__614 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__614)) __PYX_ERR(17, 739, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__614);
+  __Pyx_GIVEREF(__pyx_tuple__614);
+  __pyx_codeobj__615 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__614, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_getparent, 739, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__615)) __PYX_ERR(17, 739, __pyx_L1_error)
 
   /* "src/lxml/extensions.pxi":745
  *     # we need to use a Python class here, bytes cannot be C-subclassed
@@ -232411,10 +232392,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return self._parent
  * 
  */
-  __pyx_tuple__608 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__608)) __PYX_ERR(17, 745, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__608);
-  __Pyx_GIVEREF(__pyx_tuple__608);
-  __pyx_codeobj__609 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__608, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_getparent, 745, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__609)) __PYX_ERR(17, 745, __pyx_L1_error)
+  __pyx_tuple__616 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__616)) __PYX_ERR(17, 745, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__616);
+  __Pyx_GIVEREF(__pyx_tuple__616);
+  __pyx_codeobj__617 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__616, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_extensions_pxi, __pyx_n_s_getparent, 745, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__617)) __PYX_ERR(17, 745, __pyx_L1_error)
 
   /* "src/lxml/xpath.pxi":152
  *         self._context.set_context(xpathCtxt)
@@ -232423,10 +232404,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""evaluate(self, _eval_arg, **_variables)
  * 
  */
-  __pyx_tuple__610 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_eval_arg, __pyx_n_s_variables_2); if (unlikely(!__pyx_tuple__610)) __PYX_ERR(18, 152, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__610);
-  __Pyx_GIVEREF(__pyx_tuple__610);
-  __pyx_codeobj__611 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__610, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xpath_pxi, __pyx_n_s_evaluate, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__611)) __PYX_ERR(18, 152, __pyx_L1_error)
+  __pyx_tuple__618 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_eval_arg, __pyx_n_s_variables_2); if (unlikely(!__pyx_tuple__618)) __PYX_ERR(18, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__618);
+  __Pyx_GIVEREF(__pyx_tuple__618);
+  __pyx_codeobj__619 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__618, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xpath_pxi, __pyx_n_s_evaluate, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__619)) __PYX_ERR(18, 152, __pyx_L1_error)
 
   /* "src/lxml/xpath.pxi":268
  *         self.set_context(xpathCtxt)
@@ -232435,10 +232416,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Register a namespace with the XPath context.
  *         """
  */
-  __pyx_tuple__612 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_prefix, __pyx_n_s_uri); if (unlikely(!__pyx_tuple__612)) __PYX_ERR(18, 268, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__612);
-  __Pyx_GIVEREF(__pyx_tuple__612);
-  __pyx_codeobj__613 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__612, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xpath_pxi, __pyx_n_s_register_namespace, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__613)) __PYX_ERR(18, 268, __pyx_L1_error)
+  __pyx_tuple__620 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_prefix, __pyx_n_s_uri); if (unlikely(!__pyx_tuple__620)) __PYX_ERR(18, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__620);
+  __Pyx_GIVEREF(__pyx_tuple__620);
+  __pyx_codeobj__621 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__620, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xpath_pxi, __pyx_n_s_register_namespace, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__621)) __PYX_ERR(18, 268, __pyx_L1_error)
 
   /* "src/lxml/xpath.pxi":274
  *         self._context.addNamespace(prefix, uri)
@@ -232447,10 +232428,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Register a prefix -> uri dict.
  *         """
  */
-  __pyx_tuple__614 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_namespaces, __pyx_n_s_prefix, __pyx_n_s_uri); if (unlikely(!__pyx_tuple__614)) __PYX_ERR(18, 274, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__614);
-  __Pyx_GIVEREF(__pyx_tuple__614);
-  __pyx_codeobj__615 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__614, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xpath_pxi, __pyx_n_s_register_namespaces, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__615)) __PYX_ERR(18, 274, __pyx_L1_error)
+  __pyx_tuple__622 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_namespaces, __pyx_n_s_prefix, __pyx_n_s_uri); if (unlikely(!__pyx_tuple__622)) __PYX_ERR(18, 274, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__622);
+  __Pyx_GIVEREF(__pyx_tuple__622);
+  __pyx_codeobj__623 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__622, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xpath_pxi, __pyx_n_s_register_namespaces, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__623)) __PYX_ERR(18, 274, __pyx_L1_error)
 
   /* "src/lxml/xpath.pxi":369
  * 
@@ -232459,10 +232440,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                    regexp=True, smart_strings=True):
  *     u"""XPathEvaluator(etree_or_element, namespaces=None, extensions=None, regexp=True, smart_strings=True)
  */
-  __pyx_tuple__616 = PyTuple_Pack(5, __pyx_n_s_etree_or_element, __pyx_n_s_namespaces, __pyx_n_s_extensions, __pyx_n_s_regexp, __pyx_n_s_smart_strings); if (unlikely(!__pyx_tuple__616)) __PYX_ERR(18, 369, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__616);
-  __Pyx_GIVEREF(__pyx_tuple__616);
-  __pyx_codeobj__617 = (PyObject*)__Pyx_PyCode_New(1, 4, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__616, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xpath_pxi, __pyx_n_s_XPathEvaluator, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__617)) __PYX_ERR(18, 369, __pyx_L1_error)
+  __pyx_tuple__624 = PyTuple_Pack(5, __pyx_n_s_etree_or_element, __pyx_n_s_namespaces, __pyx_n_s_extensions, __pyx_n_s_regexp, __pyx_n_s_smart_strings); if (unlikely(!__pyx_tuple__624)) __PYX_ERR(18, 369, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__624);
+  __Pyx_GIVEREF(__pyx_tuple__624);
+  __pyx_codeobj__625 = (PyObject*)__Pyx_PyCode_New(1, 4, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__624, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xpath_pxi, __pyx_n_s_XPathEvaluator, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__625)) __PYX_ERR(18, 369, __pyx_L1_error)
 
   /* "src/lxml/xpath.pxi":467
  * cdef object _replace_strings
@@ -232471,9 +232452,9 @@ static int __Pyx_InitCachedConstants(void) {
  * _find_namespaces = re.compile(b'({[^}]+})').findall
  * 
  */
-  __pyx_tuple__619 = PyTuple_Pack(1, __pyx_kp_b__618); if (unlikely(!__pyx_tuple__619)) __PYX_ERR(18, 467, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__619);
-  __Pyx_GIVEREF(__pyx_tuple__619);
+  __pyx_tuple__627 = PyTuple_Pack(1, __pyx_kp_b__626); if (unlikely(!__pyx_tuple__627)) __PYX_ERR(18, 467, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__627);
+  __Pyx_GIVEREF(__pyx_tuple__627);
 
   /* "src/lxml/xpath.pxi":468
  * cdef object _find_namespaces
@@ -232482,9 +232463,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  * cdef class ETXPath(XPath):
  */
-  __pyx_tuple__621 = PyTuple_Pack(1, __pyx_kp_b__620); if (unlikely(!__pyx_tuple__621)) __PYX_ERR(18, 468, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__621);
-  __Pyx_GIVEREF(__pyx_tuple__621);
+  __pyx_tuple__629 = PyTuple_Pack(1, __pyx_kp_b__628); if (unlikely(!__pyx_tuple__629)) __PYX_ERR(18, 468, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__629);
+  __Pyx_GIVEREF(__pyx_tuple__629);
 
   /* "src/lxml/xslt.pxi":432
  * 
@@ -232493,10 +232474,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""strparam(strval)
  * 
  */
-  __pyx_tuple__622 = PyTuple_Pack(1, __pyx_n_s_strval); if (unlikely(!__pyx_tuple__622)) __PYX_ERR(3, 432, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__622);
-  __Pyx_GIVEREF(__pyx_tuple__622);
-  __pyx_codeobj__623 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__622, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_strparam, 432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__623)) __PYX_ERR(3, 432, __pyx_L1_error)
+  __pyx_tuple__630 = PyTuple_Pack(1, __pyx_n_s_strval); if (unlikely(!__pyx_tuple__630)) __PYX_ERR(3, 432, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__630);
+  __Pyx_GIVEREF(__pyx_tuple__630);
+  __pyx_codeobj__631 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__630, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_strparam, 432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__631)) __PYX_ERR(3, 432, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":446
  * 
@@ -232505,10 +232486,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""set_global_max_depth(max_depth)
  * 
  */
-  __pyx_tuple__624 = PyTuple_Pack(1, __pyx_n_s_max_depth); if (unlikely(!__pyx_tuple__624)) __PYX_ERR(3, 446, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__624);
-  __Pyx_GIVEREF(__pyx_tuple__624);
-  __pyx_codeobj__625 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__624, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_set_global_max_depth, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__625)) __PYX_ERR(3, 446, __pyx_L1_error)
+  __pyx_tuple__632 = PyTuple_Pack(1, __pyx_n_s_max_depth); if (unlikely(!__pyx_tuple__632)) __PYX_ERR(3, 446, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__632);
+  __Pyx_GIVEREF(__pyx_tuple__632);
+  __pyx_codeobj__633 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__632, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_set_global_max_depth, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__633)) __PYX_ERR(3, 446, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":465
  *         xslt.xsltMaxDepth = max_depth
@@ -232517,10 +232498,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""apply(self, _input,  profile_run=False, **kw)
  * 
  */
-  __pyx_tuple__626 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_input, __pyx_n_s_profile_run, __pyx_n_s_kw_2); if (unlikely(!__pyx_tuple__626)) __PYX_ERR(3, 465, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__626);
-  __Pyx_GIVEREF(__pyx_tuple__626);
-  __pyx_codeobj__627 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__626, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_apply, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__627)) __PYX_ERR(3, 465, __pyx_L1_error)
+  __pyx_tuple__634 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_input, __pyx_n_s_profile_run, __pyx_n_s_kw_2); if (unlikely(!__pyx_tuple__634)) __PYX_ERR(3, 465, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__634);
+  __Pyx_GIVEREF(__pyx_tuple__634);
+  __pyx_codeobj__635 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__634, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_apply, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__635)) __PYX_ERR(3, 465, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":471
  *         return self(_input, profile_run=profile_run, **kw)
@@ -232529,10 +232510,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""tostring(self, result_tree)
  * 
  */
-  __pyx_tuple__628 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result_tree); if (unlikely(!__pyx_tuple__628)) __PYX_ERR(3, 471, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__628);
-  __Pyx_GIVEREF(__pyx_tuple__628);
-  __pyx_codeobj__629 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__628, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_tostring, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__629)) __PYX_ERR(3, 471, __pyx_L1_error)
+  __pyx_tuple__636 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result_tree); if (unlikely(!__pyx_tuple__636)) __PYX_ERR(3, 471, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__636);
+  __Pyx_GIVEREF(__pyx_tuple__636);
+  __pyx_codeobj__637 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__636, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_tostring, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__637)) __PYX_ERR(3, 471, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":480
  *         return str(result_tree)
@@ -232541,10 +232522,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return self.__copy__()
  * 
  */
-  __pyx_tuple__630 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__630)) __PYX_ERR(3, 480, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__630);
-  __Pyx_GIVEREF(__pyx_tuple__630);
-  __pyx_codeobj__631 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__630, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_deepcopy, 480, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__631)) __PYX_ERR(3, 480, __pyx_L1_error)
+  __pyx_tuple__638 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__638)) __PYX_ERR(3, 480, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__638);
+  __Pyx_GIVEREF(__pyx_tuple__638);
+  __pyx_codeobj__639 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__638, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_deepcopy, 480, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__639)) __PYX_ERR(3, 480, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":483
  *         return self.__copy__()
@@ -232553,10 +232534,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return _copyXSLT(self)
  * 
  */
-  __pyx_tuple__632 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__632)) __PYX_ERR(3, 483, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__632);
-  __Pyx_GIVEREF(__pyx_tuple__632);
-  __pyx_codeobj__633 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__632, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_copy_2, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__633)) __PYX_ERR(3, 483, __pyx_L1_error)
+  __pyx_tuple__640 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__640)) __PYX_ERR(3, 483, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__640);
+  __Pyx_GIVEREF(__pyx_tuple__640);
+  __pyx_codeobj__641 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__640, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_copy_2, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__641)) __PYX_ERR(3, 483, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":708
  *     cdef Py_ssize_t _buffer_refcnt
@@ -232565,10 +232546,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """write_output(self, file, *, compression=0)
  * 
  */
-  __pyx_tuple__634 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_file, __pyx_n_s_compression, __pyx_n_s_writer, __pyx_n_s_doc_2, __pyx_n_s_r, __pyx_n_s_c_compression, __pyx_n_s_c_encoding, __pyx_n_s_c_buffer, __pyx_n_s_file_path, __pyx_n_s_c_filename); if (unlikely(!__pyx_tuple__634)) __PYX_ERR(3, 708, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__634);
-  __Pyx_GIVEREF(__pyx_tuple__634);
-  __pyx_codeobj__635 = (PyObject*)__Pyx_PyCode_New(2, 1, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__634, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_write_output, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__635)) __PYX_ERR(3, 708, __pyx_L1_error)
+  __pyx_tuple__642 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_file, __pyx_n_s_compression, __pyx_n_s_writer, __pyx_n_s_doc_2, __pyx_n_s_r, __pyx_n_s_c_compression, __pyx_n_s_c_encoding, __pyx_n_s_c_buffer, __pyx_n_s_file_path, __pyx_n_s_c_filename); if (unlikely(!__pyx_tuple__642)) __PYX_ERR(3, 708, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__642);
+  __Pyx_GIVEREF(__pyx_tuple__642);
+  __pyx_codeobj__643 = (PyObject*)__Pyx_PyCode_New(2, 1, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__642, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_write_output, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__643)) __PYX_ERR(3, 708, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":783
  *         return result
@@ -232577,10 +232558,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         cdef xmlChar* encoding
  *         cdef xmlChar* s = NULL
  */
-  __pyx_tuple__636 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_encoding, __pyx_n_s_s_6, __pyx_n_s_l, __pyx_n_s_result); if (unlikely(!__pyx_tuple__636)) __PYX_ERR(3, 783, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__636);
-  __Pyx_GIVEREF(__pyx_tuple__636);
-  __pyx_codeobj__637 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__636, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_unicode_2, 783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__637)) __PYX_ERR(3, 783, __pyx_L1_error)
+  __pyx_tuple__644 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_encoding, __pyx_n_s_s_6, __pyx_n_s_l, __pyx_n_s_result); if (unlikely(!__pyx_tuple__644)) __PYX_ERR(3, 783, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__644);
+  __Pyx_GIVEREF(__pyx_tuple__644);
+  __pyx_codeobj__645 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__644, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_unicode_2, 783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__645)) __PYX_ERR(3, 783, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":877
  * # XSLT PI support
@@ -232589,9 +232570,9 @@ static int __Pyx_InitCachedConstants(void) {
  * cdef object _FIND_PI_HREF = _RE_PI_HREF.findall
  * cdef object _REPLACE_PI_HREF = _RE_PI_HREF.sub
  */
-  __pyx_tuple__638 = PyTuple_Pack(1, __pyx_kp_u_s_href_s_s); if (unlikely(!__pyx_tuple__638)) __PYX_ERR(3, 877, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__638);
-  __Pyx_GIVEREF(__pyx_tuple__638);
+  __pyx_tuple__646 = PyTuple_Pack(1, __pyx_kp_u_s_href_s_s); if (unlikely(!__pyx_tuple__646)) __PYX_ERR(3, 877, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__646);
+  __Pyx_GIVEREF(__pyx_tuple__646);
 
   /* "src/lxml/xslt.pxi":891
  * 
@@ -232600,10 +232581,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""parseXSL(self, parser=None)
  * 
  */
-  __pyx_tuple__639 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_parser, __pyx_n_s_result_doc, __pyx_n_s_result_node, __pyx_n_s_href_utf, __pyx_n_s_c_href, __pyx_n_s_c_attr, __pyx_n_s_hrefs, __pyx_n_s_root); if (unlikely(!__pyx_tuple__639)) __PYX_ERR(3, 891, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__639);
-  __Pyx_GIVEREF(__pyx_tuple__639);
-  __pyx_codeobj__640 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__639, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_parseXSL, 891, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__640)) __PYX_ERR(3, 891, __pyx_L1_error)
+  __pyx_tuple__647 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_parser, __pyx_n_s_result_doc, __pyx_n_s_result_node, __pyx_n_s_href_utf, __pyx_n_s_c_href, __pyx_n_s_c_attr, __pyx_n_s_hrefs, __pyx_n_s_root); if (unlikely(!__pyx_tuple__647)) __PYX_ERR(3, 891, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__647);
+  __Pyx_GIVEREF(__pyx_tuple__647);
+  __pyx_codeobj__648 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__647, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_parseXSL, 891, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__648)) __PYX_ERR(3, 891, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":948
  *         return _elementTreeFactory(result_node._doc, result_node)
@@ -232612,10 +232593,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""set(self, key, value)
  * 
  */
-  __pyx_tuple__641 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_attrib, __pyx_n_s_text); if (unlikely(!__pyx_tuple__641)) __PYX_ERR(3, 948, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__641);
-  __Pyx_GIVEREF(__pyx_tuple__641);
-  __pyx_codeobj__642 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__641, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_set, 948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__642)) __PYX_ERR(3, 948, __pyx_L1_error)
+  __pyx_tuple__649 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_attrib, __pyx_n_s_text); if (unlikely(!__pyx_tuple__649)) __PYX_ERR(3, 948, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__649);
+  __Pyx_GIVEREF(__pyx_tuple__649);
+  __pyx_codeobj__650 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__649, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_set, 948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__650)) __PYX_ERR(3, 948, __pyx_L1_error)
 
   /* "src/lxml/xsltext.pxi":6
  *     u"""Base class of an XSLT extension element.
@@ -232624,10 +232605,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""execute(self, context, self_node, input_node, output_parent)
  *         Execute this extension element.
  */
-  __pyx_tuple__643 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_self_node, __pyx_n_s_input_node, __pyx_n_s_output_parent); if (unlikely(!__pyx_tuple__643)) __PYX_ERR(19, 6, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__643);
-  __Pyx_GIVEREF(__pyx_tuple__643);
-  __pyx_codeobj__644 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__643, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xsltext_pxi, __pyx_n_s_execute, 6, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__644)) __PYX_ERR(19, 6, __pyx_L1_error)
+  __pyx_tuple__651 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_self_node, __pyx_n_s_input_node, __pyx_n_s_output_parent); if (unlikely(!__pyx_tuple__651)) __PYX_ERR(19, 6, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__651);
+  __Pyx_GIVEREF(__pyx_tuple__651);
+  __pyx_codeobj__652 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__651, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xsltext_pxi, __pyx_n_s_execute, 6, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__652)) __PYX_ERR(19, 6, __pyx_L1_error)
 
   /* "src/lxml/xsltext.pxi":22
  *         pass
@@ -232636,10 +232617,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                         *, elements_only=False, remove_blank_text=False):
  *         u"""apply_templates(self, context, node, output_parent=None, elements_only=False, remove_blank_text=False)
  */
-  __pyx_tuple__645 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_node, __pyx_n_s_output_parent, __pyx_n_s_elements_only, __pyx_n_s_remove_blank_text, __pyx_n_s_c_parent, __pyx_n_s_c_node, __pyx_n_s_c_context_node); if (unlikely(!__pyx_tuple__645)) __PYX_ERR(19, 22, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__645);
-  __Pyx_GIVEREF(__pyx_tuple__645);
-  __pyx_codeobj__646 = (PyObject*)__Pyx_PyCode_New(4, 2, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__645, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xsltext_pxi, __pyx_n_s_apply_templates, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__646)) __PYX_ERR(19, 22, __pyx_L1_error)
+  __pyx_tuple__653 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_node, __pyx_n_s_output_parent, __pyx_n_s_elements_only, __pyx_n_s_remove_blank_text, __pyx_n_s_c_parent, __pyx_n_s_c_node, __pyx_n_s_c_context_node); if (unlikely(!__pyx_tuple__653)) __PYX_ERR(19, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__653);
+  __Pyx_GIVEREF(__pyx_tuple__653);
+  __pyx_codeobj__654 = (PyObject*)__Pyx_PyCode_New(4, 2, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__653, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xsltext_pxi, __pyx_n_s_apply_templates, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__654)) __PYX_ERR(19, 22, __pyx_L1_error)
 
   /* "src/lxml/xsltext.pxi":74
  *             tree.xmlFreeNode(c_parent)
@@ -232648,70 +232629,70 @@ static int __Pyx_InitCachedConstants(void) {
  *                          *, elements_only=False, remove_blank_text=False):
  *         u"""process_children(self, context, output_parent=None, elements_only=False, remove_blank_text=False)
  */
-  __pyx_tuple__647 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_output_parent, __pyx_n_s_elements_only, __pyx_n_s_remove_blank_text, __pyx_n_s_c_parent, __pyx_n_s_c_ctxt, __pyx_n_s_c_old_output_parent); if (unlikely(!__pyx_tuple__647)) __PYX_ERR(19, 74, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__647);
-  __Pyx_GIVEREF(__pyx_tuple__647);
-  __pyx_codeobj__648 = (PyObject*)__Pyx_PyCode_New(3, 2, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__647, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xsltext_pxi, __pyx_n_s_process_children, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__648)) __PYX_ERR(19, 74, __pyx_L1_error)
+  __pyx_tuple__655 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_output_parent, __pyx_n_s_elements_only, __pyx_n_s_remove_blank_text, __pyx_n_s_c_parent, __pyx_n_s_c_ctxt, __pyx_n_s_c_old_output_parent); if (unlikely(!__pyx_tuple__655)) __PYX_ERR(19, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__655);
+  __Pyx_GIVEREF(__pyx_tuple__655);
+  __pyx_codeobj__656 = (PyObject*)__Pyx_PyCode_New(3, 2, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__655, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xsltext_pxi, __pyx_n_s_process_children, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__656)) __PYX_ERR(19, 74, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3532
+  /* "lxml/etree.pyx":3535
  *         self._error_log = _ErrorLog()
  * 
  *     def validate(self, etree):             # <<<<<<<<<<<<<<
  *         u"""validate(self, etree)
  * 
  */
-  __pyx_tuple__649 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_etree); if (unlikely(!__pyx_tuple__649)) __PYX_ERR(0, 3532, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__649);
-  __Pyx_GIVEREF(__pyx_tuple__649);
-  __pyx_codeobj__650 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__649, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_validate, 3532, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__650)) __PYX_ERR(0, 3532, __pyx_L1_error)
+  __pyx_tuple__657 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_etree); if (unlikely(!__pyx_tuple__657)) __PYX_ERR(0, 3535, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__657);
+  __Pyx_GIVEREF(__pyx_tuple__657);
+  __pyx_codeobj__658 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__657, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_validate, 3535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__658)) __PYX_ERR(0, 3535, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3541
+  /* "lxml/etree.pyx":3544
  *         return self(etree)
  * 
  *     def assertValid(self, etree):             # <<<<<<<<<<<<<<
  *         u"""assertValid(self, etree)
  * 
  */
-  __pyx_tuple__651 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_etree); if (unlikely(!__pyx_tuple__651)) __PYX_ERR(0, 3541, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__651);
-  __Pyx_GIVEREF(__pyx_tuple__651);
-  __pyx_codeobj__652 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__651, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_assertValid, 3541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__652)) __PYX_ERR(0, 3541, __pyx_L1_error)
+  __pyx_tuple__659 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_etree); if (unlikely(!__pyx_tuple__659)) __PYX_ERR(0, 3544, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__659);
+  __Pyx_GIVEREF(__pyx_tuple__659);
+  __pyx_codeobj__660 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__659, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_assertValid, 3544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__660)) __PYX_ERR(0, 3544, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3551
+  /* "lxml/etree.pyx":3554
  *                                   self._error_log)
  * 
  *     def assert_(self, etree):             # <<<<<<<<<<<<<<
  *         u"""assert_(self, etree)
  * 
  */
-  __pyx_tuple__653 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_etree); if (unlikely(!__pyx_tuple__653)) __PYX_ERR(0, 3551, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__653);
-  __Pyx_GIVEREF(__pyx_tuple__653);
-  __pyx_codeobj__654 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__653, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_assert, 3551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__654)) __PYX_ERR(0, 3551, __pyx_L1_error)
+  __pyx_tuple__661 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_etree); if (unlikely(!__pyx_tuple__661)) __PYX_ERR(0, 3554, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__661);
+  __Pyx_GIVEREF(__pyx_tuple__661);
+  __pyx_codeobj__662 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__661, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_assert, 3554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__662)) __PYX_ERR(0, 3554, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3560
+  /* "lxml/etree.pyx":3563
  *                 u"Document does not comply with schema")
  * 
  *     cpdef _append_log_message(self, int domain, int type, int level, int line,             # <<<<<<<<<<<<<<
  *                               message, filename):
  *         self._error_log._receiveGeneric(domain, type, level, line, message,
  */
-  __pyx_tuple__655 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_domain, __pyx_n_s_type, __pyx_n_s_level, __pyx_n_s_line, __pyx_n_s_message, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__655)) __PYX_ERR(0, 3560, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__655);
-  __Pyx_GIVEREF(__pyx_tuple__655);
-  __pyx_codeobj__656 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__655, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_append_log_message, 3560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__656)) __PYX_ERR(0, 3560, __pyx_L1_error)
+  __pyx_tuple__663 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_domain, __pyx_n_s_type, __pyx_n_s_level, __pyx_n_s_line, __pyx_n_s_message, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__663)) __PYX_ERR(0, 3563, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__663);
+  __Pyx_GIVEREF(__pyx_tuple__663);
+  __pyx_codeobj__664 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__663, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_append_log_message, 3563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__664)) __PYX_ERR(0, 3563, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3565
+  /* "lxml/etree.pyx":3568
  *                                         filename)
  * 
  *     cpdef _clear_error_log(self):             # <<<<<<<<<<<<<<
  *         self._error_log.clear()
  * 
  */
-  __pyx_tuple__657 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__657)) __PYX_ERR(0, 3565, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__657);
-  __Pyx_GIVEREF(__pyx_tuple__657);
-  __pyx_codeobj__658 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__657, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_clear_error_log, 3565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__658)) __PYX_ERR(0, 3565, __pyx_L1_error)
+  __pyx_tuple__665 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__665)) __PYX_ERR(0, 3568, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__665);
+  __Pyx_GIVEREF(__pyx_tuple__665);
+  __pyx_codeobj__666 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__665, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_etree_pyx, __pyx_n_s_clear_error_log, 3568, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__666)) __PYX_ERR(0, 3568, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":163
  *            return funicode(self._c_node.defaultValue) if self._c_node.defaultValue is not NULL else None
@@ -232720,10 +232701,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         _assertValidDTDNode(self, self._c_node)
  *         cdef tree.xmlEnumeration *c_node = self._c_node.tree
  */
-  __pyx_tuple__659 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__659)) __PYX_ERR(20, 163, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__659);
-  __Pyx_GIVEREF(__pyx_tuple__659);
-  __pyx_codeobj__660 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__659, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_itervalues, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__660)) __PYX_ERR(20, 163, __pyx_L1_error)
+  __pyx_tuple__667 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__667)) __PYX_ERR(20, 163, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__667);
+  __Pyx_GIVEREF(__pyx_tuple__667);
+  __pyx_codeobj__668 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__667, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_itervalues, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__668)) __PYX_ERR(20, 163, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":170
  *             c_node = c_node.next
@@ -232732,10 +232713,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return list(self.itervalues())
  * 
  */
-  __pyx_tuple__661 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__661)) __PYX_ERR(20, 170, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__661);
-  __Pyx_GIVEREF(__pyx_tuple__661);
-  __pyx_codeobj__662 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__661, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_values, 170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__662)) __PYX_ERR(20, 170, __pyx_L1_error)
+  __pyx_tuple__669 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__669)) __PYX_ERR(20, 170, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__669);
+  __Pyx_GIVEREF(__pyx_tuple__669);
+  __pyx_codeobj__670 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__669, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_values, 170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__670)) __PYX_ERR(20, 170, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":223
  *                return None
@@ -232744,10 +232725,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         _assertValidDTDNode(self, self._c_node)
  *         cdef tree.xmlAttribute *c_node = self._c_node.attributes
  */
-  __pyx_tuple__663 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_node, __pyx_n_s_node); if (unlikely(!__pyx_tuple__663)) __PYX_ERR(20, 223, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__663);
-  __Pyx_GIVEREF(__pyx_tuple__663);
-  __pyx_codeobj__664 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__663, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_iterattributes, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__664)) __PYX_ERR(20, 223, __pyx_L1_error)
+  __pyx_tuple__671 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_node, __pyx_n_s_node); if (unlikely(!__pyx_tuple__671)) __PYX_ERR(20, 223, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__671);
+  __Pyx_GIVEREF(__pyx_tuple__671);
+  __pyx_codeobj__672 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__671, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_iterattributes, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__672)) __PYX_ERR(20, 223, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":233
  *             c_node = c_node.nexth
@@ -232756,10 +232737,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return list(self.iterattributes())
  * 
  */
-  __pyx_tuple__665 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__665)) __PYX_ERR(20, 233, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__665);
-  __Pyx_GIVEREF(__pyx_tuple__665);
-  __pyx_codeobj__666 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__665, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_attributes, 233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__666)) __PYX_ERR(20, 233, __pyx_L1_error)
+  __pyx_tuple__673 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__673)) __PYX_ERR(20, 233, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__673);
+  __Pyx_GIVEREF(__pyx_tuple__673);
+  __pyx_codeobj__674 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__673, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_attributes, 233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__674)) __PYX_ERR(20, 233, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":314
  *            return funicodeOrNone(self._c_dtd.SystemID)
@@ -232768,10 +232749,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         cdef tree.xmlNode *c_node = self._c_dtd.children if self._c_dtd is not NULL else NULL
  *         while c_node is not NULL:
  */
-  __pyx_tuple__667 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_node, __pyx_n_s_node); if (unlikely(!__pyx_tuple__667)) __PYX_ERR(20, 314, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__667);
-  __Pyx_GIVEREF(__pyx_tuple__667);
-  __pyx_codeobj__668 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__667, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_iterelements, 314, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__668)) __PYX_ERR(20, 314, __pyx_L1_error)
+  __pyx_tuple__675 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_node, __pyx_n_s_node); if (unlikely(!__pyx_tuple__675)) __PYX_ERR(20, 314, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__675);
+  __Pyx_GIVEREF(__pyx_tuple__675);
+  __pyx_codeobj__676 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__675, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_iterelements, 314, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__676)) __PYX_ERR(20, 314, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":324
  *             c_node = c_node.next
@@ -232780,10 +232761,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return list(self.iterelements())
  * 
  */
-  __pyx_tuple__669 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__669)) __PYX_ERR(20, 324, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__669);
-  __Pyx_GIVEREF(__pyx_tuple__669);
-  __pyx_codeobj__670 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__669, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_elements, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__670)) __PYX_ERR(20, 324, __pyx_L1_error)
+  __pyx_tuple__677 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__677)) __PYX_ERR(20, 324, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__677);
+  __Pyx_GIVEREF(__pyx_tuple__677);
+  __pyx_codeobj__678 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__677, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_elements, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__678)) __PYX_ERR(20, 324, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":327
  *         return list(self.iterelements())
@@ -232792,10 +232773,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         cdef tree.xmlNode *c_node = self._c_dtd.children if self._c_dtd is not NULL else NULL
  *         while c_node is not NULL:
  */
-  __pyx_tuple__671 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_node, __pyx_n_s_node); if (unlikely(!__pyx_tuple__671)) __PYX_ERR(20, 327, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__671);
-  __Pyx_GIVEREF(__pyx_tuple__671);
-  __pyx_codeobj__672 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__671, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_iterentities, 327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__672)) __PYX_ERR(20, 327, __pyx_L1_error)
+  __pyx_tuple__679 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_node, __pyx_n_s_node); if (unlikely(!__pyx_tuple__679)) __PYX_ERR(20, 327, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__679);
+  __Pyx_GIVEREF(__pyx_tuple__679);
+  __pyx_codeobj__680 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__679, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_iterentities, 327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__680)) __PYX_ERR(20, 327, __pyx_L1_error)
 
   /* "src/lxml/dtd.pxi":337
  *             c_node = c_node.next
@@ -232804,10 +232785,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return list(self.iterentities())
  * 
  */
-  __pyx_tuple__673 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__673)) __PYX_ERR(20, 337, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__673);
-  __Pyx_GIVEREF(__pyx_tuple__673);
-  __pyx_codeobj__674 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__673, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_entities, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__674)) __PYX_ERR(20, 337, __pyx_L1_error)
+  __pyx_tuple__681 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__681)) __PYX_ERR(20, 337, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__681);
+  __Pyx_GIVEREF(__pyx_tuple__681);
+  __pyx_codeobj__682 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__681, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_dtd_pxi, __pyx_n_s_entities, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__682)) __PYX_ERR(20, 337, __pyx_L1_error)
 
   /* "src/lxml/relaxng.pxi":154
  * 
@@ -232816,10 +232797,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """Parse a RelaxNG schema in compact syntax from a text string
  * 
  */
-  __pyx_tuple__675 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_src, __pyx_n_s_base_url, __pyx_n_s_rng_str); if (unlikely(!__pyx_tuple__675)) __PYX_ERR(21, 154, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__675);
-  __Pyx_GIVEREF(__pyx_tuple__675);
-  __pyx_codeobj__676 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__675, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_relaxng_pxi, __pyx_n_s_from_rnc_string, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__676)) __PYX_ERR(21, 154, __pyx_L1_error)
+  __pyx_tuple__683 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_src, __pyx_n_s_base_url, __pyx_n_s_rng_str); if (unlikely(!__pyx_tuple__683)) __PYX_ERR(21, 154, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__683);
+  __Pyx_GIVEREF(__pyx_tuple__683);
+  __pyx_codeobj__684 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__683, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_relaxng_pxi, __pyx_n_s_from_rnc_string, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__684)) __PYX_ERR(21, 154, __pyx_L1_error)
 
   /* "src/lxml/xmlschema.pxi":21
  * # XMLSchema
@@ -232828,9 +232809,9 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"boolean(//xs:attribute[@default or @fixed][1])",
  *     namespaces={u'xs': u'http://www.w3.org/2001/XMLSchema'})
  */
-  __pyx_tuple__677 = PyTuple_Pack(1, __pyx_kp_u_boolean_xs_attribute_default_or); if (unlikely(!__pyx_tuple__677)) __PYX_ERR(22, 21, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__677);
-  __Pyx_GIVEREF(__pyx_tuple__677);
+  __pyx_tuple__685 = PyTuple_Pack(1, __pyx_kp_u_boolean_xs_attribute_default_or); if (unlikely(!__pyx_tuple__685)) __PYX_ERR(22, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__685);
+  __Pyx_GIVEREF(__pyx_tuple__685);
 
   /* "src/lxml/debug.pxi":7
  *     """Debugging support for the memory allocation in libxml2.
@@ -232839,10 +232820,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """bytes_used(self)
  * 
  */
-  __pyx_tuple__678 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__678)) __PYX_ERR(25, 7, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__678);
-  __Pyx_GIVEREF(__pyx_tuple__678);
-  __pyx_codeobj__679 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__678, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_debug_pxi, __pyx_n_s_bytes_used, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__679)) __PYX_ERR(25, 7, __pyx_L1_error)
+  __pyx_tuple__686 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__686)) __PYX_ERR(25, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__686);
+  __Pyx_GIVEREF(__pyx_tuple__686);
+  __pyx_codeobj__687 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__686, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_debug_pxi, __pyx_n_s_bytes_used, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__687)) __PYX_ERR(25, 7, __pyx_L1_error)
 
   /* "src/lxml/debug.pxi":16
  *         return tree.xmlMemUsed()
@@ -232851,10 +232832,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """blocks_used(self)
  * 
  */
-  __pyx_tuple__680 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__680)) __PYX_ERR(25, 16, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__680);
-  __Pyx_GIVEREF(__pyx_tuple__680);
-  __pyx_codeobj__681 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__680, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_debug_pxi, __pyx_n_s_blocks_used, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__681)) __PYX_ERR(25, 16, __pyx_L1_error)
+  __pyx_tuple__688 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__688)) __PYX_ERR(25, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__688);
+  __Pyx_GIVEREF(__pyx_tuple__688);
+  __pyx_codeobj__689 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__688, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_debug_pxi, __pyx_n_s_blocks_used, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__689)) __PYX_ERR(25, 16, __pyx_L1_error)
 
   /* "src/lxml/debug.pxi":25
  *         return tree.xmlMemBlocks()
@@ -232863,10 +232844,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """dict_size(self)
  * 
  */
-  __pyx_tuple__682 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_dict); if (unlikely(!__pyx_tuple__682)) __PYX_ERR(25, 25, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__682);
-  __Pyx_GIVEREF(__pyx_tuple__682);
-  __pyx_codeobj__683 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__682, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_debug_pxi, __pyx_n_s_dict_size, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__683)) __PYX_ERR(25, 25, __pyx_L1_error)
+  __pyx_tuple__690 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_dict); if (unlikely(!__pyx_tuple__690)) __PYX_ERR(25, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__690);
+  __Pyx_GIVEREF(__pyx_tuple__690);
+  __pyx_codeobj__691 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__690, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_debug_pxi, __pyx_n_s_dict_size, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__691)) __PYX_ERR(25, 25, __pyx_L1_error)
 
   /* "src/lxml/debug.pxi":36
  *         return tree.xmlDictSize(c_dict)
@@ -232875,10 +232856,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """dump(self, output_file=None, byte_count=None)
  * 
  */
-  __pyx_tuple__684 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_output_file, __pyx_n_s_byte_count, __pyx_n_s_c_count, __pyx_n_s_f); if (unlikely(!__pyx_tuple__684)) __PYX_ERR(25, 36, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__684);
-  __Pyx_GIVEREF(__pyx_tuple__684);
-  __pyx_codeobj__685 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__684, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_debug_pxi, __pyx_n_s_dump, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__685)) __PYX_ERR(25, 36, __pyx_L1_error)
+  __pyx_tuple__692 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_output_file, __pyx_n_s_byte_count, __pyx_n_s_c_count, __pyx_n_s_f); if (unlikely(!__pyx_tuple__692)) __PYX_ERR(25, 36, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__692);
+  __Pyx_GIVEREF(__pyx_tuple__692);
+  __pyx_codeobj__693 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__692, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_debug_pxi, __pyx_n_s_dump, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__693)) __PYX_ERR(25, 36, __pyx_L1_error)
 
   /* "src/lxml/debug.pxi":66
  *             stdio.fclose(f)
@@ -232887,10 +232868,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """show(self, output_file=None, block_count=None)
  * 
  */
-  __pyx_tuple__686 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_output_file, __pyx_n_s_block_count, __pyx_n_s_f); if (unlikely(!__pyx_tuple__686)) __PYX_ERR(25, 66, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__686);
-  __Pyx_GIVEREF(__pyx_tuple__686);
-  __pyx_codeobj__687 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__686, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_debug_pxi, __pyx_n_s_show, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__687)) __PYX_ERR(25, 66, __pyx_L1_error)
+  __pyx_tuple__694 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_output_file, __pyx_n_s_block_count, __pyx_n_s_f); if (unlikely(!__pyx_tuple__694)) __PYX_ERR(25, 66, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__694);
+  __Pyx_GIVEREF(__pyx_tuple__694);
+  __pyx_codeobj__695 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__694, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_debug_pxi, __pyx_n_s_show, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__695)) __PYX_ERR(25, 66, __pyx_L1_error)
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -232927,6 +232908,47 @@ PyMODINIT_FUNC initetree(void)
 #else
 PyMODINIT_FUNC PyInit_etree(void); /*proto*/
 PyMODINIT_FUNC PyInit_etree(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+  return PyModuleDef_Init(&__pyx_moduledef);
+}
+static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
+    PyObject *value = PyObject_GetAttrString(spec, from_name);
+    int result = 0;
+    if (likely(value)) {
+        result = PyDict_SetItemString(moddict, to_name, value);
+        Py_DECREF(value);
+    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+        PyErr_Clear();
+    } else {
+        result = -1;
+    }
+    return result;
+}
+static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+    PyObject *module = NULL, *moddict, *modname;
+    if (__pyx_m)
+        return __Pyx_NewRef(__pyx_m);
+    modname = PyObject_GetAttrString(spec, "name");
+    if (unlikely(!modname)) goto bad;
+    module = PyModule_NewObject(modname);
+    Py_DECREF(modname);
+    if (unlikely(!module)) goto bad;
+    moddict = PyModule_GetDict(module);
+    if (unlikely(!moddict)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
+    return module;
+bad:
+    Py_XDECREF(module);
+    return NULL;
+}
+
+
+static int __pyx_pymod_exec_etree(PyObject *__pyx_pyinit_module)
+#endif
 #endif
 {
   PyObject *__pyx_t_1 = NULL;
@@ -232945,6 +232967,9 @@ PyMODINIT_FUNC PyInit_etree(void)
   PyObject *__pyx_t_14 = NULL;
   PyObject *__pyx_t_15 = NULL;
   __Pyx_RefNannyDeclarations
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
+  #endif
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
   if (!__Pyx_RefNanny) {
@@ -232971,6 +232996,9 @@ PyMODINIT_FUNC PyInit_etree(void)
   #ifdef __Pyx_Generator_USED
   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
+  #ifdef __Pyx_AsyncGen_USED
+  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   #ifdef __Pyx_StopAsyncIteration_USED
   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
@@ -232982,12 +233010,17 @@ PyMODINIT_FUNC PyInit_etree(void)
   #endif
   #endif
   /*--- Module creation code ---*/
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  __pyx_m = __pyx_pyinit_module;
+  Py_INCREF(__pyx_m);
+  #else
   #if PY_MAJOR_VERSION < 3
   __pyx_m = Py_InitModule4("etree", __pyx_methods, __pyx_k_The_lxml_etree_module_implement, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
   Py_INCREF(__pyx_d);
   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
@@ -233025,6 +233058,7 @@ PyMODINIT_FUNC PyInit_etree(void)
   __pyx_v_4lxml_5etree__elementpath = Py_None; Py_INCREF(Py_None);
   __pyx_v_4lxml_5etree_sys = Py_None; Py_INCREF(Py_None);
   __pyx_v_4lxml_5etree_re = Py_None; Py_INCREF(Py_None);
+  __pyx_v_4lxml_5etree_partial = Py_None; Py_INCREF(Py_None);
   __pyx_v_4lxml_5etree_islice = Py_None; Py_INCREF(Py_None);
   __pyx_v_4lxml_5etree_ITER_EMPTY = Py_None; Py_INCREF(Py_None);
   __pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING = Py_None; Py_INCREF(Py_None);
@@ -233116,26 +233150,26 @@ PyMODINIT_FUNC PyInit_etree(void)
   if (__Pyx_ExportFunction("findOrBuildNodeNsPrefix", (void (*)(void))findOrBuildNodeNsPrefix, "xmlNs *(struct LxmlDocument *, xmlNode *, const xmlChar *, const xmlChar *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   /*--- Type init code ---*/
   __pyx_type_4lxml_5etree_Error.tp_base = (&((PyTypeObject*)PyExc_Exception)[0]);
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_Error) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_Error) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
   __pyx_type_4lxml_5etree_Error.tp_print = 0;
-  if (PyObject_SetAttrString(__pyx_m, "Error", (PyObject *)&__pyx_type_4lxml_5etree_Error) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "Error", (PyObject *)&__pyx_type_4lxml_5etree_Error) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_Error = &__pyx_type_4lxml_5etree_Error;
   __pyx_type_4lxml_5etree_LxmlError.tp_base = __pyx_ptype_4lxml_5etree_Error;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_LxmlError) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_LxmlError) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
   __pyx_type_4lxml_5etree_LxmlError.tp_print = 0;
-  if (PyObject_SetAttrString(__pyx_m, "LxmlError", (PyObject *)&__pyx_type_4lxml_5etree_LxmlError) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "LxmlError", (PyObject *)&__pyx_type_4lxml_5etree_LxmlError) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_LxmlError = &__pyx_type_4lxml_5etree_LxmlError;
   __pyx_type_4lxml_5etree_C14NError.tp_base = __pyx_ptype_4lxml_5etree_LxmlError;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_C14NError) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_C14NError) < 0) __PYX_ERR(0, 235, __pyx_L1_error)
   __pyx_type_4lxml_5etree_C14NError.tp_print = 0;
-  if (PyObject_SetAttrString(__pyx_m, "C14NError", (PyObject *)&__pyx_type_4lxml_5etree_C14NError) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "C14NError", (PyObject *)&__pyx_type_4lxml_5etree_C14NError) < 0) __PYX_ERR(0, 235, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_C14NError = &__pyx_type_4lxml_5etree_C14NError;
   __pyx_vtabptr_4lxml_5etree__TempStore = &__pyx_vtable_4lxml_5etree__TempStore;
   __pyx_vtable_4lxml_5etree__TempStore.add = (int (*)(struct __pyx_obj_4lxml_5etree__TempStore *, PyObject *))__pyx_f_4lxml_5etree_10_TempStore_add;
   __pyx_vtable_4lxml_5etree__TempStore.clear = (int (*)(struct __pyx_obj_4lxml_5etree__TempStore *))__pyx_f_4lxml_5etree_10_TempStore_clear;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__TempStore) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__TempStore) < 0) __PYX_ERR(0, 289, __pyx_L1_error)
   __pyx_type_4lxml_5etree__TempStore.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__TempStore.tp_dict, __pyx_vtabptr_4lxml_5etree__TempStore) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__TempStore.tp_dict, __pyx_vtabptr_4lxml_5etree__TempStore) < 0) __PYX_ERR(0, 289, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__TempStore = &__pyx_type_4lxml_5etree__TempStore;
   __pyx_vtabptr_4lxml_5etree__ExceptionContext = &__pyx_vtable_4lxml_5etree__ExceptionContext;
   __pyx_vtable_4lxml_5etree__ExceptionContext.clear = (void (*)(struct __pyx_obj_4lxml_5etree__ExceptionContext *))__pyx_f_4lxml_5etree_17_ExceptionContext_clear;
@@ -233143,9 +233177,9 @@ PyMODINIT_FUNC PyInit_etree(void)
   __pyx_vtable_4lxml_5etree__ExceptionContext._store_exception = (void (*)(struct __pyx_obj_4lxml_5etree__ExceptionContext *, PyObject *))__pyx_f_4lxml_5etree_17_ExceptionContext__store_exception;
   __pyx_vtable_4lxml_5etree__ExceptionContext._has_raised = (int (*)(struct __pyx_obj_4lxml_5etree__ExceptionContext *))__pyx_f_4lxml_5etree_17_ExceptionContext__has_raised;
   __pyx_vtable_4lxml_5etree__ExceptionContext._raise_if_stored = (int (*)(struct __pyx_obj_4lxml_5etree__ExceptionContext *))__pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ExceptionContext) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ExceptionContext) < 0) __PYX_ERR(0, 304, __pyx_L1_error)
   __pyx_type_4lxml_5etree__ExceptionContext.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ExceptionContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ExceptionContext) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ExceptionContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ExceptionContext) < 0) __PYX_ERR(0, 304, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ExceptionContext = &__pyx_type_4lxml_5etree__ExceptionContext;
   __pyx_vtabptr_4lxml_5etree__LogEntry = &__pyx_vtable_4lxml_5etree__LogEntry;
   __pyx_vtable_4lxml_5etree__LogEntry._setError = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__LogEntry *, xmlError *))__pyx_f_4lxml_5etree_9_LogEntry__setError;
@@ -233230,23 +233264,23 @@ PyMODINIT_FUNC PyInit_etree(void)
   __pyx_vtable_4lxml_5etree__Document.buildNewPrefix = (PyObject *(*)(struct LxmlDocument *))__pyx_f_4lxml_5etree_9_Document_buildNewPrefix;
   __pyx_vtable_4lxml_5etree__Document._findOrBuildNodeNs = (xmlNs *(*)(struct LxmlDocument *, xmlNode *, const xmlChar *, const xmlChar *, int))__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs;
   __pyx_vtable_4lxml_5etree__Document._setNodeNs = (int (*)(struct LxmlDocument *, xmlNode *, const xmlChar *))__pyx_f_4lxml_5etree_9_Document__setNodeNs;
-  if (PyType_Ready(&LxmlDocumentType) < 0) __PYX_ERR(0, 343, __pyx_L1_error)
+  if (PyType_Ready(&LxmlDocumentType) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
   LxmlDocumentType.tp_print = 0;
-  if (__Pyx_SetVtable(LxmlDocumentType.tp_dict, __pyx_vtabptr_4lxml_5etree__Document) < 0) __PYX_ERR(0, 343, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "_Document", (PyObject *)&LxmlDocumentType) < 0) __PYX_ERR(0, 343, __pyx_L1_error)
+  if (__Pyx_SetVtable(LxmlDocumentType.tp_dict, __pyx_vtabptr_4lxml_5etree__Document) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_Document", (PyObject *)&LxmlDocumentType) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__Document = &LxmlDocumentType;
   __pyx_vtabptr_4lxml_5etree_DocInfo = &__pyx_vtable_4lxml_5etree_DocInfo;
   __pyx_vtable_4lxml_5etree_DocInfo._get_c_dtd = (xmlDtd *(*)(struct __pyx_obj_4lxml_5etree_DocInfo *))__pyx_f_4lxml_5etree_7DocInfo__get_c_dtd;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_DocInfo) < 0) __PYX_ERR(0, 517, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_DocInfo) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
   __pyx_type_4lxml_5etree_DocInfo.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_DocInfo.tp_dict, __pyx_vtabptr_4lxml_5etree_DocInfo) < 0) __PYX_ERR(0, 517, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "DocInfo", (PyObject *)&__pyx_type_4lxml_5etree_DocInfo) < 0) __PYX_ERR(0, 517, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_DocInfo.tp_dict, __pyx_vtabptr_4lxml_5etree_DocInfo) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "DocInfo", (PyObject *)&__pyx_type_4lxml_5etree_DocInfo) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_DocInfo = &__pyx_type_4lxml_5etree_DocInfo;
-  if (PyType_Ready(&LxmlElementType) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
+  if (PyType_Ready(&LxmlElementType) < 0) __PYX_ERR(0, 698, __pyx_L1_error)
   LxmlElementType.tp_print = 0;
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__setitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 695, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__setitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 698, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_8_Element_4__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_8_Element_4__setitem__.doc = __pyx_doc_4lxml_5etree_8_Element_4__setitem__;
@@ -233256,7 +233290,7 @@ PyMODINIT_FUNC PyInit_etree(void)
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__delitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 695, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__delitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 698, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_8_Element_6__delitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_8_Element_6__delitem__.doc = __pyx_doc_4lxml_5etree_8_Element_6__delitem__;
@@ -233266,7 +233300,7 @@ PyMODINIT_FUNC PyInit_etree(void)
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__repr__"); if (unlikely(!wrapper)) __PYX_ERR(0, 695, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__repr__"); if (unlikely(!wrapper)) __PYX_ERR(0, 698, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_8_Element_30__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_8_Element_30__repr__.doc = __pyx_doc_4lxml_5etree_8_Element_30__repr__;
@@ -233276,7 +233310,7 @@ PyMODINIT_FUNC PyInit_etree(void)
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 695, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 698, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_8_Element_32__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_8_Element_32__getitem__.doc = __pyx_doc_4lxml_5etree_8_Element_32__getitem__;
@@ -233286,7 +233320,7 @@ PyMODINIT_FUNC PyInit_etree(void)
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(0, 695, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(0, 698, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_8_Element_34__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_8_Element_34__len__.doc = __pyx_doc_4lxml_5etree_8_Element_34__len__;
@@ -233296,7 +233330,7 @@ PyMODINIT_FUNC PyInit_etree(void)
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__contains__"); if (unlikely(!wrapper)) __PYX_ERR(0, 695, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__contains__"); if (unlikely(!wrapper)) __PYX_ERR(0, 698, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_8_Element_38__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_8_Element_38__contains__.doc = __pyx_doc_4lxml_5etree_8_Element_38__contains__;
@@ -233306,7 +233340,7 @@ PyMODINIT_FUNC PyInit_etree(void)
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(0, 695, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementType, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(0, 698, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_8_Element_40__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_8_Element_40__iter__.doc = __pyx_doc_4lxml_5etree_8_Element_40__iter__;
@@ -233314,16 +233348,16 @@ PyMODINIT_FUNC PyInit_etree(void)
     }
   }
   #endif
-  if (PyObject_SetAttrString(__pyx_m, "_Element", (PyObject *)&LxmlElementType) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_Element", (PyObject *)&LxmlElementType) < 0) __PYX_ERR(0, 698, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__Element = &LxmlElementType;
   __pyx_vtabptr_4lxml_5etree___ContentOnlyElement = &__pyx_vtable_4lxml_5etree___ContentOnlyElement;
   __pyx_vtable_4lxml_5etree___ContentOnlyElement._raiseImmutable = (int (*)(struct __pyx_obj_4lxml_5etree___ContentOnlyElement *))__pyx_f_4lxml_5etree_20__ContentOnlyElement__raiseImmutable;
   __pyx_type_4lxml_5etree___ContentOnlyElement.tp_base = __pyx_ptype_4lxml_5etree__Element;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___ContentOnlyElement) < 0) __PYX_ERR(0, 1634, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___ContentOnlyElement) < 0) __PYX_ERR(0, 1637, __pyx_L1_error)
   __pyx_type_4lxml_5etree___ContentOnlyElement.tp_print = 0;
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree___ContentOnlyElement, "__setitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1634, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree___ContentOnlyElement, "__setitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1637, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_20__ContentOnlyElement_6__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_20__ContentOnlyElement_6__setitem__.doc = __pyx_doc_4lxml_5etree_20__ContentOnlyElement_6__setitem__;
@@ -233333,7 +233367,7 @@ PyMODINIT_FUNC PyInit_etree(void)
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree___ContentOnlyElement, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1634, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree___ContentOnlyElement, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1637, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_20__ContentOnlyElement_8__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_20__ContentOnlyElement_8__getitem__.doc = __pyx_doc_4lxml_5etree_20__ContentOnlyElement_8__getitem__;
@@ -233343,7 +233377,7 @@ PyMODINIT_FUNC PyInit_etree(void)
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree___ContentOnlyElement, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1634, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree___ContentOnlyElement, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1637, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_20__ContentOnlyElement_10__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_20__ContentOnlyElement_10__len__.doc = __pyx_doc_4lxml_5etree_20__ContentOnlyElement_10__len__;
@@ -233351,65 +233385,65 @@ PyMODINIT_FUNC PyInit_etree(void)
     }
   }
   #endif
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree___ContentOnlyElement.tp_dict, __pyx_vtabptr_4lxml_5etree___ContentOnlyElement) < 0) __PYX_ERR(0, 1634, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree___ContentOnlyElement.tp_dict, __pyx_vtabptr_4lxml_5etree___ContentOnlyElement) < 0) __PYX_ERR(0, 1637, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree___ContentOnlyElement = &__pyx_type_4lxml_5etree___ContentOnlyElement;
   __pyx_vtabptr_4lxml_5etree__Comment = &__pyx_vtable_4lxml_5etree__Comment;
   __pyx_vtable_4lxml_5etree__Comment.__pyx_base = *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
   __pyx_type_4lxml_5etree__Comment.tp_base = __pyx_ptype_4lxml_5etree___ContentOnlyElement;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__Comment) < 0) __PYX_ERR(0, 1701, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__Comment) < 0) __PYX_ERR(0, 1704, __pyx_L1_error)
   __pyx_type_4lxml_5etree__Comment.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__Comment.tp_dict, __pyx_vtabptr_4lxml_5etree__Comment) < 0) __PYX_ERR(0, 1701, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "_Comment", (PyObject *)&__pyx_type_4lxml_5etree__Comment) < 0) __PYX_ERR(0, 1701, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__Comment.tp_dict, __pyx_vtabptr_4lxml_5etree__Comment) < 0) __PYX_ERR(0, 1704, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_Comment", (PyObject *)&__pyx_type_4lxml_5etree__Comment) < 0) __PYX_ERR(0, 1704, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__Comment = &__pyx_type_4lxml_5etree__Comment;
   __pyx_vtabptr_4lxml_5etree__ProcessingInstruction = &__pyx_vtable_4lxml_5etree__ProcessingInstruction;
   __pyx_vtable_4lxml_5etree__ProcessingInstruction.__pyx_base = *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
   __pyx_type_4lxml_5etree__ProcessingInstruction.tp_base = __pyx_ptype_4lxml_5etree___ContentOnlyElement;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ProcessingInstruction) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ProcessingInstruction) < 0) __PYX_ERR(0, 1712, __pyx_L1_error)
   __pyx_type_4lxml_5etree__ProcessingInstruction.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ProcessingInstruction.tp_dict, __pyx_vtabptr_4lxml_5etree__ProcessingInstruction) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "_ProcessingInstruction", (PyObject *)&__pyx_type_4lxml_5etree__ProcessingInstruction) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ProcessingInstruction.tp_dict, __pyx_vtabptr_4lxml_5etree__ProcessingInstruction) < 0) __PYX_ERR(0, 1712, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_ProcessingInstruction", (PyObject *)&__pyx_type_4lxml_5etree__ProcessingInstruction) < 0) __PYX_ERR(0, 1712, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ProcessingInstruction = &__pyx_type_4lxml_5etree__ProcessingInstruction;
   __pyx_vtabptr_4lxml_5etree__Entity = &__pyx_vtable_4lxml_5etree__Entity;
   __pyx_vtable_4lxml_5etree__Entity.__pyx_base = *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
   __pyx_type_4lxml_5etree__Entity.tp_base = __pyx_ptype_4lxml_5etree___ContentOnlyElement;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__Entity) < 0) __PYX_ERR(0, 1760, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__Entity) < 0) __PYX_ERR(0, 1763, __pyx_L1_error)
   __pyx_type_4lxml_5etree__Entity.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__Entity.tp_dict, __pyx_vtabptr_4lxml_5etree__Entity) < 0) __PYX_ERR(0, 1760, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "_Entity", (PyObject *)&__pyx_type_4lxml_5etree__Entity) < 0) __PYX_ERR(0, 1760, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__Entity.tp_dict, __pyx_vtabptr_4lxml_5etree__Entity) < 0) __PYX_ERR(0, 1763, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_Entity", (PyObject *)&__pyx_type_4lxml_5etree__Entity) < 0) __PYX_ERR(0, 1763, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__Entity = &__pyx_type_4lxml_5etree__Entity;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_QName) < 0) __PYX_ERR(0, 1789, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_QName) < 0) __PYX_ERR(0, 1792, __pyx_L1_error)
   __pyx_type_4lxml_5etree_QName.tp_print = 0;
-  if (PyObject_SetAttrString(__pyx_m, "QName", (PyObject *)&__pyx_type_4lxml_5etree_QName) < 0) __PYX_ERR(0, 1789, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "QName", (PyObject *)&__pyx_type_4lxml_5etree_QName) < 0) __PYX_ERR(0, 1792, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_QName = &__pyx_type_4lxml_5etree_QName;
   __pyx_vtabptr_4lxml_5etree__ElementTree = &__pyx_vtable_4lxml_5etree__ElementTree;
   __pyx_vtable_4lxml_5etree__ElementTree._assertHasRoot = (int (*)(struct LxmlElementTree *))__pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot;
-  if (PyType_Ready(&LxmlElementTreeType) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
+  if (PyType_Ready(&LxmlElementTreeType) < 0) __PYX_ERR(0, 1860, __pyx_L1_error)
   LxmlElementTreeType.tp_print = 0;
-  if (__Pyx_SetVtable(LxmlElementTreeType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementTree) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "_ElementTree", (PyObject *)&LxmlElementTreeType) < 0) __PYX_ERR(0, 1857, __pyx_L1_error)
+  if (__Pyx_SetVtable(LxmlElementTreeType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementTree) < 0) __PYX_ERR(0, 1860, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_ElementTree", (PyObject *)&LxmlElementTreeType) < 0) __PYX_ERR(0, 1860, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ElementTree = &LxmlElementTreeType;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__Attrib) < 0) __PYX_ERR(0, 2405, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__Attrib) < 0) __PYX_ERR(0, 2408, __pyx_L1_error)
   __pyx_type_4lxml_5etree__Attrib.tp_print = 0;
-  if (PyObject_SetAttrString(__pyx_m, "_Attrib", (PyObject *)&__pyx_type_4lxml_5etree__Attrib) < 0) __PYX_ERR(0, 2405, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_Attrib", (PyObject *)&__pyx_type_4lxml_5etree__Attrib) < 0) __PYX_ERR(0, 2408, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__Attrib = &__pyx_type_4lxml_5etree__Attrib;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__AttribIterator) < 0) __PYX_ERR(0, 2545, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__AttribIterator) < 0) __PYX_ERR(0, 2548, __pyx_L1_error)
   __pyx_type_4lxml_5etree__AttribIterator.tp_print = 0;
   __pyx_ptype_4lxml_5etree__AttribIterator = &__pyx_type_4lxml_5etree__AttribIterator;
   __pyx_vtabptr_4lxml_5etree__ElementTagMatcher = &__pyx_vtable_4lxml_5etree__ElementTagMatcher;
   __pyx_vtable_4lxml_5etree__ElementTagMatcher._initTagMatch = (PyObject *(*)(struct LxmlElementTagMatcher *, PyObject *))__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch;
-  if (PyType_Ready(&LxmlElementTagMatcherType) < 0) __PYX_ERR(0, 2586, __pyx_L1_error)
+  if (PyType_Ready(&LxmlElementTagMatcherType) < 0) __PYX_ERR(0, 2589, __pyx_L1_error)
   LxmlElementTagMatcherType.tp_print = 0;
-  if (__Pyx_SetVtable(LxmlElementTagMatcherType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementTagMatcher) < 0) __PYX_ERR(0, 2586, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "_ElementTagMatcher", (PyObject *)&LxmlElementTagMatcherType) < 0) __PYX_ERR(0, 2586, __pyx_L1_error)
+  if (__Pyx_SetVtable(LxmlElementTagMatcherType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementTagMatcher) < 0) __PYX_ERR(0, 2589, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_ElementTagMatcher", (PyObject *)&LxmlElementTagMatcherType) < 0) __PYX_ERR(0, 2589, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ElementTagMatcher = &LxmlElementTagMatcherType;
   __pyx_vtabptr_4lxml_5etree__ElementIterator = &__pyx_vtable_4lxml_5etree__ElementIterator;
   __pyx_vtable_4lxml_5etree__ElementIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementTagMatcher;
   __pyx_vtable_4lxml_5etree__ElementIterator._storeNext = (void (*)(struct LxmlElementIterator *, struct LxmlElement *))__pyx_f_4lxml_5etree_16_ElementIterator__storeNext;
   LxmlElementIteratorType.tp_base = __pyx_ptype_4lxml_5etree__ElementTagMatcher;
-  if (PyType_Ready(&LxmlElementIteratorType) < 0) __PYX_ERR(0, 2617, __pyx_L1_error)
+  if (PyType_Ready(&LxmlElementIteratorType) < 0) __PYX_ERR(0, 2620, __pyx_L1_error)
   LxmlElementIteratorType.tp_print = 0;
-  if (__Pyx_SetVtable(LxmlElementIteratorType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementIterator) < 0) __PYX_ERR(0, 2617, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "_ElementIterator", (PyObject *)&LxmlElementIteratorType) < 0) __PYX_ERR(0, 2617, __pyx_L1_error)
+  if (__Pyx_SetVtable(LxmlElementIteratorType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementIterator) < 0) __PYX_ERR(0, 2620, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_ElementIterator", (PyObject *)&LxmlElementIteratorType) < 0) __PYX_ERR(0, 2620, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ElementIterator = &LxmlElementIteratorType;
   __pyx_vtabptr_4lxml_5etree__MultiTagMatcher = &__pyx_vtable_4lxml_5etree__MultiTagMatcher;
   __pyx_vtable_4lxml_5etree__MultiTagMatcher.rejectsAll = (int (*)(struct __pyx_obj_4lxml_5etree__MultiTagMatcher *))__pyx_f_4lxml_5etree_16_MultiTagMatcher_rejectsAll;
@@ -233422,57 +233456,57 @@ PyMODINIT_FUNC PyInit_etree(void)
   __pyx_vtable_4lxml_5etree__MultiTagMatcher.matches = (int (*)(struct __pyx_obj_4lxml_5etree__MultiTagMatcher *, xmlNode *))__pyx_f_4lxml_5etree_16_MultiTagMatcher_matches;
   __pyx_vtable_4lxml_5etree__MultiTagMatcher.matchesNsTag = (int (*)(struct __pyx_obj_4lxml_5etree__MultiTagMatcher *, const xmlChar *, const xmlChar *))__pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesNsTag;
   __pyx_vtable_4lxml_5etree__MultiTagMatcher.matchesAttribute = (int (*)(struct __pyx_obj_4lxml_5etree__MultiTagMatcher *, xmlAttr *))__pyx_f_4lxml_5etree_16_MultiTagMatcher_matchesAttribute;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__MultiTagMatcher) < 0) __PYX_ERR(0, 2654, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__MultiTagMatcher) < 0) __PYX_ERR(0, 2657, __pyx_L1_error)
   __pyx_type_4lxml_5etree__MultiTagMatcher.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__MultiTagMatcher.tp_dict, __pyx_vtabptr_4lxml_5etree__MultiTagMatcher) < 0) __PYX_ERR(0, 2654, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__MultiTagMatcher.tp_dict, __pyx_vtabptr_4lxml_5etree__MultiTagMatcher) < 0) __PYX_ERR(0, 2657, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__MultiTagMatcher = &__pyx_type_4lxml_5etree__MultiTagMatcher;
   __pyx_vtabptr_4lxml_5etree__ElementMatchIterator = &__pyx_vtable_4lxml_5etree__ElementMatchIterator;
   __pyx_vtable_4lxml_5etree__ElementMatchIterator._initTagMatcher = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__ElementMatchIterator *, PyObject *))__pyx_f_4lxml_5etree_21_ElementMatchIterator__initTagMatcher;
   __pyx_vtable_4lxml_5etree__ElementMatchIterator._storeNext = (int (*)(struct __pyx_obj_4lxml_5etree__ElementMatchIterator *, struct LxmlElement *))__pyx_f_4lxml_5etree_21_ElementMatchIterator__storeNext;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ElementMatchIterator) < 0) __PYX_ERR(0, 2795, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ElementMatchIterator) < 0) __PYX_ERR(0, 2798, __pyx_L1_error)
   __pyx_type_4lxml_5etree__ElementMatchIterator.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ElementMatchIterator.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementMatchIterator) < 0) __PYX_ERR(0, 2795, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "_ElementMatchIterator", (PyObject *)&__pyx_type_4lxml_5etree__ElementMatchIterator) < 0) __PYX_ERR(0, 2795, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ElementMatchIterator.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementMatchIterator) < 0) __PYX_ERR(0, 2798, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_ElementMatchIterator", (PyObject *)&__pyx_type_4lxml_5etree__ElementMatchIterator) < 0) __PYX_ERR(0, 2798, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ElementMatchIterator = &__pyx_type_4lxml_5etree__ElementMatchIterator;
   __pyx_vtabptr_4lxml_5etree_ElementChildIterator = &__pyx_vtable_4lxml_5etree_ElementChildIterator;
   __pyx_vtable_4lxml_5etree_ElementChildIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementMatchIterator;
   __pyx_type_4lxml_5etree_ElementChildIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementMatchIterator;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementChildIterator) < 0) __PYX_ERR(0, 2824, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementChildIterator) < 0) __PYX_ERR(0, 2827, __pyx_L1_error)
   __pyx_type_4lxml_5etree_ElementChildIterator.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementChildIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementChildIterator) < 0) __PYX_ERR(0, 2824, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "ElementChildIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementChildIterator) < 0) __PYX_ERR(0, 2824, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementChildIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementChildIterator) < 0) __PYX_ERR(0, 2827, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "ElementChildIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementChildIterator) < 0) __PYX_ERR(0, 2827, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ElementChildIterator = &__pyx_type_4lxml_5etree_ElementChildIterator;
   __pyx_vtabptr_4lxml_5etree_SiblingsIterator = &__pyx_vtable_4lxml_5etree_SiblingsIterator;
   __pyx_vtable_4lxml_5etree_SiblingsIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementMatchIterator;
   __pyx_type_4lxml_5etree_SiblingsIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementMatchIterator;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_SiblingsIterator) < 0) __PYX_ERR(0, 2844, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_SiblingsIterator) < 0) __PYX_ERR(0, 2847, __pyx_L1_error)
   __pyx_type_4lxml_5etree_SiblingsIterator.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_SiblingsIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_SiblingsIterator) < 0) __PYX_ERR(0, 2844, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "SiblingsIterator", (PyObject *)&__pyx_type_4lxml_5etree_SiblingsIterator) < 0) __PYX_ERR(0, 2844, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_SiblingsIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_SiblingsIterator) < 0) __PYX_ERR(0, 2847, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "SiblingsIterator", (PyObject *)&__pyx_type_4lxml_5etree_SiblingsIterator) < 0) __PYX_ERR(0, 2847, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_SiblingsIterator = &__pyx_type_4lxml_5etree_SiblingsIterator;
   __pyx_vtabptr_4lxml_5etree_AncestorsIterator = &__pyx_vtable_4lxml_5etree_AncestorsIterator;
   __pyx_vtable_4lxml_5etree_AncestorsIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementMatchIterator;
   __pyx_type_4lxml_5etree_AncestorsIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementMatchIterator;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_AncestorsIterator) < 0) __PYX_ERR(0, 2859, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_AncestorsIterator) < 0) __PYX_ERR(0, 2862, __pyx_L1_error)
   __pyx_type_4lxml_5etree_AncestorsIterator.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_AncestorsIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_AncestorsIterator) < 0) __PYX_ERR(0, 2859, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "AncestorsIterator", (PyObject *)&__pyx_type_4lxml_5etree_AncestorsIterator) < 0) __PYX_ERR(0, 2859, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_AncestorsIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_AncestorsIterator) < 0) __PYX_ERR(0, 2862, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "AncestorsIterator", (PyObject *)&__pyx_type_4lxml_5etree_AncestorsIterator) < 0) __PYX_ERR(0, 2862, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_AncestorsIterator = &__pyx_type_4lxml_5etree_AncestorsIterator;
   __pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator = &__pyx_vtable_4lxml_5etree_ElementDepthFirstIterator;
   __pyx_vtable_4lxml_5etree_ElementDepthFirstIterator._nextNodeAnyTag = (xmlNode *(*)(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *, xmlNode *))__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag;
   __pyx_vtable_4lxml_5etree_ElementDepthFirstIterator._nextNodeMatchTag = (xmlNode *(*)(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *, xmlNode *))__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchTag;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementDepthFirstIterator) < 0) __PYX_ERR(0, 2869, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementDepthFirstIterator) < 0) __PYX_ERR(0, 2872, __pyx_L1_error)
   __pyx_type_4lxml_5etree_ElementDepthFirstIterator.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementDepthFirstIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator) < 0) __PYX_ERR(0, 2869, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "ElementDepthFirstIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementDepthFirstIterator) < 0) __PYX_ERR(0, 2869, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementDepthFirstIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator) < 0) __PYX_ERR(0, 2872, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "ElementDepthFirstIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementDepthFirstIterator) < 0) __PYX_ERR(0, 2872, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ElementDepthFirstIterator = &__pyx_type_4lxml_5etree_ElementDepthFirstIterator;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementTextIterator) < 0) __PYX_ERR(0, 2945, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementTextIterator) < 0) __PYX_ERR(0, 2948, __pyx_L1_error)
   __pyx_type_4lxml_5etree_ElementTextIterator.tp_print = 0;
-  if (PyObject_SetAttrString(__pyx_m, "ElementTextIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementTextIterator) < 0) __PYX_ERR(0, 2945, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "ElementTextIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementTextIterator) < 0) __PYX_ERR(0, 2948, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ElementTextIterator = &__pyx_type_4lxml_5etree_ElementTextIterator;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_CDATA) < 0) __PYX_ERR(0, 3071, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_CDATA) < 0) __PYX_ERR(0, 3074, __pyx_L1_error)
   __pyx_type_4lxml_5etree_CDATA.tp_print = 0;
-  if (PyObject_SetAttrString(__pyx_m, "CDATA", (PyObject *)&__pyx_type_4lxml_5etree_CDATA) < 0) __PYX_ERR(0, 3071, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "CDATA", (PyObject *)&__pyx_type_4lxml_5etree_CDATA) < 0) __PYX_ERR(0, 3074, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_CDATA = &__pyx_type_4lxml_5etree_CDATA;
   __pyx_vtabptr_4lxml_5etree__ReadOnlyProxy = &__pyx_vtable_4lxml_5etree__ReadOnlyProxy;
   __pyx_vtable_4lxml_5etree__ReadOnlyProxy._assertNode = (int (*)(struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *))__pyx_f_4lxml_5etree_14_ReadOnlyProxy__assertNode;
@@ -233611,47 +233645,47 @@ PyMODINIT_FUNC PyInit_etree(void)
   __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup = &__pyx_vtable_4lxml_5etree_FallbackElementClassLookup;
   __pyx_vtable_4lxml_5etree_FallbackElementClassLookup._setFallback = (void (*)(struct LxmlFallbackElementClassLookup *, struct LxmlElementClassLookup *))__pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback;
   LxmlFallbackElementClassLookupType.tp_base = __pyx_ptype_4lxml_5etree_ElementClassLookup;
-  if (PyType_Ready(&LxmlFallbackElementClassLookupType) < 0) __PYX_ERR(8, 223, __pyx_L1_error)
+  if (PyType_Ready(&LxmlFallbackElementClassLookupType) < 0) __PYX_ERR(8, 222, __pyx_L1_error)
   LxmlFallbackElementClassLookupType.tp_print = 0;
-  if (__Pyx_SetVtable(LxmlFallbackElementClassLookupType.tp_dict, __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup) < 0) __PYX_ERR(8, 223, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "FallbackElementClassLookup", (PyObject *)&LxmlFallbackElementClassLookupType) < 0) __PYX_ERR(8, 223, __pyx_L1_error)
+  if (__Pyx_SetVtable(LxmlFallbackElementClassLookupType.tp_dict, __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup) < 0) __PYX_ERR(8, 222, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "FallbackElementClassLookup", (PyObject *)&LxmlFallbackElementClassLookupType) < 0) __PYX_ERR(8, 222, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_FallbackElementClassLookup = &LxmlFallbackElementClassLookupType;
   __pyx_type_4lxml_5etree_ElementDefaultClassLookup.tp_base = __pyx_ptype_4lxml_5etree_ElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) __PYX_ERR(8, 265, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) __PYX_ERR(8, 264, __pyx_L1_error)
   __pyx_type_4lxml_5etree_ElementDefaultClassLookup.tp_print = 0;
-  if (PyObject_SetAttrString(__pyx_m, "ElementDefaultClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) __PYX_ERR(8, 265, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "ElementDefaultClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) __PYX_ERR(8, 264, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ElementDefaultClassLookup = &__pyx_type_4lxml_5etree_ElementDefaultClassLookup;
   __pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup = &__pyx_vtable_4lxml_5etree_AttributeBasedElementClassLookup;
   __pyx_vtable_4lxml_5etree_AttributeBasedElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
   __pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(8, 344, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(8, 343, __pyx_L1_error)
   __pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(8, 344, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "AttributeBasedElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(8, 344, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(8, 343, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "AttributeBasedElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(8, 343, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_AttributeBasedElementClassLookup = &__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup;
   __pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup = &__pyx_vtable_4lxml_5etree_ParserBasedElementClassLookup;
   __pyx_vtable_4lxml_5etree_ParserBasedElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
   __pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(8, 396, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(8, 395, __pyx_L1_error)
   __pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(8, 396, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "ParserBasedElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(8, 396, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(8, 395, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "ParserBasedElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(8, 395, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup = &__pyx_type_4lxml_5etree_ParserBasedElementClassLookup;
   __pyx_vtabptr_4lxml_5etree_CustomElementClassLookup = &__pyx_vtable_4lxml_5etree_CustomElementClassLookup;
   __pyx_vtable_4lxml_5etree_CustomElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
   __pyx_type_4lxml_5etree_CustomElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(8, 413, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(8, 412, __pyx_L1_error)
   __pyx_type_4lxml_5etree_CustomElementClassLookup.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_CustomElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(8, 413, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "CustomElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(8, 413, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_CustomElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(8, 412, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "CustomElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(8, 412, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_CustomElementClassLookup = &__pyx_type_4lxml_5etree_CustomElementClassLookup;
   __pyx_vtabptr_4lxml_5etree_PythonElementClassLookup = &__pyx_vtable_4lxml_5etree_PythonElementClassLookup;
   __pyx_vtable_4lxml_5etree_PythonElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
   __pyx_type_4lxml_5etree_PythonElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(8, 468, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(8, 467, __pyx_L1_error)
   __pyx_type_4lxml_5etree_PythonElementClassLookup.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PythonElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(8, 468, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "PythonElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(8, 468, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PythonElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(8, 467, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "PythonElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(8, 467, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_PythonElementClassLookup = &__pyx_type_4lxml_5etree_PythonElementClassLookup;
   __pyx_type_4lxml_5etree_LxmlRegistryError.tp_base = __pyx_ptype_4lxml_5etree_LxmlError;
   if (PyType_Ready(&__pyx_type_4lxml_5etree_LxmlRegistryError) < 0) __PYX_ERR(9, 3, __pyx_L1_error)
@@ -233673,31 +233707,31 @@ PyMODINIT_FUNC PyInit_etree(void)
   __pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry = &__pyx_vtable_4lxml_5etree__ClassNamespaceRegistry;
   __pyx_vtable_4lxml_5etree__ClassNamespaceRegistry.__pyx_base = *__pyx_vtabptr_4lxml_5etree__NamespaceRegistry;
   __pyx_type_4lxml_5etree__ClassNamespaceRegistry.tp_base = __pyx_ptype_4lxml_5etree__NamespaceRegistry;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ClassNamespaceRegistry) < 0) __PYX_ERR(9, 85, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ClassNamespaceRegistry) < 0) __PYX_ERR(9, 106, __pyx_L1_error)
   __pyx_type_4lxml_5etree__ClassNamespaceRegistry.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ClassNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry) < 0) __PYX_ERR(9, 85, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ClassNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry) < 0) __PYX_ERR(9, 106, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ClassNamespaceRegistry = &__pyx_type_4lxml_5etree__ClassNamespaceRegistry;
   __pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup = &__pyx_vtable_4lxml_5etree_ElementNamespaceClassLookup;
   __pyx_vtable_4lxml_5etree_ElementNamespaceClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
   __pyx_type_4lxml_5etree_ElementNamespaceClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementNamespaceClassLookup) < 0) __PYX_ERR(9, 99, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementNamespaceClassLookup) < 0) __PYX_ERR(9, 120, __pyx_L1_error)
   __pyx_type_4lxml_5etree_ElementNamespaceClassLookup.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementNamespaceClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup) < 0) __PYX_ERR(9, 99, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "ElementNamespaceClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ElementNamespaceClassLookup) < 0) __PYX_ERR(9, 99, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementNamespaceClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup) < 0) __PYX_ERR(9, 120, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "ElementNamespaceClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ElementNamespaceClassLookup) < 0) __PYX_ERR(9, 120, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ElementNamespaceClassLookup = &__pyx_type_4lxml_5etree_ElementNamespaceClassLookup;
   __pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry = &__pyx_vtable_4lxml_5etree__FunctionNamespaceRegistry;
   __pyx_vtable_4lxml_5etree__FunctionNamespaceRegistry.__pyx_base = *__pyx_vtabptr_4lxml_5etree__NamespaceRegistry;
   __pyx_type_4lxml_5etree__FunctionNamespaceRegistry.tp_base = __pyx_ptype_4lxml_5etree__NamespaceRegistry;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__FunctionNamespaceRegistry) < 0) __PYX_ERR(9, 190, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__FunctionNamespaceRegistry) < 0) __PYX_ERR(9, 237, __pyx_L1_error)
   __pyx_type_4lxml_5etree__FunctionNamespaceRegistry.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__FunctionNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry) < 0) __PYX_ERR(9, 190, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__FunctionNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry) < 0) __PYX_ERR(9, 237, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry = &__pyx_type_4lxml_5etree__FunctionNamespaceRegistry;
   __pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry = &__pyx_vtable_4lxml_5etree__XPathFunctionNamespaceRegistry;
   __pyx_vtable_4lxml_5etree__XPathFunctionNamespaceRegistry.__pyx_base = *__pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry;
   __pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry.tp_base = __pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry) < 0) __PYX_ERR(9, 205, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry) < 0) __PYX_ERR(9, 252, __pyx_L1_error)
   __pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry) < 0) __PYX_ERR(9, 205, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry) < 0) __PYX_ERR(9, 252, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry = &__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry;
   if (PyType_Ready(&__pyx_type_4lxml_5etree__InputDocument) < 0) __PYX_ERR(10, 12, __pyx_L1_error)
   __pyx_type_4lxml_5etree__InputDocument.tp_print = 0;
@@ -233775,10 +233809,10 @@ PyMODINIT_FUNC PyInit_etree(void)
   __pyx_vtabptr_4lxml_5etree__Validator = &__pyx_vtable_4lxml_5etree__Validator;
   __pyx_vtable_4lxml_5etree__Validator._append_log_message = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__Validator *, int, int, int, int, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4lxml_5etree_10_Validator__append_log_message;
   __pyx_vtable_4lxml_5etree__Validator._clear_error_log = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__Validator *, int __pyx_skip_dispatch))__pyx_f_4lxml_5etree_10_Validator__clear_error_log;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__Validator) < 0) __PYX_ERR(0, 3526, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__Validator) < 0) __PYX_ERR(0, 3529, __pyx_L1_error)
   __pyx_type_4lxml_5etree__Validator.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__Validator.tp_dict, __pyx_vtabptr_4lxml_5etree__Validator) < 0) __PYX_ERR(0, 3526, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "_Validator", (PyObject *)&__pyx_type_4lxml_5etree__Validator) < 0) __PYX_ERR(0, 3526, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__Validator.tp_dict, __pyx_vtabptr_4lxml_5etree__Validator) < 0) __PYX_ERR(0, 3529, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_Validator", (PyObject *)&__pyx_type_4lxml_5etree__Validator) < 0) __PYX_ERR(0, 3529, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__Validator = &__pyx_type_4lxml_5etree__Validator;
   __pyx_vtabptr_4lxml_5etree_XMLSchema = &__pyx_vtable_4lxml_5etree_XMLSchema;
   __pyx_vtable_4lxml_5etree_XMLSchema.__pyx_base = *__pyx_vtabptr_4lxml_5etree__Validator;
@@ -234285,9 +234319,9 @@ PyMODINIT_FUNC PyInit_etree(void)
   if (PyObject_SetAttrString(__pyx_m, "XSLTExtension", (PyObject *)&__pyx_type_4lxml_5etree_XSLTExtension) < 0) __PYX_ERR(19, 3, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_XSLTExtension = &__pyx_type_4lxml_5etree_XSLTExtension;
   __pyx_type_4lxml_5etree_DocumentInvalid.tp_base = __pyx_ptype_4lxml_5etree_LxmlError;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_DocumentInvalid) < 0) __PYX_ERR(0, 3518, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_DocumentInvalid) < 0) __PYX_ERR(0, 3521, __pyx_L1_error)
   __pyx_type_4lxml_5etree_DocumentInvalid.tp_print = 0;
-  if (PyObject_SetAttrString(__pyx_m, "DocumentInvalid", (PyObject *)&__pyx_type_4lxml_5etree_DocumentInvalid) < 0) __PYX_ERR(0, 3518, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "DocumentInvalid", (PyObject *)&__pyx_type_4lxml_5etree_DocumentInvalid) < 0) __PYX_ERR(0, 3521, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_DocumentInvalid = &__pyx_type_4lxml_5etree_DocumentInvalid;
   __pyx_type_4lxml_5etree_DTDError.tp_base = __pyx_ptype_4lxml_5etree_LxmlError;
   if (PyType_Ready(&__pyx_type_4lxml_5etree_DTDError) < 0) __PYX_ERR(20, 4, __pyx_L1_error)
@@ -234873,7 +234907,6 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L7_try_end;
     __pyx_L2_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
     /* "lxml/etree.pyx":64
@@ -234917,14 +234950,12 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     import __builtin__
  * except ImportError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L1_error;
     __pyx_L3_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -234978,7 +235009,6 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     goto __pyx_L15_try_end;
     __pyx_L10_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -235030,14 +235060,12 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     _unicode = __builtin__.unicode
  * except AttributeError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
     goto __pyx_L1_error;
     __pyx_L11_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
@@ -235141,7 +235169,6 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L23_try_end;
     __pyx_L18_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -235211,14 +235238,12 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     from io import BytesIO, StringIO
  * except (ImportError, AttributeError):
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L1_error;
     __pyx_L19_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -235291,7 +235316,6 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     goto __pyx_L31_try_end;
     __pyx_L26_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -235320,14 +235344,12 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     from collections import OrderedDict
  * except ImportError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
     goto __pyx_L1_error;
     __pyx_L27_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
@@ -235378,7 +235400,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  * cdef object re
  * import re             # <<<<<<<<<<<<<<
  * 
- * cdef object islice
+ * cdef object partial
  */
   __pyx_t_6 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
@@ -235389,43 +235411,67 @@ PyMODINIT_FUNC PyInit_etree(void)
 
   /* "lxml/etree.pyx":102
  * 
- * cdef object islice
- * from itertools import islice             # <<<<<<<<<<<<<<
+ * cdef object partial
+ * from functools import partial             # <<<<<<<<<<<<<<
  * 
- * cdef object ITER_EMPTY = iter(())
+ * cdef object islice
  */
   __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 102, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_INCREF(__pyx_n_s_islice);
-  __Pyx_GIVEREF(__pyx_n_s_islice);
-  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_islice);
-  __pyx_t_7 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_6, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_INCREF(__pyx_n_s_partial);
+  __Pyx_GIVEREF(__pyx_n_s_partial);
+  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_partial);
+  __pyx_t_7 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_6, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 102, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_islice); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_partial); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 102, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_INCREF(__pyx_t_6);
-  __Pyx_XGOTREF(__pyx_v_4lxml_5etree_islice);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_islice, __pyx_t_6);
+  __Pyx_XGOTREF(__pyx_v_4lxml_5etree_partial);
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_partial, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/etree.pyx":104
+  /* "lxml/etree.pyx":105
+ * 
+ * cdef object islice
+ * from itertools import islice             # <<<<<<<<<<<<<<
+ * 
+ * cdef object ITER_EMPTY = iter(())
+ */
+  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_INCREF(__pyx_n_s_islice);
+  __Pyx_GIVEREF(__pyx_n_s_islice);
+  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_islice);
+  __pyx_t_6 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_7, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_islice); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_INCREF(__pyx_t_7);
+  __Pyx_XGOTREF(__pyx_v_4lxml_5etree_islice);
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_islice, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+  /* "lxml/etree.pyx":107
  * from itertools import islice
  * 
  * cdef object ITER_EMPTY = iter(())             # <<<<<<<<<<<<<<
  * 
  * try:
  */
-  __pyx_t_7 = PyObject_GetIter(__pyx_empty_tuple); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 104, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = PyObject_GetIter(__pyx_empty_tuple); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_ITER_EMPTY);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_ITER_EMPTY, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_ITER_EMPTY, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":106
+  /* "lxml/etree.pyx":109
  * cdef object ITER_EMPTY = iter(())
  * 
  * try:             # <<<<<<<<<<<<<<
@@ -235441,28 +235487,28 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_XGOTREF(__pyx_t_4);
     /*try:*/ {
 
-      /* "lxml/etree.pyx":107
+      /* "lxml/etree.pyx":110
  * 
  * try:
  *     from collections.abc import MutableMapping  # Py3.3+             # <<<<<<<<<<<<<<
  * except ImportError:
  *     from collections import MutableMapping  # Py2.6+
  */
-      __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 107, __pyx_L32_error)
-      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L32_error)
+      __Pyx_GOTREF(__pyx_t_6);
       __Pyx_INCREF(__pyx_n_s_MutableMapping);
       __Pyx_GIVEREF(__pyx_n_s_MutableMapping);
-      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_MutableMapping);
-      __pyx_t_6 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_7, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L32_error)
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_MutableMapping); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 107, __pyx_L32_error)
+      PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_MutableMapping);
+      __pyx_t_7 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_6, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 110, __pyx_L32_error)
       __Pyx_GOTREF(__pyx_t_7);
-      if (PyDict_SetItem(__pyx_d, __pyx_n_s_MutableMapping, __pyx_t_7) < 0) __PYX_ERR(0, 107, __pyx_L32_error)
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_MutableMapping); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L32_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_MutableMapping, __pyx_t_6) < 0) __PYX_ERR(0, 110, __pyx_L32_error)
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-      /* "lxml/etree.pyx":106
+      /* "lxml/etree.pyx":109
  * cdef object ITER_EMPTY = iter(())
  * 
  * try:             # <<<<<<<<<<<<<<
@@ -235475,14 +235521,13 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L37_try_end;
     __pyx_L32_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "lxml/etree.pyx":108
+    /* "lxml/etree.pyx":111
  * try:
  *     from collections.abc import MutableMapping  # Py3.3+
  * except ImportError:             # <<<<<<<<<<<<<<
@@ -235492,54 +235537,52 @@ PyMODINIT_FUNC PyInit_etree(void)
     __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
     if (__pyx_t_5) {
       __Pyx_AddTraceback("lxml.etree", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_1) < 0) __PYX_ERR(0, 108, __pyx_L34_except_error)
-      __Pyx_GOTREF(__pyx_t_6);
+      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(0, 111, __pyx_L34_except_error)
       __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_1);
 
-      /* "lxml/etree.pyx":109
+      /* "lxml/etree.pyx":112
  *     from collections.abc import MutableMapping  # Py3.3+
  * except ImportError:
  *     from collections import MutableMapping  # Py2.6+             # <<<<<<<<<<<<<<
  * 
  * class _ImmutableMapping(MutableMapping):
  */
-      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L34_except_error)
+      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 112, __pyx_L34_except_error)
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_INCREF(__pyx_n_s_MutableMapping);
       __Pyx_GIVEREF(__pyx_n_s_MutableMapping);
       PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_MutableMapping);
-      __pyx_t_9 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_8, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 109, __pyx_L34_except_error)
+      __pyx_t_9 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_8, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L34_except_error)
       __Pyx_GOTREF(__pyx_t_9);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_MutableMapping); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L34_except_error)
+      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_MutableMapping); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 112, __pyx_L34_except_error)
       __Pyx_GOTREF(__pyx_t_8);
-      if (PyDict_SetItem(__pyx_d, __pyx_n_s_MutableMapping, __pyx_t_8) < 0) __PYX_ERR(0, 109, __pyx_L34_except_error)
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_MutableMapping, __pyx_t_8) < 0) __PYX_ERR(0, 112, __pyx_L34_except_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       goto __pyx_L33_exception_handled;
     }
     goto __pyx_L34_except_error;
     __pyx_L34_except_error:;
 
-    /* "lxml/etree.pyx":106
+    /* "lxml/etree.pyx":109
  * cdef object ITER_EMPTY = iter(())
  * 
  * try:             # <<<<<<<<<<<<<<
  *     from collections.abc import MutableMapping  # Py3.3+
  * except ImportError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L1_error;
     __pyx_L33_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -235547,183 +235590,183 @@ PyMODINIT_FUNC PyInit_etree(void)
     __pyx_L37_try_end:;
   }
 
-  /* "lxml/etree.pyx":111
+  /* "lxml/etree.pyx":114
  *     from collections import MutableMapping  # Py2.6+
  * 
  * class _ImmutableMapping(MutableMapping):             # <<<<<<<<<<<<<<
  *     def __getitem__(self, key):
  *         raise KeyError, key
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MutableMapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MutableMapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 111, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_7, __pyx_n_s_ImmutableMapping, __pyx_n_s_ImmutableMapping, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 111, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __pyx_n_s_ImmutableMapping, __pyx_n_s_ImmutableMapping, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
 
-  /* "lxml/etree.pyx":112
+  /* "lxml/etree.pyx":115
  * 
  * class _ImmutableMapping(MutableMapping):
  *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
  *         raise KeyError, key
  * 
  */
-  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_1__getitem__, 0, __pyx_n_s_ImmutableMapping___getitem, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_1__getitem__, 0, __pyx_n_s_ImmutableMapping___getitem, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 115, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_getitem, __pyx_t_9) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_getitem, __pyx_t_9) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/etree.pyx":115
+  /* "lxml/etree.pyx":118
  *         raise KeyError, key
  * 
  *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
  *         raise KeyError, key
  * 
  */
-  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_3__setitem__, 0, __pyx_n_s_ImmutableMapping___setitem, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_3__setitem__, 0, __pyx_n_s_ImmutableMapping___setitem, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_setitem, __pyx_t_9) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_setitem, __pyx_t_9) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/etree.pyx":118
+  /* "lxml/etree.pyx":121
  *         raise KeyError, key
  * 
  *     def __delitem__(self, key):             # <<<<<<<<<<<<<<
  *         raise KeyError, key
  * 
  */
-  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_5__delitem__, 0, __pyx_n_s_ImmutableMapping___delitem, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 118, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_5__delitem__, 0, __pyx_n_s_ImmutableMapping___delitem, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_delitem, __pyx_t_9) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_delitem, __pyx_t_9) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/etree.pyx":121
+  /* "lxml/etree.pyx":124
  *         raise KeyError, key
  * 
  *     def __contains__(self, key):             # <<<<<<<<<<<<<<
  *         return False
  * 
  */
-  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_7__contains__, 0, __pyx_n_s_ImmutableMapping___contains, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_7__contains__, 0, __pyx_n_s_ImmutableMapping___contains, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 124, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_contains, __pyx_t_9) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_contains, __pyx_t_9) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/etree.pyx":124
+  /* "lxml/etree.pyx":127
  *         return False
  * 
  *     def __len__(self):             # <<<<<<<<<<<<<<
  *         return 0
  * 
  */
-  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_9__len__, 0, __pyx_n_s_ImmutableMapping___len, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_9__len__, 0, __pyx_n_s_ImmutableMapping___len, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_len, __pyx_t_9) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_len, __pyx_t_9) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/etree.pyx":127
+  /* "lxml/etree.pyx":130
  *         return 0
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
  *         return ITER_EMPTY
  *     iterkeys = itervalues = iteritems = __iter__
  */
-  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_11__iter__, 0, __pyx_n_s_ImmutableMapping___iter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ImmutableMapping_11__iter__, 0, __pyx_n_s_ImmutableMapping___iter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 130, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_iter_2, __pyx_t_9) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_iter_2, __pyx_t_9) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/etree.pyx":129
+  /* "lxml/etree.pyx":132
  *     def __iter__(self):
  *         return ITER_EMPTY
  *     iterkeys = itervalues = iteritems = __iter__             # <<<<<<<<<<<<<<
  * 
  * cdef object IMMUTABLE_EMPTY_MAPPING = _ImmutableMapping()
  */
-  __pyx_t_9 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_iter_2);
+  __pyx_t_9 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_iter_2);
   if (unlikely(!__pyx_t_9)) {
     PyErr_Clear();
     __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_iter_2);
   }
-  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 129, __pyx_L1_error)
+  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 132, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_iterkeys, __pyx_t_9) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_itervalues, __pyx_t_9) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_iteritems, __pyx_t_9) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_iterkeys, __pyx_t_9) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_itervalues, __pyx_t_9) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_iteritems, __pyx_t_9) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/etree.pyx":111
+  /* "lxml/etree.pyx":114
  *     from collections import MutableMapping  # Py2.6+
  * 
  * class _ImmutableMapping(MutableMapping):             # <<<<<<<<<<<<<<
  *     def __getitem__(self, key):
  *         raise KeyError, key
  */
-  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ImmutableMapping, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ImmutableMapping, __pyx_t_6, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 114, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ImmutableMapping, __pyx_t_9) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ImmutableMapping, __pyx_t_9) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":131
+  /* "lxml/etree.pyx":134
  *     iterkeys = itervalues = iteritems = __iter__
  * 
  * cdef object IMMUTABLE_EMPTY_MAPPING = _ImmutableMapping()             # <<<<<<<<<<<<<<
  * del MutableMapping, _ImmutableMapping
  * 
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ImmutableMapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ImmutableMapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_6 = NULL;
+  __pyx_t_7 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
-    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
-    if (likely(__pyx_t_6)) {
+    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
+    if (likely(__pyx_t_7)) {
       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
-      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(__pyx_t_7);
       __Pyx_INCREF(function);
       __Pyx_DECREF_SET(__pyx_t_1, function);
     }
   }
-  if (__pyx_t_6) {
-    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (__pyx_t_7) {
+    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   } else {
-    __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L1_error)
   }
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":132
+  /* "lxml/etree.pyx":135
  * 
  * cdef object IMMUTABLE_EMPTY_MAPPING = _ImmutableMapping()
  * del MutableMapping, _ImmutableMapping             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MutableMapping) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
-  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ImmutableMapping) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
+  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MutableMapping) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
+  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ImmutableMapping) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":150
+  /* "lxml/etree.pyx":153
  * 
  * # make the compiled-in debug state publicly available
  * DEBUG = __DEBUG             # <<<<<<<<<<<<<<
  * 
  * # A struct to store a cached qualified tag name+href pair.
  */
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG, __pyx_int_1) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG, __pyx_int_1) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":161
+  /* "lxml/etree.pyx":164
  * 
  * # global per-thread setup
  * tree.xmlThrDefIndentTreeOutput(1)             # <<<<<<<<<<<<<<
@@ -235732,7 +235775,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  */
   xmlThrDefIndentTreeOutput(1);
 
-  /* "lxml/etree.pyx":162
+  /* "lxml/etree.pyx":165
  * # global per-thread setup
  * tree.xmlThrDefIndentTreeOutput(1)
  * tree.xmlThrDefLineNumbersDefaultValue(1)             # <<<<<<<<<<<<<<
@@ -235741,7 +235784,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  */
   xmlThrDefLineNumbersDefaultValue(1);
 
-  /* "lxml/etree.pyx":164
+  /* "lxml/etree.pyx":167
  * tree.xmlThrDefLineNumbersDefaultValue(1)
  * 
  * _initThreadLogging()             # <<<<<<<<<<<<<<
@@ -235750,7 +235793,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  */
   __pyx_f_4lxml_5etree__initThreadLogging();
 
-  /* "lxml/etree.pyx":167
+  /* "lxml/etree.pyx":170
  * 
  * # initialize parser (and threading)
  * xmlparser.xmlInitParser()             # <<<<<<<<<<<<<<
@@ -235759,154 +235802,154 @@ PyMODINIT_FUNC PyInit_etree(void)
  */
   xmlInitParser();
 
-  /* "lxml/etree.pyx":170
+  /* "lxml/etree.pyx":173
  * 
  * # filename encoding
  * cdef bytes _FILENAME_ENCODING = (sys.getfilesystemencoding() or sys.getdefaultencoding() or 'ascii').encode("UTF-8")             # <<<<<<<<<<<<<<
  * cdef char* _C_FILENAME_ENCODING = _cstr(_FILENAME_ENCODING)
  * 
  */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_sys, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_sys, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 173, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __pyx_t_9 = NULL;
-  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
-    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
     if (likely(__pyx_t_9)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
       __Pyx_INCREF(__pyx_t_9);
       __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_6, function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
     }
   }
   if (__pyx_t_9) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   } else {
-    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 170, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
   if (!__pyx_t_10) {
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     __Pyx_INCREF(__pyx_t_1);
-    __pyx_t_7 = __pyx_t_1;
+    __pyx_t_6 = __pyx_t_1;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     goto __pyx_L40_bool_binop_done;
   }
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_sys, __pyx_n_s_getdefaultencoding); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_sys, __pyx_n_s_getdefaultencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 173, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __pyx_t_9 = NULL;
-  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
-    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
     if (likely(__pyx_t_9)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
       __Pyx_INCREF(__pyx_t_9);
       __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_6, function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
     }
   }
   if (__pyx_t_9) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   } else {
-    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
   }
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 170, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
   if (!__pyx_t_10) {
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     __Pyx_INCREF(__pyx_t_1);
-    __pyx_t_7 = __pyx_t_1;
+    __pyx_t_6 = __pyx_t_1;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     goto __pyx_L40_bool_binop_done;
   }
   __Pyx_INCREF(__pyx_n_s_ascii);
-  __pyx_t_7 = __pyx_n_s_ascii;
+  __pyx_t_6 = __pyx_n_s_ascii;
   __pyx_L40_bool_binop_done:;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__132, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 170, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__134, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (!(likely(PyBytes_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 170, __pyx_L1_error)
+  if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 173, __pyx_L1_error)
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__FILENAME_ENCODING, ((PyObject*)__pyx_t_7));
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__FILENAME_ENCODING, ((PyObject*)__pyx_t_6));
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":171
+  /* "lxml/etree.pyx":174
  * # filename encoding
  * cdef bytes _FILENAME_ENCODING = (sys.getfilesystemencoding() or sys.getdefaultencoding() or 'ascii').encode("UTF-8")
  * cdef char* _C_FILENAME_ENCODING = _cstr(_FILENAME_ENCODING)             # <<<<<<<<<<<<<<
  * 
  * # set up some default namespace prefixes
  */
-  __pyx_t_7 = __pyx_v_4lxml_5etree__FILENAME_ENCODING;
-  __Pyx_INCREF(__pyx_t_7);
-  __pyx_v_4lxml_5etree__C_FILENAME_ENCODING = PyBytes_AS_STRING(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __pyx_v_4lxml_5etree__FILENAME_ENCODING;
+  __Pyx_INCREF(__pyx_t_6);
+  __pyx_v_4lxml_5etree__C_FILENAME_ENCODING = PyBytes_AS_STRING(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":175
+  /* "lxml/etree.pyx":178
  * # set up some default namespace prefixes
  * cdef dict _DEFAULT_NAMESPACE_PREFIXES = {
  *     b"http://www.w3.org/XML/1998/namespace": b'xml',             # <<<<<<<<<<<<<<
  *     b"http://www.w3.org/1999/xhtml": b"html",
  *     b"http://www.w3.org/1999/XSL/Transform": b"xsl",
  */
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 175, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_b_http_www_w3_org_XML_1998_namespa, __pyx_n_b_xml) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_b_http_www_w3_org_1999_xhtml, __pyx_n_b_html) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_b_http_www_w3_org_1999_XSL_Transfo, __pyx_n_b_xsl) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_b_http_www_w3_org_1999_02_22_rdf_s, __pyx_n_b_rdf) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_b_http_schemas_xmlsoap_org_wsdl, __pyx_n_b_wsdl) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_b_http_www_w3_org_2001_XMLSchema, __pyx_n_b_xs) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_b_http_www_w3_org_2001_XMLSchema_i, __pyx_n_b_xsi) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_b_http_purl_org_dc_elements_1_1, __pyx_n_b_dc) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_kp_b_http_codespeak_net_lxml_objectif, __pyx_n_b_py) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_6, __pyx_kp_b_http_www_w3_org_XML_1998_namespa, __pyx_n_b_xml) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_kp_b_http_www_w3_org_1999_xhtml, __pyx_n_b_html) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_kp_b_http_www_w3_org_1999_XSL_Transfo, __pyx_n_b_xsl) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_kp_b_http_www_w3_org_1999_02_22_rdf_s, __pyx_n_b_rdf) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_kp_b_http_schemas_xmlsoap_org_wsdl, __pyx_n_b_wsdl) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_kp_b_http_www_w3_org_2001_XMLSchema, __pyx_n_b_xs) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_kp_b_http_www_w3_org_2001_XMLSchema_i, __pyx_n_b_xsi) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_kp_b_http_purl_org_dc_elements_1_1, __pyx_n_b_dc) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_kp_b_http_codespeak_net_lxml_objectif, __pyx_n_b_py) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES, ((PyObject*)__pyx_t_7));
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES, ((PyObject*)__pyx_t_6));
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":189
+  /* "lxml/etree.pyx":192
  * }
  * 
  * cdef object _check_internal_prefix = re.compile(b"ns\d+$").match             # <<<<<<<<<<<<<<
  * 
  * def register_namespace(prefix, uri):
  */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__135, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_match); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_match); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__check_internal_prefix);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__check_internal_prefix, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__check_internal_prefix, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":191
+  /* "lxml/etree.pyx":194
  * cdef object _check_internal_prefix = re.compile(b"ns\d+$").match
  * 
  * def register_namespace(prefix, uri):             # <<<<<<<<<<<<<<
  *     u"""Registers a namespace prefix that newly created Elements in that
  *     namespace will use.  The registry is global, and any existing
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_1register_namespace, 0, __pyx_n_s_register_namespace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 191, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_namespace, __pyx_t_7) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_1register_namespace, 0, __pyx_n_s_register_namespace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_namespace, __pyx_t_6) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":224
+  /* "lxml/etree.pyx":227
  *             self.error_log = error_log.copy()
  * 
  * cdef object _Error = Error             # <<<<<<<<<<<<<<
@@ -235918,34 +235961,34 @@ PyMODINIT_FUNC PyInit_etree(void)
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__Error, ((PyObject *)__pyx_ptype_4lxml_5etree_Error));
   __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_5etree_Error));
 
-  /* "lxml/etree.pyx":228
+  /* "lxml/etree.pyx":231
  * 
  * # superclass for all syntax errors
  * class LxmlSyntaxError(LxmlError, SyntaxError):             # <<<<<<<<<<<<<<
  *     """Base class for all syntax errors.
  *     """
  */
-  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_5etree_LxmlError));
   __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_5etree_LxmlError));
-  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_ptype_4lxml_5etree_LxmlError));
+  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_ptype_4lxml_5etree_LxmlError));
   __Pyx_INCREF(__pyx_builtin_SyntaxError);
   __Pyx_GIVEREF(__pyx_builtin_SyntaxError);
-  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_builtin_SyntaxError);
-  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_builtin_SyntaxError);
+  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_7, __pyx_n_s_LxmlSyntaxError, __pyx_n_s_LxmlSyntaxError, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Base_class_for_all_syntax_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_LxmlSyntaxError, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 228, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_6, __pyx_n_s_LxmlSyntaxError, __pyx_n_s_LxmlSyntaxError, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Base_class_for_all_syntax_errors); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_LxmlSyntaxError, __pyx_t_6, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 231, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LxmlSyntaxError, __pyx_t_9) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LxmlSyntaxError, __pyx_t_9) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":268
+  /* "lxml/etree.pyx":271
  * 
  * cdef int _LIBXML_VERSION_INT
  * try:             # <<<<<<<<<<<<<<
@@ -235961,18 +236004,18 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_XGOTREF(__pyx_t_2);
     /*try:*/ {
 
-      /* "lxml/etree.pyx":270
+      /* "lxml/etree.pyx":273
  * try:
  *     _LIBXML_VERSION_INT = int(
  *         re.match(u'[0-9]+', (<unsigned char*>tree.xmlParserVersion).decode("ascii")).group(0))             # <<<<<<<<<<<<<<
  * except Exception:
  *     print u"Unknown libxml2 version: %s" % (<unsigned char*>tree.xmlParserVersion).decode("latin1")
  */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_match); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L43_error)
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_match); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L43_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_t_11 = ((unsigned char *)xmlParserVersion);
-      __pyx_t_6 = __Pyx_decode_c_string(((char const *)__pyx_t_11), 0, strlen(((char const *)__pyx_t_11)), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L43_error)
-      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_7 = __Pyx_decode_c_string(((char const *)__pyx_t_11), 0, strlen(((char const *)__pyx_t_11)), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L43_error)
+      __Pyx_GOTREF(__pyx_t_7);
       __pyx_t_9 = NULL;
       __pyx_t_5 = 0;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -235987,24 +236030,24 @@ PyMODINIT_FUNC PyInit_etree(void)
       }
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_1)) {
-        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_u_0_9, __pyx_t_6};
-        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __pyx_L43_error)
+        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_u_0_9, __pyx_t_7};
+        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L43_error)
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       } else
       #endif
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
-        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_u_0_9, __pyx_t_6};
-        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __pyx_L43_error)
+        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_u_0_9, __pyx_t_7};
+        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L43_error)
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L43_error)
+        __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L43_error)
         __Pyx_GOTREF(__pyx_t_8);
         if (__pyx_t_9) {
           __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
@@ -236012,37 +236055,37 @@ PyMODINIT_FUNC PyInit_etree(void)
         __Pyx_INCREF(__pyx_kp_u_0_9);
         __Pyx_GIVEREF(__pyx_kp_u_0_9);
         PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_kp_u_0_9);
-        __Pyx_INCREF(__pyx_t_6);
-        __Pyx_GIVEREF(__pyx_t_6);
-        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_t_6);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __pyx_L43_error)
-        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_GIVEREF(__pyx_t_7);
+        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_t_7);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L43_error)
+        __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L43_error)
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L43_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __pyx_L43_error)
-      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L43_error)
+      __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-      /* "lxml/etree.pyx":269
+      /* "lxml/etree.pyx":272
  * cdef int _LIBXML_VERSION_INT
  * try:
  *     _LIBXML_VERSION_INT = int(             # <<<<<<<<<<<<<<
  *         re.match(u'[0-9]+', (<unsigned char*>tree.xmlParserVersion).decode("ascii")).group(0))
  * except Exception:
  */
-      __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L43_error)
+      __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L43_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L43_error)
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L43_error)
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_v_4lxml_5etree__LIBXML_VERSION_INT = __pyx_t_5;
 
-      /* "lxml/etree.pyx":268
+      /* "lxml/etree.pyx":271
  * 
  * cdef int _LIBXML_VERSION_INT
  * try:             # <<<<<<<<<<<<<<
@@ -236055,14 +236098,13 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     goto __pyx_L48_try_end;
     __pyx_L43_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "lxml/etree.pyx":271
+    /* "lxml/etree.pyx":274
  *     _LIBXML_VERSION_INT = int(
  *         re.match(u'[0-9]+', (<unsigned char*>tree.xmlParserVersion).decode("ascii")).group(0))
  * except Exception:             # <<<<<<<<<<<<<<
@@ -236072,12 +236114,12 @@ PyMODINIT_FUNC PyInit_etree(void)
     __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
     if (__pyx_t_5) {
       __Pyx_AddTraceback("lxml.etree", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 271, __pyx_L45_except_error)
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 274, __pyx_L45_except_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_8);
 
-      /* "lxml/etree.pyx":272
+      /* "lxml/etree.pyx":275
  *         re.match(u'[0-9]+', (<unsigned char*>tree.xmlParserVersion).decode("ascii")).group(0))
  * except Exception:
  *     print u"Unknown libxml2 version: %s" % (<unsigned char*>tree.xmlParserVersion).decode("latin1")             # <<<<<<<<<<<<<<
@@ -236085,15 +236127,15 @@ PyMODINIT_FUNC PyInit_etree(void)
  * 
  */
       __pyx_t_11 = ((unsigned char *)xmlParserVersion);
-      __pyx_t_6 = __Pyx_decode_c_string(((char const *)__pyx_t_11), 0, strlen(((char const *)__pyx_t_11)), NULL, NULL, PyUnicode_DecodeLatin1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L45_except_error)
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_9 = PyUnicode_Format(__pyx_kp_u_Unknown_libxml2_version_s, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 272, __pyx_L45_except_error)
+      __pyx_t_7 = __Pyx_decode_c_string(((char const *)__pyx_t_11), 0, strlen(((char const *)__pyx_t_11)), NULL, NULL, PyUnicode_DecodeLatin1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L45_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_9 = PyUnicode_Format(__pyx_kp_u_Unknown_libxml2_version_s, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 275, __pyx_L45_except_error)
       __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (__Pyx_PrintOne(0, __pyx_t_9) < 0) __PYX_ERR(0, 272, __pyx_L45_except_error)
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (__Pyx_PrintOne(0, __pyx_t_9) < 0) __PYX_ERR(0, 275, __pyx_L45_except_error)
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-      /* "lxml/etree.pyx":273
+      /* "lxml/etree.pyx":276
  * except Exception:
  *     print u"Unknown libxml2 version: %s" % (<unsigned char*>tree.xmlParserVersion).decode("latin1")
  *     _LIBXML_VERSION_INT = 0             # <<<<<<<<<<<<<<
@@ -236102,28 +236144,26 @@ PyMODINIT_FUNC PyInit_etree(void)
  */
       __pyx_v_4lxml_5etree__LIBXML_VERSION_INT = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       goto __pyx_L44_exception_handled;
     }
     goto __pyx_L45_except_error;
     __pyx_L45_except_error:;
 
-    /* "lxml/etree.pyx":268
+    /* "lxml/etree.pyx":271
  * 
  * cdef int _LIBXML_VERSION_INT
  * try:             # <<<<<<<<<<<<<<
  *     _LIBXML_VERSION_INT = int(
  *         re.match(u'[0-9]+', (<unsigned char*>tree.xmlParserVersion).decode("ascii")).group(0))
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
     goto __pyx_L1_error;
     __pyx_L44_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
@@ -236131,56 +236171,56 @@ PyMODINIT_FUNC PyInit_etree(void)
     __pyx_L48_try_end:;
   }
 
-  /* "lxml/etree.pyx":275
+  /* "lxml/etree.pyx":278
  *     _LIBXML_VERSION_INT = 0
  * 
  * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)             # <<<<<<<<<<<<<<
  * LIBXML_COMPILED_VERSION = __unpackIntVersion(tree.LIBXML_VERSION)
  * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)
  */
-  __pyx_t_8 = __pyx_f_4lxml_5etree___unpackIntVersion(__pyx_v_4lxml_5etree__LIBXML_VERSION_INT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error)
+  __pyx_t_8 = __pyx_f_4lxml_5etree___unpackIntVersion(__pyx_v_4lxml_5etree__LIBXML_VERSION_INT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBXML_VERSION, __pyx_t_8) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBXML_VERSION, __pyx_t_8) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":276
+  /* "lxml/etree.pyx":279
  * 
  * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)
  * LIBXML_COMPILED_VERSION = __unpackIntVersion(tree.LIBXML_VERSION)             # <<<<<<<<<<<<<<
  * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)
  * 
  */
-  __pyx_t_8 = __pyx_f_4lxml_5etree___unpackIntVersion(LIBXML_VERSION); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error)
+  __pyx_t_8 = __pyx_f_4lxml_5etree___unpackIntVersion(LIBXML_VERSION); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBXML_COMPILED_VERSION, __pyx_t_8) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBXML_COMPILED_VERSION, __pyx_t_8) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":277
+  /* "lxml/etree.pyx":280
  * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)
  * LIBXML_COMPILED_VERSION = __unpackIntVersion(tree.LIBXML_VERSION)
  * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)             # <<<<<<<<<<<<<<
  * 
  * __version__ = tree.LXML_VERSION_STRING.decode("ascii")
  */
-  __pyx_t_8 = __Pyx_PyBytes_FromString(LXML_VERSION_STRING); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyBytes_FromString(LXML_VERSION_STRING); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_7 = __pyx_f_4lxml_5etree___unpackDottedVersion(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 277, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __pyx_f_4lxml_5etree___unpackDottedVersion(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LXML_VERSION, __pyx_t_7) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LXML_VERSION, __pyx_t_6) < 0) __PYX_ERR(0, 280, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":279
+  /* "lxml/etree.pyx":282
  * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)
  * 
  * __version__ = tree.LXML_VERSION_STRING.decode("ascii")             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_t_7 = __Pyx_decode_c_string(LXML_VERSION_STRING, 0, strlen(LXML_VERSION_STRING), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 279, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_version_2, __pyx_t_7) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_decode_c_string(LXML_VERSION_STRING, 0, strlen(LXML_VERSION_STRING), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_version_2, __pyx_t_6) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
   /* "src/lxml/apihelpers.pxi":631
  *     return attributes
@@ -236216,42 +236256,42 @@ PyMODINIT_FUNC PyInit_etree(void)
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_8)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_u_xml_s_encoding_s_s_s, __pyx_t_1};
-    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 631, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 631, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
     PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_u_xml_s_encoding_s_s_s, __pyx_t_1};
-    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 631, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 631, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 631, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 631, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_9) {
-      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
+      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
     }
     __Pyx_INCREF(__pyx_kp_u_xml_s_encoding_s_s_s);
     __Pyx_GIVEREF(__pyx_kp_u_xml_s_encoding_s_s_s);
-    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_kp_u_xml_s_encoding_s_s_s);
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, __pyx_kp_u_xml_s_encoding_s_s_s);
     __Pyx_GIVEREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, __pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 631, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 631, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree___RE_XML_ENCODING);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "src/lxml/apihelpers.pxi":634
  *     ur'^(<\?xml[^>]+)\s+encoding\s*=\s*["\'][^"\']*["\'](\s*\?>|)', re.U)
@@ -236260,12 +236300,12 @@ PyMODINIT_FUNC PyInit_etree(void)
  * cdef object __HAS_XML_ENCODING = __RE_XML_ENCODING.match
  * 
  */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_n_s_sub); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 634, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_n_s_sub); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 634, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "src/lxml/apihelpers.pxi":635
  * 
@@ -236274,12 +236314,12 @@ PyMODINIT_FUNC PyInit_etree(void)
  * 
  * cdef object _stripEncodingDeclaration(object xml_string):
  */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_n_s_match); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 635, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_n_s_match); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 635, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree___HAS_XML_ENCODING);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___HAS_XML_ENCODING, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___HAS_XML_ENCODING, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "src/lxml/xmlerror.pxi":8
  * # module level API functions
@@ -236288,10 +236328,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""clear_error_log()
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_3clear_error_log, 0, __pyx_n_s_clear_error_log_2, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 8, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clear_error_log_2, __pyx_t_7) < 0) __PYX_ERR(1, 8, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_3clear_error_log, 0, __pyx_n_s_clear_error_log_2, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clear_error_log_2, __pyx_t_6) < 0) __PYX_ERR(1, 8, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
   /* "src/lxml/xmlerror.pxi":186
  *         self.last_error = last_error
@@ -236300,10 +236340,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return _BaseErrorLog(self._first_error, self.last_error)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_BaseErrorLog_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseErrorLog_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 186, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__BaseErrorLog->tp_dict, __pyx_n_s_copy, __pyx_t_7) < 0) __PYX_ERR(1, 186, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_BaseErrorLog_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseErrorLog_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__BaseErrorLog->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(1, 186, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__BaseErrorLog);
 
   /* "src/lxml/xmlerror.pxi":192
@@ -236313,10 +236353,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         pass
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_BaseErrorLog_7receive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseErrorLog_receive, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 192, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__BaseErrorLog->tp_dict, __pyx_n_s_receive, __pyx_t_7) < 0) __PYX_ERR(1, 192, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_BaseErrorLog_7receive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseErrorLog_receive, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 192, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__BaseErrorLog->tp_dict, __pyx_n_s_receive, __pyx_t_6) < 0) __PYX_ERR(1, 192, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__BaseErrorLog);
 
   /* "src/lxml/xmlerror.pxi":283
@@ -236326,10 +236366,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Creates a shallow copy of this error log.  Reuses the list of
  *         entries.
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 283, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_copy, __pyx_t_7) < 0) __PYX_ERR(1, 283, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 283, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(1, 283, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ListErrorLog);
 
   /* "src/lxml/xmlerror.pxi":321
@@ -236339,10 +236379,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Filter the errors by the given domains and return a new error log
  *         containing the matches.
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_17filter_domains, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_domains, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 321, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_domains, __pyx_t_7) < 0) __PYX_ERR(1, 321, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_17filter_domains, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_domains, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 321, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_domains, __pyx_t_6) < 0) __PYX_ERR(1, 321, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ListErrorLog);
 
   /* "src/lxml/xmlerror.pxi":331
@@ -236352,10 +236392,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""filter_types(self, types)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_19filter_types, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_types, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 331, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_types, __pyx_t_7) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_19filter_types, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_types, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 331, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_types, __pyx_t_6) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ListErrorLog);
 
   /* "src/lxml/xmlerror.pxi":343
@@ -236365,10 +236405,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""filter_levels(self, levels)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_21filter_levels, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_levels, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 343, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_levels, __pyx_t_7) < 0) __PYX_ERR(1, 343, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_21filter_levels, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_levels, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 343, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_levels, __pyx_t_6) < 0) __PYX_ERR(1, 343, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ListErrorLog);
 
   /* "src/lxml/xmlerror.pxi":355
@@ -236378,10 +236418,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""filter_from_level(self, level)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_23filter_from_level, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_from_level, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 355, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_from_level, __pyx_t_7) < 0) __PYX_ERR(1, 355, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_23filter_from_level, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_from_level, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 355, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_from_level, __pyx_t_6) < 0) __PYX_ERR(1, 355, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ListErrorLog);
 
   /* "src/lxml/xmlerror.pxi":364
@@ -236391,10 +236431,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""filter_from_fatals(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_25filter_from_fatals, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_from_fatals, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 364, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_from_fatals, __pyx_t_7) < 0) __PYX_ERR(1, 364, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_25filter_from_fatals, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_from_fatals, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 364, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_from_fatals, __pyx_t_6) < 0) __PYX_ERR(1, 364, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ListErrorLog);
 
   /* "src/lxml/xmlerror.pxi":371
@@ -236404,10 +236444,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""filter_from_errors(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_27filter_from_errors, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_from_errors, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 371, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_from_errors, __pyx_t_7) < 0) __PYX_ERR(1, 371, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_27filter_from_errors, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_from_errors, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 371, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_from_errors, __pyx_t_6) < 0) __PYX_ERR(1, 371, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ListErrorLog);
 
   /* "src/lxml/xmlerror.pxi":378
@@ -236417,10 +236457,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""filter_from_warnings(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_29filter_from_warnings, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_from_warnin, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 378, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_from_warnings, __pyx_t_7) < 0) __PYX_ERR(1, 378, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13_ListErrorLog_29filter_from_warnings, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ListErrorLog_filter_from_warnin, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 378, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dict, __pyx_n_s_filter_from_warnings, __pyx_t_6) < 0) __PYX_ERR(1, 378, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ListErrorLog);
 
   /* "src/lxml/xmlerror.pxi":408
@@ -236430,10 +236470,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         #  TODO: make this a cdef function when Cython supports it
  *         self.disconnect()
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_ErrorLog_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorLog___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 408, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog->tp_dict, __pyx_n_s_exit, __pyx_t_7) < 0) __PYX_ERR(1, 408, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_ErrorLog_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorLog___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 408, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog->tp_dict, __pyx_n_s_exit, __pyx_t_6) < 0) __PYX_ERR(1, 408, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ErrorLog);
 
   /* "src/lxml/xmlerror.pxi":432
@@ -236443,10 +236483,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._first_error = None
  *         self.last_error = None
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_ErrorLog_7clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorLog_clear, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 432, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog->tp_dict, __pyx_n_s_clear, __pyx_t_7) < 0) __PYX_ERR(1, 432, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_ErrorLog_7clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorLog_clear, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 432, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog->tp_dict, __pyx_n_s_clear, __pyx_t_6) < 0) __PYX_ERR(1, 432, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ErrorLog);
 
   /* "src/lxml/xmlerror.pxi":438
@@ -236456,10 +236496,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Creates a shallow copy of this error log and the list of entries.
  *         """
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_ErrorLog_9copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorLog_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 438, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog->tp_dict, __pyx_n_s_copy, __pyx_t_7) < 0) __PYX_ERR(1, 438, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_ErrorLog_9copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorLog_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ErrorLog);
 
   /* "src/lxml/xmlerror.pxi":448
@@ -236469,10 +236509,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         if self._first_error is None and entry.level >= xmlerror.XML_ERR_ERROR:
  *             self._first_error = entry
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_ErrorLog_13receive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorLog_receive, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 448, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog->tp_dict, __pyx_n_s_receive, __pyx_t_7) < 0) __PYX_ERR(1, 448, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_ErrorLog_13receive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ErrorLog_receive, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 448, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog->tp_dict, __pyx_n_s_receive, __pyx_t_6) < 0) __PYX_ERR(1, 448, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ErrorLog);
 
   /* "src/lxml/xmlerror.pxi":458
@@ -236482,10 +236522,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         if entry.domain in self._accepted_domains:
  *             _ErrorLog.receive(self, entry)
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15_DomainErrorLog_3receive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DomainErrorLog_receive, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 458, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__DomainErrorLog->tp_dict, __pyx_n_s_receive, __pyx_t_7) < 0) __PYX_ERR(1, 458, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15_DomainErrorLog_3receive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DomainErrorLog_receive, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 458, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__DomainErrorLog->tp_dict, __pyx_n_s_receive, __pyx_t_6) < 0) __PYX_ERR(1, 458, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__DomainErrorLog);
 
   /* "src/lxml/xmlerror.pxi":468
@@ -236495,10 +236535,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         if self._first_error is None and entry.level >= xmlerror.XML_ERR_ERROR:
  *             self._first_error = entry
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_RotatingErrorLog_3receive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RotatingErrorLog_receive, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 468, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__RotatingErrorLog->tp_dict, __pyx_n_s_receive, __pyx_t_7) < 0) __PYX_ERR(1, 468, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_RotatingErrorLog_3receive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RotatingErrorLog_receive, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 468, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__RotatingErrorLog->tp_dict, __pyx_n_s_receive, __pyx_t_6) < 0) __PYX_ERR(1, 468, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__RotatingErrorLog);
 
   /* "src/lxml/xmlerror.pxi":519
@@ -236508,10 +236548,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Dummy method that returns an empty error log.
  *         """
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10PyErrorLog_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyErrorLog_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 519, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_PyErrorLog->tp_dict, __pyx_n_s_copy, __pyx_t_7) < 0) __PYX_ERR(1, 519, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10PyErrorLog_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyErrorLog_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_PyErrorLog->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(1, 519, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_PyErrorLog);
 
   /* "src/lxml/xmlerror.pxi":524
@@ -236521,10 +236561,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""log(self, log_entry, message, *args)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10PyErrorLog_5log, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyErrorLog_log, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 524, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_PyErrorLog->tp_dict, __pyx_n_s_log, __pyx_t_7) < 0) __PYX_ERR(1, 524, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10PyErrorLog_5log, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyErrorLog_log, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 524, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_PyErrorLog->tp_dict, __pyx_n_s_log, __pyx_t_6) < 0) __PYX_ERR(1, 524, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_PyErrorLog);
 
   /* "src/lxml/xmlerror.pxi":541
@@ -236534,10 +236574,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""receive(self, log_entry)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10PyErrorLog_7receive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyErrorLog_receive, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 541, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_PyErrorLog->tp_dict, __pyx_n_s_receive, __pyx_t_7) < 0) __PYX_ERR(1, 541, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10PyErrorLog_7receive, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyErrorLog_receive, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 541, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_PyErrorLog->tp_dict, __pyx_n_s_receive, __pyx_t_6) < 0) __PYX_ERR(1, 541, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_PyErrorLog);
 
   /* "src/lxml/xmlerror.pxi":558
@@ -236547,12 +236587,12 @@ PyMODINIT_FUNC PyInit_etree(void)
  * 
  * cdef _BaseErrorLog _getGlobalErrorLog():
  */
-  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__RotatingErrorLog), __pyx_tuple__176, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 558, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__RotatingErrorLog), __pyx_tuple__178, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_XGOTREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG));
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG, ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_7));
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG, ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_6));
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "src/lxml/xmlerror.pxi":587
  *     return _getGlobalErrorLog().copy()
@@ -236561,10 +236601,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""use_global_python_log(log)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_5use_global_python_log, 0, __pyx_n_s_use_global_python_log, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 587, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_use_global_python_log, __pyx_t_7) < 0) __PYX_ERR(1, 587, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_5use_global_python_log, 0, __pyx_n_s_use_global_python_log, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 587, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_use_global_python_log, __pyx_t_6) < 0) __PYX_ERR(1, 587, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
   /* "src/lxml/xmlerror.pxi":772
  * 
@@ -236573,22 +236613,16 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"Libxml2 error levels"
  * 
  */
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 772, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_INCREF(__pyx_builtin_object);
-  __Pyx_GIVEREF(__pyx_builtin_object);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_builtin_object);
-  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 772, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_7, __pyx_n_s_ErrorLevels, __pyx_n_s_ErrorLevels, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Libxml2_error_levels); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 772, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__181); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 772, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_ErrorLevels, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 772, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ErrorLevels, __pyx_t_1) < 0) __PYX_ERR(1, 772, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_tuple__181, __pyx_n_s_ErrorLevels, __pyx_n_s_ErrorLevels, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Libxml2_error_levels); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 772, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_ErrorLevels, __pyx_tuple__181, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 772, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ErrorLevels, __pyx_t_7) < 0) __PYX_ERR(1, 772, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
   /* "src/lxml/xmlerror.pxi":775
  *     u"Libxml2 error levels"
@@ -236597,22 +236631,16 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"Libxml2 error domains"
  * 
  */
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 775, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_INCREF(__pyx_builtin_object);
-  __Pyx_GIVEREF(__pyx_builtin_object);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_builtin_object);
-  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 775, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_7, __pyx_n_s_ErrorDomains, __pyx_n_s_ErrorDomains, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Libxml2_error_domains); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 775, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__182); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 775, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_ErrorDomains, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 775, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ErrorDomains, __pyx_t_1) < 0) __PYX_ERR(1, 775, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_tuple__182, __pyx_n_s_ErrorDomains, __pyx_n_s_ErrorDomains, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Libxml2_error_domains); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 775, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_ErrorDomains, __pyx_tuple__182, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 775, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ErrorDomains, __pyx_t_7) < 0) __PYX_ERR(1, 775, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
   /* "src/lxml/xmlerror.pxi":778
  *     u"Libxml2 error domains"
@@ -236621,22 +236649,16 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"Libxml2 error types"
  * 
  */
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 778, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_INCREF(__pyx_builtin_object);
-  __Pyx_GIVEREF(__pyx_builtin_object);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_builtin_object);
-  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 778, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_7, __pyx_n_s_ErrorTypes, __pyx_n_s_ErrorTypes, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Libxml2_error_types); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 778, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__183); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 778, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_ErrorTypes, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 778, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ErrorTypes, __pyx_t_1) < 0) __PYX_ERR(1, 778, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_tuple__183, __pyx_n_s_ErrorTypes, __pyx_n_s_ErrorTypes, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Libxml2_error_types); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 778, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_ErrorTypes, __pyx_tuple__183, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 778, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ErrorTypes, __pyx_t_7) < 0) __PYX_ERR(1, 778, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
   /* "src/lxml/xmlerror.pxi":781
  *     u"Libxml2 error types"
@@ -236645,22 +236667,16 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"Libxml2 RelaxNG error types"
  * 
  */
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 781, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_INCREF(__pyx_builtin_object);
-  __Pyx_GIVEREF(__pyx_builtin_object);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_builtin_object);
-  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 781, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_7, __pyx_n_s_RelaxNGErrorTypes, __pyx_n_s_RelaxNGErrorTypes, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Libxml2_RelaxNG_error_types); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 781, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__184); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 781, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_RelaxNGErrorTypes, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 781, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RelaxNGErrorTypes, __pyx_t_1) < 0) __PYX_ERR(1, 781, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_tuple__184, __pyx_n_s_RelaxNGErrorTypes, __pyx_n_s_RelaxNGErrorTypes, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Libxml2_RelaxNG_error_types); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 781, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_RelaxNGErrorTypes, __pyx_tuple__184, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 781, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RelaxNGErrorTypes, __pyx_t_7) < 0) __PYX_ERR(1, 781, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
   /* "src/lxml/xmlerror.pxi":794
  * # cannot handle strings that are a few thousand bytes in length.
@@ -236669,10 +236685,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  * NONE=0
  * WARNING=1
  */
-  __Pyx_INCREF(__pyx_tuple__179);
+  __Pyx_INCREF(__pyx_tuple__185);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree___ERROR_LEVELS);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___ERROR_LEVELS, __pyx_tuple__179);
-  __Pyx_GIVEREF(__pyx_tuple__179);
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___ERROR_LEVELS, __pyx_tuple__185);
+  __Pyx_GIVEREF(__pyx_tuple__185);
 
   /* "src/lxml/xmlerror.pxi":801
  * """,)
@@ -236681,10 +236697,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  * NONE=0
  * PARSER=1
  */
-  __Pyx_INCREF(__pyx_tuple__180);
+  __Pyx_INCREF(__pyx_tuple__186);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree___ERROR_DOMAINS);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___ERROR_DOMAINS, __pyx_tuple__180);
-  __Pyx_GIVEREF(__pyx_tuple__180);
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___ERROR_DOMAINS, __pyx_tuple__186);
+  __Pyx_GIVEREF(__pyx_tuple__186);
 
   /* "src/lxml/xmlerror.pxi":835
  * """,)
@@ -236693,10 +236709,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  * ERR_OK=0
  * ERR_INTERNAL_ERROR=1
  */
-  __Pyx_INCREF(__pyx_tuple__181);
+  __Pyx_INCREF(__pyx_tuple__187);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree___PARSER_ERROR_TYPES);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___PARSER_ERROR_TYPES, __pyx_tuple__181);
-  __Pyx_GIVEREF(__pyx_tuple__181);
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___PARSER_ERROR_TYPES, __pyx_tuple__187);
+  __Pyx_GIVEREF(__pyx_tuple__187);
 
   /* "src/lxml/xmlerror.pxi":1592
  * """,)
@@ -236705,671 +236721,671 @@ PyMODINIT_FUNC PyInit_etree(void)
  * RELAXNG_OK=0
  * RELAXNG_ERR_MEMORY=1
  */
-  __Pyx_INCREF(__pyx_tuple__182);
+  __Pyx_INCREF(__pyx_tuple__188);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES, __pyx_tuple__182);
-  __Pyx_GIVEREF(__pyx_tuple__182);
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES, __pyx_tuple__188);
+  __Pyx_GIVEREF(__pyx_tuple__188);
 
   /* "src/lxml/xmlerror.pxi":1636
  * # --- END: GENERATED CONSTANTS ---
  * 
  * __initErrorConstants()             # <<<<<<<<<<<<<<
  */
-  __pyx_t_7 = __pyx_f_4lxml_5etree___initErrorConstants(); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1636, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __pyx_f_4lxml_5etree___initErrorConstants(); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1636, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":499
+  /* "lxml/etree.pyx":502
  *                    for i in range(30) ])
  * 
  * cdef tuple _PREFIX_CACHE = __initPrefixCache()             # <<<<<<<<<<<<<<
  * 
  * cdef _Document _documentFactory(xmlDoc* c_doc, _BaseParser parser):
  */
-  __pyx_t_7 = __pyx_f_4lxml_5etree___initPrefixCache(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __pyx_f_4lxml_5etree___initPrefixCache(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__PREFIX_CACHE);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__PREFIX_CACHE, ((PyObject*)__pyx_t_7));
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__PREFIX_CACHE, ((PyObject*)__pyx_t_6));
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":513
+  /* "lxml/etree.pyx":516
  * 
  * 
  * cdef object _find_invalid_public_id_characters = re.compile(             # <<<<<<<<<<<<<<
  *     ur"[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#@$_%-]+").search
  * 
  */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__183, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 513, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__189, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 516, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":514
+  /* "lxml/etree.pyx":517
  * 
  * cdef object _find_invalid_public_id_characters = re.compile(
  *     ur"[^\x20\x0D\x0Aa-zA-Z0-9'()+,./:=?;!*#@$_%-]+").search             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 514, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_search); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__find_invalid_public_id_characters);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__find_invalid_public_id_characters, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__find_invalid_public_id_characters, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":547
+  /* "lxml/etree.pyx":550
  *         return  tree.xmlCreateIntSubset(c_doc, c_name, NULL, NULL)
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
  *         u"""Removes DOCTYPE and internal subset from the document."""
  *         cdef xmlDoc* c_doc = self._doc._c_doc
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7DocInfo_3clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DocInfo_clear, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 547, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_DocInfo->tp_dict, __pyx_n_s_clear, __pyx_t_7) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7DocInfo_3clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DocInfo_clear, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_DocInfo->tp_dict, __pyx_n_s_clear, __pyx_t_6) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_DocInfo);
 
-  /* "lxml/etree.pyx":707
+  /* "lxml/etree.pyx":710
  *     cdef object _tag
  * 
  *     def _init(self):             # <<<<<<<<<<<<<<
  *         u"""_init(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element__init, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 707, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_init_2, __pyx_t_7) < 0) __PYX_ERR(0, 707, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element__init, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 710, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_init_2, __pyx_t_6) < 0) __PYX_ERR(0, 710, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":794
+  /* "lxml/etree.pyx":797
  *             _removeNode(self._doc, c_node)
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
  *         u"__deepcopy__(self, memo)"
  *         return self.__copy__()
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_9__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__189)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 794, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_deepcopy, __pyx_t_7) < 0) __PYX_ERR(0, 794, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_9__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 797, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_deepcopy, __pyx_t_6) < 0) __PYX_ERR(0, 797, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":798
+  /* "lxml/etree.pyx":801
  *         return self.__copy__()
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
  *         u"__copy__(self)"
  *         cdef xmlDoc* c_doc
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_11__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 798, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_copy_2, __pyx_t_7) < 0) __PYX_ERR(0, 798, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_11__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_copy_2, __pyx_t_6) < 0) __PYX_ERR(0, 801, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":817
+  /* "lxml/etree.pyx":820
  *         return _elementFactory(new_doc, c_node)
  * 
  *     def set(self, key, value):             # <<<<<<<<<<<<<<
  *         u"""set(self, key, value)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_13set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_set, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 817, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_set, __pyx_t_7) < 0) __PYX_ERR(0, 817, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_13set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_set, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_set, __pyx_t_6) < 0) __PYX_ERR(0, 820, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":825
+  /* "lxml/etree.pyx":828
  *         _setAttributeValue(self, key, value)
  * 
  *     def append(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""append(self, element)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_15append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 825, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_append, __pyx_t_7) < 0) __PYX_ERR(0, 825, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_15append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 828, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_append, __pyx_t_6) < 0) __PYX_ERR(0, 828, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":834
+  /* "lxml/etree.pyx":837
  *         _appendChild(self, element)
  * 
  *     def addnext(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""addnext(self, element)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_17addnext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_addnext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 834, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_addnext, __pyx_t_7) < 0) __PYX_ERR(0, 834, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_17addnext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_addnext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_addnext, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":853
+  /* "lxml/etree.pyx":856
  *         _appendSibling(self, element)
  * 
  *     def addprevious(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""addprevious(self, element)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_19addprevious, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_addprevious, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 853, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_addprevious, __pyx_t_7) < 0) __PYX_ERR(0, 853, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_19addprevious, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_addprevious, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 856, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_addprevious, __pyx_t_6) < 0) __PYX_ERR(0, 856, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":872
+  /* "lxml/etree.pyx":875
  *         _prependSibling(self, element)
  * 
  *     def extend(self, elements):             # <<<<<<<<<<<<<<
  *         u"""extend(self, elements)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_21extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_extend, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 872, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_extend, __pyx_t_7) < 0) __PYX_ERR(0, 872, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_21extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_extend, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 875, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_extend, __pyx_t_6) < 0) __PYX_ERR(0, 875, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":885
+  /* "lxml/etree.pyx":888
  *             _appendChild(self, element)
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
  *         u"""clear(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_23clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_clear, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 885, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_clear, __pyx_t_7) < 0) __PYX_ERR(0, 885, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_23clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_clear, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 888, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_clear, __pyx_t_6) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":916
+  /* "lxml/etree.pyx":919
  *                 c_node = c_node_next
  * 
  *     def insert(self, index, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""insert(self, index, element)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_25insert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_insert, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 916, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_insert, __pyx_t_7) < 0) __PYX_ERR(0, 916, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_25insert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_insert, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 919, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_insert, __pyx_t_6) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":936
+  /* "lxml/etree.pyx":939
  *         moveNodeToDocument(self._doc, c_source_doc, element._c_node)
  * 
  *     def remove(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""remove(self, element)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_27remove, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_remove, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 936, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_remove, __pyx_t_7) < 0) __PYX_ERR(0, 936, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_27remove, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_remove, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 939, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_remove, __pyx_t_6) < 0) __PYX_ERR(0, 939, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":956
+  /* "lxml/etree.pyx":959
  *         moveNodeToDocument(self._doc, c_node.doc, c_node)
  * 
  *     def replace(self, _Element old_element not None,             # <<<<<<<<<<<<<<
  *                 _Element new_element not None):
  *         u"""replace(self, old_element, new_element)
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_29replace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_replace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 956, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_replace, __pyx_t_7) < 0) __PYX_ERR(0, 956, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_29replace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_replace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 959, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_replace, __pyx_t_6) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1213
+  /* "lxml/etree.pyx":1216
  *         return ElementChildIterator(self)
  * 
  *     def __reversed__(self):             # <<<<<<<<<<<<<<
  *         u"__reversed__(self)"
  *         return ElementChildIterator(self, reversed=True)
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_43__reversed__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element___reversed, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1213, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_reversed_2, __pyx_t_7) < 0) __PYX_ERR(0, 1213, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_43__reversed__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element___reversed, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1216, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_reversed_2, __pyx_t_6) < 0) __PYX_ERR(0, 1216, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1217
+  /* "lxml/etree.pyx":1220
  *         return ElementChildIterator(self, reversed=True)
  * 
  *     def index(self, _Element child not None, start=None, stop=None):             # <<<<<<<<<<<<<<
  *         u"""index(self, child, start=None, stop=None)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_45index, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_index, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1217, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(0, 1217, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_45index, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_index, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1220, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_index, __pyx_t_6) < 0) __PYX_ERR(0, 1220, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1304
+  /* "lxml/etree.pyx":1307
  *             raise ValueError, u"list.index(x): x not in list"
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
  *         u"""get(self, key, default=None)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_47get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1304, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_get, __pyx_t_7) < 0) __PYX_ERR(0, 1304, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_47get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1307, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1312
+  /* "lxml/etree.pyx":1315
  *         return _getAttributeValue(self, key, default)
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
  *         u"""keys(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_49keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1312, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_keys, __pyx_t_7) < 0) __PYX_ERR(0, 1312, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_49keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1315, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_keys, __pyx_t_6) < 0) __PYX_ERR(0, 1315, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1321
+  /* "lxml/etree.pyx":1324
  *         return _collectAttributes(self._c_node, 1)
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
  *         u"""values(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_51values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1321, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_values, __pyx_t_7) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_51values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1324, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_values, __pyx_t_6) < 0) __PYX_ERR(0, 1324, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1330
+  /* "lxml/etree.pyx":1333
  *         return _collectAttributes(self._c_node, 2)
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
  *         u"""items(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_53items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1330, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_items, __pyx_t_7) < 0) __PYX_ERR(0, 1330, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_53items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1333, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_items, __pyx_t_6) < 0) __PYX_ERR(0, 1333, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1339
+  /* "lxml/etree.pyx":1342
  *         return _collectAttributes(self._c_node, 3)
  * 
  *     def getchildren(self):             # <<<<<<<<<<<<<<
  *         u"""getchildren(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_55getchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1339, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getchildren, __pyx_t_7) < 0) __PYX_ERR(0, 1339, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_55getchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1342, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getchildren, __pyx_t_6) < 0) __PYX_ERR(0, 1342, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1352
+  /* "lxml/etree.pyx":1355
  *         return _collectChildren(self)
  * 
  *     def getparent(self):             # <<<<<<<<<<<<<<
  *         u"""getparent(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_57getparent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1352, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getparent, __pyx_t_7) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_57getparent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__231)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1355, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getparent, __pyx_t_6) < 0) __PYX_ERR(0, 1355, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1364
+  /* "lxml/etree.pyx":1367
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def getnext(self):             # <<<<<<<<<<<<<<
  *         u"""getnext(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_59getnext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getnext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1364, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getnext, __pyx_t_7) < 0) __PYX_ERR(0, 1364, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_59getnext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getnext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1367, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getnext, __pyx_t_6) < 0) __PYX_ERR(0, 1367, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1376
+  /* "lxml/etree.pyx":1379
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def getprevious(self):             # <<<<<<<<<<<<<<
  *         u"""getprevious(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_61getprevious, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getprevious, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1376, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getprevious, __pyx_t_7) < 0) __PYX_ERR(0, 1376, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_61getprevious, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getprevious, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1379, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getprevious, __pyx_t_6) < 0) __PYX_ERR(0, 1379, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1388
+  /* "lxml/etree.pyx":1391
  *         return _elementFactory(self._doc, c_node)
  * 
  *     def itersiblings(self, tag=None, *tags, preceding=False):             # <<<<<<<<<<<<<<
  *         u"""itersiblings(self, tag=None, *tags, preceding=False)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_63itersiblings, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_itersiblings, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__231)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1388, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_itersiblings, __pyx_t_7) < 0) __PYX_ERR(0, 1388, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_63itersiblings, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_itersiblings, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1391, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_itersiblings, __pyx_t_6) < 0) __PYX_ERR(0, 1391, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1406
+  /* "lxml/etree.pyx":1409
  *         return SiblingsIterator(self, tags, preceding=preceding)
  * 
  *     def iterancestors(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""iterancestors(self, tag=None, *tags)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_65iterancestors, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_iterancestors, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1406, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_iterancestors, __pyx_t_7) < 0) __PYX_ERR(0, 1406, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_65iterancestors, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_iterancestors, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1409, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_iterancestors, __pyx_t_6) < 0) __PYX_ERR(0, 1409, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1418
+  /* "lxml/etree.pyx":1421
  *         return AncestorsIterator(self, tags)
  * 
  *     def iterdescendants(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""iterdescendants(self, tag=None, *tags)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_67iterdescendants, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_iterdescendants, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1418, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_iterdescendants, __pyx_t_7) < 0) __PYX_ERR(0, 1418, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_67iterdescendants, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_iterdescendants, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1421, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_iterdescendants, __pyx_t_6) < 0) __PYX_ERR(0, 1421, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1431
+  /* "lxml/etree.pyx":1434
  *         return ElementDepthFirstIterator(self, tags, inclusive=False)
  * 
  *     def iterchildren(self, tag=None, *tags, reversed=False):             # <<<<<<<<<<<<<<
  *         u"""iterchildren(self, tag=None, *tags, reversed=False)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_69iterchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_iterchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1431, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_iterchildren, __pyx_t_7) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_69iterchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_iterchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__243)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1434, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_iterchildren, __pyx_t_6) < 0) __PYX_ERR(0, 1434, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1444
+  /* "lxml/etree.pyx":1447
  *         return ElementChildIterator(self, tags, reversed=reversed)
  * 
  *     def getroottree(self):             # <<<<<<<<<<<<<<
  *         u"""getroottree(self)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_71getroottree, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getroottree, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1444, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getroottree, __pyx_t_7) < 0) __PYX_ERR(0, 1444, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_71getroottree, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getroottree, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__245)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1447, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getroottree, __pyx_t_6) < 0) __PYX_ERR(0, 1447, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1456
+  /* "lxml/etree.pyx":1459
  *         return _elementTreeFactory(self._doc, None)
  * 
  *     def getiterator(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""getiterator(self, tag=None, *tags)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_73getiterator, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getiterator, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1456, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getiterator, __pyx_t_7) < 0) __PYX_ERR(0, 1456, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_73getiterator, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_getiterator, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__247)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1459, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_getiterator, __pyx_t_6) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1478
+  /* "lxml/etree.pyx":1481
  *         return ElementDepthFirstIterator(self, tags)
  * 
  *     def iter(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""iter(self, tag=None, *tags)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_75iter, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_iter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__243)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1478, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_iter, __pyx_t_7) < 0) __PYX_ERR(0, 1478, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_75iter, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_iter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1481, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_iter, __pyx_t_6) < 0) __PYX_ERR(0, 1481, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1501
+  /* "lxml/etree.pyx":1504
  *         return ElementDepthFirstIterator(self, tags)
  * 
  *     def itertext(self, tag=None, *tags, with_tail=True):             # <<<<<<<<<<<<<<
  *         u"""itertext(self, tag=None, *tags, with_tail=True)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_77itertext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_itertext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__245)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1501, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_itertext, __pyx_t_7) < 0) __PYX_ERR(0, 1501, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_77itertext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_itertext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1504, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_itertext, __pyx_t_6) < 0) __PYX_ERR(0, 1504, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1516
+  /* "lxml/etree.pyx":1519
  *         return ElementTextIterator(self, tags, with_tail=with_tail)
  * 
  *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
  *         u"""makeelement(self, _tag, attrib=None, nsmap=None, **_extra)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_79makeelement, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_makeelement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__247)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1516, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_makeelement, __pyx_t_7) < 0) __PYX_ERR(0, 1516, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_79makeelement, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_makeelement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_makeelement, __pyx_t_6) < 0) __PYX_ERR(0, 1519, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1525
+  /* "lxml/etree.pyx":1528
  *                             attrib, nsmap, _extra)
  * 
  *     def find(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""find(self, path, namespaces=None)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_81find, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_find, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1525, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_find, __pyx_t_7) < 0) __PYX_ERR(0, 1525, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_81find, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_find, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1528, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_find, __pyx_t_6) < 0) __PYX_ERR(0, 1528, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1538
+  /* "lxml/etree.pyx":1541
  *         return _elementpath.find(self, path, namespaces)
  * 
  *     def findtext(self, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""findtext(self, path, default=None, namespaces=None)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_83findtext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_findtext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1538, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_findtext, __pyx_t_7) < 0) __PYX_ERR(0, 1538, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_83findtext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_findtext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1541, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_findtext, __pyx_t_6) < 0) __PYX_ERR(0, 1541, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1551
+  /* "lxml/etree.pyx":1554
  *         return _elementpath.findtext(self, path, default, namespaces)
  * 
  *     def findall(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""findall(self, path, namespaces=None)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_85findall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_findall, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1551, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_findall, __pyx_t_7) < 0) __PYX_ERR(0, 1551, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_85findall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_findall, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1554, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_findall, __pyx_t_6) < 0) __PYX_ERR(0, 1554, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1564
+  /* "lxml/etree.pyx":1567
  *         return _elementpath.findall(self, path, namespaces)
  * 
  *     def iterfind(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""iterfind(self, path, namespaces=None)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_87iterfind, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_iterfind, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1564, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_iterfind, __pyx_t_7) < 0) __PYX_ERR(0, 1564, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_87iterfind, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_iterfind, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__261)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1567, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_iterfind, __pyx_t_6) < 0) __PYX_ERR(0, 1567, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1577
+  /* "lxml/etree.pyx":1580
  *         return _elementpath.iterfind(self, path, namespaces)
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
  *               smart_strings=True, **_variables):
  *         u"""xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables)
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_89xpath, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_xpath, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1577, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_xpath, __pyx_t_7) < 0) __PYX_ERR(0, 1577, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_89xpath, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_xpath, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__263)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_xpath, __pyx_t_6) < 0) __PYX_ERR(0, 1580, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1588
+  /* "lxml/etree.pyx":1591
  *         return evaluator(_path, **_variables)
  * 
  *     def cssselect(self, expr, *, translator='xml'):             # <<<<<<<<<<<<<<
  *         """
  *         Run the CSS expression on this element and its children,
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_91cssselect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_cssselect, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1588, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_cssselect, __pyx_t_7) < 0) __PYX_ERR(0, 1588, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8_Element_91cssselect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Element_cssselect, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1591, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Element->tp_dict, __pyx_n_s_cssselect, __pyx_t_6) < 0) __PYX_ERR(0, 1591, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Element);
 
-  /* "lxml/etree.pyx":1638
+  /* "lxml/etree.pyx":1641
  *         raise TypeError, u"this element does not have children or attributes"
  * 
  *     def set(self, key, value):             # <<<<<<<<<<<<<<
  *         u"set(self, key, value)"
  *         self._raiseImmutable()
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_1set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_set, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__261)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1638, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_set, __pyx_t_7) < 0) __PYX_ERR(0, 1638, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_1set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_set, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__267)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1641, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_set, __pyx_t_6) < 0) __PYX_ERR(0, 1641, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree___ContentOnlyElement);
 
-  /* "lxml/etree.pyx":1642
+  /* "lxml/etree.pyx":1645
  *         self._raiseImmutable()
  * 
  *     def append(self, value):             # <<<<<<<<<<<<<<
  *         u"append(self, value)"
  *         self._raiseImmutable()
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_3append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__263)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1642, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_append, __pyx_t_7) < 0) __PYX_ERR(0, 1642, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_3append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__269)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1645, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_append, __pyx_t_6) < 0) __PYX_ERR(0, 1645, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree___ContentOnlyElement);
 
-  /* "lxml/etree.pyx":1646
+  /* "lxml/etree.pyx":1649
  *         self._raiseImmutable()
  * 
  *     def insert(self, index, value):             # <<<<<<<<<<<<<<
  *         u"insert(self, index, value)"
  *         self._raiseImmutable()
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_5insert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_insert, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1646, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_insert, __pyx_t_7) < 0) __PYX_ERR(0, 1646, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_5insert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_insert, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__271)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1649, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_insert, __pyx_t_6) < 0) __PYX_ERR(0, 1649, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree___ContentOnlyElement);
 
-  /* "lxml/etree.pyx":1685
+  /* "lxml/etree.pyx":1688
  *         return 0
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
  *         u"get(self, key, default=None)"
  *         return None
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_13get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__267)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1685, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_get, __pyx_t_7) < 0) __PYX_ERR(0, 1685, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_13get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__273)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1688, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 1688, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree___ContentOnlyElement);
 
-  /* "lxml/etree.pyx":1689
+  /* "lxml/etree.pyx":1692
  *         return None
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
  *         u"keys(self)"
  *         return []
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_15keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__269)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1689, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_keys, __pyx_t_7) < 0) __PYX_ERR(0, 1689, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_15keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__275)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1692, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_keys, __pyx_t_6) < 0) __PYX_ERR(0, 1692, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree___ContentOnlyElement);
 
-  /* "lxml/etree.pyx":1693
+  /* "lxml/etree.pyx":1696
  *         return []
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
  *         u"items(self)"
  *         return []
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_17items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__271)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1693, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_items, __pyx_t_7) < 0) __PYX_ERR(0, 1693, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_17items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__277)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1696, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_items, __pyx_t_6) < 0) __PYX_ERR(0, 1696, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree___ContentOnlyElement);
 
-  /* "lxml/etree.pyx":1697
+  /* "lxml/etree.pyx":1700
  *         return []
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
  *         u"values(self)"
  *         return []
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_19values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__273)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1697, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_values, __pyx_t_7) < 0) __PYX_ERR(0, 1697, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20__ContentOnlyElement_19values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ContentOnlyElement_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__279)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1700, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dict, __pyx_n_s_values, __pyx_t_6) < 0) __PYX_ERR(0, 1700, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree___ContentOnlyElement);
 
-  /* "lxml/etree.pyx":1734
+  /* "lxml/etree.pyx":1737
  *             return "<?%s?>" % strrepr(self.target)
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
  *         u"""get(self, key, default=None)
  * 
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_ProcessingInstruction_3get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ProcessingInstruction_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__275)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1734, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ProcessingInstruction->tp_dict, __pyx_n_s_get, __pyx_t_7) < 0) __PYX_ERR(0, 1734, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_ProcessingInstruction_3get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ProcessingInstruction_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__281)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1737, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ProcessingInstruction->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 1737, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ProcessingInstruction);
 
-  /* "lxml/etree.pyx":1758
+  /* "lxml/etree.pyx":1761
  *                      for attr, value1, value2 in _FIND_PI_ATTRIBUTES(u' ' + self.text) }
  * 
  * cdef object _FIND_PI_ATTRIBUTES = re.compile(ur'\s+(\w+)\s*=\s*(?:\'([^\']*)\'|"([^"]*)")', re.U).findall             # <<<<<<<<<<<<<<
  * 
  * cdef class _Entity(__ContentOnlyElement):
  */
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1758, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1761, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_U); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1758, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_U); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1761, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __pyx_t_1 = NULL;
   __pyx_t_5 = 0;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
@@ -237384,24 +237400,24 @@ PyMODINIT_FUNC PyInit_etree(void)
   }
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_8)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_s_w_s_s, __pyx_t_6};
-    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1758, __pyx_L1_error)
+    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_s_w_s_s, __pyx_t_7};
+    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1761, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_s_w_s_s, __pyx_t_6};
-    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1758, __pyx_L1_error)
+    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_u_s_w_s_s, __pyx_t_7};
+    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1761, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   } else
   #endif
   {
-    __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1758, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1761, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     if (__pyx_t_1) {
       __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __pyx_t_1 = NULL;
@@ -237409,791 +237425,791 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_INCREF(__pyx_kp_u_s_w_s_s);
     __Pyx_GIVEREF(__pyx_kp_u_s_w_s_s);
     PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_kp_u_s_w_s_s);
-    __Pyx_GIVEREF(__pyx_t_6);
-    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_t_6);
-    __pyx_t_6 = 0;
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1758, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_GIVEREF(__pyx_t_7);
+    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_t_7);
+    __pyx_t_7 = 0;
+    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1761, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   }
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1758, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1761, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES, __pyx_t_8);
   __Pyx_GIVEREF(__pyx_t_8);
   __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":1877
+  /* "lxml/etree.pyx":1880
  *         return 0
  * 
  *     def parse(self, source, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
  *         u"""parse(self, source, parser=None, base_url=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_1parse, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_parse, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__277)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1877, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_1parse, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_parse, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__283)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1880, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_parse, __pyx_t_8) < 0) __PYX_ERR(0, 1877, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_parse, __pyx_t_8) < 0) __PYX_ERR(0, 1880, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":1893
+  /* "lxml/etree.pyx":1896
  *         return self._context_node
  * 
  *     def _setroot(self, _Element root not None):             # <<<<<<<<<<<<<<
  *         u"""_setroot(self, root)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_3_setroot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree__setroot, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__279)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1893, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_3_setroot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree__setroot, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1896, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_setroot, __pyx_t_8) < 0) __PYX_ERR(0, 1893, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_setroot, __pyx_t_8) < 0) __PYX_ERR(0, 1896, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":1904
+  /* "lxml/etree.pyx":1907
  *         self._doc = None
  * 
  *     def getroot(self):             # <<<<<<<<<<<<<<
  *         u"""getroot(self)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_5getroot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_getroot, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__281)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1904, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_5getroot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_getroot, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__287)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1907, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_getroot, __pyx_t_8) < 0) __PYX_ERR(0, 1904, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_getroot, __pyx_t_8) < 0) __PYX_ERR(0, 1907, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":1911
+  /* "lxml/etree.pyx":1914
  *         return self._context_node
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
  *         return _elementTreeFactory(self._doc, self._context_node)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_7__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__283)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1911, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_7__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__289)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1914, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_copy_2, __pyx_t_8) < 0) __PYX_ERR(0, 1911, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_copy_2, __pyx_t_8) < 0) __PYX_ERR(0, 1914, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":1914
+  /* "lxml/etree.pyx":1917
  *         return _elementTreeFactory(self._doc, self._context_node)
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
  *         cdef _Element root
  *         cdef _Document doc
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_9__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1914, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_9__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__291)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1917, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_deepcopy, __pyx_t_8) < 0) __PYX_ERR(0, 1914, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_deepcopy, __pyx_t_8) < 0) __PYX_ERR(0, 1917, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":1954
+  /* "lxml/etree.pyx":1957
  *             return None
  * 
  *     def write(self, file, *, encoding=None, method=u"xml",             # <<<<<<<<<<<<<<
  *               pretty_print=False, xml_declaration=None, with_tail=True,
  *               standalone=None, doctype=None, compression=0,
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_11write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_write, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__287)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1954, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_11write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_write, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__293)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1957, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_write, __pyx_t_8) < 0) __PYX_ERR(0, 1954, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_write, __pyx_t_8) < 0) __PYX_ERR(0, 1957, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2051
+  /* "lxml/etree.pyx":2054
  *                     is_standalone, compression)
  * 
  *     def getpath(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""getpath(self, element)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_13getpath, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_getpath, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__289)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2051, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_13getpath, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_getpath, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__295)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2054, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_getpath, __pyx_t_8) < 0) __PYX_ERR(0, 2051, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_getpath, __pyx_t_8) < 0) __PYX_ERR(0, 2054, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2089
+  /* "lxml/etree.pyx":2092
  *         return path
  * 
  *     def getelementpath(self, _Element element not None):             # <<<<<<<<<<<<<<
  *         u"""getelementpath(self, element)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_15getelementpath, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_getelementpath, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__291)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2089, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_15getelementpath, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_getelementpath, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__297)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2092, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_getelementpath, __pyx_t_8) < 0) __PYX_ERR(0, 2089, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_getelementpath, __pyx_t_8) < 0) __PYX_ERR(0, 2092, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2153
+  /* "lxml/etree.pyx":2156
  *         return '/'.join(path)
  * 
  *     def getiterator(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""getiterator(self, *tags, tag=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_17getiterator, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_getiterator, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__293)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2153, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_17getiterator, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_getiterator, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__299)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2156, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_getiterator, __pyx_t_8) < 0) __PYX_ERR(0, 2153, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_getiterator, __pyx_t_8) < 0) __PYX_ERR(0, 2156, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2177
+  /* "lxml/etree.pyx":2180
  *         return root.getiterator(*tags)
  * 
  *     def iter(self, tag=None, *tags):             # <<<<<<<<<<<<<<
  *         u"""iter(self, tag=None, *tags)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_19iter, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_iter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__295)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2177, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_19iter, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_iter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__301)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2180, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_iter, __pyx_t_8) < 0) __PYX_ERR(0, 2177, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_iter, __pyx_t_8) < 0) __PYX_ERR(0, 2180, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2195
+  /* "lxml/etree.pyx":2198
  *         return root.iter(*tags)
  * 
  *     def find(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""find(self, path, namespaces=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_21find, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_find, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__297)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2195, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_21find, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_find, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__303)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2198, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_find, __pyx_t_8) < 0) __PYX_ERR(0, 2195, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_find, __pyx_t_8) < 0) __PYX_ERR(0, 2198, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2212
+  /* "lxml/etree.pyx":2215
  *         return root.find(path, namespaces)
  * 
  *     def findtext(self, path, default=None, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""findtext(self, path, default=None, namespaces=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_23findtext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_findtext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__299)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2212, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_23findtext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_findtext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__305)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2215, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_findtext, __pyx_t_8) < 0) __PYX_ERR(0, 2212, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_findtext, __pyx_t_8) < 0) __PYX_ERR(0, 2215, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2229
+  /* "lxml/etree.pyx":2232
  *         return root.findtext(path, default, namespaces)
  * 
  *     def findall(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""findall(self, path, namespaces=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_25findall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_findall, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__301)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2229, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_25findall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_findall, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__307)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2232, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_findall, __pyx_t_8) < 0) __PYX_ERR(0, 2229, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_findall, __pyx_t_8) < 0) __PYX_ERR(0, 2232, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2246
+  /* "lxml/etree.pyx":2249
  *         return root.findall(path, namespaces)
  * 
  *     def iterfind(self, path, namespaces=None):             # <<<<<<<<<<<<<<
  *         u"""iterfind(self, path, namespaces=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_27iterfind, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_iterfind, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__303)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2246, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_27iterfind, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_iterfind, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__309)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2249, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_iterfind, __pyx_t_8) < 0) __PYX_ERR(0, 2246, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_iterfind, __pyx_t_8) < 0) __PYX_ERR(0, 2249, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2263
+  /* "lxml/etree.pyx":2266
  *         return root.iterfind(path, namespaces)
  * 
  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
  *               smart_strings=True, **_variables):
  *         u"""xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_29xpath, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_xpath, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__305)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2263, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_29xpath, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_xpath, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__311)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2266, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_xpath, __pyx_t_8) < 0) __PYX_ERR(0, 2263, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_xpath, __pyx_t_8) < 0) __PYX_ERR(0, 2266, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2288
+  /* "lxml/etree.pyx":2291
  *         return evaluator(_path, **_variables)
  * 
  *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):             # <<<<<<<<<<<<<<
  *         u"""xslt(self, _xslt, extensions=None, access_control=None, **_kw)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_31xslt, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_xslt, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__307)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2288, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_31xslt, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_xslt, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__313)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2291, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_xslt_2, __pyx_t_8) < 0) __PYX_ERR(0, 2288, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_xslt_2, __pyx_t_8) < 0) __PYX_ERR(0, 2291, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2307
+  /* "lxml/etree.pyx":2310
  *         return style(self, **_kw)
  * 
  *     def relaxng(self, relaxng):             # <<<<<<<<<<<<<<
  *         u"""relaxng(self, relaxng)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_33relaxng, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_relaxng, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__309)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2307, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_33relaxng, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_relaxng, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__315)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2310, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_relaxng, __pyx_t_8) < 0) __PYX_ERR(0, 2307, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_relaxng, __pyx_t_8) < 0) __PYX_ERR(0, 2310, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2325
+  /* "lxml/etree.pyx":2328
  *         return schema.validate(self)
  * 
  *     def xmlschema(self, xmlschema):             # <<<<<<<<<<<<<<
  *         u"""xmlschema(self, xmlschema)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_35xmlschema, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_xmlschema, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__311)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2325, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_35xmlschema, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_xmlschema, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__317)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2328, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_xmlschema, __pyx_t_8) < 0) __PYX_ERR(0, 2325, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_xmlschema, __pyx_t_8) < 0) __PYX_ERR(0, 2328, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2343
+  /* "lxml/etree.pyx":2346
  *         return schema.validate(self)
  * 
  *     def xinclude(self):             # <<<<<<<<<<<<<<
  *         u"""xinclude(self)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_37xinclude, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_xinclude, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__313)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2343, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_37xinclude, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_xinclude, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__319)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2346, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_xinclude, __pyx_t_8) < 0) __PYX_ERR(0, 2343, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_xinclude, __pyx_t_8) < 0) __PYX_ERR(0, 2346, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2358
+  /* "lxml/etree.pyx":2361
  *         XInclude()(self._context_node)
  * 
  *     def write_c14n(self, file, *, exclusive=False, with_comments=True,             # <<<<<<<<<<<<<<
  *                    compression=0, inclusive_ns_prefixes=None):
  *         u"""write_c14n(self, file, exclusive=False, with_comments=True,
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_39write_c14n, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_write_c14n, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__315)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2358, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ElementTree_39write_c14n, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementTree_write_c14n, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__321)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2361, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_write_c14n, __pyx_t_8) < 0) __PYX_ERR(0, 2358, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementTree->tp_dict, __pyx_n_s_write_c14n, __pyx_t_8) < 0) __PYX_ERR(0, 2361, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementTree);
 
-  /* "lxml/etree.pyx":2422
+  /* "lxml/etree.pyx":2425
  *         _delAttribute(self._element, key)
  * 
  *     def update(self, sequence_or_dict):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         if isinstance(sequence_or_dict, (dict, _Attrib)):
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_7update, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_update, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__317)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2422, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_7update, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_update, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__323)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2425, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_update, __pyx_t_8) < 0) __PYX_ERR(0, 2422, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_update, __pyx_t_8) < 0) __PYX_ERR(0, 2425, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2429
+  /* "lxml/etree.pyx":2432
  *             _setAttributeValue(self._element, key, value)
  * 
  *     def pop(self, key, *default):             # <<<<<<<<<<<<<<
  *         if len(default) > 1:
  *             raise TypeError, u"pop expected at most 2 arguments, got %d" % (
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_9pop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_pop, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__319)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2429, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_9pop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_pop, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__325)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2432, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_pop, __pyx_t_8) < 0) __PYX_ERR(0, 2429, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_pop, __pyx_t_8) < 0) __PYX_ERR(0, 2432, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2443
+  /* "lxml/etree.pyx":2446
  *         return result
  * 
  *     def clear(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         cdef xmlNode* c_node = self._element._c_node
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_11clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_clear, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__321)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2443, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_11clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_clear, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__327)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2446, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_clear, __pyx_t_8) < 0) __PYX_ERR(0, 2443, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_clear, __pyx_t_8) < 0) __PYX_ERR(0, 2446, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2454
+  /* "lxml/etree.pyx":2457
  *         return repr(dict( _collectAttributes(self._element._c_node, 3) ))
  * 
  *     def __copy__(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return dict(_collectAttributes(self._element._c_node, 3))
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_15__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__323)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2454, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_15__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__329)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2457, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_copy_2, __pyx_t_8) < 0) __PYX_ERR(0, 2454, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_copy_2, __pyx_t_8) < 0) __PYX_ERR(0, 2457, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2458
+  /* "lxml/etree.pyx":2461
  *         return dict(_collectAttributes(self._element._c_node, 3))
  * 
  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return dict(_collectAttributes(self._element._c_node, 3))
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_17__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__325)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2458, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_17__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__331)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2461, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_deepcopy, __pyx_t_8) < 0) __PYX_ERR(0, 2458, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_deepcopy, __pyx_t_8) < 0) __PYX_ERR(0, 2461, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2488
+  /* "lxml/etree.pyx":2491
  *         return c
  * 
  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return _getAttributeValue(self._element, key, default)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_25get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__327)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2488, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_25get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__333)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2491, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_get, __pyx_t_8) < 0) __PYX_ERR(0, 2488, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_get, __pyx_t_8) < 0) __PYX_ERR(0, 2491, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2492
+  /* "lxml/etree.pyx":2495
  *         return _getAttributeValue(self._element, key, default)
  * 
  *     def keys(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return _collectAttributes(self._element._c_node, 1)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_27keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__329)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2492, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_27keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__335)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2495, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_keys, __pyx_t_8) < 0) __PYX_ERR(0, 2492, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_keys, __pyx_t_8) < 0) __PYX_ERR(0, 2495, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2500
+  /* "lxml/etree.pyx":2503
  *         return iter(_collectAttributes(self._element._c_node, 1))
  * 
  *     def iterkeys(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return iter(_collectAttributes(self._element._c_node, 1))
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_31iterkeys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_iterkeys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__331)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2500, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_31iterkeys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_iterkeys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__337)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2503, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_iterkeys, __pyx_t_8) < 0) __PYX_ERR(0, 2500, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_iterkeys, __pyx_t_8) < 0) __PYX_ERR(0, 2503, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2504
+  /* "lxml/etree.pyx":2507
  *         return iter(_collectAttributes(self._element._c_node, 1))
  * 
  *     def values(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return _collectAttributes(self._element._c_node, 2)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_33values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__333)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2504, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_33values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__339)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2507, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_values, __pyx_t_8) < 0) __PYX_ERR(0, 2504, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_values, __pyx_t_8) < 0) __PYX_ERR(0, 2507, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2508
+  /* "lxml/etree.pyx":2511
  *         return _collectAttributes(self._element._c_node, 2)
  * 
  *     def itervalues(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return iter(_collectAttributes(self._element._c_node, 2))
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_35itervalues, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_itervalues, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__335)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2508, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_35itervalues, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_itervalues, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__341)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2511, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_itervalues, __pyx_t_8) < 0) __PYX_ERR(0, 2508, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_itervalues, __pyx_t_8) < 0) __PYX_ERR(0, 2511, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2512
+  /* "lxml/etree.pyx":2515
  *         return iter(_collectAttributes(self._element._c_node, 2))
  * 
  *     def items(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return _collectAttributes(self._element._c_node, 3)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_37items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__337)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2512, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_37items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__343)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2515, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_items, __pyx_t_8) < 0) __PYX_ERR(0, 2512, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_items, __pyx_t_8) < 0) __PYX_ERR(0, 2515, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2516
+  /* "lxml/etree.pyx":2519
  *         return _collectAttributes(self._element._c_node, 3)
  * 
  *     def iteritems(self):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return iter(_collectAttributes(self._element._c_node, 3))
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_39iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_iteritems, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__339)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2516, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_39iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_iteritems, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__345)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2519, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_iteritems, __pyx_t_8) < 0) __PYX_ERR(0, 2516, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_iteritems, __pyx_t_8) < 0) __PYX_ERR(0, 2519, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":2520
+  /* "lxml/etree.pyx":2523
  *         return iter(_collectAttributes(self._element._c_node, 3))
  * 
  *     def has_key(self, key):             # <<<<<<<<<<<<<<
  *         _assertValidNode(self._element)
  *         return key in self
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_41has_key, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_has_key, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__341)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2520, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_Attrib_41has_key, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Attrib_has_key, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__347)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2523, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_has_key, __pyx_t_8) < 0) __PYX_ERR(0, 2520, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Attrib->tp_dict, __pyx_n_s_has_key, __pyx_t_8) < 0) __PYX_ERR(0, 2523, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Attrib);
 
-  /* "lxml/etree.pyx":3002
+  /* "lxml/etree.pyx":3005
  * # module-level API for ElementTree
  * 
  * def Element(_tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
  *     u"""Element(_tag, attrib=None, nsmap=None, **_extra)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7Element, 0, __pyx_n_s_Element, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__343)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3002, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7Element, 0, __pyx_n_s_Element, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__349)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3005, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__344);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Element, __pyx_t_8) < 0) __PYX_ERR(0, 3002, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__350);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Element, __pyx_t_8) < 0) __PYX_ERR(0, 3005, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3016
+  /* "lxml/etree.pyx":3019
  * 
  * 
  * def Comment(text=None):             # <<<<<<<<<<<<<<
  *     u"""Comment(text=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9Comment, 0, __pyx_n_s_Comment, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__346)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3016, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9Comment, 0, __pyx_n_s_Comment, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__352)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3019, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__347);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Comment, __pyx_t_8) < 0) __PYX_ERR(0, 3016, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__353);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Comment, __pyx_t_8) < 0) __PYX_ERR(0, 3019, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3040
+  /* "lxml/etree.pyx":3043
  * 
  * 
  * def ProcessingInstruction(target, text=None):             # <<<<<<<<<<<<<<
  *     u"""ProcessingInstruction(target, text=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11ProcessingInstruction, 0, __pyx_n_s_ProcessingInstruction, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__349)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3040, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11ProcessingInstruction, 0, __pyx_n_s_ProcessingInstruction, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__355)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3043, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__350);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProcessingInstruction, __pyx_t_8) < 0) __PYX_ERR(0, 3040, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__356);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProcessingInstruction, __pyx_t_8) < 0) __PYX_ERR(0, 3043, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3068
+  /* "lxml/etree.pyx":3071
  *     return _elementFactory(doc, c_node)
  * 
  * PI = ProcessingInstruction             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3068, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3071, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PI, __pyx_t_8) < 0) __PYX_ERR(0, 3068, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PI, __pyx_t_8) < 0) __PYX_ERR(0, 3071, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3093
+  /* "lxml/etree.pyx":3096
  * 
  * 
  * def Entity(name):             # <<<<<<<<<<<<<<
  *     u"""Entity(name)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13Entity, 0, __pyx_n_s_Entity, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__352)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3093, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13Entity, 0, __pyx_n_s_Entity, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__358)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3096, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Entity, __pyx_t_8) < 0) __PYX_ERR(0, 3093, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Entity, __pyx_t_8) < 0) __PYX_ERR(0, 3096, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3119
+  /* "lxml/etree.pyx":3122
  * 
  * 
  * def SubElement(_Element _parent not None, _tag,             # <<<<<<<<<<<<<<
  *                attrib=None, nsmap=None, **_extra):
  *     u"""SubElement(_parent, _tag, attrib=None, nsmap=None, **_extra)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15SubElement, 0, __pyx_n_s_SubElement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__354)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3119, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15SubElement, 0, __pyx_n_s_SubElement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__360)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3122, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__355);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SubElement, __pyx_t_8) < 0) __PYX_ERR(0, 3119, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__361);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SubElement, __pyx_t_8) < 0) __PYX_ERR(0, 3122, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3129
+  /* "lxml/etree.pyx":3132
  * 
  * 
  * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):             # <<<<<<<<<<<<<<
  *     u"""ElementTree(element=None, file=None, parser=None)
  * 
  */
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3129, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3132, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_file, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3129, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_parser, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3129, __pyx_L1_error)
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17ElementTree, 0, __pyx_n_s_ElementTree, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__357)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3129, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__358);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_8);
+  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_file, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3132, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_parser, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3132, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17ElementTree, 0, __pyx_n_s_ElementTree, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__363)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3132, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__364);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_6, __pyx_t_8);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ElementTree, __pyx_t_7) < 0) __PYX_ERR(0, 3129, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ElementTree, __pyx_t_6) < 0) __PYX_ERR(0, 3132, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":3155
+  /* "lxml/etree.pyx":3158
  * 
  * 
  * def HTML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
  *     u"""HTML(text, parser=None, base_url=None)
  * 
  */
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3155, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3155, __pyx_L1_error)
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_19HTML, 0, __pyx_n_s_HTML, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__360)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3155, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3158, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3158, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_19HTML, 0, __pyx_n_s_HTML, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__366)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3158, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__361);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_7);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HTML, __pyx_t_8) < 0) __PYX_ERR(0, 3155, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__367);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_6);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HTML, __pyx_t_8) < 0) __PYX_ERR(0, 3158, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3181
+  /* "lxml/etree.pyx":3184
  * 
  * 
  * def XML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
  *     u"""XML(text, parser=None, base_url=None)
  * 
  */
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3181, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3184, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3181, __pyx_L1_error)
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21XML, 0, __pyx_n_s_XML, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__363)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3181, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__364);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_8);
+  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3184, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21XML, 0, __pyx_n_s_XML, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__369)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__370);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_6, __pyx_t_8);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XML, __pyx_t_7) < 0) __PYX_ERR(0, 3181, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XML, __pyx_t_6) < 0) __PYX_ERR(0, 3184, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":3212
+  /* "lxml/etree.pyx":3215
  * 
  * 
  * def fromstring(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
  *     u"""fromstring(text, parser=None, base_url=None)
  * 
  */
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3212, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3212, __pyx_L1_error)
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23fromstring, 0, __pyx_n_s_fromstring, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__366)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3212, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3215, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23fromstring, 0, __pyx_n_s_fromstring, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__372)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3215, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__367);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_7);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstring, __pyx_t_8) < 0) __PYX_ERR(0, 3212, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__373);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_6);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstring, __pyx_t_8) < 0) __PYX_ERR(0, 3215, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3233
+  /* "lxml/etree.pyx":3236
  * 
  * 
  * def fromstringlist(strings, _BaseParser parser=None):             # <<<<<<<<<<<<<<
  *     u"""fromstringlist(strings, parser=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_25fromstringlist, 0, __pyx_n_s_fromstringlist, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__369)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3233, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_25fromstringlist, 0, __pyx_n_s_fromstringlist, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__375)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3236, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__370);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstringlist, __pyx_t_8) < 0) __PYX_ERR(0, 3233, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__376);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstringlist, __pyx_t_8) < 0) __PYX_ERR(0, 3236, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3254
+  /* "lxml/etree.pyx":3257
  * 
  * 
  * def iselement(element):             # <<<<<<<<<<<<<<
  *     u"""iselement(element)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27iselement, 0, __pyx_n_s_iselement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__372)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3254, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27iselement, 0, __pyx_n_s_iselement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__378)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3257, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iselement, __pyx_t_8) < 0) __PYX_ERR(0, 3254, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iselement, __pyx_t_8) < 0) __PYX_ERR(0, 3257, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3262
+  /* "lxml/etree.pyx":3265
  * 
  * 
  * def dump(_Element elem not None, *, bint pretty_print=True, with_tail=True):             # <<<<<<<<<<<<<<
  *     u"""dump(elem, pretty_print=True, with_tail=True)
  * 
  */
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3262, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3265, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_7 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3262, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_pretty_print, __pyx_t_7) < 0) __PYX_ERR(0, 3262, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_with_tail, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 3262, __pyx_L1_error)
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_29dump, 0, __pyx_n_s_dump, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__374)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3262, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_8);
+  __pyx_t_6 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_pretty_print, __pyx_t_6) < 0) __PYX_ERR(0, 3265, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_with_tail, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 3265, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_29dump, 0, __pyx_n_s_dump, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__380)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_6, __pyx_t_8);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dump, __pyx_t_7) < 0) __PYX_ERR(0, 3262, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dump, __pyx_t_6) < 0) __PYX_ERR(0, 3265, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":3275
+  /* "lxml/etree.pyx":3278
  * 
  * 
  * def tostring(element_or_tree, *, encoding=None, method="xml",             # <<<<<<<<<<<<<<
  *              xml_declaration=None, bint pretty_print=False, bint with_tail=True,
  *              standalone=None, doctype=None,
  */
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3275, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encoding, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_method, ((PyObject*)__pyx_n_s_xml)) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_xml_declaration, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3278, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_method, ((PyObject*)__pyx_n_s_xml)) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_xml_declaration, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3276
+  /* "lxml/etree.pyx":3279
  * 
  * def tostring(element_or_tree, *, encoding=None, method="xml",
  *              xml_declaration=None, bint pretty_print=False, bint with_tail=True,             # <<<<<<<<<<<<<<
  *              standalone=None, doctype=None,
  *              bint exclusive=False, bint with_comments=True, inclusive_ns_prefixes=None):
  */
-  __pyx_t_8 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3276, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3279, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_pretty_print, __pyx_t_8) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pretty_print, __pyx_t_8) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3276, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3279, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_with_tail, __pyx_t_8) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_with_tail, __pyx_t_8) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_standalone, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_doctype, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_standalone, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_doctype, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3278
+  /* "lxml/etree.pyx":3281
  *              xml_declaration=None, bint pretty_print=False, bint with_tail=True,
  *              standalone=None, doctype=None,
  *              bint exclusive=False, bint with_comments=True, inclusive_ns_prefixes=None):             # <<<<<<<<<<<<<<
  *     u"""tostring(element_or_tree, encoding=None, method="xml",
  *                  xml_declaration=None, pretty_print=False, with_tail=True,
  */
-  __pyx_t_8 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3278, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3281, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exclusive, __pyx_t_8) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_exclusive, __pyx_t_8) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3278, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3281, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_with_comments, __pyx_t_8) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_with_comments, __pyx_t_8) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_inclusive_ns_prefixes, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_inclusive_ns_prefixes, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3275
+  /* "lxml/etree.pyx":3278
  * 
  * 
  * def tostring(element_or_tree, *, encoding=None, method="xml",             # <<<<<<<<<<<<<<
  *              xml_declaration=None, bint pretty_print=False, bint with_tail=True,
  *              standalone=None, doctype=None,
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_31tostring, 0, __pyx_n_s_tostring, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__376)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3275, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_31tostring, 0, __pyx_n_s_tostring, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__382)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3278, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_7);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tostring, __pyx_t_8) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_6);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tostring, __pyx_t_8) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3368
+  /* "lxml/etree.pyx":3371
  * 
  * 
  * def tostringlist(element_or_tree, *args, **kwargs):             # <<<<<<<<<<<<<<
  *     u"""tostringlist(element_or_tree, *args, **kwargs)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_33tostringlist, 0, __pyx_n_s_tostringlist, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__378)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3368, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_33tostringlist, 0, __pyx_n_s_tostringlist, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__384)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3371, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tostringlist, __pyx_t_8) < 0) __PYX_ERR(0, 3368, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tostringlist, __pyx_t_8) < 0) __PYX_ERR(0, 3371, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3380
+  /* "lxml/etree.pyx":3383
  * 
  * 
  * def tounicode(element_or_tree, *, method=u"xml", bint pretty_print=False,             # <<<<<<<<<<<<<<
  *               bint with_tail=True, doctype=None):
  *     u"""tounicode(element_or_tree, method="xml", pretty_print=False,
  */
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3380, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3383, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_method, ((PyObject*)__pyx_n_u_xml)) < 0) __PYX_ERR(0, 3380, __pyx_L1_error)
-  __pyx_t_7 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3380, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_pretty_print, __pyx_t_7) < 0) __PYX_ERR(0, 3380, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_method, ((PyObject*)__pyx_n_u_xml)) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3383, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_pretty_print, __pyx_t_6) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":3381
+  /* "lxml/etree.pyx":3384
  * 
  * def tounicode(element_or_tree, *, method=u"xml", bint pretty_print=False,
  *               bint with_tail=True, doctype=None):             # <<<<<<<<<<<<<<
  *     u"""tounicode(element_or_tree, method="xml", pretty_print=False,
  *                   with_tail=True, doctype=None)
  */
-  __pyx_t_7 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3381, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_with_tail, __pyx_t_7) < 0) __PYX_ERR(0, 3380, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_doctype, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3380, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3384, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_with_tail, __pyx_t_6) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_doctype, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
 
-  /* "lxml/etree.pyx":3380
+  /* "lxml/etree.pyx":3383
  * 
  * 
  * def tounicode(element_or_tree, *, method=u"xml", bint pretty_print=False,             # <<<<<<<<<<<<<<
  *               bint with_tail=True, doctype=None):
  *     u"""tounicode(element_or_tree, method="xml", pretty_print=False,
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_35tounicode, 0, __pyx_n_s_tounicode, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__380)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3380, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_8);
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_35tounicode, 0, __pyx_n_s_tounicode, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__386)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3383, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_6, __pyx_t_8);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tounicode, __pyx_t_7) < 0) __PYX_ERR(0, 3380, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tounicode, __pyx_t_6) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/etree.pyx":3415
+  /* "lxml/etree.pyx":3418
  * 
  * 
  * def parse(source, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
  *     u"""parse(source, parser=None, base_url=None)
  * 
  */
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3415, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3415, __pyx_L1_error)
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_37parse, 0, __pyx_n_s_parse, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__382)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3415, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3418, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 3418, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_37parse, 0, __pyx_n_s_parse, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__388)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3418, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__383);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_7);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse, __pyx_t_8) < 0) __PYX_ERR(0, 3415, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__389);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_6);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse, __pyx_t_8) < 0) __PYX_ERR(0, 3418, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/etree.pyx":3447
+  /* "lxml/etree.pyx":3450
  * 
  * 
  * def adopt_external_document(capsule, _BaseParser parser=None):             # <<<<<<<<<<<<<<
  *     """adopt_external_document(capsule, parser=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_39adopt_external_document, 0, __pyx_n_s_adopt_external_document, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__385)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3447, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_39adopt_external_document, 0, __pyx_n_s_adopt_external_document, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__391)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3450, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__386);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_adopt_external_document, __pyx_t_8) < 0) __PYX_ERR(0, 3447, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__392);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_adopt_external_document, __pyx_t_8) < 0) __PYX_ERR(0, 3450, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
   /* "src/lxml/readonlytree.pxi":160
@@ -238203,7 +238219,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"__deepcopy__(self, memo)"
  *         return self.__copy__()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_11__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__388)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 160, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_11__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__394)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 160, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_deepcopy, __pyx_t_8) < 0) __PYX_ERR(6, 160, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238216,7 +238232,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"__copy__(self)"
  *         cdef xmlDoc* c_doc
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_13__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__390)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 164, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_13__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__396)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 164, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_copy_2, __pyx_t_8) < 0) __PYX_ERR(6, 164, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238229,7 +238245,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""iterchildren(self, tag=None, reversed=False)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_17iterchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_iterchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__392)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 187, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_17iterchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_iterchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__398)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 187, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_iterchildren, __pyx_t_8) < 0) __PYX_ERR(6, 187, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238242,7 +238258,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Returns all subelements. The elements are returned in document
  *         order.
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_19getchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__394)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 199, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_19getchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__400)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getchildren, __pyx_t_8) < 0) __PYX_ERR(6, 199, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238255,7 +238271,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Returns the parent of this element or None for the root element.
  *         """
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_21getparent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__396)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 214, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_21getparent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__402)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 214, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getparent, __pyx_t_8) < 0) __PYX_ERR(6, 214, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238268,7 +238284,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Returns the following sibling of this element or None.
  *         """
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_23getnext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getnext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__398)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 225, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_23getnext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getnext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__404)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 225, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getnext, __pyx_t_8) < 0) __PYX_ERR(6, 225, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238281,7 +238297,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Returns the preceding sibling of this element or None.
  *         """
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_25getprevious, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getprevious, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__400)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 235, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_25getprevious, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getprevious, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__406)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 235, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getprevious, __pyx_t_8) < 0) __PYX_ERR(6, 235, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238294,7 +238310,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Gets an element attribute.
  *         """
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_1get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__402)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 293, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_1get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__408)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 293, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_get, __pyx_t_8) < 0) __PYX_ERR(6, 293, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238307,7 +238323,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Gets a list of attribute names. The names are returned in an
  *         arbitrary order (just like for an ordinary Python dictionary).
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_3keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__404)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 299, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_3keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__410)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 299, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_keys, __pyx_t_8) < 0) __PYX_ERR(6, 299, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238320,7 +238336,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Gets element attributes, as a sequence. The attributes are returned
  *         in an arbitrary order.
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_5values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__406)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 306, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_5values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__412)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 306, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_values, __pyx_t_8) < 0) __PYX_ERR(6, 306, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238333,7 +238349,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Gets element attributes, as a sequence. The attributes are returned
  *         in an arbitrary order.
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_7items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__408)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 313, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_7items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__414)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 313, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_items, __pyx_t_8) < 0) __PYX_ERR(6, 313, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238346,7 +238362,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Append a copy of an Element to the list of children.
  *         """
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_OpaqueDocumentWrapper_1append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OpaqueDocumentWrapper_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__410)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 379, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_OpaqueDocumentWrapper_1append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OpaqueDocumentWrapper_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__416)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 379, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper->tp_dict, __pyx_n_s_append, __pyx_t_8) < 0) __PYX_ERR(6, 379, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238359,7 +238375,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Append a copy of all Elements from a sequence to the list of
  *         children.
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_OpaqueDocumentWrapper_3extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OpaqueDocumentWrapper_extend, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__412)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 396, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_OpaqueDocumentWrapper_3extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OpaqueDocumentWrapper_extend, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__418)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 396, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper->tp_dict, __pyx_n_s_extend, __pyx_t_8) < 0) __PYX_ERR(6, 396, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238372,7 +238388,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Append a copy of an Element to the list of children.
  *         """
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23_AppendOnlyElementProxy_1append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AppendOnlyElementProxy_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__414)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 476, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23_AppendOnlyElementProxy_1append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AppendOnlyElementProxy_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__420)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 476, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy->tp_dict, __pyx_n_s_append, __pyx_t_8) < 0) __PYX_ERR(6, 476, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238385,128 +238401,128 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Append a copy of all Elements from a sequence to the list of
  *         children.
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23_AppendOnlyElementProxy_3extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AppendOnlyElementProxy_extend, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__416)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 488, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23_AppendOnlyElementProxy_3extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AppendOnlyElementProxy_extend, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__422)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 488, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy->tp_dict, __pyx_n_s_extend, __pyx_t_8) < 0) __PYX_ERR(6, 488, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy);
 
-  /* "src/lxml/classlookup.pxi":250
+  /* "src/lxml/classlookup.pxi":249
  *             self._fallback_function = _lookupDefaultElementClass
  * 
  *     def set_fallback(self, ElementClassLookup lookup not None):             # <<<<<<<<<<<<<<
  *         u"""set_fallback(self, lookup)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_26FallbackElementClassLookup_5set_fallback, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FallbackElementClassLookup_set_f, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__418)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 250, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_26FallbackElementClassLookup_5set_fallback, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FallbackElementClassLookup_set_f, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__424)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 249, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_dict, __pyx_n_s_set_fallback, __pyx_t_8) < 0) __PYX_ERR(8, 250, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_dict, __pyx_n_s_set_fallback, __pyx_t_8) < 0) __PYX_ERR(8, 249, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_FallbackElementClassLookup);
 
-  /* "src/lxml/classlookup.pxi":432
+  /* "src/lxml/classlookup.pxi":431
  *         self._lookup_function = _custom_class_lookup
  * 
  *     def lookup(self, type, doc, namespace, name):             # <<<<<<<<<<<<<<
  *         u"lookup(self, type, doc, namespace, name)"
  *         return None
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_24CustomElementClassLookup_3lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CustomElementClassLookup_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__420)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 432, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_24CustomElementClassLookup_3lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CustomElementClassLookup_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__426)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 431, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_CustomElementClassLookup->tp_dict, __pyx_n_s_lookup, __pyx_t_8) < 0) __PYX_ERR(8, 432, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_CustomElementClassLookup->tp_dict, __pyx_n_s_lookup, __pyx_t_8) < 0) __PYX_ERR(8, 431, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_CustomElementClassLookup);
 
-  /* "src/lxml/classlookup.pxi":514
+  /* "src/lxml/classlookup.pxi":513
  *         self._lookup_function = _python_class_lookup
  * 
  *     def lookup(self, doc, element):             # <<<<<<<<<<<<<<
  *         u"""lookup(self, doc, element)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_24PythonElementClassLookup_3lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PythonElementClassLookup_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__422)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 514, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_24PythonElementClassLookup_3lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PythonElementClassLookup_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__428)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 513, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_PythonElementClassLookup->tp_dict, __pyx_n_s_lookup, __pyx_t_8) < 0) __PYX_ERR(8, 514, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_PythonElementClassLookup->tp_dict, __pyx_n_s_lookup, __pyx_t_8) < 0) __PYX_ERR(8, 513, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_PythonElementClassLookup);
 
-  /* "src/lxml/classlookup.pxi":551
+  /* "src/lxml/classlookup.pxi":550
  *     LOOKUP_ELEMENT_CLASS = function
  * 
  * def set_element_class_lookup(ElementClassLookup lookup = None):             # <<<<<<<<<<<<<<
  *     u"""set_element_class_lookup(lookup = None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_41set_element_class_lookup, 0, __pyx_n_s_set_element_class_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__424)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 551, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_41set_element_class_lookup, 0, __pyx_n_s_set_element_class_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__430)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 550, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__425);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_element_class_lookup, __pyx_t_8) < 0) __PYX_ERR(8, 551, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__431);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_element_class_lookup, __pyx_t_8) < 0) __PYX_ERR(8, 550, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "src/lxml/classlookup.pxi":563
+  /* "src/lxml/classlookup.pxi":562
  * # default setup: parser delegation
  * cdef ParserBasedElementClassLookup DEFAULT_ELEMENT_CLASS_LOOKUP
  * DEFAULT_ELEMENT_CLASS_LOOKUP = ParserBasedElementClassLookup()             # <<<<<<<<<<<<<<
  * 
  * set_element_class_lookup(DEFAULT_ELEMENT_CLASS_LOOKUP)
  */
-  __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 563, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 562, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_XGOTREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP, ((struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *)__pyx_t_8));
   __Pyx_GIVEREF(__pyx_t_8);
   __pyx_t_8 = 0;
 
-  /* "src/lxml/classlookup.pxi":565
+  /* "src/lxml/classlookup.pxi":564
  * DEFAULT_ELEMENT_CLASS_LOOKUP = ParserBasedElementClassLookup()
  * 
  * set_element_class_lookup(DEFAULT_ELEMENT_CLASS_LOOKUP)             # <<<<<<<<<<<<<<
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_element_class_lookup); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 565, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_element_class_lookup); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 564, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_9 = NULL;
-  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
-    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
     if (likely(__pyx_t_9)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
       __Pyx_INCREF(__pyx_t_9);
       __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_7, function);
+      __Pyx_DECREF_SET(__pyx_t_6, function);
     }
   }
   if (!__pyx_t_9) {
-    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 565, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 564, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
   } else {
     #if CYTHON_FAST_PYCALL
-    if (PyFunction_Check(__pyx_t_7)) {
+    if (PyFunction_Check(__pyx_t_6)) {
       PyObject *__pyx_temp[2] = {__pyx_t_9, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP)};
-      __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 565, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 564, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_GOTREF(__pyx_t_8);
     } else
     #endif
     #if CYTHON_FAST_PYCCALL
-    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
       PyObject *__pyx_temp[2] = {__pyx_t_9, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP)};
-      __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 565, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 564, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_GOTREF(__pyx_t_8);
     } else
     #endif
     {
-      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 565, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
+      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 564, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
       __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
       __Pyx_GIVEREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
-      PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 565, __pyx_L1_error)
+      PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
+      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 564, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     }
   }
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
   /* "src/lxml/nsclasses.pxi":29
@@ -238516,7 +238532,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""update(self, class_dict_iterable)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_NamespaceRegistry_3update, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamespaceRegistry_update, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__427)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 29, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_NamespaceRegistry_3update, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamespaceRegistry_update, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__433)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 29, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_dict, __pyx_n_s_update, __pyx_t_8) < 0) __PYX_ERR(9, 29, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238529,7 +238545,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return list(self._entries.items())
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_NamespaceRegistry_11items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamespaceRegistry_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__429)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 74, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_NamespaceRegistry_11items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamespaceRegistry_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__435)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 74, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_dict, __pyx_n_s_items, __pyx_t_8) < 0) __PYX_ERR(9, 74, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238542,7 +238558,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return iter(self._entries.items())
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_NamespaceRegistry_13iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamespaceRegistry_iteritems, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__431)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 77, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_NamespaceRegistry_13iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamespaceRegistry_iteritems, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__437)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 77, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_dict, __pyx_n_s_iteritems, __pyx_t_8) < 0) __PYX_ERR(9, 77, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238555,49 +238571,62 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._entries.clear()
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_NamespaceRegistry_15clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamespaceRegistry_clear, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__433)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 80, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_NamespaceRegistry_15clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamespaceRegistry_clear, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__439)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 80, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_dict, __pyx_n_s_clear, __pyx_t_8) < 0) __PYX_ERR(9, 80, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__NamespaceRegistry);
 
-  /* "src/lxml/nsclasses.pxi":113
+  /* "src/lxml/nsclasses.pxi":99
+ *         return obj
+ * 
+ *     def __deco(self, name, obj):             # <<<<<<<<<<<<<<
+ *         self[name] = obj
+ *         return obj
+ */
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_NamespaceRegistry_19__deco, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamespaceRegistry___deco, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__441)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_dict, __pyx_n_s_deco, __pyx_t_8) < 0) __PYX_ERR(9, 99, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  PyType_Modified(__pyx_ptype_4lxml_5etree__NamespaceRegistry);
+
+  /* "src/lxml/nsclasses.pxi":147
  *         self._lookup_function = _find_nselement_class
  * 
  *     def get_namespace(self, ns_uri):             # <<<<<<<<<<<<<<
  *         u"""get_namespace(self, ns_uri)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27ElementNamespaceClassLookup_5get_namespace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementNamespaceClassLookup_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__435)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 113, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27ElementNamespaceClassLookup_5get_namespace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementNamespaceClassLookup_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__443)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 147, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_ElementNamespaceClassLookup->tp_dict, __pyx_n_s_get_namespace, __pyx_t_8) < 0) __PYX_ERR(9, 113, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_ElementNamespaceClassLookup->tp_dict, __pyx_n_s_get_namespace, __pyx_t_8) < 0) __PYX_ERR(9, 147, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_ElementNamespaceClassLookup);
 
-  /* "src/lxml/nsclasses.pxi":171
+  /* "src/lxml/nsclasses.pxi":205
  * 
  * cdef dict __FUNCTION_NAMESPACE_REGISTRIES
  * __FUNCTION_NAMESPACE_REGISTRIES = {}             # <<<<<<<<<<<<<<
  * 
  * def FunctionNamespace(ns_uri):
  */
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 171, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, ((PyObject*)__pyx_t_8));
   __Pyx_GIVEREF(__pyx_t_8);
   __pyx_t_8 = 0;
 
-  /* "src/lxml/nsclasses.pxi":173
+  /* "src/lxml/nsclasses.pxi":207
  * __FUNCTION_NAMESPACE_REGISTRIES = {}
  * 
  * def FunctionNamespace(ns_uri):             # <<<<<<<<<<<<<<
  *     u"""FunctionNamespace(ns_uri)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_43FunctionNamespace, 0, __pyx_n_s_FunctionNamespace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__437)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 173, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_43FunctionNamespace, 0, __pyx_n_s_FunctionNamespace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__445)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 207, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionNamespace, __pyx_t_8) < 0) __PYX_ERR(9, 173, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionNamespace, __pyx_t_8) < 0) __PYX_ERR(9, 207, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
   /* "src/lxml/docloader.pxi":25
@@ -238607,7 +238636,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""resolve(self, system_url, public_id, context)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8Resolver_1resolve, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Resolver_resolve, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__439)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 25, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8Resolver_1resolve, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Resolver_resolve, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__447)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 25, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_Resolver->tp_dict, __pyx_n_s_resolve, __pyx_t_8) < 0) __PYX_ERR(10, 25, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238620,7 +238649,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""resolve_empty(self, context)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8Resolver_3resolve_empty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Resolver_resolve_empty, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__441)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 36, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8Resolver_3resolve_empty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Resolver_resolve_empty, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__449)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 36, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_Resolver->tp_dict, __pyx_n_s_resolve_empty, __pyx_t_8) < 0) __PYX_ERR(10, 36, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238633,7 +238662,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""resolve_string(self, string, context, base_url=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8Resolver_5resolve_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Resolver_resolve_string, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__443)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 48, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8Resolver_5resolve_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Resolver_resolve_string, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__451)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 48, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_Resolver->tp_dict, __pyx_n_s_resolve_string, __pyx_t_8) < 0) __PYX_ERR(10, 48, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238646,7 +238675,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""resolve_filename(self, filename, context)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8Resolver_7resolve_filename, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Resolver_resolve_filename, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__445)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 69, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8Resolver_7resolve_filename, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Resolver_resolve_filename, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__453)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 69, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_Resolver->tp_dict, __pyx_n_s_resolve_filename, __pyx_t_8) < 0) __PYX_ERR(10, 69, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238659,7 +238688,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""resolve_file(self, f, context, base_url=None, close=True)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8Resolver_9resolve_file, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Resolver_resolve_file, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__447)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 83, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8Resolver_9resolve_file, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Resolver_resolve_file, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__455)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 83, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_Resolver->tp_dict, __pyx_n_s_resolve_file, __pyx_t_8) < 0) __PYX_ERR(10, 83, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238672,7 +238701,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""add(self, resolver)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ResolverRegistry_3add, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ResolverRegistry_add, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__449)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 120, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ResolverRegistry_3add, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ResolverRegistry_add, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__457)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 120, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ResolverRegistry->tp_dict, __pyx_n_s_add, __pyx_t_8) < 0) __PYX_ERR(10, 120, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238685,7 +238714,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"remove(self, resolver)"
  *         self._resolvers.discard(resolver)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ResolverRegistry_5remove, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ResolverRegistry_remove, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__451)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 133, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ResolverRegistry_5remove, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ResolverRegistry_remove, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__459)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 133, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ResolverRegistry->tp_dict, __pyx_n_s_remove, __pyx_t_8) < 0) __PYX_ERR(10, 133, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238698,7 +238727,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"copy(self)"
  *         return self._copy()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ResolverRegistry_7copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ResolverRegistry_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__453)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 143, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ResolverRegistry_7copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ResolverRegistry_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__461)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 143, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ResolverRegistry->tp_dict, __pyx_n_s_copy, __pyx_t_8) < 0) __PYX_ERR(10, 143, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238711,7 +238740,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"resolve(self, system_url, public_id, context)"
  *         for resolver in self._resolvers:
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ResolverRegistry_9resolve, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ResolverRegistry_resolve, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__455)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 147, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_ResolverRegistry_9resolve, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ResolverRegistry_resolve, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__463)); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 147, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ResolverRegistry->tp_dict, __pyx_n_s_resolve, __pyx_t_8) < 0) __PYX_ERR(10, 147, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238726,15 +238755,15 @@ PyMODINIT_FUNC PyInit_etree(void)
  */
   __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_8);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
   __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 14, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_7, __pyx_n_s_ParseError, __pyx_n_s_ParseError, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Syntax_error_while_parsing_an_XM); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_6, __pyx_n_s_ParseError, __pyx_n_s_ParseError, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Syntax_error_while_parsing_an_XM); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
 
   /* "src/lxml/parser.pxi":19
  *     For compatibility with ElementTree 1.3 and later.
@@ -238743,10 +238772,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         super(_ParseError, self).__init__(message)
  *         self.lineno, self.offset = (line, column - 1)
  */
-  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10ParseError_1__init__, 0, __pyx_n_s_ParseError___init, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__457)); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 19, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10ParseError_1__init__, 0, __pyx_n_s_ParseError___init, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__465)); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 19, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__458);
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_init, __pyx_t_9) < 0) __PYX_ERR(2, 19, __pyx_L1_error)
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__466);
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_init, __pyx_t_9) < 0) __PYX_ERR(2, 19, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
   /* "src/lxml/parser.pxi":26
@@ -238756,7 +238785,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return self.lineno, self.offset + 1
  * 
  */
-  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10ParseError_3position, 0, __pyx_n_s_ParseError_position, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__460)); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 26, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10ParseError_3position, 0, __pyx_n_s_ParseError_position, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__468)); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 26, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
 
   /* "src/lxml/parser.pxi":25
@@ -238774,7 +238803,7 @@ PyMODINIT_FUNC PyInit_etree(void)
   __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 25, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_position, __pyx_t_9) < 0) __PYX_ERR(2, 26, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_position, __pyx_t_9) < 0) __PYX_ERR(2, 26, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
   /* "src/lxml/parser.pxi":29
@@ -238784,7 +238813,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     def position(self, new_pos):
  *         self.lineno, column = new_pos
  */
-  __pyx_t_1 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_position);
+  __pyx_t_1 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_position);
   if (unlikely(!__pyx_t_1)) {
     PyErr_Clear();
     __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_position);
@@ -238802,7 +238831,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self.lineno, column = new_pos
  *         self.offset = column - 1
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10ParseError_5position, 0, __pyx_n_s_ParseError_position, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__462)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 30, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10ParseError_5position, 0, __pyx_n_s_ParseError_position, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__470)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 30, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_13 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
@@ -238850,7 +238879,7 @@ PyMODINIT_FUNC PyInit_etree(void)
     }
   }
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_position, __pyx_t_9) < 0) __PYX_ERR(2, 30, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_position, __pyx_t_9) < 0) __PYX_ERR(2, 30, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
   /* "src/lxml/parser.pxi":14
@@ -238860,13 +238889,13 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     """Syntax error while parsing an XML document.
  * 
  */
-  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_ParseError, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_ParseError, __pyx_t_6, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_ParseError, __pyx_t_9) < 0) __PYX_ERR(2, 14, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
   /* "src/lxml/parser.pxi":34
  *         self.offset = column - 1
@@ -238875,12 +238904,12 @@ PyMODINIT_FUNC PyInit_etree(void)
  * 
  * 
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ParseError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 34, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ParseError); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 34, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__ParseError);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__ParseError, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__ParseError, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_6);
+  __pyx_t_6 = 0;
 
   /* "src/lxml/parser.pxi":37
  * 
@@ -238889,23 +238918,23 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     """Syntax error while parsing an XML document.
  *     """
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_ParseError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 37, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ParseError); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 37, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
-  __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 37, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_8, __pyx_n_s_XMLSyntaxError, __pyx_n_s_XMLSyntaxError, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Syntax_error_while_parsing_an_XM_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 37, __pyx_L1_error)
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
+  __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 37, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_XMLSyntaxError, __pyx_t_8, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 37, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_8, __pyx_n_s_XMLSyntaxError, __pyx_n_s_XMLSyntaxError, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Syntax_error_while_parsing_an_XM_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_XMLSyntaxError, __pyx_t_8, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 37, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMLSyntaxError, __pyx_t_9) < 0) __PYX_ERR(2, 37, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
   /* "src/lxml/parser.pxi":185
@@ -238947,7 +238976,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  * 
  * ############################################################
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__setupPythonUnicode(); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 248, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__setupPythonUnicode(); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 248, __pyx_L1_error)
 
   /* "src/lxml/parser.pxi":509
  * 
@@ -238974,7 +239003,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u":deprecated: use ``parser.set_element_class_lookup(lookup)`` instead."
  *         self.set_element_class_lookup(lookup)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_BaseParser_3setElementClassLookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseParser_setElementClassLooku, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__464)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 959, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_BaseParser_3setElementClassLookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseParser_setElementClassLooku, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__472)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 959, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__BaseParser->tp_dict, __pyx_n_s_setElementClassLookup, __pyx_t_8) < 0) __PYX_ERR(2, 959, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -238987,7 +239016,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""set_element_class_lookup(self, lookup = None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_BaseParser_5set_element_class_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseParser_set_element_class_lo, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__466)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 963, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_BaseParser_5set_element_class_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseParser_set_element_class_lo, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__474)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 963, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__BaseParser->tp_dict, __pyx_n_s_set_element_class_lookup, __pyx_t_8) < 0) __PYX_ERR(2, 963, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239000,7 +239029,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""copy(self)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_BaseParser_7copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseParser_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__468)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 990, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_BaseParser_7copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseParser_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__476)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 990, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__BaseParser->tp_dict, __pyx_n_s_copy, __pyx_t_8) < 0) __PYX_ERR(2, 990, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239013,7 +239042,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""makeelement(self, _tag, attrib=None, nsmap=None, **_extra)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_BaseParser_9makeelement, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseParser_makeelement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__470)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 997, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_BaseParser_9makeelement, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseParser_makeelement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__478)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 997, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__BaseParser->tp_dict, __pyx_n_s_makeelement, __pyx_t_8) < 0) __PYX_ERR(2, 997, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239026,7 +239055,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""feed(self, data)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_FeedParser_1feed, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FeedParser_feed, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__472)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1240, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_FeedParser_1feed, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FeedParser_feed, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__480)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1240, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__FeedParser->tp_dict, __pyx_n_s_feed, __pyx_t_8) < 0) __PYX_ERR(2, 1240, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239039,7 +239068,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""close(self)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_FeedParser_3close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FeedParser_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__474)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1366, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11_FeedParser_3close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FeedParser_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__482)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1366, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__FeedParser->tp_dict, __pyx_n_s_close, __pyx_t_8) < 0) __PYX_ERR(2, 1366, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239061,7 +239090,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return (<_SaxParserContext?>self._getPushParserContext()).events_iterator
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13XMLPullParser_3read_events, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XMLPullParser_read_events, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__476)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1548, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13XMLPullParser_3read_events, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XMLPullParser_read_events, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__484)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1548, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XMLPullParser->tp_dict, __pyx_n_s_read_events, __pyx_t_8) < 0) __PYX_ERR(2, 1548, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239109,9 +239138,9 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""set_default_parser(parser=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_45set_default_parser, 0, __pyx_n_s_set_default_parser, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__478)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1600, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_45set_default_parser, 0, __pyx_n_s_set_default_parser, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__486)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1600, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__479);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__487);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_parser, __pyx_t_8) < 0) __PYX_ERR(2, 1600, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
@@ -239122,7 +239151,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"get_default_parser()"
  *     return __GLOBAL_PARSER_CONTEXT.getDefaultParser()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_47get_default_parser, 0, __pyx_n_s_get_default_parser, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__480)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1616, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_47get_default_parser, 0, __pyx_n_s_get_default_parser, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__488)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1616, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_default_parser, __pyx_t_8) < 0) __PYX_ERR(2, 1616, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239157,7 +239186,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return (<_SaxParserContext?>self._getPushParserContext()).events_iterator
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14HTMLPullParser_3read_events, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTMLPullParser_read_events, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__482)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1717, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14HTMLPullParser_3read_events, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HTMLPullParser_read_events, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__490)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1717, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_HTMLPullParser->tp_dict, __pyx_n_s_read_events, __pyx_t_8) < 0) __PYX_ERR(2, 1717, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239170,10 +239199,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  * 
  * 
  */
-  __Pyx_INCREF(__pyx_tuple__483);
+  __Pyx_INCREF(__pyx_tuple__491);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_NS_END_EVENT);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_NS_END_EVENT, __pyx_tuple__483);
-  __Pyx_GIVEREF(__pyx_tuple__483);
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_NS_END_EVENT, __pyx_tuple__491);
+  __Pyx_GIVEREF(__pyx_tuple__491);
 
   /* "src/lxml/saxparser.pxi":721
  *     # Python level event handlers
@@ -239182,7 +239211,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""close(self)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_3close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__485)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 721, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_3close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__493)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 721, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_close, __pyx_t_8) < 0) __PYX_ERR(11, 721, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239195,7 +239224,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""data(self, data)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_5data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_data, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__487)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 731, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_5data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_data, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__495)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 731, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_data, __pyx_t_8) < 0) __PYX_ERR(11, 731, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239208,7 +239237,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""start(self, tag, attrs, nsmap=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_7start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_start, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__489)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 739, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_7start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_start, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__497)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 739, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_start, __pyx_t_8) < 0) __PYX_ERR(11, 739, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239221,7 +239250,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""end(self, tag)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_9end, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_end, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__491)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 748, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_9end, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_end, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__499)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 748, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_end, __pyx_t_8) < 0) __PYX_ERR(11, 748, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239234,7 +239263,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""pi(self, target, data)
  *         """
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_11pi, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_pi, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__493)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 759, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_11pi, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_pi, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__501)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 759, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_pi, __pyx_t_8) < 0) __PYX_ERR(11, 759, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239247,7 +239276,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""comment(self, comment)
  *         """
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_13comment, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_comment, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__495)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 764, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_11TreeBuilder_13comment, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_comment, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__503)); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 764, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_comment, __pyx_t_8) < 0) __PYX_ERR(11, 764, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239281,17 +239310,17 @@ PyMODINIT_FUNC PyInit_etree(void)
       __Pyx_INCREF(__pyx_n_s_getargspec);
       __Pyx_GIVEREF(__pyx_n_s_getargspec);
       PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_getargspec);
-      __pyx_t_7 = __Pyx_patch_inspect(__Pyx_Import(__pyx_n_s_inspect, __pyx_t_8, 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 5, __pyx_L51_error)
-      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_6 = __Pyx_patch_inspect(__Pyx_Import(__pyx_n_s_inspect, __pyx_t_8, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 5, __pyx_L51_error)
+      __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_getargspec); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 5, __pyx_L51_error)
+      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_getargspec); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 5, __pyx_L51_error)
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_INCREF(__pyx_t_8);
       __Pyx_XGOTREF(__pyx_v_4lxml_5etree_inspect_getargspec);
       __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_inspect_getargspec, __pyx_t_8);
       __Pyx_GIVEREF(__pyx_t_8);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
       /* "src/lxml/parsertarget.pxi":4
  * 
@@ -239306,15 +239335,14 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L56_try_end;
     __pyx_L51_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
     /* "src/lxml/parsertarget.pxi":6
  * try:
@@ -239326,10 +239354,10 @@ PyMODINIT_FUNC PyInit_etree(void)
     __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
     if (__pyx_t_5) {
       __Pyx_AddTraceback("lxml.etree", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(12, 6, __pyx_L53_except_error)
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_GOTREF(__pyx_t_8);
+      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(12, 6, __pyx_L53_except_error)
       __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_GOTREF(__pyx_t_7);
 
       /* "src/lxml/parsertarget.pxi":7
  *     from inspect import getargspec as inspect_getargspec
@@ -239354,9 +239382,9 @@ PyMODINIT_FUNC PyInit_etree(void)
       __Pyx_GIVEREF(__pyx_t_9);
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       goto __pyx_L52_exception_handled;
     }
     goto __pyx_L53_except_error;
@@ -239369,14 +239397,12 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     from inspect import getargspec as inspect_getargspec
  * except ImportError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L1_error;
     __pyx_L52_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -239391,15 +239417,15 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     # Admittedly, this is somewhat ugly, but it's the easiest way
  *     # to push the Python level parser result through the parser
  */
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 10, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
   __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
-  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 10, __pyx_L1_error)
+  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 10, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_6, __pyx_n_s_TargetParserResult, __pyx_n_s_TargetParserResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 10, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_7, __pyx_n_s_TargetParserResult, __pyx_n_s_TargetParserResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
 
   /* "src/lxml/parsertarget.pxi":14
  *     # to push the Python level parser result through the parser
@@ -239408,9 +239434,9 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self.result = result
  * 
  */
-  __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_19_TargetParserResult_1__init__, 0, __pyx_n_s_TargetParserResult___init, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__497)); if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 14, __pyx_L1_error)
+  __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_19_TargetParserResult_1__init__, 0, __pyx_n_s_TargetParserResult___init, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__505)); if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 14, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_12);
-  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_init, __pyx_t_12) < 0) __PYX_ERR(12, 14, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_init, __pyx_t_12) < 0) __PYX_ERR(12, 14, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
 
   /* "src/lxml/parsertarget.pxi":10
@@ -239420,13 +239446,13 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     # Admittedly, this is somewhat ugly, but it's the easiest way
  *     # to push the Python level parser result through the parser
  */
-  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_TargetParserResult, __pyx_t_6, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 10, __pyx_L1_error)
+  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_TargetParserResult, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 10, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_12);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_TargetParserResult, __pyx_t_12) < 0) __PYX_ERR(12, 10, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "src/lxml/serializer.pxi":4
  * 
@@ -239435,21 +239461,21 @@ PyMODINIT_FUNC PyInit_etree(void)
  * 
  * 
  */
-  __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 4, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 4, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_n_s_GzipFile);
   __Pyx_GIVEREF(__pyx_n_s_GzipFile);
-  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_GzipFile);
-  __pyx_t_8 = __Pyx_Import(__pyx_n_s_gzip, __pyx_t_6, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 4, __pyx_L1_error)
+  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_GzipFile);
+  __pyx_t_8 = __Pyx_Import(__pyx_n_s_gzip, __pyx_t_7, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 4, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_GzipFile); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 4, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_INCREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_GzipFile); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 4, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_INCREF(__pyx_t_7);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_GzipFile);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_GzipFile, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_GzipFile, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
   /* "src/lxml/serializer.pxi":914
@@ -239459,7 +239485,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         assert self.output_file is not None
  *         self.writer = _IncrementalFileWriter(
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7xmlfile_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__499)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 914, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7xmlfile_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__507)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 914, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_enter, __pyx_t_8) < 0) __PYX_ERR(7, 914, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239472,7 +239498,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         if self.writer is not None:
  *             old_writer, self.writer = self.writer, None
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7xmlfile_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__501)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 921, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7xmlfile_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__509)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 921, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_exit, __pyx_t_8) < 0) __PYX_ERR(7, 921, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239485,7 +239511,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         assert self.output_file is not None
  *         if isinstance(self.output_file, basestring):
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7xmlfile_7__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__503)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 929, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7xmlfile_7__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__511)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 929, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_aenter, __pyx_t_8) < 0) __PYX_ERR(7, 929, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239498,7 +239524,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         if self.async_writer is not None:
  *             old_writer, self.async_writer = self.async_writer, None
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7xmlfile_10__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__505)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 940, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7xmlfile_10__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__513)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 940, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_aexit, __pyx_t_8) < 0) __PYX_ERR(7, 940, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239511,7 +239537,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """write_declaration(self, version=None, standalone=None, doctype=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_5write_declaration, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write_dec, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__507)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 997, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_5write_declaration, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write_dec, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__515)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 997, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_write_declaration, __pyx_t_8) < 0) __PYX_ERR(7, 997, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239524,7 +239550,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """write_doctype(self, doctype)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_7write_doctype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write_doc, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__509)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1026, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_7write_doctype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write_doc, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__517)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1026, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_write_doctype, __pyx_t_8) < 0) __PYX_ERR(7, 1026, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239537,7 +239563,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """method(self, method)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_9method, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_method, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__511)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1043, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_9method, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_method, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__519)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1043, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_method, __pyx_t_8) < 0) __PYX_ERR(7, 1043, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239550,7 +239576,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """element(self, tag, attrib=None, nsmap=None, method, **_extra)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_11element, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_element, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__513)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1053, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_11element, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_element, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__521)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1053, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_element, __pyx_t_8) < 0) __PYX_ERR(7, 1053, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239563,7 +239589,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """write(self, *args, with_tail=True, pretty_print=False, method=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_13write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__515)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1190, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_13write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__523)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1190, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_write, __pyx_t_8) < 0) __PYX_ERR(7, 1190, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239576,7 +239602,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """flush(self)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_15flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_flush, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__517)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1236, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_15flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_flush, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__525)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1236, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_flush, __pyx_t_8) < 0) __PYX_ERR(7, 1236, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239589,7 +239615,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._data.append(data)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_16_AsyncDataWriter_3write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncDataWriter_write, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__519)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1283, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_16_AsyncDataWriter_3write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncDataWriter_write, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__527)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1283, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncDataWriter->tp_dict, __pyx_n_s_write, __pyx_t_8) < 0) __PYX_ERR(7, 1283, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239602,7 +239628,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         pass
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_16_AsyncDataWriter_5close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncDataWriter_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__521)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1286, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_16_AsyncDataWriter_5close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncDataWriter_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__529)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1286, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncDataWriter->tp_dict, __pyx_n_s_close, __pyx_t_8) < 0) __PYX_ERR(7, 1286, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239615,7 +239641,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._writer.flush()
  *         data = self._buffer.collect()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_3flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_flus, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__523)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1315, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_3flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_flus, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__531)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1315, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_flush, __pyx_t_8) < 0) __PYX_ERR(7, 1315, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239628,7 +239654,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._writer.write_declaration(version, standalone, doctype)
  *         data = self._flush()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_6write_declaration, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__525)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1321, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_6write_declaration, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__533)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1321, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_write_declaration, __pyx_t_8) < 0) __PYX_ERR(7, 1321, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239641,7 +239667,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._writer.write_doctype(doctype)
  *         data = self._flush()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_9write_doctype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ_2, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__527)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1327, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_9write_doctype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ_2, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__535)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1327, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_write_doctype, __pyx_t_8) < 0) __PYX_ERR(7, 1327, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239654,7 +239680,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._writer.write(*args, with_tail=with_tail, pretty_print=pretty_print, method=method)
  *         data = self._flush()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_12write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ_3, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__529)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1333, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_12write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ_3, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__537)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1333, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_write, __pyx_t_8) < 0) __PYX_ERR(7, 1333, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239667,7 +239693,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return self._writer.method(method)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_15method, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_meth, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__531)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1339, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_15method, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_meth, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__539)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1339, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_method, __pyx_t_8) < 0) __PYX_ERR(7, 1339, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239680,7 +239706,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         element_writer = self._writer.element(tag, attrib, nsmap, method, **_extra)
  *         return _AsyncFileWriterElement(element_writer, self)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_17element, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_elem, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__533)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1342, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_17element, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_elem, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__541)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1342, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_element, __pyx_t_8) < 0) __PYX_ERR(7, 1342, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239693,7 +239719,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._writer._close(raise_on_error)
  *         data = self._buffer.collect()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_19_close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter__clo, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__535)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1346, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_19_close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter__clo, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__543)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1346, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_close_2, __pyx_t_8) < 0) __PYX_ERR(7, 1346, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239706,7 +239732,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._element_writer.__enter__()
  *         data = self._writer._flush()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23_AsyncFileWriterElement_3__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncFileWriterElement___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__537)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1366, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23_AsyncFileWriterElement_3__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncFileWriterElement___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__545)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1366, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncFileWriterElement->tp_dict, __pyx_n_s_aenter, __pyx_t_8) < 0) __PYX_ERR(7, 1366, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239719,7 +239745,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._element_writer.__exit__(*args)
  *         data = self._writer._flush()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23_AsyncFileWriterElement_6__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncFileWriterElement___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__539)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1372, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23_AsyncFileWriterElement_6__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncFileWriterElement___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__547)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1372, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncFileWriterElement->tp_dict, __pyx_n_s_aexit, __pyx_t_8) < 0) __PYX_ERR(7, 1372, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239732,7 +239758,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._writer._method = self._new_method
  *         self._writer._write_start_element(self._element)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_FileWriterElement_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FileWriterElement___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__541)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1394, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_FileWriterElement_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FileWriterElement___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__549)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1394, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__FileWriterElement->tp_dict, __pyx_n_s_enter, __pyx_t_8) < 0) __PYX_ERR(7, 1394, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239745,7 +239771,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         self._writer._write_end_element(self._element)
  *         self._writer._method = self._old_method
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_FileWriterElement_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FileWriterElement___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__543)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1398, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_18_FileWriterElement_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FileWriterElement___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__551)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1398, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__FileWriterElement->tp_dict, __pyx_n_s_exit, __pyx_t_8) < 0) __PYX_ERR(7, 1398, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239758,7 +239784,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         if self._entered:
  *             raise LxmlSyntaxError("Inconsistent enter action in context manager")
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_MethodChanger_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__545)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1420, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_MethodChanger_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__553)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1420, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_enter, __pyx_t_8) < 0) __PYX_ERR(7, 1420, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239771,7 +239797,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         if self._exited:
  *             raise LxmlSyntaxError("Inconsistent exit action in context manager")
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_MethodChanger_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__547)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1426, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_MethodChanger_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__555)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1426, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_exit, __pyx_t_8) < 0) __PYX_ERR(7, 1426, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239784,7 +239810,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         # for your async convenience
  *         return self.__enter__()
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_MethodChanger_7__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__549)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1434, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_MethodChanger_7__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__557)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1434, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_aenter, __pyx_t_8) < 0) __PYX_ERR(7, 1434, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239797,7 +239823,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         # for your async convenience
  *         return self.__exit__(*args)
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_MethodChanger_10__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__551)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1438, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_14_MethodChanger_10__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__559)); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 1438, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_aexit, __pyx_t_8) < 0) __PYX_ERR(7, 1438, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239810,7 +239836,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""set_element_class_lookup(self, lookup = None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9iterparse_3set_element_class_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterparse_set_element_class_look, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__553)); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 147, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9iterparse_3set_element_class_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterparse_set_element_class_look, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__561)); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 147, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_iterparse->tp_dict, __pyx_n_s_set_element_class_lookup, __pyx_t_8) < 0) __PYX_ERR(13, 147, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239823,7 +239849,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""makeelement(self, _tag, attrib=None, nsmap=None, **_extra)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9iterparse_5makeelement, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterparse_makeelement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__555)); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 156, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9iterparse_5makeelement, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterparse_makeelement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__563)); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 156, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_iterparse->tp_dict, __pyx_n_s_makeelement, __pyx_t_8) < 0) __PYX_ERR(13, 156, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239836,7 +239862,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """Prevent descending into the current subtree.
  *         Instead, the next returned event will be the 'end' event of the current element
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8iterwalk_7skip_subtree, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterwalk_skip_subtree, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__557)); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 334, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_8iterwalk_7skip_subtree, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterwalk_skip_subtree, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__565)); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 334, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_iterwalk->tp_dict, __pyx_n_s_skip_subtree, __pyx_t_8) < 0) __PYX_ERR(13, 334, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -239849,16 +239875,16 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""XMLID(text, parser=None, base_url=None)
  * 
  */
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 3, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 3, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(14, 3, __pyx_L1_error)
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_49XMLID, 0, __pyx_n_s_XMLID, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__559)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__560);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_6, __pyx_t_8);
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_49XMLID, 0, __pyx_n_s_XMLID, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__567)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__568);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_8);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMLID, __pyx_t_6) < 0) __PYX_ERR(14, 3, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMLID, __pyx_t_7) < 0) __PYX_ERR(14, 3, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "src/lxml/xmlid.pxi":24
  *     return (root, dic)
@@ -239867,14 +239893,14 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""XMLDTDID(text, parser=None, base_url=None)
  * 
  */
-  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 24, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(14, 24, __pyx_L1_error)
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_51XMLDTDID, 0, __pyx_n_s_XMLDTDID, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__562)); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 24, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(14, 24, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_51XMLDTDID, 0, __pyx_n_s_XMLDTDID, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__570)); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 24, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__563);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_6);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__571);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_7);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMLDTDID, __pyx_t_8) < 0) __PYX_ERR(14, 24, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
@@ -239885,16 +239911,16 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""parseid(source, parser=None)
  * 
  */
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 44, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 44, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(14, 44, __pyx_L1_error)
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_53parseid, 0, __pyx_n_s_parseid, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__565)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 44, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__566);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_6, __pyx_t_8);
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_53parseid, 0, __pyx_n_s_parseid, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__573)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__574);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_8);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_parseid, __pyx_t_6) < 0) __PYX_ERR(14, 44, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_parseid, __pyx_t_7) < 0) __PYX_ERR(14, 44, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "src/lxml/xmlid.pxi":78
  *         self._items = None
@@ -239903,10 +239929,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return _IDDict(self._doc)
  * 
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__568)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 78, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(14, 78, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__576)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_copy, __pyx_t_7) < 0) __PYX_ERR(14, 78, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":95
@@ -239916,10 +239942,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return self[id_name]
  * 
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_7get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__570)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 95, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(14, 95, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_7get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__578)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_get, __pyx_t_7) < 0) __PYX_ERR(14, 95, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":105
@@ -239929,10 +239955,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return id_name in self
  * 
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_11has_key, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_has_key, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__572)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 105, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_has_key, __pyx_t_6) < 0) __PYX_ERR(14, 105, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_11has_key, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_has_key, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__580)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_has_key, __pyx_t_7) < 0) __PYX_ERR(14, 105, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":111
@@ -239942,10 +239968,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         if self._keys is None:
  *             self._keys = self._build_keys()
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_15keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__574)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 111, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_keys, __pyx_t_6) < 0) __PYX_ERR(14, 111, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_15keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__582)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 111, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_keys, __pyx_t_7) < 0) __PYX_ERR(14, 111, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":121
@@ -239955,10 +239981,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return self
  * 
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_19iterkeys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_iterkeys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__576)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 121, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_iterkeys, __pyx_t_6) < 0) __PYX_ERR(14, 121, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_19iterkeys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_iterkeys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__584)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_iterkeys, __pyx_t_7) < 0) __PYX_ERR(14, 121, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":129
@@ -239968,10 +239994,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         if self._items is None:
  *             self._items = self._build_items()
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_23items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__578)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 129, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_items, __pyx_t_6) < 0) __PYX_ERR(14, 129, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_23items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__586)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_items, __pyx_t_7) < 0) __PYX_ERR(14, 129, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":134
@@ -239981,10 +240007,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         if self._items is None:
  *             self._items = self._build_items()
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_25iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_iteritems, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__580)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 134, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_iteritems, __pyx_t_6) < 0) __PYX_ERR(14, 134, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_25iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_iteritems, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__588)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 134, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_iteritems, __pyx_t_7) < 0) __PYX_ERR(14, 134, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":139
@@ -239994,10 +240020,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         cdef list values = []
  *         if self._items is None:
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_27values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__582)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 139, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_values, __pyx_t_6) < 0) __PYX_ERR(14, 139, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_27values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__590)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_values, __pyx_t_7) < 0) __PYX_ERR(14, 139, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":149
@@ -240007,10 +240033,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return iter(self.values())
  * 
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_29itervalues, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_itervalues, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__584)); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 149, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_itervalues, __pyx_t_6) < 0) __PYX_ERR(14, 149, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7_IDDict_29itervalues, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_itervalues, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__592)); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_itervalues, __pyx_t_7) < 0) __PYX_ERR(14, 149, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/cleanup.pxi":3
@@ -240020,11 +240046,11 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""cleanup_namespaces(tree_or_element, top_nsmap=None, keep_ns_prefixes=None)
  * 
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_55cleanup_namespaces, 0, __pyx_n_s_cleanup_namespaces, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__586)); if (unlikely(!__pyx_t_6)) __PYX_ERR(16, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__587);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cleanup_namespaces, __pyx_t_6) < 0) __PYX_ERR(16, 3, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_55cleanup_namespaces, 0, __pyx_n_s_cleanup_namespaces, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__594)); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__595);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cleanup_namespaces, __pyx_t_7) < 0) __PYX_ERR(16, 3, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "src/lxml/cleanup.pxi":33
  * 
@@ -240033,10 +240059,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""strip_attributes(tree_or_element, *attribute_names)
  * 
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_57strip_attributes, 0, __pyx_n_s_strip_attributes, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__589)); if (unlikely(!__pyx_t_6)) __PYX_ERR(16, 33, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_attributes, __pyx_t_6) < 0) __PYX_ERR(16, 33, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_57strip_attributes, 0, __pyx_n_s_strip_attributes, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__597)); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_attributes, __pyx_t_7) < 0) __PYX_ERR(16, 33, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "src/lxml/cleanup.pxi":74
  * 
@@ -240045,16 +240071,16 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""strip_elements(tree_or_element, *tag_names, with_tail=True)
  * 
  */
-  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(16, 74, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __pyx_t_8 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(16, 74, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_with_tail, __pyx_t_8) < 0) __PYX_ERR(16, 74, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_with_tail, __pyx_t_8) < 0) __PYX_ERR(16, 74, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_59strip_elements, 0, __pyx_n_s_strip_elements, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__591)); if (unlikely(!__pyx_t_8)) __PYX_ERR(16, 74, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_59strip_elements, 0, __pyx_n_s_strip_elements, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__599)); if (unlikely(!__pyx_t_8)) __PYX_ERR(16, 74, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_6);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_7);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_elements, __pyx_t_8) < 0) __PYX_ERR(16, 74, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
@@ -240065,7 +240091,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""strip_tags(tree_or_element, *tag_names)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_61strip_tags, 0, __pyx_n_s_strip_tags, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__593)); if (unlikely(!__pyx_t_8)) __PYX_ERR(16, 145, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_61strip_tags, 0, __pyx_n_s_strip_tags, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__601)); if (unlikely(!__pyx_t_8)) __PYX_ERR(16, 145, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_tags, __pyx_t_8) < 0) __PYX_ERR(16, 145, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -240077,10 +240103,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     b"Number encoding",
  *     b"Unfinished literal",
  */
-  __Pyx_INCREF(__pyx_tuple__594);
+  __Pyx_INCREF(__pyx_tuple__602);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_LIBXML2_XPATH_ERROR_MESSAGES);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_LIBXML2_XPATH_ERROR_MESSAGES, __pyx_tuple__594);
-  __Pyx_GIVEREF(__pyx_tuple__594);
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_LIBXML2_XPATH_ERROR_MESSAGES, __pyx_tuple__602);
+  __Pyx_GIVEREF(__pyx_tuple__602);
 
   /* "src/lxml/extensions.pxi":426
  * 
@@ -240089,16 +240115,16 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"""Extension(module, function_mapping=None, ns=None)
  * 
  */
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 426, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 426, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_ns, ((PyObject *)Py_None)) < 0) __PYX_ERR(17, 426, __pyx_L1_error)
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_63Extension, 0, __pyx_n_s_Extension, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__596)); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 426, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__597);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_6, __pyx_t_8);
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_63Extension, 0, __pyx_n_s_Extension, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__604)); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 426, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__605);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_8);
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Extension, __pyx_t_6) < 0) __PYX_ERR(17, 426, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Extension, __pyx_t_7) < 0) __PYX_ERR(17, 426, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "src/lxml/extensions.pxi":498
  *         return rexp_compiled
@@ -240107,10 +240133,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         flags = self._make_string(flags)
  *         s = self._make_string(s)
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_3test, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_test, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__599)); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 498, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(17, 498, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_3test, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_test, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__607)); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 498, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(17, 498, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ExsltRegExp);
 
   /* "src/lxml/extensions.pxi":507
@@ -240120,10 +240146,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         cdef list result_list
  *         flags = self._make_string(flags)
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_5match, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_match, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__601)); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 507, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_match, __pyx_t_6) < 0) __PYX_ERR(17, 507, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_5match, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_match, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__609)); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 507, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_match, __pyx_t_7) < 0) __PYX_ERR(17, 507, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ExsltRegExp);
 
   /* "src/lxml/extensions.pxi":533
@@ -240133,10 +240159,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         replacement = self._make_string(replacement)
  *         flags = self._make_string(flags)
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_7replace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_replace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__603)); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 533, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_replace, __pyx_t_6) < 0) __PYX_ERR(17, 533, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_7replace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_replace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__611)); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 533, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_replace, __pyx_t_7) < 0) __PYX_ERR(17, 533, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ExsltRegExp);
 
   /* "src/lxml/extensions.pxi":731
@@ -240146,10 +240172,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return self._parent
  * 
  */
-  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21_ElementUnicodeResult_1getparent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementUnicodeResult_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__605)); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 731, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementUnicodeResult->tp_dict, __pyx_n_s_getparent, __pyx_t_6) < 0) __PYX_ERR(17, 731, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21_ElementUnicodeResult_1getparent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementUnicodeResult_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__613)); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 731, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementUnicodeResult->tp_dict, __pyx_n_s_getparent, __pyx_t_7) < 0) __PYX_ERR(17, 731, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementUnicodeResult);
 
   /* "src/lxml/extensions.pxi":735
@@ -240169,15 +240195,15 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         # we need to use a Python class here, or PyPy will crash on creation
  *         # https://bitbucket.org/pypy/pypy/issues/2021/pypy3-pytype_ready-crashes-for-extension
  */
-    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 736, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 736, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
     __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
-    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyUnicode_Type)));
-    __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 736, __pyx_L1_error)
+    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)(&PyUnicode_Type)));
+    __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 736, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_6, __pyx_n_s_PyElementUnicodeResult, __pyx_n_s_PyElementUnicodeResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 736, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_7, __pyx_n_s_PyElementUnicodeResult, __pyx_n_s_PyElementUnicodeResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 736, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
 
     /* "src/lxml/extensions.pxi":739
  *         # we need to use a Python class here, or PyPy will crash on creation
@@ -240186,9 +240212,9 @@ PyMODINIT_FUNC PyInit_etree(void)
  *             return self._parent
  * 
  */
-    __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23_PyElementUnicodeResult_1getparent, 0, __pyx_n_s_PyElementUnicodeResult_getparen, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__607)); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 739, __pyx_L1_error)
+    __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_23_PyElementUnicodeResult_1getparent, 0, __pyx_n_s_PyElementUnicodeResult_getparen, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__615)); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 739, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_12);
-    if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_getparent, __pyx_t_12) < 0) __PYX_ERR(17, 739, __pyx_L1_error)
+    if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_getparent, __pyx_t_12) < 0) __PYX_ERR(17, 739, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
 
     /* "src/lxml/extensions.pxi":736
@@ -240198,15 +240224,15 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         # we need to use a Python class here, or PyPy will crash on creation
  *         # https://bitbucket.org/pypy/pypy/issues/2021/pypy3-pytype_ready-crashes-for-extension
  */
-    __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_PyElementUnicodeResult, __pyx_t_6, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 736, __pyx_L1_error)
+    __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_PyElementUnicodeResult, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 736, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_12);
     __Pyx_XGOTREF(__pyx_v_4lxml_5etree__PyElementUnicodeResult);
     __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__PyElementUnicodeResult, __pyx_t_12);
     __Pyx_GIVEREF(__pyx_t_12);
     __pyx_t_12 = 0;
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
     /* "src/lxml/extensions.pxi":735
  * 
@@ -240224,15 +240250,15 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     # we need to use a Python class here, bytes cannot be C-subclassed
  *     # in Pyrex/Cython
  */
-  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 742, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 742, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
   __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
-  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)(&PyBytes_Type)));
-  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 742, __pyx_L1_error)
+  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)(&PyBytes_Type)));
+  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 742, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_6, __pyx_n_s_ElementStringResult, __pyx_n_s_ElementStringResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 742, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_7, __pyx_n_s_ElementStringResult, __pyx_n_s_ElementStringResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 742, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
 
   /* "src/lxml/extensions.pxi":745
  *     # we need to use a Python class here, bytes cannot be C-subclassed
@@ -240241,9 +240267,9 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return self._parent
  * 
  */
-  __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20_ElementStringResult_1getparent, 0, __pyx_n_s_ElementStringResult_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__609)); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 745, __pyx_L1_error)
+  __pyx_t_12 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_20_ElementStringResult_1getparent, 0, __pyx_n_s_ElementStringResult_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__617)); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 745, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_12);
-  if (PyObject_SetItem(__pyx_t_7, __pyx_n_s_getparent, __pyx_t_12) < 0) __PYX_ERR(17, 745, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_getparent, __pyx_t_12) < 0) __PYX_ERR(17, 745, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
 
   /* "src/lxml/extensions.pxi":742
@@ -240253,13 +240279,13 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     # we need to use a Python class here, bytes cannot be C-subclassed
  *     # in Pyrex/Cython
  */
-  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_ElementStringResult, __pyx_t_6, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 742, __pyx_L1_error)
+  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_ElementStringResult, __pyx_t_7, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 742, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_12);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_ElementStringResult, __pyx_t_12) < 0) __PYX_ERR(17, 742, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "src/lxml/xpath.pxi":3
  * # XPath evaluation
@@ -240268,26 +240294,26 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     pass
  * 
  */
-  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 3, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
   __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_5etree_XPathError));
   __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_5etree_XPathError));
   PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_ptype_4lxml_5etree_XPathError));
-  __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_8, __pyx_n_s_XPathSyntaxError, __pyx_n_s_XPathSyntaxError, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 3, __pyx_L1_error)
+  __pyx_t_7 = 0;
+  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 3, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_XPathSyntaxError, __pyx_t_8, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(18, 3, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_8, __pyx_n_s_XPathSyntaxError, __pyx_n_s_XPathSyntaxError, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_XPathSyntaxError, __pyx_t_8, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(18, 3, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_12);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_XPathSyntaxError, __pyx_t_12) < 0) __PYX_ERR(18, 3, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
   /* "src/lxml/xpath.pxi":11
@@ -240307,8 +240333,8 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
  *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
  */
-  __pyx_t_6 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_UNFINISHED_LITERAL_ERROR); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 12, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_UNFINISHED_LITERAL_ERROR); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
 
   /* "src/lxml/xpath.pxi":13
  *     xmlerror.XML_XPATH_NUMBER_ERROR,
@@ -240317,8 +240343,8 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
  *     xmlerror.XML_XPATH_UNCLOSED_ERROR,
  */
-  __pyx_t_7 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_VARIABLE_REF_ERROR); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 13, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_VARIABLE_REF_ERROR); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
 
   /* "src/lxml/xpath.pxi":14
  *     xmlerror.XML_XPATH_UNFINISHED_LITERAL_ERROR,
@@ -240361,10 +240387,10 @@ PyMODINIT_FUNC PyInit_etree(void)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_8);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
   __Pyx_GIVEREF(__pyx_t_12);
   PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_12);
   __Pyx_GIVEREF(__pyx_t_9);
@@ -240372,8 +240398,8 @@ PyMODINIT_FUNC PyInit_etree(void)
   __Pyx_GIVEREF(__pyx_t_14);
   PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_14);
   __pyx_t_8 = 0;
-  __pyx_t_6 = 0;
   __pyx_t_7 = 0;
+  __pyx_t_6 = 0;
   __pyx_t_12 = 0;
   __pyx_t_9 = 0;
   __pyx_t_14 = 0;
@@ -240429,8 +240455,8 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     xmlerror.XML_XPATH_INVALID_ARITY,
  *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,
  */
-  __pyx_t_7 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_INVALID_TYPE); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 25, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_6 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_INVALID_TYPE); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
 
   /* "src/lxml/xpath.pxi":26
  *     xmlerror.XML_XPATH_INVALID_OPERAND,
@@ -240439,8 +240465,8 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,
  *     xmlerror.XML_XPATH_INVALID_CTXT_POSITION
  */
-  __pyx_t_6 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_INVALID_ARITY); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 26, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_INVALID_ARITY); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 26, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
 
   /* "src/lxml/xpath.pxi":27
  *     xmlerror.XML_XPATH_INVALID_TYPE,
@@ -240479,10 +240505,10 @@ PyMODINIT_FUNC PyInit_etree(void)
   PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_9);
   __Pyx_GIVEREF(__pyx_t_12);
   PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_12);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_7);
   __Pyx_GIVEREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_t_7);
   __Pyx_GIVEREF(__pyx_t_8);
   PyTuple_SET_ITEM(__pyx_t_15, 6, __pyx_t_8);
   __Pyx_GIVEREF(__pyx_t_13);
@@ -240491,8 +240517,8 @@ PyMODINIT_FUNC PyInit_etree(void)
   __pyx_t_14 = 0;
   __pyx_t_9 = 0;
   __pyx_t_12 = 0;
-  __pyx_t_7 = 0;
   __pyx_t_6 = 0;
+  __pyx_t_7 = 0;
   __pyx_t_8 = 0;
   __pyx_t_13 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS);
@@ -240507,7 +240533,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""evaluate(self, _eval_arg, **_variables)
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_19_XPathEvaluatorBase_7evaluate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XPathEvaluatorBase_evaluate, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__611)); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 152, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_19_XPathEvaluatorBase_7evaluate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XPathEvaluatorBase_evaluate, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__619)); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 152, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XPathEvaluatorBase->tp_dict, __pyx_n_s_evaluate, __pyx_t_15) < 0) __PYX_ERR(18, 152, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -240520,7 +240546,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Register a namespace with the XPath context.
  *         """
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21XPathElementEvaluator_3register_namespace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XPathElementEvaluator_register_n, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__613)); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 268, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21XPathElementEvaluator_3register_namespace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XPathElementEvaluator_register_n, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__621)); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 268, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XPathElementEvaluator->tp_dict, __pyx_n_s_register_namespace, __pyx_t_15) < 0) __PYX_ERR(18, 268, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -240533,7 +240559,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""Register a prefix -> uri dict.
  *         """
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21XPathElementEvaluator_5register_namespaces, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XPathElementEvaluator_register_n_2, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__615)); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 274, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_21XPathElementEvaluator_5register_namespaces, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XPathElementEvaluator_register_n_2, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__623)); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 274, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XPathElementEvaluator->tp_dict, __pyx_n_s_register_namespaces, __pyx_t_15) < 0) __PYX_ERR(18, 274, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -240546,13 +240572,13 @@ PyMODINIT_FUNC PyInit_etree(void)
  *                    regexp=True, smart_strings=True):
  *     u"""XPathEvaluator(etree_or_element, namespaces=None, extensions=None, regexp=True, smart_strings=True)
  */
-  __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 369, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 369, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_namespaces, ((PyObject *)Py_None)) < 0) __PYX_ERR(18, 369, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_extensions, ((PyObject *)Py_None)) < 0) __PYX_ERR(18, 369, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_regexp, ((PyObject *)Py_True)) < 0) __PYX_ERR(18, 369, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_smart_strings, ((PyObject *)Py_True)) < 0) __PYX_ERR(18, 369, __pyx_L1_error)
-  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_65XPathEvaluator, 0, __pyx_n_s_XPathEvaluator, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__617)); if (unlikely(!__pyx_t_13)) __PYX_ERR(18, 369, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_65XPathEvaluator, 0, __pyx_n_s_XPathEvaluator, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__625)); if (unlikely(!__pyx_t_13)) __PYX_ERR(18, 369, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_13, __pyx_t_15);
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -240568,7 +240594,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  */
   __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_13)) __PYX_ERR(18, 467, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
-  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__619, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 467, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__627, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 467, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
   __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_sub); if (unlikely(!__pyx_t_13)) __PYX_ERR(18, 467, __pyx_L1_error)
@@ -240588,7 +240614,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  */
   __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_13)) __PYX_ERR(18, 468, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
-  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__621, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 468, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__629, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(18, 468, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
   __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_findall); if (unlikely(!__pyx_t_13)) __PYX_ERR(18, 468, __pyx_L1_error)
@@ -240618,10 +240644,10 @@ PyMODINIT_FUNC PyInit_etree(void)
   __Pyx_GOTREF(__pyx_t_15);
   __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_13, __pyx_n_s_XSLTSaveError, __pyx_n_s_XSLTSaveError, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Error_serialising_an_XSLT_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 18, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_XSLTSaveError, __pyx_t_13, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 18, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XSLTSaveError, __pyx_t_6) < 0) __PYX_ERR(3, 18, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_XSLTSaveError, __pyx_t_13, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XSLTSaveError, __pyx_t_7) < 0) __PYX_ERR(3, 18, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -240675,7 +240701,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         read_network=False, write_network=False)
  * 
  */
-  __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 201, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 201, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_read_file, Py_False) < 0) __PYX_ERR(3, 201, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_write_file, Py_False) < 0) __PYX_ERR(3, 201, __pyx_L1_error)
@@ -240712,7 +240738,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         read_network=True, write_network=False)
  * 
  */
-  __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 205, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_read_file, Py_True) < 0) __PYX_ERR(3, 205, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_write_file, Py_False) < 0) __PYX_ERR(3, 205, __pyx_L1_error)
@@ -240749,7 +240775,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  * 
  * @cython.final
  */
-  __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 264, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 264, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_EMPTY_DICT);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_EMPTY_DICT, ((PyObject*)__pyx_t_13));
@@ -240763,7 +240789,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""strparam(strval)
  * 
  */
-  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_7strparam, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_strparam, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__623)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 432, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_7strparam, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_strparam, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__631)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 432, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_strparam, __pyx_t_13) < 0) __PYX_ERR(3, 432, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -240797,7 +240823,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""set_global_max_depth(max_depth)
  * 
  */
-  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_9set_global_max_depth, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_set_global_max_depth, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__625)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 446, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_9set_global_max_depth, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_set_global_max_depth, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__633)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 446, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_set_global_max_depth, __pyx_t_13) < 0) __PYX_ERR(3, 446, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -240831,7 +240857,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""apply(self, _input,  profile_run=False, **kw)
  * 
  */
-  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_11apply, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_apply, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__627)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 465, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_11apply, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_apply, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__635)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 465, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_apply, __pyx_t_13) < 0) __PYX_ERR(3, 465, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -240844,7 +240870,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""tostring(self, result_tree)
  * 
  */
-  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_13tostring, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_tostring, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__629)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 471, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_13tostring, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_tostring, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__637)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 471, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_tostring, __pyx_t_13) < 0) __PYX_ERR(3, 471, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -240857,7 +240883,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return self.__copy__()
  * 
  */
-  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_15__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__631)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 480, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_15__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__639)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 480, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_deepcopy, __pyx_t_13) < 0) __PYX_ERR(3, 480, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -240870,7 +240896,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return _copyXSLT(self)
  * 
  */
-  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_17__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__633)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 483, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_4XSLT_17__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__641)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 483, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_copy_2, __pyx_t_13) < 0) __PYX_ERR(3, 483, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -240883,7 +240909,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """write_output(self, file, *, compression=0)
  * 
  */
-  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15_XSLTResultTree_1write_output, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTResultTree_write_output, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__635)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 708, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15_XSLTResultTree_1write_output, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTResultTree_write_output, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__643)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 708, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResultTree->tp_dict, __pyx_n_s_write_output, __pyx_t_13) < 0) __PYX_ERR(3, 708, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -240896,7 +240922,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         cdef xmlChar* encoding
  *         cdef xmlChar* s = NULL
  */
-  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15_XSLTResultTree_5__unicode__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTResultTree___unicode, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__637)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 783, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15_XSLTResultTree_5__unicode__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTResultTree___unicode, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__645)); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 783, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResultTree->tp_dict, __pyx_n_s_unicode_2, __pyx_t_13) < 0) __PYX_ERR(3, 783, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
@@ -240929,7 +240955,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  */
   __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 877, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
-  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__638, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 877, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__646, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 877, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__RE_PI_HREF);
@@ -240984,7 +241010,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""parseXSL(self, parser=None)
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_26_XSLTProcessingInstruction_1parseXSL, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTProcessingInstruction_parse, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__640)); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 891, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_26_XSLTProcessingInstruction_1parseXSL, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTProcessingInstruction_parse, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__648)); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 891, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction->tp_dict, __pyx_n_s_parseXSL, __pyx_t_15) < 0) __PYX_ERR(3, 891, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -240997,7 +241023,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""set(self, key, value)
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_26_XSLTProcessingInstruction_3set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTProcessingInstruction_set, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__642)); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 948, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_26_XSLTProcessingInstruction_3set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTProcessingInstruction_set, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__650)); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 948, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction->tp_dict, __pyx_n_s_set, __pyx_t_15) < 0) __PYX_ERR(3, 948, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241010,7 +241036,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         u"""execute(self, context, self_node, input_node, output_parent)
  *         Execute this extension element.
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13XSLTExtension_1execute, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTExtension_execute, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__644)); if (unlikely(!__pyx_t_15)) __PYX_ERR(19, 6, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13XSLTExtension_1execute, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTExtension_execute, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__652)); if (unlikely(!__pyx_t_15)) __PYX_ERR(19, 6, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLTExtension->tp_dict, __pyx_n_s_execute, __pyx_t_15) < 0) __PYX_ERR(19, 6, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241023,7 +241049,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *                         *, elements_only=False, remove_blank_text=False):
  *         u"""apply_templates(self, context, node, output_parent=None, elements_only=False, remove_blank_text=False)
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13XSLTExtension_3apply_templates, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTExtension_apply_templates, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__646)); if (unlikely(!__pyx_t_15)) __PYX_ERR(19, 22, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13XSLTExtension_3apply_templates, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTExtension_apply_templates, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__654)); if (unlikely(!__pyx_t_15)) __PYX_ERR(19, 22, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLTExtension->tp_dict, __pyx_n_s_apply_templates, __pyx_t_15) < 0) __PYX_ERR(19, 22, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241036,74 +241062,74 @@ PyMODINIT_FUNC PyInit_etree(void)
  *                          *, elements_only=False, remove_blank_text=False):
  *         u"""process_children(self, context, output_parent=None, elements_only=False, remove_blank_text=False)
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13XSLTExtension_5process_children, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTExtension_process_children, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__648)); if (unlikely(!__pyx_t_15)) __PYX_ERR(19, 74, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_13XSLTExtension_5process_children, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTExtension_process_children, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__656)); if (unlikely(!__pyx_t_15)) __PYX_ERR(19, 74, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLTExtension->tp_dict, __pyx_n_s_process_children, __pyx_t_15) < 0) __PYX_ERR(19, 74, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLTExtension);
 
-  /* "lxml/etree.pyx":3532
+  /* "lxml/etree.pyx":3535
  *         self._error_log = _ErrorLog()
  * 
  *     def validate(self, etree):             # <<<<<<<<<<<<<<
  *         u"""validate(self, etree)
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10_Validator_3validate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Validator_validate, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__650)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3532, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10_Validator_3validate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Validator_validate, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__658)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3535, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Validator->tp_dict, __pyx_n_s_validate, __pyx_t_15) < 0) __PYX_ERR(0, 3532, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Validator->tp_dict, __pyx_n_s_validate, __pyx_t_15) < 0) __PYX_ERR(0, 3535, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Validator);
 
-  /* "lxml/etree.pyx":3541
+  /* "lxml/etree.pyx":3544
  *         return self(etree)
  * 
  *     def assertValid(self, etree):             # <<<<<<<<<<<<<<
  *         u"""assertValid(self, etree)
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10_Validator_5assertValid, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Validator_assertValid, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__652)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3541, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10_Validator_5assertValid, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Validator_assertValid, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__660)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3544, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Validator->tp_dict, __pyx_n_s_assertValid, __pyx_t_15) < 0) __PYX_ERR(0, 3541, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Validator->tp_dict, __pyx_n_s_assertValid, __pyx_t_15) < 0) __PYX_ERR(0, 3544, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Validator);
 
-  /* "lxml/etree.pyx":3551
+  /* "lxml/etree.pyx":3554
  *                                   self._error_log)
  * 
  *     def assert_(self, etree):             # <<<<<<<<<<<<<<
  *         u"""assert_(self, etree)
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10_Validator_7assert_, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Validator_assert, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__654)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3551, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10_Validator_7assert_, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Validator_assert, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__662)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3554, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Validator->tp_dict, __pyx_n_s_assert, __pyx_t_15) < 0) __PYX_ERR(0, 3551, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Validator->tp_dict, __pyx_n_s_assert, __pyx_t_15) < 0) __PYX_ERR(0, 3554, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Validator);
 
-  /* "lxml/etree.pyx":3560
+  /* "lxml/etree.pyx":3563
  *                 u"Document does not comply with schema")
  * 
  *     cpdef _append_log_message(self, int domain, int type, int level, int line,             # <<<<<<<<<<<<<<
  *                               message, filename):
  *         self._error_log._receiveGeneric(domain, type, level, line, message,
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10_Validator_9_append_log_message, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Validator__append_log_message, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__656)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3560, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10_Validator_9_append_log_message, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Validator__append_log_message, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__664)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3563, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Validator->tp_dict, __pyx_n_s_append_log_message, __pyx_t_15) < 0) __PYX_ERR(0, 3560, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Validator->tp_dict, __pyx_n_s_append_log_message, __pyx_t_15) < 0) __PYX_ERR(0, 3563, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Validator);
 
-  /* "lxml/etree.pyx":3565
+  /* "lxml/etree.pyx":3568
  *                                         filename)
  * 
  *     cpdef _clear_error_log(self):             # <<<<<<<<<<<<<<
  *         self._error_log.clear()
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10_Validator_11_clear_error_log, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Validator__clear_error_log, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__658)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3565, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_10_Validator_11_clear_error_log, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Validator__clear_error_log, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__666)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3568, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Validator->tp_dict, __pyx_n_s_clear_error_log, __pyx_t_15) < 0) __PYX_ERR(0, 3565, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__Validator->tp_dict, __pyx_n_s_clear_error_log, __pyx_t_15) < 0) __PYX_ERR(0, 3568, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__Validator);
 
@@ -241114,7 +241140,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         _assertValidDTDNode(self, self._c_node)
  *         cdef tree.xmlEnumeration *c_node = self._c_node.tree
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_DTDAttributeDecl_3itervalues, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTDAttributeDecl_itervalues, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__660)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 163, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_DTDAttributeDecl_3itervalues, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTDAttributeDecl_itervalues, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__668)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 163, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__DTDAttributeDecl->tp_dict, __pyx_n_s_itervalues, __pyx_t_15) < 0) __PYX_ERR(20, 163, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241127,7 +241153,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return list(self.itervalues())
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_DTDAttributeDecl_6values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTDAttributeDecl_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__662)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 170, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_17_DTDAttributeDecl_6values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTDAttributeDecl_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__670)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 170, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__DTDAttributeDecl->tp_dict, __pyx_n_s_values, __pyx_t_15) < 0) __PYX_ERR(20, 170, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241140,7 +241166,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         _assertValidDTDNode(self, self._c_node)
  *         cdef tree.xmlAttribute *c_node = self._c_node.attributes
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15_DTDElementDecl_3iterattributes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTDElementDecl_iterattributes, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__664)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 223, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15_DTDElementDecl_3iterattributes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTDElementDecl_iterattributes, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__672)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 223, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__DTDElementDecl->tp_dict, __pyx_n_s_iterattributes, __pyx_t_15) < 0) __PYX_ERR(20, 223, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241153,7 +241179,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return list(self.iterattributes())
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15_DTDElementDecl_6attributes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTDElementDecl_attributes, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__666)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 233, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_15_DTDElementDecl_6attributes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTDElementDecl_attributes, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__674)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 233, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__DTDElementDecl->tp_dict, __pyx_n_s_attributes, __pyx_t_15) < 0) __PYX_ERR(20, 233, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241166,7 +241192,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         cdef tree.xmlNode *c_node = self._c_dtd.children if self._c_dtd is not NULL else NULL
  *         while c_node is not NULL:
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_3DTD_3iterelements, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTD_iterelements, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__668)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 314, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_3DTD_3iterelements, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTD_iterelements, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__676)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 314, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_DTD->tp_dict, __pyx_n_s_iterelements, __pyx_t_15) < 0) __PYX_ERR(20, 314, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241179,7 +241205,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return list(self.iterelements())
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_3DTD_6elements, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTD_elements, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__670)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 324, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_3DTD_6elements, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTD_elements, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__678)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 324, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_DTD->tp_dict, __pyx_n_s_elements, __pyx_t_15) < 0) __PYX_ERR(20, 324, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241192,7 +241218,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         cdef tree.xmlNode *c_node = self._c_dtd.children if self._c_dtd is not NULL else NULL
  *         while c_node is not NULL:
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_3DTD_8iterentities, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTD_iterentities, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__672)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 327, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_3DTD_8iterentities, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTD_iterentities, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__680)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 327, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_DTD->tp_dict, __pyx_n_s_iterentities, __pyx_t_15) < 0) __PYX_ERR(20, 327, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241205,7 +241231,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         return list(self.iterentities())
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_3DTD_11entities, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTD_entities, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__674)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 337, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_3DTD_11entities, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DTD_entities, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__682)); if (unlikely(!__pyx_t_15)) __PYX_ERR(20, 337, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_DTD->tp_dict, __pyx_n_s_entities, __pyx_t_15) < 0) __PYX_ERR(20, 337, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241254,13 +241280,12 @@ PyMODINIT_FUNC PyInit_etree(void)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     goto __pyx_L65_try_end;
     __pyx_L60_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
     __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -241306,14 +241331,12 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     import rnc2rng as _rnc2rng
  * except ImportError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
     goto __pyx_L1_error;
     __pyx_L61_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
@@ -241328,7 +241351,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """Parse a RelaxNG schema in compact syntax from a text string
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7RelaxNG_9from_rnc_string, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RelaxNG_from_rnc_string, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__676)); if (unlikely(!__pyx_t_8)) __PYX_ERR(21, 154, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_7RelaxNG_9from_rnc_string, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RelaxNG_from_rnc_string, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__684)); if (unlikely(!__pyx_t_8)) __PYX_ERR(21, 154, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_RelaxNG->tp_dict, __pyx_n_s_from_rnc_string, __pyx_t_8) < 0) __PYX_ERR(21, 154, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -241357,9 +241380,9 @@ PyMODINIT_FUNC PyInit_etree(void)
  * 
  * 
  */
-  __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(22, 23, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(22, 23, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 23, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 23, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_xs, __pyx_kp_u_http_www_w3_org_2001_XMLSchema) < 0) __PYX_ERR(22, 23, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_namespaces, __pyx_t_8) < 0) __PYX_ERR(22, 23, __pyx_L1_error)
@@ -241372,7 +241395,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *     u"boolean(//xs:attribute[@default or @fixed][1])",
  *     namespaces={u'xs': u'http://www.w3.org/2001/XMLSchema'})
  */
-  __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPath), __pyx_tuple__677, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 21, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPath), __pyx_tuple__685, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 21, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
   __Pyx_XGOTREF(((PyObject *)__pyx_v_4lxml_5etree__check_for_default_attributes));
@@ -241387,7 +241410,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """bytes_used(self)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_MemDebug_1bytes_used, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_bytes_used, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__679)); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 7, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_MemDebug_1bytes_used, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_bytes_used, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__687)); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 7, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_bytes_used, __pyx_t_8) < 0) __PYX_ERR(25, 7, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -241400,7 +241423,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """blocks_used(self)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_MemDebug_3blocks_used, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_blocks_used, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__681)); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 16, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_MemDebug_3blocks_used, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_blocks_used, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__689)); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 16, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_blocks_used, __pyx_t_8) < 0) __PYX_ERR(25, 16, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -241413,7 +241436,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """dict_size(self)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_MemDebug_5dict_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_dict_size, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__683)); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 25, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_MemDebug_5dict_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_dict_size, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__691)); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 25, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_dict_size, __pyx_t_8) < 0) __PYX_ERR(25, 25, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -241426,7 +241449,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """dump(self, output_file=None, byte_count=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_MemDebug_7dump, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_dump, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__685)); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 36, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_MemDebug_7dump, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_dump, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__693)); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 36, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_dump, __pyx_t_8) < 0) __PYX_ERR(25, 36, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -241439,7 +241462,7 @@ PyMODINIT_FUNC PyInit_etree(void)
  *         """show(self, output_file=None, block_count=None)
  * 
  */
-  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_MemDebug_9show, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_show, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__687)); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 66, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_5etree_9_MemDebug_9show, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_show, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__695)); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 66, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_show, __pyx_t_8) < 0) __PYX_ERR(25, 66, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -241460,9 +241483,10 @@ PyMODINIT_FUNC PyInit_etree(void)
  * # cython: auto_pickle=False
  * 
  */
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_t_8, __pyx_kp_u_XML_line_3181, __pyx_kp_u_XML_text_parser_None_base_url_No) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_8, __pyx_kp_u_XML_line_3184, __pyx_kp_u_XML_text_parser_None_base_url_No) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_8, __pyx_kp_u_FunctionNamespace_line_207, __pyx_kp_u_FunctionNamespace_ns_uri_Retriev) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_8) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
@@ -241490,10 +241514,12 @@ PyMODINIT_FUNC PyInit_etree(void)
   }
   __pyx_L0:;
   __Pyx_RefNannyFinishContext();
-  #if PY_MAJOR_VERSION < 3
-  return;
-  #else
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  return (__pyx_m != NULL) ? 0 : -1;
+  #elif PY_MAJOR_VERSION >= 3
   return __pyx_m;
+  #else
+  return;
   #endif
 }
 
@@ -241521,30 +241547,30 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__27);
   Py_CLEAR(__pyx_tuple__28);
   Py_CLEAR(__pyx_tuple__31);
-  Py_CLEAR(__pyx_tuple__34);
+  Py_CLEAR(__pyx_tuple__32);
   Py_CLEAR(__pyx_tuple__35);
   Py_CLEAR(__pyx_tuple__36);
-  Py_CLEAR(__pyx_slice__38);
-  Py_CLEAR(__pyx_slice__39);
+  Py_CLEAR(__pyx_tuple__37);
+  Py_CLEAR(__pyx_tuple__38);
   Py_CLEAR(__pyx_slice__40);
   Py_CLEAR(__pyx_slice__41);
-  Py_CLEAR(__pyx_tuple__44);
-  Py_CLEAR(__pyx_tuple__45);
+  Py_CLEAR(__pyx_slice__42);
+  Py_CLEAR(__pyx_slice__43);
+  Py_CLEAR(__pyx_tuple__46);
   Py_CLEAR(__pyx_tuple__47);
-  Py_CLEAR(__pyx_tuple__48);
+  Py_CLEAR(__pyx_tuple__49);
   Py_CLEAR(__pyx_tuple__50);
   Py_CLEAR(__pyx_tuple__52);
-  Py_CLEAR(__pyx_tuple__53);
   Py_CLEAR(__pyx_tuple__54);
   Py_CLEAR(__pyx_tuple__55);
   Py_CLEAR(__pyx_tuple__56);
   Py_CLEAR(__pyx_tuple__57);
   Py_CLEAR(__pyx_tuple__58);
-  Py_CLEAR(__pyx_slice__59);
+  Py_CLEAR(__pyx_tuple__59);
   Py_CLEAR(__pyx_tuple__60);
   Py_CLEAR(__pyx_slice__61);
-  Py_CLEAR(__pyx_tuple__63);
-  Py_CLEAR(__pyx_tuple__64);
+  Py_CLEAR(__pyx_tuple__62);
+  Py_CLEAR(__pyx_slice__63);
   Py_CLEAR(__pyx_tuple__65);
   Py_CLEAR(__pyx_tuple__66);
   Py_CLEAR(__pyx_tuple__67);
@@ -241556,12 +241582,12 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__73);
   Py_CLEAR(__pyx_tuple__74);
   Py_CLEAR(__pyx_tuple__75);
-  Py_CLEAR(__pyx_slice__76);
-  Py_CLEAR(__pyx_slice__77);
-  Py_CLEAR(__pyx_tuple__78);
+  Py_CLEAR(__pyx_tuple__76);
+  Py_CLEAR(__pyx_tuple__77);
+  Py_CLEAR(__pyx_slice__78);
   Py_CLEAR(__pyx_slice__79);
   Py_CLEAR(__pyx_tuple__80);
-  Py_CLEAR(__pyx_tuple__81);
+  Py_CLEAR(__pyx_slice__81);
   Py_CLEAR(__pyx_tuple__82);
   Py_CLEAR(__pyx_tuple__83);
   Py_CLEAR(__pyx_tuple__84);
@@ -241575,31 +241601,31 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__92);
   Py_CLEAR(__pyx_tuple__93);
   Py_CLEAR(__pyx_tuple__94);
-  Py_CLEAR(__pyx_slice__95);
-  Py_CLEAR(__pyx_slice__96);
-  Py_CLEAR(__pyx_tuple__97);
-  Py_CLEAR(__pyx_tuple__98);
+  Py_CLEAR(__pyx_tuple__95);
+  Py_CLEAR(__pyx_tuple__96);
+  Py_CLEAR(__pyx_slice__97);
+  Py_CLEAR(__pyx_slice__98);
   Py_CLEAR(__pyx_tuple__99);
-  Py_CLEAR(__pyx_slice__100);
+  Py_CLEAR(__pyx_tuple__100);
   Py_CLEAR(__pyx_tuple__101);
+  Py_CLEAR(__pyx_slice__102);
   Py_CLEAR(__pyx_tuple__103);
-  Py_CLEAR(__pyx_tuple__104);
   Py_CLEAR(__pyx_tuple__105);
   Py_CLEAR(__pyx_tuple__106);
+  Py_CLEAR(__pyx_tuple__107);
   Py_CLEAR(__pyx_tuple__108);
-  Py_CLEAR(__pyx_tuple__109);
   Py_CLEAR(__pyx_tuple__110);
   Py_CLEAR(__pyx_tuple__111);
   Py_CLEAR(__pyx_tuple__112);
   Py_CLEAR(__pyx_tuple__113);
   Py_CLEAR(__pyx_tuple__114);
-  Py_CLEAR(__pyx_slice__115);
+  Py_CLEAR(__pyx_tuple__115);
   Py_CLEAR(__pyx_tuple__116);
   Py_CLEAR(__pyx_slice__117);
   Py_CLEAR(__pyx_tuple__118);
-  Py_CLEAR(__pyx_tuple__119);
+  Py_CLEAR(__pyx_slice__119);
   Py_CLEAR(__pyx_tuple__120);
-  Py_CLEAR(__pyx_codeobj__121);
+  Py_CLEAR(__pyx_tuple__121);
   Py_CLEAR(__pyx_tuple__122);
   Py_CLEAR(__pyx_codeobj__123);
   Py_CLEAR(__pyx_tuple__124);
@@ -241611,9 +241637,9 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__130);
   Py_CLEAR(__pyx_codeobj__131);
   Py_CLEAR(__pyx_tuple__132);
-  Py_CLEAR(__pyx_tuple__133);
+  Py_CLEAR(__pyx_codeobj__133);
   Py_CLEAR(__pyx_tuple__134);
-  Py_CLEAR(__pyx_codeobj__135);
+  Py_CLEAR(__pyx_tuple__135);
   Py_CLEAR(__pyx_tuple__136);
   Py_CLEAR(__pyx_codeobj__137);
   Py_CLEAR(__pyx_tuple__138);
@@ -241655,19 +241681,19 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__174);
   Py_CLEAR(__pyx_codeobj__175);
   Py_CLEAR(__pyx_tuple__176);
-  Py_CLEAR(__pyx_tuple__177);
-  Py_CLEAR(__pyx_codeobj__178);
+  Py_CLEAR(__pyx_codeobj__177);
+  Py_CLEAR(__pyx_tuple__178);
   Py_CLEAR(__pyx_tuple__179);
-  Py_CLEAR(__pyx_tuple__180);
+  Py_CLEAR(__pyx_codeobj__180);
   Py_CLEAR(__pyx_tuple__181);
   Py_CLEAR(__pyx_tuple__182);
   Py_CLEAR(__pyx_tuple__183);
   Py_CLEAR(__pyx_tuple__184);
-  Py_CLEAR(__pyx_codeobj__185);
+  Py_CLEAR(__pyx_tuple__185);
   Py_CLEAR(__pyx_tuple__186);
-  Py_CLEAR(__pyx_codeobj__187);
+  Py_CLEAR(__pyx_tuple__187);
   Py_CLEAR(__pyx_tuple__188);
-  Py_CLEAR(__pyx_codeobj__189);
+  Py_CLEAR(__pyx_tuple__189);
   Py_CLEAR(__pyx_tuple__190);
   Py_CLEAR(__pyx_codeobj__191);
   Py_CLEAR(__pyx_tuple__192);
@@ -241823,20 +241849,20 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__342);
   Py_CLEAR(__pyx_codeobj__343);
   Py_CLEAR(__pyx_tuple__344);
-  Py_CLEAR(__pyx_tuple__345);
-  Py_CLEAR(__pyx_codeobj__346);
-  Py_CLEAR(__pyx_tuple__347);
+  Py_CLEAR(__pyx_codeobj__345);
+  Py_CLEAR(__pyx_tuple__346);
+  Py_CLEAR(__pyx_codeobj__347);
   Py_CLEAR(__pyx_tuple__348);
   Py_CLEAR(__pyx_codeobj__349);
   Py_CLEAR(__pyx_tuple__350);
   Py_CLEAR(__pyx_tuple__351);
   Py_CLEAR(__pyx_codeobj__352);
   Py_CLEAR(__pyx_tuple__353);
-  Py_CLEAR(__pyx_codeobj__354);
-  Py_CLEAR(__pyx_tuple__355);
+  Py_CLEAR(__pyx_tuple__354);
+  Py_CLEAR(__pyx_codeobj__355);
   Py_CLEAR(__pyx_tuple__356);
-  Py_CLEAR(__pyx_codeobj__357);
-  Py_CLEAR(__pyx_tuple__358);
+  Py_CLEAR(__pyx_tuple__357);
+  Py_CLEAR(__pyx_codeobj__358);
   Py_CLEAR(__pyx_tuple__359);
   Py_CLEAR(__pyx_codeobj__360);
   Py_CLEAR(__pyx_tuple__361);
@@ -241852,9 +241878,9 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__371);
   Py_CLEAR(__pyx_codeobj__372);
   Py_CLEAR(__pyx_tuple__373);
-  Py_CLEAR(__pyx_codeobj__374);
-  Py_CLEAR(__pyx_tuple__375);
-  Py_CLEAR(__pyx_codeobj__376);
+  Py_CLEAR(__pyx_tuple__374);
+  Py_CLEAR(__pyx_codeobj__375);
+  Py_CLEAR(__pyx_tuple__376);
   Py_CLEAR(__pyx_tuple__377);
   Py_CLEAR(__pyx_codeobj__378);
   Py_CLEAR(__pyx_tuple__379);
@@ -241862,15 +241888,15 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__381);
   Py_CLEAR(__pyx_codeobj__382);
   Py_CLEAR(__pyx_tuple__383);
-  Py_CLEAR(__pyx_tuple__384);
-  Py_CLEAR(__pyx_codeobj__385);
-  Py_CLEAR(__pyx_tuple__386);
+  Py_CLEAR(__pyx_codeobj__384);
+  Py_CLEAR(__pyx_tuple__385);
+  Py_CLEAR(__pyx_codeobj__386);
   Py_CLEAR(__pyx_tuple__387);
   Py_CLEAR(__pyx_codeobj__388);
   Py_CLEAR(__pyx_tuple__389);
-  Py_CLEAR(__pyx_codeobj__390);
-  Py_CLEAR(__pyx_tuple__391);
-  Py_CLEAR(__pyx_codeobj__392);
+  Py_CLEAR(__pyx_tuple__390);
+  Py_CLEAR(__pyx_codeobj__391);
+  Py_CLEAR(__pyx_tuple__392);
   Py_CLEAR(__pyx_tuple__393);
   Py_CLEAR(__pyx_codeobj__394);
   Py_CLEAR(__pyx_tuple__395);
@@ -241904,12 +241930,12 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__423);
   Py_CLEAR(__pyx_codeobj__424);
   Py_CLEAR(__pyx_tuple__425);
-  Py_CLEAR(__pyx_tuple__426);
-  Py_CLEAR(__pyx_codeobj__427);
-  Py_CLEAR(__pyx_tuple__428);
-  Py_CLEAR(__pyx_codeobj__429);
-  Py_CLEAR(__pyx_tuple__430);
-  Py_CLEAR(__pyx_codeobj__431);
+  Py_CLEAR(__pyx_codeobj__426);
+  Py_CLEAR(__pyx_tuple__427);
+  Py_CLEAR(__pyx_codeobj__428);
+  Py_CLEAR(__pyx_tuple__429);
+  Py_CLEAR(__pyx_codeobj__430);
+  Py_CLEAR(__pyx_tuple__431);
   Py_CLEAR(__pyx_tuple__432);
   Py_CLEAR(__pyx_codeobj__433);
   Py_CLEAR(__pyx_tuple__434);
@@ -241937,14 +241963,14 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__456);
   Py_CLEAR(__pyx_codeobj__457);
   Py_CLEAR(__pyx_tuple__458);
-  Py_CLEAR(__pyx_tuple__459);
-  Py_CLEAR(__pyx_codeobj__460);
-  Py_CLEAR(__pyx_tuple__461);
-  Py_CLEAR(__pyx_codeobj__462);
-  Py_CLEAR(__pyx_tuple__463);
-  Py_CLEAR(__pyx_codeobj__464);
-  Py_CLEAR(__pyx_tuple__465);
-  Py_CLEAR(__pyx_codeobj__466);
+  Py_CLEAR(__pyx_codeobj__459);
+  Py_CLEAR(__pyx_tuple__460);
+  Py_CLEAR(__pyx_codeobj__461);
+  Py_CLEAR(__pyx_tuple__462);
+  Py_CLEAR(__pyx_codeobj__463);
+  Py_CLEAR(__pyx_tuple__464);
+  Py_CLEAR(__pyx_codeobj__465);
+  Py_CLEAR(__pyx_tuple__466);
   Py_CLEAR(__pyx_tuple__467);
   Py_CLEAR(__pyx_codeobj__468);
   Py_CLEAR(__pyx_tuple__469);
@@ -241962,14 +241988,14 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__481);
   Py_CLEAR(__pyx_codeobj__482);
   Py_CLEAR(__pyx_tuple__483);
-  Py_CLEAR(__pyx_tuple__484);
-  Py_CLEAR(__pyx_codeobj__485);
-  Py_CLEAR(__pyx_tuple__486);
-  Py_CLEAR(__pyx_codeobj__487);
-  Py_CLEAR(__pyx_tuple__488);
-  Py_CLEAR(__pyx_codeobj__489);
-  Py_CLEAR(__pyx_tuple__490);
-  Py_CLEAR(__pyx_codeobj__491);
+  Py_CLEAR(__pyx_codeobj__484);
+  Py_CLEAR(__pyx_tuple__485);
+  Py_CLEAR(__pyx_codeobj__486);
+  Py_CLEAR(__pyx_tuple__487);
+  Py_CLEAR(__pyx_codeobj__488);
+  Py_CLEAR(__pyx_tuple__489);
+  Py_CLEAR(__pyx_codeobj__490);
+  Py_CLEAR(__pyx_tuple__491);
   Py_CLEAR(__pyx_tuple__492);
   Py_CLEAR(__pyx_codeobj__493);
   Py_CLEAR(__pyx_tuple__494);
@@ -242039,20 +242065,20 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__558);
   Py_CLEAR(__pyx_codeobj__559);
   Py_CLEAR(__pyx_tuple__560);
-  Py_CLEAR(__pyx_tuple__561);
-  Py_CLEAR(__pyx_codeobj__562);
-  Py_CLEAR(__pyx_tuple__563);
+  Py_CLEAR(__pyx_codeobj__561);
+  Py_CLEAR(__pyx_tuple__562);
+  Py_CLEAR(__pyx_codeobj__563);
   Py_CLEAR(__pyx_tuple__564);
   Py_CLEAR(__pyx_codeobj__565);
   Py_CLEAR(__pyx_tuple__566);
-  Py_CLEAR(__pyx_tuple__567);
-  Py_CLEAR(__pyx_codeobj__568);
+  Py_CLEAR(__pyx_codeobj__567);
+  Py_CLEAR(__pyx_tuple__568);
   Py_CLEAR(__pyx_tuple__569);
   Py_CLEAR(__pyx_codeobj__570);
   Py_CLEAR(__pyx_tuple__571);
-  Py_CLEAR(__pyx_codeobj__572);
-  Py_CLEAR(__pyx_tuple__573);
-  Py_CLEAR(__pyx_codeobj__574);
+  Py_CLEAR(__pyx_tuple__572);
+  Py_CLEAR(__pyx_codeobj__573);
+  Py_CLEAR(__pyx_tuple__574);
   Py_CLEAR(__pyx_tuple__575);
   Py_CLEAR(__pyx_codeobj__576);
   Py_CLEAR(__pyx_tuple__577);
@@ -242066,24 +242092,24 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__585);
   Py_CLEAR(__pyx_codeobj__586);
   Py_CLEAR(__pyx_tuple__587);
-  Py_CLEAR(__pyx_tuple__588);
-  Py_CLEAR(__pyx_codeobj__589);
-  Py_CLEAR(__pyx_tuple__590);
-  Py_CLEAR(__pyx_codeobj__591);
-  Py_CLEAR(__pyx_tuple__592);
-  Py_CLEAR(__pyx_codeobj__593);
-  Py_CLEAR(__pyx_tuple__594);
+  Py_CLEAR(__pyx_codeobj__588);
+  Py_CLEAR(__pyx_tuple__589);
+  Py_CLEAR(__pyx_codeobj__590);
+  Py_CLEAR(__pyx_tuple__591);
+  Py_CLEAR(__pyx_codeobj__592);
+  Py_CLEAR(__pyx_tuple__593);
+  Py_CLEAR(__pyx_codeobj__594);
   Py_CLEAR(__pyx_tuple__595);
-  Py_CLEAR(__pyx_codeobj__596);
-  Py_CLEAR(__pyx_tuple__597);
+  Py_CLEAR(__pyx_tuple__596);
+  Py_CLEAR(__pyx_codeobj__597);
   Py_CLEAR(__pyx_tuple__598);
   Py_CLEAR(__pyx_codeobj__599);
   Py_CLEAR(__pyx_tuple__600);
   Py_CLEAR(__pyx_codeobj__601);
   Py_CLEAR(__pyx_tuple__602);
-  Py_CLEAR(__pyx_codeobj__603);
-  Py_CLEAR(__pyx_tuple__604);
-  Py_CLEAR(__pyx_codeobj__605);
+  Py_CLEAR(__pyx_tuple__603);
+  Py_CLEAR(__pyx_codeobj__604);
+  Py_CLEAR(__pyx_tuple__605);
   Py_CLEAR(__pyx_tuple__606);
   Py_CLEAR(__pyx_codeobj__607);
   Py_CLEAR(__pyx_tuple__608);
@@ -242096,16 +242122,16 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_codeobj__615);
   Py_CLEAR(__pyx_tuple__616);
   Py_CLEAR(__pyx_codeobj__617);
-  Py_CLEAR(__pyx_tuple__619);
-  Py_CLEAR(__pyx_tuple__621);
+  Py_CLEAR(__pyx_tuple__618);
+  Py_CLEAR(__pyx_codeobj__619);
+  Py_CLEAR(__pyx_tuple__620);
+  Py_CLEAR(__pyx_codeobj__621);
   Py_CLEAR(__pyx_tuple__622);
   Py_CLEAR(__pyx_codeobj__623);
   Py_CLEAR(__pyx_tuple__624);
   Py_CLEAR(__pyx_codeobj__625);
-  Py_CLEAR(__pyx_tuple__626);
-  Py_CLEAR(__pyx_codeobj__627);
-  Py_CLEAR(__pyx_tuple__628);
-  Py_CLEAR(__pyx_codeobj__629);
+  Py_CLEAR(__pyx_tuple__627);
+  Py_CLEAR(__pyx_tuple__629);
   Py_CLEAR(__pyx_tuple__630);
   Py_CLEAR(__pyx_codeobj__631);
   Py_CLEAR(__pyx_tuple__632);
@@ -242115,14 +242141,14 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__636);
   Py_CLEAR(__pyx_codeobj__637);
   Py_CLEAR(__pyx_tuple__638);
-  Py_CLEAR(__pyx_tuple__639);
-  Py_CLEAR(__pyx_codeobj__640);
-  Py_CLEAR(__pyx_tuple__641);
-  Py_CLEAR(__pyx_codeobj__642);
-  Py_CLEAR(__pyx_tuple__643);
-  Py_CLEAR(__pyx_codeobj__644);
-  Py_CLEAR(__pyx_tuple__645);
-  Py_CLEAR(__pyx_codeobj__646);
+  Py_CLEAR(__pyx_codeobj__639);
+  Py_CLEAR(__pyx_tuple__640);
+  Py_CLEAR(__pyx_codeobj__641);
+  Py_CLEAR(__pyx_tuple__642);
+  Py_CLEAR(__pyx_codeobj__643);
+  Py_CLEAR(__pyx_tuple__644);
+  Py_CLEAR(__pyx_codeobj__645);
+  Py_CLEAR(__pyx_tuple__646);
   Py_CLEAR(__pyx_tuple__647);
   Py_CLEAR(__pyx_codeobj__648);
   Py_CLEAR(__pyx_tuple__649);
@@ -242154,16 +242180,24 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__675);
   Py_CLEAR(__pyx_codeobj__676);
   Py_CLEAR(__pyx_tuple__677);
-  Py_CLEAR(__pyx_tuple__678);
-  Py_CLEAR(__pyx_codeobj__679);
-  Py_CLEAR(__pyx_tuple__680);
-  Py_CLEAR(__pyx_codeobj__681);
-  Py_CLEAR(__pyx_tuple__682);
-  Py_CLEAR(__pyx_codeobj__683);
-  Py_CLEAR(__pyx_tuple__684);
-  Py_CLEAR(__pyx_codeobj__685);
+  Py_CLEAR(__pyx_codeobj__678);
+  Py_CLEAR(__pyx_tuple__679);
+  Py_CLEAR(__pyx_codeobj__680);
+  Py_CLEAR(__pyx_tuple__681);
+  Py_CLEAR(__pyx_codeobj__682);
+  Py_CLEAR(__pyx_tuple__683);
+  Py_CLEAR(__pyx_codeobj__684);
+  Py_CLEAR(__pyx_tuple__685);
   Py_CLEAR(__pyx_tuple__686);
   Py_CLEAR(__pyx_codeobj__687);
+  Py_CLEAR(__pyx_tuple__688);
+  Py_CLEAR(__pyx_codeobj__689);
+  Py_CLEAR(__pyx_tuple__690);
+  Py_CLEAR(__pyx_codeobj__691);
+  Py_CLEAR(__pyx_tuple__692);
+  Py_CLEAR(__pyx_codeobj__693);
+  Py_CLEAR(__pyx_tuple__694);
+  Py_CLEAR(__pyx_codeobj__695);
   /* CodeObjectCache.cleanup */
   if (__pyx_code_cache.entries) {
       __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
@@ -242231,6 +242265,7 @@ static void __pyx_module_cleanup(CYTHON_UNUSED PyObject *self) {
   Py_CLEAR(__pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING);
   Py_CLEAR(__pyx_v_4lxml_5etree_ITER_EMPTY);
   Py_CLEAR(__pyx_v_4lxml_5etree_islice);
+  Py_CLEAR(__pyx_v_4lxml_5etree_partial);
   Py_CLEAR(__pyx_v_4lxml_5etree_re);
   Py_CLEAR(__pyx_v_4lxml_5etree_sys);
   Py_CLEAR(__pyx_v_4lxml_5etree__elementpath);
@@ -242694,11 +242729,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             "raise: exception class must be a subclass of BaseException");
         goto bad;
     }
-#if PY_VERSION_HEX >= 0x03030000
     if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
         PyObject *fixed_cause;
         if (cause == Py_None) {
             fixed_cause = NULL;
@@ -242726,7 +242757,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         PyErr_Restore(tmp_type, tmp_value, tb);
         Py_XDECREF(tmp_tb);
 #else
-        PyThreadState *tstate = PyThreadState_GET();
+        PyThreadState *tstate = __Pyx_PyThreadState_Current;
         PyObject* tmp_tb = tstate->curexc_traceback;
         if (tb != tmp_tb) {
             Py_INCREF(tb);
@@ -242742,7 +242773,7 @@ bad:
 #endif
 
 /* PyCFunctionFastCall */
-  #if CYTHON_FAST_PYCCALL
+#if CYTHON_FAST_PYCCALL
 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
@@ -242765,12 +242796,12 @@ static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, P
 #endif
 
 /* PyFunctionFastCall */
-  #if CYTHON_FAST_PYCALL
+#if CYTHON_FAST_PYCALL
 #include "frameobject.h"
 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                                PyObject *globals) {
     PyFrameObject *f;
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject **fastlocals;
     Py_ssize_t i;
     PyObject *result;
@@ -242885,7 +242916,7 @@ done:
 #endif
 
 /* PyObjectCall */
-  #if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
     PyObject *result;
     ternaryfunc call = func->ob_type->tp_call;
@@ -242905,7 +242936,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
 #endif
 
 /* PyObjectCallMethO */
-  #if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
     PyObject *self, *result;
     PyCFunction cfunc;
@@ -242925,7 +242956,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
 #endif
 
 /* PyObjectCallOneArg */
-  #if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_COMPILING_IN_CPYTHON
 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
     PyObject *result;
     PyObject *args = PyTuple_New(1);
@@ -242965,7 +242996,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
 #endif
 
 /* UnpackUnboundCMethod */
-  static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
+static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
     PyObject *method;
     method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
     if (unlikely(!method))
@@ -242973,7 +243004,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
     target->method = method;
 #if CYTHON_COMPILING_IN_CPYTHON
     #if PY_MAJOR_VERSION >= 3
-    if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
+    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
     #endif
     {
         PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
@@ -242985,7 +243016,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
 }
 
 /* CallUnboundCMethod0 */
-  static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
+static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
     PyObject *args, *result = NULL;
     if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
 #if CYTHON_ASSUME_SAFE_MACROS
@@ -243004,7 +243035,7 @@ bad:
 }
 
 /* py_dict_items */
-  static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
+static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
     if (PY_MAJOR_VERSION >= 3)
         return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
     else
 }
 
 /* RaiseTooManyValuesToUnpack */
-  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
     PyErr_Format(PyExc_ValueError,
                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
 }
 
 /* RaiseNeedMoreValuesToUnpack */
-  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                  index, (index == 1) ? "" : "s");
 }
 
 /* IterFinish */
-  static CYTHON_INLINE int __Pyx_IterFinish(void) {
+static CYTHON_INLINE int __Pyx_IterFinish(void) {
 #if CYTHON_FAST_THREAD_STATE
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject* exc_type = tstate->curexc_type;
     if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
+        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
             PyObject *exc_value, *exc_tb;
             exc_value = tstate->curexc_value;
             exc_tb = tstate->curexc_traceback;
@@ -243060,7 +243091,7 @@ bad:
 }
 
 /* UnpackItemEndCheck */
-  static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
     if (unlikely(retval)) {
         Py_DECREF(retval);
         __Pyx_RaiseTooManyValuesError(expected);
@@ -243072,7 +243103,7 @@ bad:
 }
 
 /* BytesEquals */
-  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
 #if CYTHON_COMPILING_IN_PYPY
     return PyObject_RichCompareBool(s1, s2, equals);
 #else
@@ -243119,7 +243150,7 @@ bad:
 }
 
 /* PyObjectCallNoArg */
-  #if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(func)) {
@@ -243127,7 +243158,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
     }
 #endif
 #ifdef __Pyx_CyFunction_USED
-    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+    if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
 #else
     if (likely(PyCFunction_Check(func))) {
 #endif
@@ -243140,7 +243171,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 #endif
 
 /* SliceObject */
-    static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
+  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
         Py_ssize_t cstart, Py_ssize_t cstop,
         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
@@ -243237,7 +243268,7 @@ bad:
 }
 
 /* SaveResetException */
-    #if CYTHON_FAST_THREAD_STATE
+  #if CYTHON_FAST_THREAD_STATE
 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
     *type = tstate->exc_type;
     *value = tstate->exc_value;
@@ -243261,17 +243292,32 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject
 #endif
 
 /* PyErrExceptionMatches */
-    #if CYTHON_FAST_THREAD_STATE
+  #if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+    Py_ssize_t i, n;
+    n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+    for (i=0; i<n; i++) {
+        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+    }
+#endif
+    for (i=0; i<n; i++) {
+        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
+    }
+    return 0;
+}
 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
     PyObject *exc_type = tstate->curexc_type;
     if (exc_type == err) return 1;
     if (unlikely(!exc_type)) return 0;
-    return PyErr_GivenExceptionMatches(exc_type, err);
+    if (unlikely(PyTuple_Check(err)))
+        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
 }
 #endif
 
 /* GetException */
-    #if CYTHON_FAST_THREAD_STATE
+  #if CYTHON_FAST_THREAD_STATE
 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
 #else
 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
 }
 
 /* None */
-      static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
+    static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
     long r = a % b;
     r += ((r != 0) & ((r ^ b) < 0)) * b;
     return r;
 }
 
 /* None */
-      static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
+    static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
     long q = a / b;
     long r = a - q*b;
     q -= ((r != 0) & ((r ^ b) < 0));
@@ -243347,7 +243393,7 @@ bad:
 }
 
 /* KeywordStringCheck */
-      static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
+    static int __Pyx_CheckKeywordStrings(
     PyObject *kwdict,
     const char* function_name,
     int kw_allowed)
@@ -243361,7 +243407,7 @@ bad:
 #else
     while (PyDict_Next(kwdict, &pos, &key, 0)) {
         #if PY_MAJOR_VERSION < 3
-        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
+        if (unlikely(!PyString_Check(key)))
         #endif
             if (unlikely(!PyUnicode_Check(key)))
                 goto invalid_keyword_type;
@@ -243387,7 +243433,7 @@ invalid_keyword:
 }
 
 /* SliceObject */
-      static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
+    static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
         Py_ssize_t cstart, Py_ssize_t cstop,
         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
@@ -243485,7 +243531,7 @@ bad:
 }
 
 /* WriteUnraisableException */
-      static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+    static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                   int full_traceback, CYTHON_UNUSED int nogil) {
     PyObject *old_exc, *old_val, *old_tb;
@@ -243527,7 +243573,7 @@ bad:
 }
 
 /* PyIntBinop */
-      #if !CYTHON_COMPILING_IN_PYPY
+    #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_CheckExact(op1))) {
@@ -243643,7 +243689,7 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
 #endif
 
 /* SwapException */
-      #if CYTHON_FAST_THREAD_STATE
+    #if CYTHON_FAST_THREAD_STATE
 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
     PyObject *tmp_type, *tmp_value, *tmp_tb;
     tmp_type = tstate->exc_type;
@@ -243668,7 +243714,7 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
 #endif
 
 /* decode_c_string */
-      static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+    static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
          const char* encoding, const char* errors,
          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
@@ -243701,12 +243747,12 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
 }
 
 /* ExtTypeTest */
-      static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+    static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
     if (unlikely(!type)) {
         PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
-    if (likely(PyObject_TypeCheck(obj, type)))
+    if (likely(__Pyx_TypeCheck(obj, type)))
         return 1;
     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                  Py_TYPE(obj)->tp_name, type->tp_name);
@@ -243714,13 +243760,13 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
 }
 
 /* RaiseNoneIterError */
-      static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+    static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
 }
 
 /* GetAttr */
-      static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
-#if CYTHON_COMPILING_IN_CPYTHON
+    static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_USE_TYPE_SLOTS
 #if PY_MAJOR_VERSION >= 3
     if (likely(PyUnicode_Check(n)))
 #else
@@ -243732,7 +243778,7 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
 }
 
 /* HasAttr */
-      static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
+    static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
     PyObject *r;
     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
         PyErr_SetString(PyExc_TypeError,
@@ -243750,7 +243796,7 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
 }
 
 /* SetItemInt */
-      static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
+    static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
     int r;
     if (!j) return -1;
     r = PyObject_SetItem(o, j, v);
@@ -243798,7 +243844,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
 }
 
 /* None */
-        static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+      static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
     Py_ssize_t q = a / b;
     Py_ssize_t r = a - q*b;
     q -= ((r != 0) & ((r ^ b) < 0));
@@ -243806,7 +243852,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
 }
 
 /* decode_c_bytes */
-        static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
+      static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
          const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
          const char* encoding, const char* errors,
          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
@@ -243833,7 +243879,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
 }
 
 /* GetModuleGlobalName */
-        static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+      static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
     PyObject *result;
 #if !CYTHON_AVOID_BORROWED_REFS
     result = PyDict_GetItem(__pyx_d, name);
@@ -243851,34 +243897,28 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
 }
 
 /* ArgTypeTest */
-          static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
-}
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact)
+        static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
 {
     if (unlikely(!type)) {
         PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
-    if (none_allowed && obj == Py_None) return 1;
     else if (exact) {
-        if (likely(Py_TYPE(obj) == type)) return 1;
         #if PY_MAJOR_VERSION == 2
-        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
         #endif
     }
     else {
-        if (likely(PyObject_TypeCheck(obj, type))) return 1;
+        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
     }
-    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
+    PyErr_Format(PyExc_TypeError,
+        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+        name, type->tp_name, Py_TYPE(obj)->tp_name);
     return 0;
 }
 
 /* GetItemInt */
-          static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+        static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
     PyObject *r;
     if (!j) return NULL;
     r = PyObject_GetItem(o, j);
@@ -243965,7 +244005,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
 }
 
 /* PyObjectCallMethod0 */
-          static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
+        static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
     PyObject *method, *result = NULL;
     method = __Pyx_PyObject_GetAttrStr(obj, method_name);
     if (unlikely(!method)) goto bad;
@@ -243987,7 +244027,7 @@ bad:
 }
 
 /* pop */
-          static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) {
+        static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) {
     if (Py_TYPE(L) == &PySet_Type) {
         return PySet_Pop(L);
     }
@@ -244004,7 +244044,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) {
 #endif
 
 /* SliceTupleAndList */
-          #if CYTHON_COMPILING_IN_CPYTHON
+        #if CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
     Py_ssize_t start = *_start, stop = *_stop, length = *_length;
     if (start < 0) {
@@ -244063,13 +244103,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
 #endif
 
 /* Import */
-          static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+        static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     PyObject *empty_list = 0;
     PyObject *module = 0;
     PyObject *global_dict = 0;
     PyObject *empty_dict = 0;
     PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     PyObject *py_import;
     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
@@ -244093,17 +244133,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
             if (strchr(__Pyx_MODULE_NAME, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                PyObject *py_level = PyInt_FromLong(1);
-                if (!py_level)
-                    goto bad;
-                module = PyObject_CallFunctionObjArgs(py_import,
-                    name, global_dict, empty_dict, list, py_level, NULL);
-                Py_DECREF(py_level);
-                #else
                 module = PyImport_ImportModuleLevelObject(
                     name, global_dict, empty_dict, list, 1);
-                #endif
                 if (!module) {
                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
                         goto bad;
@@ -244114,7 +244145,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
         }
         #endif
         if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
+            #if PY_MAJOR_VERSION < 3
             PyObject *py_level = PyInt_FromLong(level);
             if (!py_level)
                 goto bad;
@@ -244128,7 +244159,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
         }
     }
 bad:
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     Py_XDECREF(py_import);
     #endif
     Py_XDECREF(empty_list);
 }
 
 /* None */
-          static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+        static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
 }
 
 /* PyIntBinop */
-          #if !CYTHON_COMPILING_IN_PYPY
+        #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     if (op1 == op2) {
         Py_RETURN_TRUE;
@@ -244227,7 +244258,7 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
 #endif
 
 /* ImportFrom */
-          static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+        static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
         PyErr_Format(PyExc_ImportError,
@@ -244241,7 +244272,7 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
 }
 
 /* UnicodeEquals */
-          static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+        static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
 #if CYTHON_COMPILING_IN_PYPY
     return PyObject_RichCompareBool(s1, s2, equals);
 #else
@@ -244340,52 +244371,64 @@ return_ne:
 }
 
 /* StringJoin */
-          #if !CYTHON_COMPILING_IN_CPYTHON
+        #if !CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
     return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
 }
 #endif
 
 /* IterNext */
-          static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
+        static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
+    PyObject* exc_type;
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    exc_type = __Pyx_PyErr_Occurred();
+    if (unlikely(exc_type)) {
+        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
+            return NULL;
+        if (defval) {
+            __Pyx_PyErr_Clear();
+            Py_INCREF(defval);
+        }
+        return defval;
+    }
+    if (defval) {
+        Py_INCREF(defval);
+        return defval;
+    }
+    __Pyx_PyErr_SetNone(PyExc_StopIteration);
+    return NULL;
+}
+static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
+    PyErr_Format(PyExc_TypeError,
+        "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
+}
+static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
     PyObject* next;
     iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
+    if (likely(iternext)) {
 #if CYTHON_USE_TYPE_SLOTS
-    if (unlikely(!iternext)) {
+        next = iternext(iterator);
+        if (likely(next))
+            return next;
+        #if PY_VERSION_HEX >= 0x02070000
+        if (unlikely(iternext == &_PyObject_NextNotImplemented))
+            return NULL;
+        #endif
 #else
-    if (unlikely(!iternext) || unlikely(!PyIter_Check(iterator))) {
+        next = PyIter_Next(iterator);
+        if (likely(next))
+            return next;
 #endif
-        PyErr_Format(PyExc_TypeError,
-            "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
+    } else if (CYTHON_USE_TYPE_SLOTS || !PyIter_Check(iterator)) {
+        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
         return NULL;
     }
-    next = iternext(iterator);
-    if (likely(next))
-        return next;
-#if CYTHON_USE_TYPE_SLOTS
-#if PY_VERSION_HEX >= 0x02070000
-    if (unlikely(iternext == &_PyObject_NextNotImplemented))
-        return NULL;
-#endif
-#endif
-    if (defval) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-            if (unlikely(exc_type != PyExc_StopIteration) &&
-                    !PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))
-                return NULL;
-            PyErr_Clear();
-        }
-        Py_INCREF(defval);
-        return defval;
-    }
-    if (!PyErr_Occurred())
-        PyErr_SetNone(PyExc_StopIteration);
-    return NULL;
+    return __Pyx_PyIter_Next2Default(defval);
 }
 
 /* UnpackTupleError */
-            static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
+        static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
     if (t == Py_None) {
       __Pyx_RaiseNoneNotIterableError();
     } else if (PyTuple_GET_SIZE(t) < index) {
@@ -244396,41 +244439,46 @@ static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* value
 }
 
 /* UnpackTuple2 */
-            static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
-                                             int is_tuple, int has_known_size, int decref_tuple) {
-    Py_ssize_t index;
-    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
-    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
-        iternextfunc iternext;
-        iter = PyObject_GetIter(tuple);
-        if (unlikely(!iter)) goto bad;
-        if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
-        iternext = Py_TYPE(iter)->tp_iternext;
-        value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
-        value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
-        if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
-        Py_DECREF(iter);
-    } else {
-        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
-            __Pyx_UnpackTupleError(tuple, 2);
-            goto bad;
-        }
+        static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
+        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
+    PyObject *value1 = NULL, *value2 = NULL;
 #if CYTHON_COMPILING_IN_PYPY
-        value1 = PySequence_ITEM(tuple, 0);
-        if (unlikely(!value1)) goto bad;
-        value2 = PySequence_ITEM(tuple, 1);
-        if (unlikely(!value2)) goto bad;
+    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
+    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
 #else
-        value1 = PyTuple_GET_ITEM(tuple, 0);
-        value2 = PyTuple_GET_ITEM(tuple, 1);
-        Py_INCREF(value1);
-        Py_INCREF(value2);
+    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
+    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
 #endif
-        if (decref_tuple) { Py_DECREF(tuple); }
+    if (decref_tuple) {
+        Py_DECREF(tuple);
     }
     *pvalue1 = value1;
     *pvalue2 = value2;
     return 0;
+#if CYTHON_COMPILING_IN_PYPY
+bad:
+    Py_XDECREF(value1);
+    Py_XDECREF(value2);
+    if (decref_tuple) { Py_XDECREF(tuple); }
+    return -1;
+#endif
+}
+static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
+                                       int has_known_size, int decref_tuple) {
+    Py_ssize_t index;
+    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
+    iternextfunc iternext;
+    iter = PyObject_GetIter(tuple);
+    if (unlikely(!iter)) goto bad;
+    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
+    iternext = Py_TYPE(iter)->tp_iternext;
+    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
+    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
+    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
+    Py_DECREF(iter);
+    *pvalue1 = value1;
+    *pvalue2 = value2;
+    return 0;
 unpacking_failed:
     if (!has_known_size && __Pyx_IterFinish() == 0)
         __Pyx_RaiseNeedMoreValuesError(index);
@@ -244443,7 +244491,7 @@ bad:
 }
 
 /* dict_iter */
-            static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
+        static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                    Py_ssize_t* p_orig_length, int* p_source_is_dict) {
     is_dict = is_dict || likely(PyDict_CheckExact(iterable));
     *p_source_is_dict = is_dict;
         return iterable;
 #elif PY_MAJOR_VERSION >= 3
         static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
-        const char *name = PyUnicode_AsUTF8(method_name);
         PyObject **pp = NULL;
-        if (strcmp(name, "iteritems") == 0) pp = &py_items;
-        else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
-        else if (strcmp(name, "itervalues") == 0) pp = &py_values;
-        if (pp) {
-            if (!*pp) {
-                *pp = PyUnicode_FromString(name + 4);
-                if (!*pp)
-                    return NULL;
+        if (method_name) {
+            const char *name = PyUnicode_AsUTF8(method_name);
+            if (strcmp(name, "iteritems") == 0) pp = &py_items;
+            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
+            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
+            if (pp) {
+                if (!*pp) {
+                    *pp = PyUnicode_FromString(name + 4);
+                    if (!*pp)
+                        return NULL;
+                }
+                method_name = *pp;
             }
-            method_name = *pp;
         }
 #endif
     }
@@ -244554,7 +244604,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next(
 }
 
 /* PyIntBinop */
-            #if !CYTHON_COMPILING_IN_PYPY
+        #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_CheckExact(op1))) {
@@ -244670,11 +244720,12 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_U
 #endif
 
 /* ReturnWithStopIteration */
-            static void __Pyx__ReturnWithStopIteration(PyObject* value) {
+        static void __Pyx__ReturnWithStopIteration(PyObject* value) {
     PyObject *exc, *args;
 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_PYSTON
     __Pyx_PyThreadState_declare
-    if ((PY_VERSION_HEX >= 0x03030000 && PY_VERSION_HEX < 0x030500B1) || unlikely(PyTuple_Check(value))) {
+    if ((PY_VERSION_HEX >= 0x03030000 && PY_VERSION_HEX < 0x030500B1)
+            || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
         args = PyTuple_New(1);
         if (unlikely(!args)) return;
         Py_INCREF(value);
@@ -244704,7 +244755,7 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_U
 }
 
 /* FetchCommonType */
-            static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+        static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
     PyObject* fake_module;
     PyTypeObject* cached_type = NULL;
     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
@@ -244743,10 +244794,8 @@ bad:
 }
 
 /* PyObjectCallMethod1 */
-            static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
-    PyObject *method, *result = NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto done;
+        static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
+    PyObject *result = NULL;
 #if CYTHON_UNPACK_METHODS
     if (likely(PyMethod_Check(method))) {
         PyObject *self = PyMethod_GET_SELF(method);
@@ -244774,7 +244823,6 @@ bad:
             Py_INCREF(arg);
             PyTuple_SET_ITEM(args, 1, arg);
             Py_INCREF(function);
-            Py_DECREF(method); method = NULL;
             result = __Pyx_PyObject_Call(function, args, NULL);
             Py_DECREF(args);
             Py_DECREF(function);
     }
 #endif
     result = __Pyx_PyObject_CallOneArg(method, arg);
+    goto done;
+done:
+    return result;
+}
+static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
+    PyObject *method, *result = NULL;
+    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
+    if (unlikely(!method)) goto done;
+    result = __Pyx__PyObject_CallMethod1(method, arg);
 done:
     Py_XDECREF(method);
     return result;
 }
 
 /* CoroutineBase */
-            #include <structmember.h>
+        #include <structmember.h>
 #include <frameobject.h>
-static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
-static PyObject *__Pyx_Coroutine_Close(PyObject *self);
-static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
+static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
     PyObject *et, *ev, *tb;
     PyObject *value = NULL;
-    __Pyx_PyThreadState_declare
-    __Pyx_PyThreadState_assign
     __Pyx_ErrFetch(&et, &ev, &tb);
     if (!et) {
         Py_XDECREF(tb);
@@ -244835,7 +244886,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
             }
             Py_DECREF(ev);
         }
-        else if (!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
+        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
             value = ev;
         }
         if (likely(value)) {
@@ -244844,7 +244895,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
             *pvalue = value;
             return 0;
         }
-    } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
+    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
         __Pyx_ErrRestore(et, ev, tb);
         return -1;
     }
@@ -244877,7 +244928,6 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
     *pvalue = value;
     return 0;
 }
-#endif
 static CYTHON_INLINE
 void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
     PyObject *exc_type = self->exc_type;
@@ -244890,72 +244940,121 @@ void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
     Py_XDECREF(exc_value);
     Py_XDECREF(exc_traceback);
 }
-static CYTHON_INLINE
-int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
-    if (unlikely(gen->is_running)) {
-        PyErr_SetString(PyExc_ValueError,
-                        "generator already executing");
-        return 1;
+#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
+static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
+    const char *msg;
+    if (0) {
+    #ifdef __Pyx_Coroutine_USED
+    } else if (__Pyx_Coroutine_CheckExact((PyObject*)gen)) {
+        msg = "coroutine already executing";
+    #endif
+    #ifdef __Pyx_AsyncGen_USED
+    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
+        msg = "async generator already executing";
+    #endif
+    } else {
+        msg = "generator already executing";
     }
-    return 0;
+    PyErr_SetString(PyExc_ValueError, msg);
 }
-static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
-    PyObject *retval;
+#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
+static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
+    const char *msg;
+    if (0) {
+    #ifdef __Pyx_Coroutine_USED
+    } else if (__Pyx_Coroutine_CheckExact(gen)) {
+        msg = "can't send non-None value to a just-started coroutine";
+    #endif
+    #ifdef __Pyx_AsyncGen_USED
+    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
+        msg = "can't send non-None value to a just-started async generator";
+    #endif
+    } else {
+        msg = "can't send non-None value to a just-started generator";
+    }
+    PyErr_SetString(PyExc_TypeError, msg);
+}
+#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
+static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
+    #ifdef __Pyx_Coroutine_USED
+    if (!closing && __Pyx_Coroutine_CheckExact(gen)) {
+        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
+    } else
+    #endif
+    if (value) {
+        #ifdef __Pyx_AsyncGen_USED
+        if (__Pyx_AsyncGen_CheckExact(gen))
+            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
+        else
+        #endif
+        PyErr_SetNone(PyExc_StopIteration);
+    }
+}
+static
+PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
     __Pyx_PyThreadState_declare
+    PyThreadState *tstate;
+    PyObject *retval;
     assert(!self->is_running);
     if (unlikely(self->resume_label == 0)) {
         if (unlikely(value && value != Py_None)) {
-            PyErr_SetString(PyExc_TypeError,
-                            "can't send non-None value to a "
-                            "just-started generator");
-            return NULL;
+            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
         }
     }
     if (unlikely(self->resume_label == -1)) {
-        PyErr_SetNone(PyExc_StopIteration);
-        return NULL;
+        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
     }
+#if CYTHON_FAST_THREAD_STATE
     __Pyx_PyThreadState_assign
-    if (value) {
+    tstate = __pyx_tstate;
+#else
+    tstate = __Pyx_PyThreadState_Current;
+#endif
+    if (self->exc_type) {
 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
 #else
         if (self->exc_traceback) {
             PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
             PyFrameObject *f = tb->tb_frame;
-            Py_XINCREF(__pyx_tstate->frame);
+            Py_XINCREF(tstate->frame);
             assert(f->f_back == NULL);
-            f->f_back = __pyx_tstate->frame;
+            f->f_back = tstate->frame;
         }
 #endif
         __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                             &self->exc_traceback);
     } else {
         __Pyx_Coroutine_ExceptionClear(self);
+        __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
     }
     self->is_running = 1;
-    retval = self->body((PyObject *) self, value);
+    retval = self->body((PyObject *) self, tstate, value);
     self->is_running = 0;
-    if (retval) {
-        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
-                            &self->exc_traceback);
+    return retval;
+}
+static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *self) {
+    if (likely(self->exc_traceback)) {
 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
 #else
-        if (self->exc_traceback) {
-            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
-            PyFrameObject *f = tb->tb_frame;
-            Py_CLEAR(f->f_back);
-        }
+        PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
+        PyFrameObject *f = tb->tb_frame;
+        Py_CLEAR(f->f_back);
 #endif
-    } else {
-        __Pyx_Coroutine_ExceptionClear(self);
     }
-    return retval;
 }
 static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
-    if (unlikely(!retval && !PyErr_Occurred())) {
-        PyErr_SetNone(PyExc_StopIteration);
+PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
+    if (unlikely(!retval)) {
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        if (!__Pyx_PyErr_Occurred()) {
+            PyObject *exc = PyExc_StopIteration;
+            #ifdef __Pyx_AsyncGen_USED
+            if (__Pyx_AsyncGen_CheckExact(gen))
+                exc = __Pyx_PyExc_StopAsyncIteration;
+            #endif
+            __Pyx_PyErr_SetNone(exc);
+        }
     }
     return retval;
 }
@@ -244964,8 +245063,8 @@ PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
     PyObject *ret;
     PyObject *val = NULL;
     __Pyx_Coroutine_Undelegate(gen);
-    __Pyx_PyGen_FetchStopIterationValue(&val);
-    ret = __Pyx_Coroutine_SendEx(gen, val);
+    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
+    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
     Py_XDECREF(val);
     return ret;
 }
@@ -244973,8 +245072,8 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
     PyObject *retval;
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
     PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         PyObject *ret;
         gen->is_running = 1;
@@ -244988,6 +245087,21 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
             ret = __Pyx_Coroutine_Send(yf, value);
         } else
         #endif
+        #ifdef __Pyx_AsyncGen_USED
+        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
+            ret = __Pyx_async_gen_asend_send(yf, value);
+        } else
+        #endif
+        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000)
+        if (PyGen_CheckExact(yf)) {
+            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
+        } else
+        #endif
+        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000)
+        if (PyCoro_CheckExact(yf)) {
+            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
+        } else
+        #endif
         {
             if (value == Py_None)
                 ret = Py_TYPE(yf)->tp_iternext(yf);
@@ -245000,9 +245114,9 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
         }
         retval = __Pyx_Coroutine_FinishDelegation(gen);
     } else {
-        retval = __Pyx_Coroutine_SendEx(gen, value);
+        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
     }
-    return __Pyx_Coroutine_MethodReturn(retval);
+    return __Pyx_Coroutine_MethodReturn(self, retval);
 }
 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
     PyObject *retval = NULL;
@@ -245020,6 +245134,19 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
         if (!retval)
             return -1;
     } else
+    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
+        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
+        if (!retval)
+            return -1;
+    } else
+    #endif
+    #ifdef __Pyx_AsyncGen_USED
+    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
+        retval = __Pyx_async_gen_asend_close(yf, NULL);
+    } else
+    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
+        retval = __Pyx_async_gen_athrow_close(yf, NULL);
+    } else
     #endif
     {
         PyObject *meth;
@@ -245044,8 +245171,8 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
 static PyObject *__Pyx_Generator_Next(PyObject *self) {
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
     PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         PyObject *ret;
         gen->is_running = 1;
@@ -245053,6 +245180,11 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
         if (__Pyx_Generator_CheckExact(yf)) {
             ret = __Pyx_Generator_Next(yf);
         } else
+        #endif
+        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000)
+        if (PyGen_CheckExact(yf)) {
+            ret = _PyGen_Send((PyGenObject*)yf, NULL);
+        } else
         #endif
             ret = Py_TYPE(yf)->tp_iternext(yf);
         gen->is_running = 0;
@@ -245061,15 +245193,15 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
         }
         return __Pyx_Coroutine_FinishDelegation(gen);
     }
-    return __Pyx_Coroutine_SendEx(gen, Py_None);
+    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
 }
 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
     PyObject *retval, *raised_exception;
     PyObject *yf = gen->yieldfrom;
     int err = 0;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         Py_INCREF(yf);
         err = __Pyx_Coroutine_CloseIter(gen, yf);
@@ -245078,59 +245210,69 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
     }
     if (err == 0)
         PyErr_SetNone(PyExc_GeneratorExit);
-    retval = __Pyx_Coroutine_SendEx(gen, NULL);
-    if (retval) {
+    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
+    if (unlikely(retval)) {
+        const char *msg;
         Py_DECREF(retval);
-        PyErr_SetString(PyExc_RuntimeError,
-                        "generator ignored GeneratorExit");
+        if ((0)) {
+        #ifdef __Pyx_Coroutine_USED
+        } else if (__Pyx_Coroutine_CheckExact(self)) {
+            msg = "coroutine ignored GeneratorExit";
+        #endif
+        #ifdef __Pyx_AsyncGen_USED
+        } else if (__Pyx_AsyncGen_CheckExact(self)) {
+#if PY_VERSION_HEX < 0x03060000
+            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
+#else
+            msg = "async generator ignored GeneratorExit";
+#endif
+        #endif
+        } else {
+            msg = "generator ignored GeneratorExit";
+        }
+        PyErr_SetString(PyExc_RuntimeError, msg);
         return NULL;
     }
     raised_exception = PyErr_Occurred();
-    if (!raised_exception
-        || raised_exception == PyExc_StopIteration
-        || raised_exception == PyExc_GeneratorExit
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
-    {
+    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
         if (raised_exception) PyErr_Clear();
         Py_INCREF(Py_None);
         return Py_None;
     }
     return NULL;
 }
-static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
+static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
+                                        PyObject *args, int close_on_genexit) {
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
-    PyObject *typ;
-    PyObject *tb = NULL;
-    PyObject *val = NULL;
     PyObject *yf = gen->yieldfrom;
-    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
-        return NULL;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         PyObject *ret;
         Py_INCREF(yf);
-        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
+        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
             int err = __Pyx_Coroutine_CloseIter(gen, yf);
             Py_DECREF(yf);
             __Pyx_Coroutine_Undelegate(gen);
             if (err < 0)
-                return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
+                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
             goto throw_here;
         }
         gen->is_running = 1;
+        if (0
         #ifdef __Pyx_Generator_USED
-        if (__Pyx_Generator_CheckExact(yf)) {
-            ret = __Pyx_Coroutine_Throw(yf, args);
-        } else
+            || __Pyx_Generator_CheckExact(yf)
         #endif
         #ifdef __Pyx_Coroutine_USED
-        if (__Pyx_Coroutine_CheckExact(yf)) {
-            ret = __Pyx_Coroutine_Throw(yf, args);
-        } else
+            || __Pyx_Coroutine_CheckExact(yf)
         #endif
-        {
+            ) {
+            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
+        #ifdef __Pyx_Coroutine_USED
+        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
+            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
+        #endif
+        } else {
             PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
             if (unlikely(!meth)) {
                 Py_DECREF(yf);
@@ -245143,7 +245285,11 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
                 gen->is_running = 0;
                 goto throw_here;
             }
-            ret = PyObject_CallObject(meth, args);
+            if (likely(args)) {
+                ret = PyObject_CallObject(meth, args);
+            } else {
+                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
+            }
             Py_DECREF(meth);
         }
         gen->is_running = 0;
@@ -245151,14 +245297,21 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
         if (!ret) {
             ret = __Pyx_Coroutine_FinishDelegation(gen);
         }
-        return __Pyx_Coroutine_MethodReturn(ret);
+        return __Pyx_Coroutine_MethodReturn(self, ret);
     }
 throw_here:
     __Pyx_Raise(typ, val, tb, NULL);
-    return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
+    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
 }
-static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
-    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
+static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
+    PyObject *typ;
+    PyObject *val = NULL;
+    PyObject *tb = NULL;
+    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
+        return NULL;
+    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
+}
+static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
     Py_VISIT(gen->closure);
     Py_VISIT(gen->classobj);
     Py_VISIT(gen->yieldfrom);
@@ -245175,6 +245328,11 @@ static int __Pyx_Coroutine_clear(PyObject *self) {
     Py_CLEAR(gen->exc_type);
     Py_CLEAR(gen->exc_value);
     Py_CLEAR(gen->exc_traceback);
+#ifdef __Pyx_AsyncGen_USED
+    if (__Pyx_AsyncGen_CheckExact(self)) {
+        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
+    }
+#endif
     Py_CLEAR(gen->gi_name);
     Py_CLEAR(gen->gi_qualname);
     return 0;
@@ -245184,9 +245342,9 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) {
     PyObject_GC_UnTrack(gen);
     if (gen->gi_weakreflist != NULL)
         PyObject_ClearWeakRefs(self);
-    if (gen->resume_label > 0) {
+    if (gen->resume_label >= 0) {
         PyObject_GC_Track(self);
-#if PY_VERSION_HEX >= 0x030400a1
+#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
         if (PyObject_CallFinalizerFromDealloc(self))
 #else
         Py_TYPE(gen)->tp_del(self);
@@ -245197,29 +245355,93 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) {
         }
         PyObject_GC_UnTrack(self);
     }
+#ifdef __Pyx_AsyncGen_USED
+    if (__Pyx_AsyncGen_CheckExact(self)) {
+        /* We have to handle this case for asynchronous generators
+           right here, because this code has to be between UNTRACK
+           and GC_Del. */
+        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
+    }
+#endif
     __Pyx_Coroutine_clear(self);
     PyObject_GC_Del(gen);
 }
 static void __Pyx_Coroutine_del(PyObject *self) {
-    PyObject *res;
     PyObject *error_type, *error_value, *error_traceback;
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
     __Pyx_PyThreadState_declare
-    if (gen->resume_label <= 0)
-        return ;
-#if PY_VERSION_HEX < 0x030400a1
+    if (gen->resume_label < 0) {
+        return;
+    }
+#if !CYTHON_USE_TP_FINALIZE
     assert(self->ob_refcnt == 0);
     self->ob_refcnt = 1;
 #endif
     __Pyx_PyThreadState_assign
     __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
-    res = __Pyx_Coroutine_Close(self);
-    if (res == NULL)
-        PyErr_WriteUnraisable(self);
-    else
-        Py_DECREF(res);
+#ifdef __Pyx_AsyncGen_USED
+    if (__Pyx_AsyncGen_CheckExact(self)) {
+        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
+        PyObject *finalizer = agen->ag_finalizer;
+        if (finalizer && !agen->ag_closed) {
+            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
+            if (unlikely(!res)) {
+                PyErr_WriteUnraisable(self);
+            } else {
+                Py_DECREF(res);
+            }
+            __Pyx_ErrRestore(error_type, error_value, error_traceback);
+            return;
+        }
+    }
+#endif
+    if (unlikely(gen->resume_label == 0 && !error_value)) {
+#ifdef __Pyx_Coroutine_USED
+#ifdef __Pyx_Generator_USED
+    if (!__Pyx_Generator_CheckExact(self))
+#endif
+        {
+        PyObject_GC_UnTrack(self);
+#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
+        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
+            PyErr_WriteUnraisable(self);
+#else
+        {PyObject *msg;
+        char *cmsg;
+        #if CYTHON_COMPILING_IN_PYPY
+        msg = NULL;
+        cmsg = (char*) "coroutine was never awaited";
+        #else
+        char *cname;
+        PyObject *qualname;
+        qualname = gen->gi_qualname;
+        cname = PyString_AS_STRING(qualname);
+        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
+        if (unlikely(!msg)) {
+            PyErr_Clear();
+            cmsg = (char*) "coroutine was never awaited";
+        } else {
+            cmsg = PyString_AS_STRING(msg);
+        }
+        #endif
+        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
+            PyErr_WriteUnraisable(self);
+        Py_XDECREF(msg);}
+#endif
+        PyObject_GC_Track(self);
+        }
+#endif
+    } else {
+        PyObject *res = __Pyx_Coroutine_Close(self);
+        if (unlikely(!res)) {
+            if (PyErr_Occurred())
+                PyErr_WriteUnraisable(self);
+        } else {
+            Py_DECREF(res);
+        }
+    }
     __Pyx_ErrRestore(error_type, error_value, error_traceback);
-#if PY_VERSION_HEX < 0x030400a1
+#if !CYTHON_USE_TP_FINALIZE
     assert(self->ob_refcnt > 0);
     if (--self->ob_refcnt == 0) {
         return;
@@ -245298,8 +245520,13 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_New(
             PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure,
             PyObject *name, PyObject *qualname, PyObject *module_name) {
     __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
-    if (gen == NULL)
+    if (unlikely(!gen))
         return NULL;
+    return __Pyx__Coroutine_NewInit(gen, body, closure, name, qualname, module_name);
+}
+static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
+            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
+            PyObject *name, PyObject *qualname, PyObject *module_name) {
     gen->body = body;
     gen->closure = closure;
     Py_XINCREF(closure);
@@ -245322,7 +245549,7 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_New(
 }
 
 /* PatchModuleWithCoroutine */
-                static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
+            static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
     int result;
     PyObject *globals, *result_obj;
@@ -245362,7 +245589,7 @@ ignore:
 }
 
 /* PatchGeneratorABC */
-                #ifndef CYTHON_REGISTER_ABCS
+            #ifndef CYTHON_REGISTER_ABCS
 #define CYTHON_REGISTER_ABCS 1
 #endif
 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
@@ -245387,11 +245614,11 @@ static int __Pyx_patch_abc(void) {
     static int abc_patched = 0;
     if (CYTHON_REGISTER_ABCS && !abc_patched) {
         PyObject *module;
-        module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
+        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
         if (!module) {
             PyErr_WriteUnraisable(NULL);
             if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
-                    ((PY_VERSION_HEX >= 0x03030000) ?
+                    ((PY_MAJOR_VERSION >= 3) ?
                         "Cython module failed to register with collections.abc module" :
                         "Cython module failed to register with collections module"), 1) < 0)) {
                 return -1;
@@ -245419,11 +245646,7 @@ static int __Pyx_patch_abc(void) {
 }
 
 /* Coroutine */
-                typedef struct {
-    PyObject_HEAD
-    PyObject *coroutine;
-} __pyx_CoroutineAwaitObject;
-static void __Pyx_CoroutineAwait_dealloc(PyObject *self) {
+            static void __Pyx_CoroutineAwait_dealloc(PyObject *self) {
     PyObject_GC_UnTrack(self);
     Py_CLEAR(((__pyx_CoroutineAwaitObject*)self)->coroutine);
     PyObject_GC_Del(self);
@@ -245538,59 +245761,6 @@ static PyObject *__Pyx_Coroutine_await(PyObject *coroutine) {
     }
     return __Pyx__Coroutine_await(coroutine);
 }
-static void __Pyx_Coroutine_check_and_dealloc(PyObject *self) {
-    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
-    if (gen->resume_label == 0 && !PyErr_Occurred()) {
-        PyObject_GC_UnTrack(self);
-#if PY_VERSION_HEX >= 0x03030000 || defined(PyErr_WarnFormat)
-        PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname);
-        PyErr_Clear();
-#else
-        {PyObject *msg;
-        char *cmsg;
-        #if CYTHON_COMPILING_IN_PYPY
-        msg = NULL;
-        cmsg = (char*) "coroutine was never awaited";
-        #else
-        char *cname;
-        PyObject *qualname;
-        #if PY_MAJOR_VERSION >= 3
-        qualname = PyUnicode_AsUTF8String(gen->gi_qualname);
-        if (likely(qualname)) {
-            cname = PyBytes_AS_STRING(qualname);
-        } else {
-            PyErr_Clear();
-            cname = (char*) "?";
-        }
-        msg = PyBytes_FromFormat(
-        #else
-        qualname = gen->gi_qualname;
-        cname = PyString_AS_STRING(qualname);
-        msg = PyString_FromFormat(
-        #endif
-            "coroutine '%.50s' was never awaited", cname);
-        #if PY_MAJOR_VERSION >= 3
-        Py_XDECREF(qualname);
-        #endif
-        if (unlikely(!msg)) {
-            PyErr_Clear();
-            cmsg = (char*) "coroutine was never awaited";
-        } else {
-            #if PY_MAJOR_VERSION >= 3
-            cmsg = PyBytes_AS_STRING(msg);
-            #else
-            cmsg = PyString_AS_STRING(msg);
-            #endif
-        }
-        #endif
-        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
-            PyErr_WriteUnraisable(self);
-        Py_XDECREF(msg);}
-#endif
-        PyObject_GC_Track(self);
-    }
-    __Pyx_Coroutine_dealloc(self);
-}
 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
 static PyObject *__Pyx_Coroutine_compare(PyObject *obj, PyObject *other, int op) {
     PyObject* result;
@@ -245643,7 +245813,7 @@ static PyTypeObject __pyx_CoroutineType_type = {
     "coroutine",
     sizeof(__pyx_CoroutineObject),
     0,
-    (destructor) __Pyx_Coroutine_check_and_dealloc,
+    (destructor) __Pyx_Coroutine_dealloc,
     0,
     0,
     0,
@@ -245666,7 +245836,7 @@ static PyTypeObject __pyx_CoroutineType_type = {
     0,
     (traverseproc) __Pyx_Coroutine_traverse,
     0,
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
+#if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
     __Pyx_Coroutine_compare,
 #else
     0,
@@ -245692,14 +245862,16 @@ static PyTypeObject __pyx_CoroutineType_type = {
     0,
     0,
     0,
-#if PY_VERSION_HEX >= 0x030400a1
+#if CYTHON_USE_TP_FINALIZE
     0,
 #else
     __Pyx_Coroutine_del,
 #endif
     0,
-#if PY_VERSION_HEX >= 0x030400a1
+#if CYTHON_USE_TP_FINALIZE
     __Pyx_Coroutine_del,
+#elif PY_VERSION_HEX >= 0x030400a1
+    0,
 #endif
 };
 static int __pyx_Coroutine_init(void) {
@@ -245714,15 +245886,47 @@ static int __pyx_Coroutine_init(void) {
 }
 
 /* GetAwaitIter */
-                static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) {
+            static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) {
 #ifdef __Pyx_Coroutine_USED
     if (__Pyx_Coroutine_CheckExact(o)) {
-        Py_INCREF(o);
-        return o;
+        return __Pyx_NewRef(o);
     }
 #endif
     return __Pyx__Coroutine_GetAwaitableIter(o);
 }
+static void __Pyx_Coroutine_AwaitableIterError(PyObject *source) {
+#if PY_VERSION_HEX >= 0x030600B3 || defined(_PyErr_FormatFromCause)
+    _PyErr_FormatFromCause(
+        PyExc_TypeError,
+        "'async for' received an invalid object "
+        "from __anext__: %.100s",
+        Py_TYPE(source)->tp_name);
+#elif PY_MAJOR_VERSION >= 3
+    PyObject *exc, *val, *val2, *tb;
+    assert(PyErr_Occurred());
+    PyErr_Fetch(&exc, &val, &tb);
+    PyErr_NormalizeException(&exc, &val, &tb);
+    if (tb != NULL) {
+        PyException_SetTraceback(val, tb);
+        Py_DECREF(tb);
+    }
+    Py_DECREF(exc);
+    assert(!PyErr_Occurred());
+    PyErr_Format(
+        PyExc_TypeError,
+        "'async for' received an invalid object "
+        "from __anext__: %.100s",
+        Py_TYPE(source)->tp_name);
+    PyErr_Fetch(&exc, &val2, &tb);
+    PyErr_NormalizeException(&exc, &val2, &tb);
+    Py_INCREF(val);
+    PyException_SetCause(val2, val);
+    PyException_SetContext(val2, val);
+    PyErr_Restore(exc, val2, tb);
+#else
+    source++;
+#endif
+}
 static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) {
     PyObject *res;
 #if CYTHON_USE_ASYNC_SLOTS
@@ -245733,14 +245937,12 @@ static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) {
 #endif
 #if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact)
     if (PyCoro_CheckExact(obj)) {
-        Py_INCREF(obj);
-        return obj;
+        return __Pyx_NewRef(obj);
     } else
 #endif
 #if CYTHON_COMPILING_IN_CPYTHON && defined(CO_ITERABLE_COROUTINE)
     if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) {
-        Py_INCREF(obj);
-        return obj;
+        return __Pyx_NewRef(obj);
     } else
 #endif
     {
@@ -245759,8 +245961,11 @@ static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) {
             res = __Pyx_PyObject_CallNoArg(method);
         Py_DECREF(method);
     }
-    if (unlikely(!res)) goto bad;
-    if (!PyIter_Check(res)) {
+    if (unlikely(!res)) {
+        __Pyx_Coroutine_AwaitableIterError(obj);
+        goto bad;
+    }
+    if (unlikely(!PyIter_Check(res))) {
         PyErr_Format(PyExc_TypeError,
                      "__await__() returned non-iterator of type '%.100s'",
                      Py_TYPE(res)->tp_name);
 }
 
 /* CoroutineYieldFrom */
-                static int __Pyx_WarnAIterDeprecation(PyObject *aiter) {
-    int result;
-#if PY_MAJOR_VERSION >= 3
-    result = PyErr_WarnFormat(
-        PyExc_PendingDeprecationWarning, 1,
-        "'%.100s' implements legacy __aiter__ protocol; "
-        "__aiter__ should return an asynchronous "
-        "iterator, not awaitable",
-        Py_TYPE(aiter)->tp_name);
+            static PyObject* __Pyx__Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen, PyObject *source) {
+    PyObject *retval;
+    PyObject *source_gen = __Pyx__Coroutine_GetAwaitableIter(source);
+    if (unlikely(!source_gen)) {
+        return NULL;
+    }
+    if (__Pyx_Coroutine_CheckExact(source_gen)) {
+        retval = __Pyx_Generator_Next(source_gen);
+    } else {
+#if CYTHON_USE_TYPE_SLOTS
+        retval = Py_TYPE(source_gen)->tp_iternext(source_gen);
 #else
-    result = PyErr_WarnEx(
-        PyExc_PendingDeprecationWarning,
-        "object implements legacy __aiter__ protocol; "
-        "__aiter__ should return an asynchronous "
-        "iterator, not awaitable",
-        1);
+        retval = PyIter_Next(source_gen);
 #endif
-    return result != 0;
+    }
+    if (retval) {
+        gen->yieldfrom = source_gen;
+        return retval;
+    }
+    Py_DECREF(source_gen);
+    return NULL;
 }
-static CYTHON_INLINE PyObject* __Pyx__Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source, int warn) {
+static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source) {
     PyObject *retval;
     if (__Pyx_Coroutine_CheckExact(source)) {
-        if (warn && unlikely(__Pyx_WarnAIterDeprecation(source))) {
+        if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) {
+            PyErr_SetString(
+                PyExc_RuntimeError,
+                "coroutine is being awaited already");
             return NULL;
         }
         retval = __Pyx_Generator_Next(source);
-        if (retval) {
-            Py_INCREF(source);
-            gen->yieldfrom = source;
-            return retval;
-        }
+#ifdef __Pyx_AsyncGen_USED
+    } else if (__pyx_PyAsyncGenASend_CheckExact(source)) {
+        retval = __Pyx_async_gen_asend_iternext(source);
+#endif
     } else {
-        PyObject *source_gen = __Pyx__Coroutine_GetAwaitableIter(source);
-        if (unlikely(!source_gen))
-            return NULL;
-        if (warn && unlikely(__Pyx_WarnAIterDeprecation(source))) {
-            Py_DECREF(source_gen);
-            return NULL;
-        }
-        if (__Pyx_Coroutine_CheckExact(source_gen)) {
-            retval = __Pyx_Generator_Next(source_gen);
-        } else {
-            retval = Py_TYPE(source_gen)->tp_iternext(source_gen);
-        }
-        if (retval) {
-            gen->yieldfrom = source_gen;
-            return retval;
-        }
-        Py_DECREF(source_gen);
+        return __Pyx__Coroutine_Yield_From_Generic(gen, source);
     }
-    return NULL;
+    if (retval) {
+        Py_INCREF(source);
+        gen->yieldfrom = source;
+    }
+    return retval;
 }
 
 /* py_dict_values */
-                static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
+            static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
     if (PY_MAJOR_VERSION >= 3)
         return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
     else
@@ -245853,7 +246051,7 @@ static CYTHON_INLINE PyObject* __Pyx__Coroutine_Yield_From(__pyx_CoroutineObject
 }
 
 /* dict_getitem_default */
-                static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
+            static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
     PyObject* value;
 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
     value = PyDict_GetItemWithError(d, key);
@@ -245881,7 +246079,7 @@ static CYTHON_INLINE PyObject* __Pyx__Coroutine_Yield_From(__pyx_CoroutineObject
 }
 
 /* MergeKeywords */
-                static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
+            static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
     PyObject *iter, *key = NULL, *value = NULL;
     int source_is_dict, result;
     Py_ssize_t orig_length, ppos = 0;
@@ -245923,7 +246121,7 @@ bad:
 }
 
 /* CallNextTpTraverse */
-                static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
+            static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
     PyTypeObject* type = Py_TYPE(obj);
     while (type && type->tp_traverse != current_tp_traverse)
         type = type->tp_base;
@@ -245935,7 +246133,7 @@ bad:
 }
 
 /* CallNextTpClear */
-                static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
+            static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
     PyTypeObject* type = Py_TYPE(obj);
     while (type && type->tp_clear != current_tp_clear)
         type = type->tp_base;
@@ -245946,7 +246144,7 @@ bad:
 }
 
 /* SetVTable */
-                static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+            static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
 #if PY_VERSION_HEX >= 0x02070000
     PyObject *ob = PyCapsule_New(vtable, 0, 0);
 #else
@@ -245964,7 +246162,7 @@ bad:
 }
 
 /* CalculateMetaclass */
-                static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
+            static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
     Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
     for (i=0; i < nbases; i++) {
         PyTypeObject *tmptype;
@@ -246003,7 +246201,7 @@ bad:
 }
 
 /* CythonFunction */
-                static PyObject *
+            static PyObject *
 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
 {
     if (unlikely(op->func_doc == NULL)) {
@@ -246363,14 +246561,18 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
     }
     return 0;
 }
-static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
 {
-    PyObject_GC_UnTrack(m);
     if (__Pyx_CyFunction_weakreflist(m) != NULL)
         PyObject_ClearWeakRefs((PyObject *) m);
     __Pyx_CyFunction_clear(m);
     PyObject_GC_Del(m);
 }
+static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+{
+    PyObject_GC_UnTrack(m);
+    __Pyx__CyFunction_dealloc(m);
+}
 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
 {
     Py_VISIT(m->func_closure);
@@ -246445,10 +246647,16 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py
         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
             size = PyTuple_GET_SIZE(arg);
             if (likely(size == 1)) {
-                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
-                if (unlikely(!arg0)) return NULL;
+                PyObject *result, *arg0;
+                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+                arg0 = PyTuple_GET_ITEM(arg, 0);
+                #else
+                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
+                #endif
                 result = (*meth)(self, arg0);
+                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                 Py_DECREF(arg0);
+                #endif
                 return result;
             }
             PyErr_Format(PyExc_TypeError,
@@ -246555,7 +246763,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
 };
 static int __pyx_CyFunction_init(void) {
     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
-    if (__pyx_CyFunctionType == NULL) {
+    if (unlikely(__pyx_CyFunctionType == NULL)) {
         return -1;
     }
     return 0;
@@ -246563,7 +246771,7 @@ static int __pyx_CyFunction_init(void) {
 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
     m->defaults = PyObject_Malloc(size);
-    if (!m->defaults)
+    if (unlikely(!m->defaults))
         return PyErr_NoMemory();
     memset(m->defaults, 0, size);
     m->defaults_pyobjects = pyobjects;
@@ -246586,7 +246794,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
 }
 
 /* Py3ClassCreate */
-                    static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
+                static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                            PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
     PyObject *ns;
     if (metaclass) {
@@ -246653,7 +246861,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj
 }
 
 /* PatchInspect */
-                    static PyObject* __Pyx_patch_inspect(PyObject* module) {
+                static PyObject* __Pyx_patch_inspect(PyObject* module) {
 #if defined(__Pyx_Generator_USED) && (!defined(CYTHON_PATCH_INSPECT) || CYTHON_PATCH_INSPECT)
     static int inspect_patched = 0;
     if (unlikely((!inspect_patched) && module)) {
@@ -246678,22 +246886,31 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj
 }
 
 /* GetNameInClass */
-                    static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
+                static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
+        return NULL;
+    __Pyx_PyErr_Clear();
+    return __Pyx_GetModuleGlobalName(name);
+}
+static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
     PyObject *result;
     result = __Pyx_PyObject_GetAttrStr(nmspace, name);
-    if (!result)
-        result = __Pyx_GetModuleGlobalName(name);
+    if (!result) {
+        result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
+    }
     return result;
 }
 
 /* ClassMethod */
-                    static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
-#if CYTHON_COMPILING_IN_PYPY
+                static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
+#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
     if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
         return PyClassMethod_New(method);
     }
 #else
-#if CYTHON_COMPILING_IN_PYSTON
+#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
     if (PyMethodDescr_Check(method)) {
 #else
     static PyTypeObject *methoddescr_type = NULL;
@@ -246703,7 +246920,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj
        methoddescr_type = Py_TYPE(meth);
        Py_DECREF(meth);
     }
-    if (PyObject_TypeCheck(method, methoddescr_type)) {
+    if (__Pyx_TypeCheck(method, methoddescr_type)) {
 #endif
         PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
         #if PY_VERSION_HEX < 0x03020000
@@ -246721,7 +246938,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj
         return PyClassMethod_New(method);
     }
 #ifdef __Pyx_CyFunction_USED
-    else if (PyObject_TypeCheck(method, __pyx_CyFunctionType)) {
+    else if (__Pyx_TypeCheck(method, __pyx_CyFunctionType)) {
         return PyClassMethod_New(method);
     }
 #endif
@@ -246732,7 +246949,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj
 }
 
 /* ModuleImport */
-                      #ifndef __PYX_HAVE_RT_ImportModule
+                  #ifndef __PYX_HAVE_RT_ImportModule
 #define __PYX_HAVE_RT_ImportModule
 static PyObject *__Pyx_ImportModule(const char *name) {
     PyObject *py_name = 0;
@@ -246750,7 +246967,7 @@ bad:
 #endif
 
 /* RegisterModuleCleanup */
-                      #if PY_MAJOR_VERSION < 3
+                  #if PY_MAJOR_VERSION < 3
 static PyObject* __pyx_module_cleanup_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) {
     __pyx_module_cleanup(module);
     Py_INCREF(Py_None); return Py_None;
@@ -246817,7 +247034,7 @@ static int __Pyx_RegisterCleanup(void) {
 #endif
 
 /* CLineInTraceback */
-                      static int __Pyx_CLineForTraceback(int c_line) {
+                  static int __Pyx_CLineForTraceback(int c_line) {
 #ifdef CYTHON_CLINE_IN_TRACEBACK
     return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0;
 #else
@@ -246853,7 +247070,7 @@ static int __Pyx_RegisterCleanup(void) {
 }
 
 /* CodeObjectCache */
-                      static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+                  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
     int start = 0, mid = 0, end = count - 1;
     if (end >= 0 && code_line > entries[end].code_line) {
         return count;
@@ -246933,7 +247150,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
 }
 
 /* AddTraceback */
-                      #include "compile.h"
+                  #include "compile.h"
 #include "frameobject.h"
 #include "traceback.h"
 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -247003,10 +247220,10 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
     }
     py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        __pyx_d,      /*PyObject *globals,*/
-        0                    /*PyObject *locals*/
+        __Pyx_PyThreadState_Current, /*PyThreadState *tstate,*/
+        py_code,                     /*PyCodeObject *code,*/
+        __pyx_d,              /*PyObject *globals,*/
+        0                            /*PyObject *locals*/
     );
     if (!py_frame) goto bad;
     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
@@ -247017,7 +247234,7 @@ bad:
 }
 
 /* CIntFromPyVerify */
-                      #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+                  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
@@ -247039,7 +247256,7 @@ bad:
     }
 
 /* Print */
-                      #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
+                  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
 static PyObject *__Pyx_GetStdout(void) {
     PyObject *f = PySys_GetObject((char *)"stdout");
     if (!f) {
@@ -247145,7 +247362,7 @@ bad:
 #endif
 
 /* CIntToPy */
-                      static CYTHON_INLINE PyObject* __Pyx_PyInt_From_xmlParserErrors(xmlParserErrors value) {
+                  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_xmlParserErrors(xmlParserErrors value) {
     const xmlParserErrors neg_one = (xmlParserErrors) -1, const_zero = (xmlParserErrors) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -247176,7 +247393,7 @@ bad:
 }
 
 /* CIntToPy */
-                      static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+                  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -247207,7 +247424,7 @@ bad:
 }
 
 /* CIntToPy */
-                      static CYTHON_INLINE PyObject* __Pyx_PyInt_From_xmlElementType(xmlElementType value) {
+                  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_xmlElementType(xmlElementType value) {
     const xmlElementType neg_one = (xmlElementType) -1, const_zero = (xmlElementType) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -247238,7 +247455,7 @@ bad:
 }
 
 /* CIntToPy */
-                      static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+                  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
     const int neg_one = (int) -1, const_zero = (int) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -247269,7 +247486,7 @@ bad:
 }
 
 /* CIntToPy */
-                      static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
+                  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
     const char neg_one = (char) -1, const_zero = (char) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -247300,7 +247517,7 @@ bad:
 }
 
 /* CIntToPy */
-                      static CYTHON_INLINE PyObject* __Pyx_PyInt_From_xmlXPathObjectType(xmlXPathObjectType value) {
+                  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_xmlXPathObjectType(xmlXPathObjectType value) {
     const xmlXPathObjectType neg_one = (xmlXPathObjectType) -1, const_zero = (xmlXPathObjectType) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -247331,7 +247548,7 @@ bad:
 }
 
 /* CIntFromPy */
-                      static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+                  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
     const int neg_one = (int) -1, const_zero = (int) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -247520,7 +247737,7 @@ raise_neg_overflow:
 }
 
 /* PrintOne */
-                      #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
+                  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
 static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
     if (!f) {
         if (!(f = __Pyx_GetStdout()))
@@ -247557,7 +247774,7 @@ static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
 #endif
 
 /* CIntFromPy */
-                      static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
+                  static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
     const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -247746,7 +247963,7 @@ raise_neg_overflow:
 }
 
 /* CIntFromPy */
-                      static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *x) {
+                  static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *x) {
     const signed char neg_one = (signed char) -1, const_zero = (signed char) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -247935,7 +248152,7 @@ raise_neg_overflow:
 }
 
 /* CIntFromPy */
-                      static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
+                  static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
     const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -248124,7 +248341,7 @@ raise_neg_overflow:
 }
 
 /* CIntFromPy */
-                      static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+                  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -248313,14 +248530,86 @@ raise_neg_overflow:
 }
 
 /* BytesContains */
-                      static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) {
+                  static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character) {
     const Py_ssize_t length = PyBytes_GET_SIZE(bytes);
     char* char_start = PyBytes_AS_STRING(bytes);
     return memchr(char_start, (unsigned char)character, (size_t)length) != NULL;
 }
 
+/* FastTypeChecks */
+                  #if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+    while (a) {
+        a = a->tp_base;
+        if (a == b)
+            return 1;
+    }
+    return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+    PyObject *mro;
+    if (a == b) return 1;
+    mro = a->tp_mro;
+    if (likely(mro)) {
+        Py_ssize_t i, n;
+        n = PyTuple_GET_SIZE(mro);
+        for (i = 0; i < n; i++) {
+            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+                return 1;
+        }
+        return 0;
+    }
+    return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+    PyObject *exception, *value, *tb;
+    int res;
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    __Pyx_ErrFetch(&exception, &value, &tb);
+    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+    if (unlikely(res == -1)) {
+        PyErr_WriteUnraisable(err);
+        res = 0;
+    }
+    if (!res) {
+        res = PyObject_IsSubclass(err, exc_type2);
+        if (unlikely(res == -1)) {
+            PyErr_WriteUnraisable(err);
+            res = 0;
+        }
+    }
+    __Pyx_ErrRestore(exception, value, tb);
+    return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+    if (!res) {
+        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+    }
+    return res;
+}
+#endif
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+    if (likely(err == exc_type)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+    }
+    return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+    if (likely(err == exc_type1 || err == exc_type2)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+    }
+    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
 /* Generator */
-                      static PyMethodDef __pyx_Generator_methods[] = {
+                  static PyMethodDef __pyx_Generator_methods[] = {
     {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
      (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
     {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
@@ -248388,14 +248677,16 @@ static PyTypeObject __pyx_GeneratorType_type = {
     0,
     0,
     0,
-#if PY_VERSION_HEX >= 0x030400a1
+#if CYTHON_USE_TP_FINALIZE
     0,
 #else
     __Pyx_Coroutine_del,
 #endif
     0,
-#if PY_VERSION_HEX >= 0x030400a1
+#if CYTHON_USE_TP_FINALIZE
     __Pyx_Coroutine_del,
+#elif PY_VERSION_HEX >= 0x030400a1
+    0,
 #endif
 };
 static int __pyx_Generator_init(void) {
@@ -248409,7 +248700,7 @@ static int __pyx_Generator_init(void) {
 }
 
 /* CheckBinaryVersion */
-                      static int __Pyx_check_binary_version(void) {
+                  static int __Pyx_check_binary_version(void) {
     char ctversion[4], rtversion[4];
     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -248425,7 +248716,7 @@ static int __pyx_Generator_init(void) {
 }
 
 /* FunctionExport */
-                      static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
+                  static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
     PyObject *d = 0;
     PyObject *cobj = 0;
     union {
@@ -248462,7 +248753,7 @@ bad:
 }
 
 /* TypeImport */
-                      #ifndef __PYX_HAVE_RT_ImportType
+                  #ifndef __PYX_HAVE_RT_ImportType
 #define __PYX_HAVE_RT_ImportType
 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
     size_t size, int strict)
@@ -248527,7 +248818,7 @@ bad:
 #endif
 
 /* InitStrings */
-                      static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+                  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
         if (t->is_unicode) {
@@ -248566,46 +248857,53 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
     Py_ssize_t ignore;
     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
 }
-static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    char* defenc_c;
+    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+    if (!defenc) return NULL;
+    defenc_c = PyBytes_AS_STRING(defenc);
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
+    {
+        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+        char* c;
+        for (c = defenc_c; c < end; c++) {
+            if ((unsigned char) (*c) >= 128) {
+                PyUnicode_AsASCIIString(o);
+                return NULL;
             }
         }
+    }
 #endif
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
+    *length = PyBytes_GET_SIZE(defenc);
+    return defenc_c;
+}
 #else
-        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_LENGTH(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
+    if (likely(PyUnicode_IS_ASCII(o))) {
+        *length = PyUnicode_GET_LENGTH(o);
+        return PyUnicode_AsUTF8(o);
+    } else {
+        PyUnicode_AsASCIIString(o);
+        return NULL;
+    }
 #else
-        return PyUnicode_AsUTF8AndSize(o, length);
+    return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+}
+#endif
 #endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+    if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+            __Pyx_sys_getdefaultencoding_not_ascii &&
 #endif
+            PyUnicode_Check(o)) {
+        return __Pyx_PyUnicode_AsStringAndSize(o, length);
     } else
 #endif
 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
@@ -248629,6 +248927,26 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
    else return PyObject_IsTrue(x);
 }
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+    if (PyLong_Check(result)) {
+        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+                "__int__ returned non-int (type %.200s).  "
+                "The ability to return an instance of a strict subclass of int "
+                "is deprecated, and may be removed in a future version of Python.",
+                Py_TYPE(result)->tp_name)) {
+            Py_DECREF(result);
+            return NULL;
+        }
+        return result;
+    }
+#endif
+    PyErr_Format(PyExc_TypeError,
+                 "__%.4s__ returned non-%.4s (type %.200s)",
+                 type_name, type_name, Py_TYPE(result)->tp_name);
+    Py_DECREF(result);
+    return NULL;
+}
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
 #if CYTHON_USE_TYPE_SLOTS
   PyNumberMethods *m;
@@ -248636,9 +248954,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   const char *name = NULL;
   PyObject *res = NULL;
 #if PY_MAJOR_VERSION < 3
-  if (PyInt_Check(x) || PyLong_Check(x))
+  if (likely(PyInt_Check(x) || PyLong_Check(x)))
 #else
-  if (PyLong_Check(x))
+  if (likely(PyLong_Check(x)))
 #endif
     return __Pyx_NewRef(x);
 #if CYTHON_USE_TYPE_SLOTS
@@ -248646,32 +248964,30 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   #if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
-    res = PyNumber_Int(x);
+    res = m->nb_int(x);
   }
   else if (m && m->nb_long) {
     name = "long";
-    res = PyNumber_Long(x);
+    res = m->nb_long(x);
   }
   #else
-  if (m && m->nb_int) {
+  if (likely(m && m->nb_int)) {
     name = "int";
-    res = PyNumber_Long(x);
+    res = m->nb_int(x);
   }
   #endif
 #else
-  res = PyNumber_Int(x);
+  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+    res = PyNumber_Int(x);
+  }
 #endif
-  if (res) {
+  if (likely(res)) {
 #if PY_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
+    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
 #else
-    if (!PyLong_Check(res)) {
+    if (unlikely(!PyLong_CheckExact(res))) {
 #endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (type %.200s)",
-                   name, name, Py_TYPE(res)->tp_name);
-      Py_DECREF(res);
-      return NULL;
+        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
     }
   }
   else if (!PyErr_Occurred()) {
index 3517768502fcb241f8f552b2a32857990590b14d..9960cc95f831d9fd4b963d62697a030a9dae1a8d 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.26.1 */
+/* Generated by Cython 0.27.1 */
 
 #ifndef __PYX_HAVE__lxml__etree
 #define __PYX_HAVE__lxml__etree
@@ -12,7 +12,7 @@ struct LxmlElementBase;
 struct LxmlElementClassLookup;
 struct LxmlFallbackElementClassLookup;
 
-/* "lxml/etree.pyx":327
+/* "lxml/etree.pyx":330
  * 
  * # type of a function that steps from node to node
  * ctypedef public xmlNode* (*_node_to_node_function)(xmlNode*)             # <<<<<<<<<<<<<<
@@ -21,7 +21,7 @@ struct LxmlFallbackElementClassLookup;
  */
 typedef xmlNode *(*_node_to_node_function)(xmlNode *);
 
-/* "lxml/etree.pyx":343
+/* "lxml/etree.pyx":346
  * @cython.final
  * @cython.freelist(8)
  * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]:             # <<<<<<<<<<<<<<
@@ -37,7 +37,7 @@ struct LxmlDocument {
   struct __pyx_obj_4lxml_5etree__BaseParser *_parser;
 };
 
-/* "lxml/etree.pyx":695
+/* "lxml/etree.pyx":698
  * 
  * @cython.no_gc_clear
  * cdef public class _Element [ type LxmlElementType, object LxmlElement ]:             # <<<<<<<<<<<<<<
@@ -51,7 +51,7 @@ struct LxmlElement {
   PyObject *_tag;
 };
 
-/* "lxml/etree.pyx":1857
+/* "lxml/etree.pyx":1860
  * 
  * 
  * cdef public class _ElementTree [ type LxmlElementTreeType,             # <<<<<<<<<<<<<<
@@ -65,7 +65,7 @@ struct LxmlElementTree {
   struct LxmlElement *_context_node;
 };
 
-/* "lxml/etree.pyx":2586
+/* "lxml/etree.pyx":2589
  * 
  * 
  * cdef public class _ElementTagMatcher [ object LxmlElementTagMatcher,             # <<<<<<<<<<<<<<
@@ -81,7 +81,7 @@ struct LxmlElementTagMatcher {
   char *_name;
 };
 
-/* "lxml/etree.pyx":2617
+/* "lxml/etree.pyx":2620
  *                 self._name = NULL
  * 
  * cdef public class _ElementIterator(_ElementTagMatcher) [             # <<<<<<<<<<<<<<
@@ -126,8 +126,8 @@ struct LxmlElementClassLookup {
   _element_class_lookup_function _lookup_function;
 };
 
-/* "src/lxml/classlookup.pxi":223
- *         self._lookup_function = NULL # use default lookup
+/* "src/lxml/classlookup.pxi":222
+ * 
  * 
  * cdef public class FallbackElementClassLookup(ElementClassLookup) \             # <<<<<<<<<<<<<<
  *          [ type LxmlFallbackElementClassLookupType,
@@ -211,6 +211,9 @@ __PYX_EXTERN_C xmlNs *findOrBuildNodeNsPrefix(struct LxmlDocument *, xmlNode *,
 
 #endif /* !__PYX_HAVE_API__lxml__etree */
 
+/* WARNING: the interface of the module init function changed in CPython 3.5. */
+/* It now returns a PyModuleDef instance instead of a PyModule instance. */
+
 #if PY_MAJOR_VERSION < 3
 PyMODINIT_FUNC initetree(void);
 #else
index 75e7543c39fec11db3410e5ff066372f20ac1404..88c3ab10d05f062b62f3c292d7a9b462dd12021a 100644 (file)
@@ -98,6 +98,9 @@ import sys
 cdef object re
 import re
 
+cdef object partial
+from functools import partial
+
 cdef object islice
 from itertools import islice
 
index ac11a42800c92b39657a8ce52a643a6e315ce8f4..05b19abd70c87f94cc95c47a51f7810ee23affbe 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.26.1 */
+/* Generated by Cython 0.27.1 */
 
 #ifndef __PYX_HAVE_API__lxml__etree
 #define __PYX_HAVE_API__lxml__etree
index efe548acbe2c0bb9933a1553ea50cb78c5475ae6..9401f0a515822a7e8427478594889332bcfad89f 100644 (file)
@@ -1,8 +1,14 @@
-/* Generated by Cython 0.26.1 */
+/* Generated by Cython 0.27.1 */
 
 /* BEGIN: Cython Metadata
 {
     "distutils": {
+        "define_macros": [
+            [
+                "CYTHON_CLINE_IN_TRACEBACK", 
+                "1"
+            ]
+        ], 
         "extra_compile_args": [
             "-w"
         ], 
@@ -32,10 +38,11 @@ END: Cython Metadata */
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
-    #error Cython requires Python 2.6+ or Python 3.2+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+    #error Cython requires Python 2.6+ or Python 3.3+.
 #else
-#define CYTHON_ABI "0_26_1"
+#define CYTHON_ABI "0_27_1"
+#define CYTHON_FUTURE_DIVISION 0
 #include <stddef.h>
 #ifndef offsetof
   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
@@ -59,7 +66,7 @@ END: Cython Metadata */
 #endif
 #define __PYX_COMMA ,
 #ifndef HAVE_LONG_LONG
-  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+  #if PY_VERSION_HEX >= 0x02070000
     #define HAVE_LONG_LONG
   #endif
 #endif
@@ -77,8 +84,12 @@ END: Cython Metadata */
   #define CYTHON_USE_TYPE_SLOTS 0
   #undef CYTHON_USE_PYTYPE_LOOKUP
   #define CYTHON_USE_PYTYPE_LOOKUP 0
-  #undef CYTHON_USE_ASYNC_SLOTS
-  #define CYTHON_USE_ASYNC_SLOTS 0
+  #if PY_VERSION_HEX < 0x03050000
+    #undef CYTHON_USE_ASYNC_SLOTS
+    #define CYTHON_USE_ASYNC_SLOTS 0
+  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+    #define CYTHON_USE_ASYNC_SLOTS 1
+  #endif
   #undef CYTHON_USE_PYLIST_INTERNALS
   #define CYTHON_USE_PYLIST_INTERNALS 0
   #undef CYTHON_USE_UNICODE_INTERNALS
@@ -97,6 +108,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #elif defined(PYSTON_VERSION)
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 1
@@ -130,6 +145,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #else
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 0
@@ -182,6 +201,12 @@ END: Cython Metadata */
   #ifndef CYTHON_FAST_PYCALL
     #define CYTHON_FAST_PYCALL 1
   #endif
+  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+    #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
+  #endif
+  #ifndef CYTHON_USE_TP_FINALIZE
+    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+  #endif
 #endif
 #if !defined(CYTHON_FAST_PYCCALL)
 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
@@ -237,6 +262,27 @@ END: Cython Metadata */
 #else
 #define __Pyx_PyFastCFunction_Check(func) 0
 #endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+  #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
+#else
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
@@ -320,7 +366,6 @@ END: Cython Metadata */
 #ifndef PySet_CheckExact
   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
 #endif
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
 #if PY_MAJOR_VERSION >= 3
   #define PyIntObject                  PyLongObject
@@ -371,15 +416,17 @@ END: Cython Metadata */
     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
   #else
+    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+  #endif
+#else
+  #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
     typedef struct {
         unaryfunc am_await;
         unaryfunc am_aiter;
         unaryfunc am_anext;
     } __Pyx_PyAsyncMethodsStruct;
-    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
-  #endif
-#else
-  #define __Pyx_PyType_AsAsync(obj) NULL
 #endif
 #ifndef CYTHON_RESTRICT
   #if defined(__GNUC__)
@@ -489,14 +536,6 @@ static CYTHON_INLINE float __PYX_NAN() {
   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
 }
 
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
-#else
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
-#endif
-
 #ifndef __PYX_EXTERN_C
   #ifdef __cplusplus
     #define __PYX_EXTERN_C extern "C"
@@ -511,7 +550,7 @@ static CYTHON_INLINE float __PYX_NAN() {
 #include <omp.h>
 #endif /* _OPENMP */
 
-#ifdef PYREX_WITHOUT_ASSERTIONS
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
@@ -542,8 +581,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc
     #define __Pyx_sst_abs(value) abs(value)
 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
     #define __Pyx_sst_abs(value) labs(value)
-#elif defined (_MSC_VER) && defined (_M_X64)
-    #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (_MSC_VER)
+    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
     #define __Pyx_sst_abs(value) llabs(value)
 #elif defined (__GNUC__)
@@ -565,6 +604,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
 #endif
+#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
@@ -575,16 +620,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
     const Py_UNICODE *u_end = u;
     while (*u_end++) ;
     return (size_t)(u_end - u - 1);
 }
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
@@ -593,6 +633,8 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 #if CYTHON_ASSUME_SAFE_MACROS
@@ -693,7 +735,7 @@ bad:
 #endif /* __GNUC__ */
 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
 
-static PyObject *__pyx_m;
+static PyObject *__pyx_m = NULL;
 static PyObject *__pyx_d;
 static PyObject *__pyx_b;
 static PyObject *__pyx_cython_runtime;
@@ -911,21 +953,31 @@ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
 /* PyThreadStateGet.proto */
 #if CYTHON_FAST_THREAD_STATE
 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
+#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
 #else
 #define __Pyx_PyThreadState_declare
 #define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
 #endif
 
 /* PyErrFetchRestore.proto */
 #if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
+#else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
 #else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
@@ -1023,12 +1075,13 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                               int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                      int is_list, int wraparound, int boundscheck);
 
 /* PyObjectCallMethod1.proto */
 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
+static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
 
 /* pop_index.proto */
 static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix);
@@ -1232,6 +1285,18 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 /* CIntFromPy.proto */
 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+
 /* CheckBinaryVersion.proto */
 static int __Pyx_check_binary_version(void);
 
@@ -1264,7 +1329,7 @@ static const char __pyx_k__22[] = ":";
 static const char __pyx_k__24[] = "\\";
 static const char __pyx_k__30[] = ".";
 static const char __pyx_k__32[] = ",";
-static const char __pyx_k__63[] = "/\\*.*?\\*/";
+static const char __pyx_k__64[] = "/\\*.*?\\*/";
 static const char __pyx_k_a_z[] = "[^a-z]";
 static const char __pyx_k_all[] = "__all__";
 static const char __pyx_k_bad[] = "bad";
@@ -1561,7 +1626,7 @@ static PyObject *__pyx_kp_s__24;
 static PyObject *__pyx_kp_s__30;
 static PyObject *__pyx_kp_s__32;
 static PyObject *__pyx_kp_s__4;
-static PyObject *__pyx_kp_s__63;
+static PyObject *__pyx_kp_s__64;
 static PyObject *__pyx_n_s_a;
 static PyObject *__pyx_kp_s_a_z;
 static PyObject *__pyx_n_s_add_nofollow;
@@ -1873,43 +1938,44 @@ static PyObject *__pyx_tuple__43;
 static PyObject *__pyx_tuple__44;
 static PyObject *__pyx_tuple__45;
 static PyObject *__pyx_tuple__46;
-static PyObject *__pyx_tuple__48;
-static PyObject *__pyx_tuple__50;
-static PyObject *__pyx_tuple__52;
-static PyObject *__pyx_tuple__54;
-static PyObject *__pyx_tuple__56;
-static PyObject *__pyx_tuple__58;
-static PyObject *__pyx_tuple__60;
+static PyObject *__pyx_tuple__47;
+static PyObject *__pyx_tuple__49;
+static PyObject *__pyx_tuple__51;
+static PyObject *__pyx_tuple__53;
+static PyObject *__pyx_tuple__55;
+static PyObject *__pyx_tuple__57;
+static PyObject *__pyx_tuple__59;
 static PyObject *__pyx_tuple__61;
-static PyObject *__pyx_tuple__64;
-static PyObject *__pyx_tuple__66;
-static PyObject *__pyx_tuple__68;
+static PyObject *__pyx_tuple__62;
+static PyObject *__pyx_tuple__65;
+static PyObject *__pyx_tuple__67;
 static PyObject *__pyx_tuple__69;
-static PyObject *__pyx_tuple__71;
-static PyObject *__pyx_tuple__73;
-static PyObject *__pyx_tuple__75;
-static PyObject *__pyx_tuple__77;
+static PyObject *__pyx_tuple__70;
+static PyObject *__pyx_tuple__72;
+static PyObject *__pyx_tuple__74;
+static PyObject *__pyx_tuple__76;
 static PyObject *__pyx_tuple__78;
-static PyObject *__pyx_tuple__80;
-static PyObject *__pyx_tuple__82;
+static PyObject *__pyx_tuple__79;
+static PyObject *__pyx_tuple__81;
+static PyObject *__pyx_tuple__83;
 static PyObject *__pyx_codeobj__42;
-static PyObject *__pyx_codeobj__47;
-static PyObject *__pyx_codeobj__49;
-static PyObject *__pyx_codeobj__51;
-static PyObject *__pyx_codeobj__53;
-static PyObject *__pyx_codeobj__55;
-static PyObject *__pyx_codeobj__57;
-static PyObject *__pyx_codeobj__59;
-static PyObject *__pyx_codeobj__62;
-static PyObject *__pyx_codeobj__65;
-static PyObject *__pyx_codeobj__67;
-static PyObject *__pyx_codeobj__70;
-static PyObject *__pyx_codeobj__72;
-static PyObject *__pyx_codeobj__74;
-static PyObject *__pyx_codeobj__76;
-static PyObject *__pyx_codeobj__79;
-static PyObject *__pyx_codeobj__81;
-static PyObject *__pyx_codeobj__83;
+static PyObject *__pyx_codeobj__48;
+static PyObject *__pyx_codeobj__50;
+static PyObject *__pyx_codeobj__52;
+static PyObject *__pyx_codeobj__54;
+static PyObject *__pyx_codeobj__56;
+static PyObject *__pyx_codeobj__58;
+static PyObject *__pyx_codeobj__60;
+static PyObject *__pyx_codeobj__63;
+static PyObject *__pyx_codeobj__66;
+static PyObject *__pyx_codeobj__68;
+static PyObject *__pyx_codeobj__71;
+static PyObject *__pyx_codeobj__73;
+static PyObject *__pyx_codeobj__75;
+static PyObject *__pyx_codeobj__77;
+static PyObject *__pyx_codeobj__80;
+static PyObject *__pyx_codeobj__82;
+static PyObject *__pyx_codeobj__84;
 
 /* "lxml/html/clean.py":78
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
@@ -2224,7 +2290,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 218, __pyx_L1_error)
         }
         break;
@@ -2293,7 +2359,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
  *                 raise TypeError(
  *                     "Unknown parameter: %s=%r" % (name, value))
  */
-    __pyx_t_9 = __Pyx_HasAttr(__pyx_v_self, __pyx_v_name); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_HasAttr(__pyx_v_self, __pyx_v_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 219, __pyx_L1_error)
     __pyx_t_10 = ((!(__pyx_t_9 != 0)) != 0);
     if (__pyx_t_10) {
 
@@ -2351,7 +2417,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
  *         if self.inline_style is None and 'inline_style' not in kw:
  *             self.inline_style = self.style
  */
-    __pyx_t_11 = PyObject_SetAttr(__pyx_v_self, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 222, __pyx_L1_error)
+    __pyx_t_11 = PyObject_SetAttr(__pyx_v_self, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 222, __pyx_L1_error)
 
     /* "lxml/html/clean.py":218
  * 
@@ -2547,7 +2613,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *             # ElementTree instance, instead of an element
  *             doc = doc.getroot()
  */
-  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_doc, __pyx_n_s_getroot); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 252, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_doc, __pyx_n_s_getroot); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 252, __pyx_L1_error)
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
@@ -2689,7 +2755,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 259, __pyx_L1_error)
         }
         break;
@@ -2896,7 +2962,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *         if self.safe_attrs_only:
  *             safe_attrs = set(self.safe_attrs)
  */
-    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_script); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
+    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_script); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 271, __pyx_L1_error)
 
     /* "lxml/html/clean.py":270
  *         allow_tags = set(self.allow_tags or ())
@@ -3028,7 +3094,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         if (unlikely(!__pyx_t_3)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 274, __pyx_L1_error)
           }
           break;
@@ -3110,7 +3176,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           if (unlikely(!__pyx_t_3)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(0, 276, __pyx_L1_error)
             }
             break;
@@ -3333,7 +3399,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           if (unlikely(!__pyx_t_10)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(0, 283, __pyx_L1_error)
             }
             break;
@@ -3415,7 +3481,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
             if (unlikely(!__pyx_t_10)) {
               PyObject* exc_type = PyErr_Occurred();
               if (exc_type) {
-                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                 else __PYX_ERR(0, 285, __pyx_L1_error)
               }
               break;
@@ -3512,7 +3578,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *             # If we're deleting style then we don't have to remove JS links
  *             # from styles, otherwise...
  */
-    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_resolve_base_href, Py_False) < 0) __PYX_ERR(0, 289, __pyx_L1_error)
 
@@ -3629,7 +3695,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           if (unlikely(!__pyx_t_10)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(0, 293, __pyx_L1_error)
             }
             break;
@@ -4411,7 +4477,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Comment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_t_5); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 320, __pyx_L1_error)
+    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_t_5); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 320, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
     /* "lxml/html/clean.py":316
@@ -4448,7 +4514,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 322, __pyx_L1_error)
+    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 322, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
     /* "lxml/html/clean.py":321
@@ -4480,7 +4546,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *         if self.inline_style:
  *             etree.strip_attributes(doc, 'style')
  */
-    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_style); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_style); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 324, __pyx_L1_error)
 
     /* "lxml/html/clean.py":323
  *         if self.processing_instructions:
@@ -4592,7 +4658,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *         elif self.style or self.javascript:
  *             # We must get rid of included stylesheets if Javascript is not
  */
-    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_link); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 328, __pyx_L1_error)
+    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_link); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error)
 
     /* "lxml/html/clean.py":327
  *         if self.inline_style:
@@ -4838,7 +4904,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *         if self.page_structure:
  *             remove_tags.update(('head', 'html', 'title'))
  */
-    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_meta); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 338, __pyx_L1_error)
+    __pyx_t_9 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_meta); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 338, __pyx_L1_error)
 
     /* "lxml/html/clean.py":337
  *                     if not self.allow_element(el):
@@ -5228,7 +5294,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *             kill_tags.update(('button', 'input', 'select', 'textarea'))
  *         if self.annoying_tags:
  */
-    __pyx_t_9 = PySet_Add(__pyx_v_remove_tags, __pyx_n_s_form); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 361, __pyx_L1_error)
+    __pyx_t_9 = PySet_Add(__pyx_v_remove_tags, __pyx_n_s_form); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 361, __pyx_L1_error)
 
     /* "lxml/html/clean.py":362
  *         if self.forms:
@@ -5373,7 +5439,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       if (unlikely(!__pyx_t_6)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 368, __pyx_L1_error)
         }
         break;
@@ -5478,7 +5544,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *             elif el.tag in remove_tags:
  *                 if self.allow_element(el):
  */
-      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v__kill, __pyx_v_el); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 372, __pyx_L1_error)
+      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v__kill, __pyx_v_el); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 372, __pyx_L1_error)
 
       /* "lxml/html/clean.py":369
  *         _kill = []
@@ -5585,7 +5651,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  * 
  *         if _remove and _remove[0] == doc:
  */
-      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v__remove, __pyx_v_el); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 376, __pyx_L1_error)
+      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v__remove, __pyx_v_el); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 376, __pyx_L1_error)
 
       /* "lxml/html/clean.py":373
  *                     continue
@@ -5806,7 +5872,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *         for el in _kill:
  *             el.drop_tree()
  */
-  __pyx_t_9 = PyList_Reverse(__pyx_v__kill); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 392, __pyx_L1_error)
+  __pyx_t_9 = PyList_Reverse(__pyx_v__kill); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 392, __pyx_L1_error)
 
   /* "lxml/html/clean.py":393
  * 
@@ -6078,7 +6144,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         if (unlikely(!__pyx_t_5)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 405, __pyx_L1_error)
           }
           break;
@@ -6109,7 +6175,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *             if bad:
  *                 if bad[0] is doc:
  */
-        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 407, __pyx_L1_error)
+        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 407, __pyx_L1_error)
 
         /* "lxml/html/clean.py":406
  *             bad = []
@@ -6390,7 +6456,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         if (unlikely(!__pyx_t_6)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 416, __pyx_L1_error)
           }
           break;
@@ -6482,15 +6548,6 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_rel); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 419, __pyx_L1_error)
         if (__pyx_t_1) {
 
-          /* "lxml/html/clean.py":421
- *                     if rel:
- *                         if ('nofollow' in rel
- *                                 and ' nofollow ' in (' %s ' % rel)):             # <<<<<<<<<<<<<<
- *                             continue
- *                         rel = '%s nofollow' % rel
- */
-          __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_nofollow, __pyx_v_rel, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
-
           /* "lxml/html/clean.py":420
  *                     rel = el.get('rel')
  *                     if rel:
@@ -6498,6 +6555,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *                                 and ' nofollow ' in (' %s ' % rel)):
  *                             continue
  */
+          __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_nofollow, __pyx_v_rel, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
           __pyx_t_14 = (__pyx_t_2 != 0);
           if (__pyx_t_14) {
           } else {
@@ -7015,7 +7073,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
         if (unlikely(!__pyx_t_1)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 439, __pyx_L1_error)
           }
           break;
@@ -8385,7 +8443,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 477, __pyx_L1_error)
         }
         break;
@@ -8457,7 +8515,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
  *         for el in bad:
  *             el.drop_tree()
  */
-      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 479, __pyx_L1_error)
+      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 479, __pyx_L1_error)
 
       /* "lxml/html/clean.py":478
  *         bad = []
@@ -9259,7 +9317,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
  */
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 516, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 516, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
@@ -9836,7 +9894,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
         if (unlikely(!__pyx_t_1)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 569, __pyx_L1_error)
           }
           break;
@@ -9933,7 +9991,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
     __Pyx_INCREF(__pyx_v_child);
     __Pyx_GIVEREF(__pyx_v_child);
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_child);
-    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_link_regexes, __pyx_v_link_regexes) < 0) __PYX_ERR(0, 573, __pyx_L1_error)
 
@@ -10037,7 +10095,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  *             if tail_children:
  *                 child.tail = text
  */
-      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 579, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 579, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_makeelement); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
@@ -10287,7 +10345,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  *         if pre_children:
  *             el.text = text
  */
-    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_makeelement); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 586, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
@@ -10662,7 +10720,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         if (unlikely(!__pyx_t_1)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 597, __pyx_L1_error)
           }
           break;
@@ -10707,7 +10765,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         __Pyx_INCREF(__pyx_v_text);
         __Pyx_GIVEREF(__pyx_v_text);
         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text);
-        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pos, __pyx_v_regex_pos) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
         __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error)
@@ -10801,7 +10859,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
             if (unlikely(!__pyx_t_7)) {
               PyObject* exc_type = PyErr_Occurred();
               if (exc_type) {
-                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                 else __PYX_ERR(0, 604, __pyx_L1_error)
               }
               break;
@@ -11602,7 +11660,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  *         text = text[end:]
  *     return leading_text, links
  */
-    __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_links, __pyx_v_anchor); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 645, __pyx_L1_error)
+    __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_links, __pyx_v_anchor); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 645, __pyx_L1_error)
 
     /* "lxml/html/clean.py":646
  *         anchor.text = body
@@ -11789,7 +11847,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
  */
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 651, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 651, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
@@ -12346,7 +12404,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
         if (unlikely(!__pyx_t_2)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 692, __pyx_L1_error)
           }
           break;
@@ -12569,7 +12627,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
       if (unlikely(!__pyx_t_2)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 700, __pyx_L1_error)
         }
         break;
@@ -12593,7 +12651,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
     __Pyx_INCREF(__pyx_v_child);
     __Pyx_GIVEREF(__pyx_v_child);
     PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_child);
-    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_max_width, __pyx_v_max_width) < 0) __PYX_ERR(0, 701, __pyx_L1_error)
 
@@ -13194,7 +13252,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
       if (unlikely(!__pyx_t_2)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 716, __pyx_L1_error)
         }
         break;
@@ -13211,7 +13269,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
  *             replacement = _insert_break(word, max_width, break_character)
  *             text = text.replace(word, replacement)
  */
-    __pyx_t_6 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
+    __pyx_t_6 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 717, __pyx_L1_error)
     __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_max_width, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error)
@@ -13521,7 +13579,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
  *         breaks = list(_break_prefer_re.finditer(start))
  */
   while (1) {
-    __pyx_t_1 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 727, __pyx_L1_error)
+    __pyx_t_1 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 727, __pyx_L1_error)
     __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_width, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error)
@@ -13734,7 +13792,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
  *     result += word
  *     return result
  */
-    __pyx_t_1 = PyObject_Length(__pyx_v_start); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 738, __pyx_L1_error)
+    __pyx_t_1 = PyObject_Length(__pyx_v_start); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 738, __pyx_L1_error)
     __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_word, __pyx_t_1, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 738, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF_SET(__pyx_v_word, __pyx_t_6);
@@ -13797,17 +13855,31 @@ static PyMethodDef __pyx_methods[] = {
 };
 
 #if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec_clean(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+  {Py_mod_create, (void*)__pyx_pymod_create},
+  {Py_mod_exec, (void*)__pyx_pymod_exec_clean},
+  {0, NULL}
+};
+#endif
+
 static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
     PyModuleDef_HEAD_INIT,
-  #endif
     "clean",
     __pyx_k_A_cleanup_tool_for_HTML_Removes, /* m_doc */
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    0, /* m_size */
+  #else
     -1, /* m_size */
+  #endif
     __pyx_methods /* m_methods */,
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    __pyx_moduledef_slots, /* m_slots */
+  #else
     NULL, /* m_reload */
+  #endif
     NULL, /* m_traverse */
     NULL, /* m_clear */
     (freefunc)__pyx_module_cleanup /* m_free */
@@ -13848,7 +13920,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_kp_s__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 0, 1, 0},
   {&__pyx_kp_s__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 1, 0},
   {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0},
-  {&__pyx_kp_s__63, __pyx_k__63, sizeof(__pyx_k__63), 0, 0, 1, 0},
+  {&__pyx_kp_s__64, __pyx_k__64, sizeof(__pyx_k__64), 0, 0, 1, 0},
   {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
   {&__pyx_kp_s_a_z, __pyx_k_a_z, sizeof(__pyx_k_a_z), 0, 0, 1, 0},
   {&__pyx_n_s_add_nofollow, __pyx_k_add_nofollow, sizeof(__pyx_k_add_nofollow), 0, 0, 1, 1},
@@ -14449,7 +14521,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 78, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__41);
   __Pyx_GIVEREF(__pyx_tuple__41);
-  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_is_javascript_scheme, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 78, __pyx_L1_error)
+  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_is_javascript_scheme, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 78, __pyx_L1_error)
 
   /* "lxml/html/clean.py":83
  *     return _is_possibly_malicious_scheme(s)
@@ -14484,6 +14556,17 @@ static int __Pyx_InitCachedConstants(void) {
   __Pyx_GOTREF(__pyx_tuple__45);
   __Pyx_GIVEREF(__pyx_tuple__45);
 
+  /* "lxml/html/clean.py":99
+ * 
+ * 
+ * class Cleaner(object):             # <<<<<<<<<<<<<<
+ *     """
+ *     Instances cleans the document of each of the possible offending
+ */
+  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__46);
+  __Pyx_GIVEREF(__pyx_tuple__46);
+
   /* "lxml/html/clean.py":217
  *     whitelist_tags = set(['iframe', 'embed'])
  * 
@@ -14491,10 +14574,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         for name, value in kw.items():
  *             if not hasattr(self, name):
  */
-  __pyx_tuple__46 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_kw, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 217, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__46);
-  __Pyx_GIVEREF(__pyx_tuple__46);
-  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_init, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_kw, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
+  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_init, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 217, __pyx_L1_error)
 
   /* "lxml/html/clean.py":248
  *         )
@@ -14503,10 +14586,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """
  *         Cleans the document.
  */
-  __pyx_tuple__48 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_el, __pyx_n_s_kill_tags, __pyx_n_s_remove_tags, __pyx_n_s_allow_tags, __pyx_n_s_safe_attrs, __pyx_n_s_attrib, __pyx_n_s_aname, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_found_parent, __pyx_n_s_parent, __pyx_n_s_remove, __pyx_n_s_kill, __pyx_n_s_bad, __pyx_n_s_rel); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 248, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__48);
-  __Pyx_GIVEREF(__pyx_tuple__48);
-  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_call, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 248, __pyx_L1_error)
+  __pyx_tuple__49 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_el, __pyx_n_s_kill_tags, __pyx_n_s_remove_tags, __pyx_n_s_allow_tags, __pyx_n_s_safe_attrs, __pyx_n_s_attrib, __pyx_n_s_aname, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_found_parent, __pyx_n_s_parent, __pyx_n_s_remove, __pyx_n_s_kill, __pyx_n_s_bad, __pyx_n_s_rel); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 248, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
+  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_call, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 248, __pyx_L1_error)
 
   /* "lxml/html/clean.py":428
  *                     el.set('rel', rel)
@@ -14515,10 +14598,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """
  *         Override to suppress rel="nofollow" on some anchors.
  */
-  __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_anchor); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 428, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__50);
-  __Pyx_GIVEREF(__pyx_tuple__50);
-  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_follow, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 428, __pyx_L1_error)
+  __pyx_tuple__51 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_anchor); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 428, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__51);
+  __Pyx_GIVEREF(__pyx_tuple__51);
+  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_follow, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 428, __pyx_L1_error)
 
   /* "lxml/html/clean.py":434
  *         return False
@@ -14527,10 +14610,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if el.tag not in self._tag_link_attrs:
  *             return False
  */
-  __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_attr, __pyx_n_s_one_attr, __pyx_n_s_url); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 434, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__52);
-  __Pyx_GIVEREF(__pyx_tuple__52);
-  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_element, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 434, __pyx_L1_error)
+  __pyx_tuple__53 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_attr, __pyx_n_s_one_attr, __pyx_n_s_url); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 434, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__53);
+  __Pyx_GIVEREF(__pyx_tuple__53);
+  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_element, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 434, __pyx_L1_error)
 
   /* "lxml/html/clean.py":452
  *             return self.allow_embedded_url(el, url)
@@ -14539,10 +14622,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         if (self.whitelist_tags is not None
  *             and el.tag not in self.whitelist_tags):
  */
-  __pyx_tuple__54 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_url, __pyx_n_s_scheme, __pyx_n_s_netloc, __pyx_n_s_path, __pyx_n_s_query, __pyx_n_s_fragment); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 452, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__54);
-  __Pyx_GIVEREF(__pyx_tuple__54);
-  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_embedded_url, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 452, __pyx_L1_error)
+  __pyx_tuple__55 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_url, __pyx_n_s_scheme, __pyx_n_s_netloc, __pyx_n_s_path, __pyx_n_s_query, __pyx_n_s_fragment); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__55);
+  __Pyx_GIVEREF(__pyx_tuple__55);
+  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_embedded_url, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 452, __pyx_L1_error)
 
   /* "lxml/html/clean.py":464
  *         return False
@@ -14551,10 +14634,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """
  *         IE conditional comments basically embed HTML that the parser
  */
-  __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_bad); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 464, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__56);
-  __Pyx_GIVEREF(__pyx_tuple__56);
-  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_conditional_comments, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __pyx_tuple__57 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_bad); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__57);
+  __Pyx_GIVEREF(__pyx_tuple__57);
+  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_conditional_comments, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 464, __pyx_L1_error)
 
   /* "lxml/html/clean.py":475
  *             etree.Comment)
@@ -14563,13 +14646,13 @@ static int __Pyx_InitCachedConstants(void) {
  *         bad = []
  *         for el in doc.iter(iterate):
  */
-  __pyx_tuple__58 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_condition, __pyx_n_s_iterate, __pyx_n_s_bad, __pyx_n_s_el); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 475, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__58);
-  __Pyx_GIVEREF(__pyx_tuple__58);
-  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_elements, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 475, __pyx_L1_error)
-  __pyx_tuple__60 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 475, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__60);
-  __Pyx_GIVEREF(__pyx_tuple__60);
+  __pyx_tuple__59 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_condition, __pyx_n_s_iterate, __pyx_n_s_bad, __pyx_n_s_el); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 475, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__59);
+  __Pyx_GIVEREF(__pyx_tuple__59);
+  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_elements, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 475, __pyx_L1_error)
+  __pyx_tuple__61 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 475, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__61);
+  __Pyx_GIVEREF(__pyx_tuple__61);
 
   /* "lxml/html/clean.py":483
  *             el.drop_tree()
@@ -14578,10 +14661,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         # links like "j a v a s c r i p t:" might be interpreted in IE
  *         new = _substitute_whitespace('', link)
  */
-  __pyx_tuple__61 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_link, __pyx_n_s_new); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 483, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__61);
-  __Pyx_GIVEREF(__pyx_tuple__61);
-  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_remove_javascript_link, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 483, __pyx_L1_error)
+  __pyx_tuple__62 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_link, __pyx_n_s_new); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 483, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__62);
+  __Pyx_GIVEREF(__pyx_tuple__62);
+  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_remove_javascript_link, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 483, __pyx_L1_error)
 
   /* "lxml/html/clean.py":493
  *     _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
@@ -14590,10 +14673,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         """
  *         Depending on the browser, stuff like ``e x p r e s s i o n(...)``
  */
-  __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_style); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 493, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__64);
-  __Pyx_GIVEREF(__pyx_tuple__64);
-  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_has_sneaky_javascript, 493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_style); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__65);
+  __Pyx_GIVEREF(__pyx_tuple__65);
+  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_has_sneaky_javascript, 493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 493, __pyx_L1_error)
 
   /* "lxml/html/clean.py":514
  *         return False
@@ -14602,10 +14685,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         result_type = type(html)
  *         if isinstance(html, basestring):
  */
-  __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_html, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 514, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__66);
-  __Pyx_GIVEREF(__pyx_tuple__66);
-  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_clean_html, 514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 514, __pyx_L1_error)
+  __pyx_tuple__67 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_html, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 514, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__67);
+  __Pyx_GIVEREF(__pyx_tuple__67);
+  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_clean_html, 514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 514, __pyx_L1_error)
 
   /* "lxml/html/clean.py":541
  *     re.compile(r'^localhost', re.I),
@@ -14614,9 +14697,9 @@ static int __Pyx_InitCachedConstants(void) {
  *     ]
  * 
  */
-  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_127_0_0_1); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 541, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__68);
-  __Pyx_GIVEREF(__pyx_tuple__68);
+  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_127_0_0_1); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 541, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__69);
+  __Pyx_GIVEREF(__pyx_tuple__69);
 
   /* "lxml/html/clean.py":546
  * _avoid_classes = ['nolink']
@@ -14625,10 +14708,10 @@ static int __Pyx_InitCachedConstants(void) {
  *              avoid_elements=_avoid_elements,
  *              avoid_hosts=_avoid_hosts,
  */
-  __pyx_tuple__69 = PyTuple_Pack(12, __pyx_n_s_el, __pyx_n_s_link_regexes, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_hosts, __pyx_n_s_avoid_classes, __pyx_n_s_class_name, __pyx_n_s_match_class, __pyx_n_s_child, __pyx_n_s_text, __pyx_n_s_tail_children, __pyx_n_s_index, __pyx_n_s_pre_children); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 546, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__69);
-  __Pyx_GIVEREF(__pyx_tuple__69);
-  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink, 546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 546, __pyx_L1_error)
+  __pyx_tuple__70 = PyTuple_Pack(12, __pyx_n_s_el, __pyx_n_s_link_regexes, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_hosts, __pyx_n_s_avoid_classes, __pyx_n_s_class_name, __pyx_n_s_match_class, __pyx_n_s_child, __pyx_n_s_text, __pyx_n_s_tail_children, __pyx_n_s_index, __pyx_n_s_pre_children); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 546, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__70);
+  __Pyx_GIVEREF(__pyx_tuple__70);
+  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink, 546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 546, __pyx_L1_error)
 
   /* "lxml/html/clean.py":591
  *             el[:0] = pre_children
@@ -14637,10 +14720,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     leading_text = ''
  *     links = []
  */
-  __pyx_tuple__71 = PyTuple_Pack(19, __pyx_n_s_text, __pyx_n_s_link_regexes, __pyx_n_s_avoid_hosts, __pyx_n_s_factory, __pyx_n_s_leading_text, __pyx_n_s_links, __pyx_n_s_last_pos, __pyx_n_s_best_match, __pyx_n_s_best_pos, __pyx_n_s_regex, __pyx_n_s_regex_pos, __pyx_n_s_match, __pyx_n_s_host, __pyx_n_s_host_regex, __pyx_n_s_link, __pyx_n_s_end, __pyx_n_s_prev_text, __pyx_n_s_anchor, __pyx_n_s_body); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 591, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__71);
-  __Pyx_GIVEREF(__pyx_tuple__71);
-  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_link_text, 591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 591, __pyx_L1_error)
+  __pyx_tuple__72 = PyTuple_Pack(19, __pyx_n_s_text, __pyx_n_s_link_regexes, __pyx_n_s_avoid_hosts, __pyx_n_s_factory, __pyx_n_s_leading_text, __pyx_n_s_links, __pyx_n_s_last_pos, __pyx_n_s_best_match, __pyx_n_s_best_pos, __pyx_n_s_regex, __pyx_n_s_regex_pos, __pyx_n_s_match, __pyx_n_s_host, __pyx_n_s_host_regex, __pyx_n_s_link, __pyx_n_s_end, __pyx_n_s_prev_text, __pyx_n_s_anchor, __pyx_n_s_body); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 591, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__72);
+  __Pyx_GIVEREF(__pyx_tuple__72);
+  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_link_text, 591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 591, __pyx_L1_error)
 
   /* "lxml/html/clean.py":649
  *     return leading_text, links
@@ -14649,10 +14732,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     result_type = type(html)
  *     if isinstance(html, basestring):
  */
-  __pyx_tuple__73 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 649, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__73);
-  __Pyx_GIVEREF(__pyx_tuple__73);
-  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink_html, 649, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 649, __pyx_L1_error)
+  __pyx_tuple__74 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 649, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__74);
+  __Pyx_GIVEREF(__pyx_tuple__74);
+  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink_html, 649, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 649, __pyx_L1_error)
 
   /* "lxml/html/clean.py":667
  * _avoid_word_break_classes = ['nobreak']
@@ -14661,10 +14744,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                avoid_elements=_avoid_word_break_elements,
  *                avoid_classes=_avoid_word_break_classes,
  */
-  __pyx_tuple__75 = PyTuple_Pack(9, __pyx_n_s_el, __pyx_n_s_max_width, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_classes, __pyx_n_s_break_character, __pyx_n_s_class_name, __pyx_n_s_dont_break, __pyx_n_s_avoid, __pyx_n_s_child); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 667, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__75);
-  __Pyx_GIVEREF(__pyx_tuple__75);
-  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __pyx_tuple__76 = PyTuple_Pack(9, __pyx_n_s_el, __pyx_n_s_max_width, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_classes, __pyx_n_s_break_character, __pyx_n_s_class_name, __pyx_n_s_dont_break, __pyx_n_s_avoid, __pyx_n_s_child); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__76);
+  __Pyx_GIVEREF(__pyx_tuple__76);
+  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 667, __pyx_L1_error)
 
   /* "lxml/html/clean.py":670
  *                avoid_elements=_avoid_word_break_elements,
@@ -14673,9 +14756,9 @@ static int __Pyx_InitCachedConstants(void) {
  *     """
  *     Breaks any long words found in the body of the text (not attributes).
  */
-  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_int_8203); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 670, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__77);
-  __Pyx_GIVEREF(__pyx_tuple__77);
+  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_int_8203); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 670, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__78);
+  __Pyx_GIVEREF(__pyx_tuple__78);
 
   /* "lxml/html/clean.py":708
  *             child.tail = _break_text(child.tail, max_width, break_character)
@@ -14684,10 +14767,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     result_type = type(html)
  *     doc = fromstring(html)
  */
-  __pyx_tuple__78 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 708, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__78);
-  __Pyx_GIVEREF(__pyx_tuple__78);
-  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break_html, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 708, __pyx_L1_error)
+  __pyx_tuple__79 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 708, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__79);
+  __Pyx_GIVEREF(__pyx_tuple__79);
+  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break_html, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 708, __pyx_L1_error)
 
   /* "lxml/html/clean.py":714
  *     return _transform_result(result_type, doc)
@@ -14696,10 +14779,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     words = text.split()
  *     for word in words:
  */
-  __pyx_tuple__80 = PyTuple_Pack(6, __pyx_n_s_text, __pyx_n_s_max_width, __pyx_n_s_break_character, __pyx_n_s_words, __pyx_n_s_word, __pyx_n_s_replacement); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 714, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__80);
-  __Pyx_GIVEREF(__pyx_tuple__80);
-  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_break_text, 714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 714, __pyx_L1_error)
+  __pyx_tuple__81 = PyTuple_Pack(6, __pyx_n_s_text, __pyx_n_s_max_width, __pyx_n_s_break_character, __pyx_n_s_words, __pyx_n_s_word, __pyx_n_s_replacement); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 714, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__81);
+  __Pyx_GIVEREF(__pyx_tuple__81);
+  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_break_text, 714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 714, __pyx_L1_error)
 
   /* "lxml/html/clean.py":724
  * _break_prefer_re = re.compile(r'[^a-z]', re.I)
@@ -14708,10 +14791,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     orig_word = word
  *     result = ''
  */
-  __pyx_tuple__82 = PyTuple_Pack(8, __pyx_n_s_word, __pyx_n_s_width, __pyx_n_s_break_character, __pyx_n_s_orig_word, __pyx_n_s_result, __pyx_n_s_start, __pyx_n_s_breaks, __pyx_n_s_last_break); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 724, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__82);
-  __Pyx_GIVEREF(__pyx_tuple__82);
-  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_insert_break, 724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 724, __pyx_L1_error)
+  __pyx_tuple__83 = PyTuple_Pack(8, __pyx_n_s_word, __pyx_n_s_width, __pyx_n_s_break_character, __pyx_n_s_orig_word, __pyx_n_s_result, __pyx_n_s_start, __pyx_n_s_breaks, __pyx_n_s_last_break); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 724, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__83);
+  __Pyx_GIVEREF(__pyx_tuple__83);
+  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_insert_break, 724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 724, __pyx_L1_error)
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -14739,6 +14822,47 @@ PyMODINIT_FUNC initclean(void)
 #else
 PyMODINIT_FUNC PyInit_clean(void); /*proto*/
 PyMODINIT_FUNC PyInit_clean(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+  return PyModuleDef_Init(&__pyx_moduledef);
+}
+static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
+    PyObject *value = PyObject_GetAttrString(spec, from_name);
+    int result = 0;
+    if (likely(value)) {
+        result = PyDict_SetItemString(moddict, to_name, value);
+        Py_DECREF(value);
+    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+        PyErr_Clear();
+    } else {
+        result = -1;
+    }
+    return result;
+}
+static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+    PyObject *module = NULL, *moddict, *modname;
+    if (__pyx_m)
+        return __Pyx_NewRef(__pyx_m);
+    modname = PyObject_GetAttrString(spec, "name");
+    if (unlikely(!modname)) goto bad;
+    module = PyModule_NewObject(modname);
+    Py_DECREF(modname);
+    if (unlikely(!module)) goto bad;
+    moddict = PyModule_GetDict(module);
+    if (unlikely(!moddict)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
+    return module;
+bad:
+    Py_XDECREF(module);
+    return NULL;
+}
+
+
+static int __pyx_pymod_exec_clean(PyObject *__pyx_pyinit_module)
+#endif
 #endif
 {
   PyObject *__pyx_t_1 = NULL;
@@ -14752,8 +14876,10 @@ PyMODINIT_FUNC PyInit_clean(void)
   PyObject *__pyx_t_9 = NULL;
   PyObject *__pyx_t_10 = NULL;
   PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
   __Pyx_RefNannyDeclarations
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
+  #endif
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
   if (!__Pyx_RefNanny) {
@@ -14780,6 +14906,9 @@ PyMODINIT_FUNC PyInit_clean(void)
   #ifdef __Pyx_Generator_USED
   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
+  #ifdef __Pyx_AsyncGen_USED
+  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   #ifdef __Pyx_StopAsyncIteration_USED
   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
@@ -14791,12 +14920,17 @@ PyMODINIT_FUNC PyInit_clean(void)
   #endif
   #endif
   /*--- Module creation code ---*/
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  __pyx_m = __pyx_pyinit_module;
+  Py_INCREF(__pyx_m);
+  #else
   #if PY_MAJOR_VERSION < 3
   __pyx_m = Py_InitModule4("clean", __pyx_methods, __pyx_k_A_cleanup_tool_for_HTML_Removes, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
   Py_INCREF(__pyx_d);
   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
@@ -14911,7 +15045,6 @@ PyMODINIT_FUNC PyInit_clean(void)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L7_try_end;
     __pyx_L2_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -14965,14 +15098,12 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     from urlparse import urlsplit
  * except ImportError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L1_error;
     __pyx_L3_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -15118,7 +15249,6 @@ PyMODINIT_FUNC PyInit_clean(void)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     goto __pyx_L15_try_end;
     __pyx_L10_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -15163,14 +15293,12 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     unichr
  * except NameError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
     goto __pyx_L1_error;
     __pyx_L11_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
@@ -15218,7 +15346,6 @@ PyMODINIT_FUNC PyInit_clean(void)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L23_try_end;
     __pyx_L18_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -15263,14 +15390,12 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     unicode
  * except NameError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L1_error;
     __pyx_L19_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -15318,7 +15443,6 @@ PyMODINIT_FUNC PyInit_clean(void)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     goto __pyx_L31_try_end;
     __pyx_L26_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -15363,14 +15487,12 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     bytes
  * except NameError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
     goto __pyx_L1_error;
     __pyx_L27_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_2);
@@ -15418,7 +15540,6 @@ PyMODINIT_FUNC PyInit_clean(void)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L39_try_end;
     __pyx_L34_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -15474,14 +15595,12 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     basestring
  * except NameError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
     goto __pyx_L1_error;
     __pyx_L35_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
@@ -15992,9 +16111,9 @@ PyMODINIT_FUNC PyInit_clean(void)
  * 
  * 
  */
-  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_XHTML_NAMESPACE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
@@ -16024,15 +16143,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     """
  *     Instances cleans the document of each of the possible offending
  */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_builtin_object);
-  __Pyx_GIVEREF(__pyx_builtin_object);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
-  __pyx_t_9 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__46, __pyx_n_s_Cleaner, __pyx_n_s_Cleaner, (PyObject *) NULL, __pyx_n_s_lxml_html_clean, __pyx_kp_s_Instances_cleans_the_document_o); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_9, __pyx_t_1, __pyx_n_s_Cleaner, __pyx_n_s_Cleaner, (PyObject *) NULL, __pyx_n_s_lxml_html_clean, __pyx_kp_s_Instances_cleans_the_document_o); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_8);
 
   /* "lxml/html/clean.py":194
  *     """
@@ -16041,7 +16155,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     javascript = True
  *     comments = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_scripts, Py_True) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_scripts, Py_True) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
 
   /* "lxml/html/clean.py":195
  * 
@@ -16050,7 +16164,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     comments = True
  *     style = False
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_javascript, Py_True) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_javascript, Py_True) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
 
   /* "lxml/html/clean.py":196
  *     scripts = True
@@ -16059,7 +16173,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     style = False
  *     inline_style = None
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_comments, Py_True) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_comments, Py_True) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
 
   /* "lxml/html/clean.py":197
  *     javascript = True
@@ -16068,7 +16182,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     inline_style = None
  *     links = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_style, Py_False) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_style, Py_False) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
 
   /* "lxml/html/clean.py":198
  *     comments = True
@@ -16077,7 +16191,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     links = True
  *     meta = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_inline_style, Py_None) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_inline_style, Py_None) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
 
   /* "lxml/html/clean.py":199
  *     style = False
@@ -16086,7 +16200,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     meta = True
  *     page_structure = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_links, Py_True) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_links, Py_True) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
 
   /* "lxml/html/clean.py":200
  *     inline_style = None
@@ -16095,7 +16209,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     page_structure = True
  *     processing_instructions = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_meta, Py_True) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_meta, Py_True) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
 
   /* "lxml/html/clean.py":201
  *     links = True
@@ -16104,7 +16218,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     processing_instructions = True
  *     embedded = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_page_structure, Py_True) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_page_structure, Py_True) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
 
   /* "lxml/html/clean.py":202
  *     meta = True
@@ -16113,7 +16227,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     embedded = True
  *     frames = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_processing_instructions, Py_True) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_processing_instructions, Py_True) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
 
   /* "lxml/html/clean.py":203
  *     page_structure = True
@@ -16122,7 +16236,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     frames = True
  *     forms = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_embedded, Py_True) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_embedded, Py_True) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
 
   /* "lxml/html/clean.py":204
  *     processing_instructions = True
@@ -16131,7 +16245,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     forms = True
  *     annoying_tags = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_frames, Py_True) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_frames, Py_True) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
 
   /* "lxml/html/clean.py":205
  *     embedded = True
@@ -16140,7 +16254,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     annoying_tags = True
  *     remove_tags = None
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_forms, Py_True) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_forms, Py_True) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
 
   /* "lxml/html/clean.py":206
  *     frames = True
@@ -16149,7 +16263,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     remove_tags = None
  *     allow_tags = None
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_annoying_tags, Py_True) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_annoying_tags, Py_True) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
 
   /* "lxml/html/clean.py":207
  *     forms = True
@@ -16158,7 +16272,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     allow_tags = None
  *     kill_tags = None
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_remove_tags, Py_None) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_remove_tags, Py_None) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
 
   /* "lxml/html/clean.py":208
  *     annoying_tags = True
@@ -16167,7 +16281,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     kill_tags = None
  *     remove_unknown_tags = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_allow_tags, Py_None) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_allow_tags, Py_None) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
 
   /* "lxml/html/clean.py":209
  *     remove_tags = None
@@ -16176,7 +16290,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     remove_unknown_tags = True
  *     safe_attrs_only = True
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_kill_tags, Py_None) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_kill_tags, Py_None) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
 
   /* "lxml/html/clean.py":210
  *     allow_tags = None
@@ -16185,7 +16299,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     safe_attrs_only = True
  *     safe_attrs = defs.safe_attrs
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_remove_unknown_tags, Py_True) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_remove_unknown_tags, Py_True) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
 
   /* "lxml/html/clean.py":211
  *     kill_tags = None
@@ -16194,7 +16308,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     safe_attrs = defs.safe_attrs
  *     add_nofollow = False
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_safe_attrs_only, Py_True) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_safe_attrs_only, Py_True) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
 
   /* "lxml/html/clean.py":212
  *     remove_unknown_tags = True
@@ -16203,13 +16317,13 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     add_nofollow = False
  *     host_whitelist = ()
  */
-  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_defs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_safe_attrs, __pyx_t_5) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_safe_attrs, __pyx_t_7) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "lxml/html/clean.py":213
  *     safe_attrs_only = True
@@ -16218,7 +16332,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     host_whitelist = ()
  *     whitelist_tags = set(['iframe', 'embed'])
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_add_nofollow, Py_False) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_add_nofollow, Py_False) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
 
   /* "lxml/html/clean.py":214
  *     safe_attrs = defs.safe_attrs
@@ -16227,7 +16341,7 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     whitelist_tags = set(['iframe', 'embed'])
  * 
  */
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_host_whitelist, __pyx_empty_tuple) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_host_whitelist, __pyx_empty_tuple) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
 
   /* "lxml/html/clean.py":215
  *     add_nofollow = False
@@ -16236,12 +16350,12 @@ PyMODINIT_FUNC PyInit_clean(void)
  * 
  *     def __init__(self, **kw):
  */
-  __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PySet_Add(__pyx_t_7, __pyx_n_s_iframe) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
-  if (PySet_Add(__pyx_t_7, __pyx_n_s_embed) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_whitelist_tags, __pyx_t_7) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PySet_Add(__pyx_t_5, __pyx_n_s_iframe) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_5, __pyx_n_s_embed) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_whitelist_tags, __pyx_t_5) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":217
  *     whitelist_tags = set(['iframe', 'embed'])
@@ -16250,10 +16364,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         for name, value in kw.items():
  *             if not hasattr(self, name):
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_1__init__, 0, __pyx_n_s_Cleaner___init, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_1__init__, 0, __pyx_n_s_Cleaner___init, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":229
  *     # removal:
@@ -16262,10 +16376,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         link='href',
  *         # From: http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html
  */
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_script, __pyx_n_s_src) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_link, __pyx_n_s_href) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_script, __pyx_n_s_src) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_link, __pyx_n_s_href) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
 
   /* "lxml/html/clean.py":233
  *         # From: http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html
@@ -16274,22 +16388,22 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         iframe='src',
  *         embed='src',
  */
-  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
   __Pyx_INCREF(__pyx_n_s_code);
   __Pyx_GIVEREF(__pyx_n_s_code);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_code);
+  PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_code);
   __Pyx_INCREF(__pyx_n_s_object);
   __Pyx_GIVEREF(__pyx_n_s_object);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_object);
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_applet, __pyx_t_5) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
+  PyList_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_object);
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_applet, __pyx_t_8) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_iframe, __pyx_n_s_src) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_embed, __pyx_n_s_src) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_layer, __pyx_n_s_src) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_a, __pyx_n_s_href) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_tag_link_attrs, __pyx_t_5) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_iframe, __pyx_n_s_src) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_embed, __pyx_n_s_src) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_layer, __pyx_n_s_src) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_a, __pyx_n_s_href) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_tag_link_attrs, __pyx_t_7) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "lxml/html/clean.py":248
  *         )
@@ -16298,10 +16412,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         """
  *         Cleans the document.
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_3__call__, 0, __pyx_n_s_Cleaner___call, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_call, __pyx_t_7) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_3__call__, 0, __pyx_n_s_Cleaner___call, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_call, __pyx_t_5) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":428
  *                     el.set('rel', rel)
@@ -16310,10 +16424,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         """
  *         Override to suppress rel="nofollow" on some anchors.
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_5allow_follow, 0, __pyx_n_s_Cleaner_allow_follow, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_allow_follow, __pyx_t_7) < 0) __PYX_ERR(0, 428, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_5allow_follow, 0, __pyx_n_s_Cleaner_allow_follow, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_allow_follow, __pyx_t_5) < 0) __PYX_ERR(0, 428, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":434
  *         return False
@@ -16322,10 +16436,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         if el.tag not in self._tag_link_attrs:
  *             return False
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_7allow_element, 0, __pyx_n_s_Cleaner_allow_element, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_allow_element, __pyx_t_7) < 0) __PYX_ERR(0, 434, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_7allow_element, 0, __pyx_n_s_Cleaner_allow_element, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_allow_element, __pyx_t_5) < 0) __PYX_ERR(0, 434, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":452
  *             return self.allow_embedded_url(el, url)
@@ -16334,10 +16448,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         if (self.whitelist_tags is not None
  *             and el.tag not in self.whitelist_tags):
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_9allow_embedded_url, 0, __pyx_n_s_Cleaner_allow_embedded_url, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_allow_embedded_url, __pyx_t_7) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_9allow_embedded_url, 0, __pyx_n_s_Cleaner_allow_embedded_url, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_allow_embedded_url, __pyx_t_5) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":464
  *         return False
@@ -16346,10 +16460,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         """
  *         IE conditional comments basically embed HTML that the parser
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_11kill_conditional_comments, 0, __pyx_n_s_Cleaner_kill_conditional_comment_2, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_kill_conditional_comments, __pyx_t_7) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_11kill_conditional_comments, 0, __pyx_n_s_Cleaner_kill_conditional_comment_2, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_kill_conditional_comments, __pyx_t_5) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":475
  *             etree.Comment)
@@ -16358,11 +16472,11 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         bad = []
  *         for el in doc.iter(iterate):
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_13_kill_elements, 0, __pyx_n_s_Cleaner__kill_elements, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__60);
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_kill_elements, __pyx_t_7) < 0) __PYX_ERR(0, 475, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_13_kill_elements, 0, __pyx_n_s_Cleaner__kill_elements, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__61);
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_kill_elements, __pyx_t_5) < 0) __PYX_ERR(0, 475, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":483
  *             el.drop_tree()
@@ -16371,10 +16485,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         # links like "j a v a s c r i p t:" might be interpreted in IE
  *         new = _substitute_whitespace('', link)
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_15_remove_javascript_link, 0, __pyx_n_s_Cleaner__remove_javascript_link, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_remove_javascript_link, __pyx_t_7) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_15_remove_javascript_link, 0, __pyx_n_s_Cleaner__remove_javascript_link, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_remove_javascript_link, __pyx_t_5) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":491
  *         return link
@@ -16383,68 +16497,68 @@ PyMODINIT_FUNC PyInit_clean(void)
  * 
  *     def _has_sneaky_javascript(self, style):
  */
-  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 491, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 491, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_compile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 491, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 491, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_S); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 491, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_10);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_S); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 491, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_11);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = NULL;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_8 = NULL;
   __pyx_t_6 = 0;
-  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
-    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
-    if (likely(__pyx_t_5)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
-      __Pyx_INCREF(__pyx_t_5);
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_8)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_8);
       __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_10, function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
       __pyx_t_6 = 1;
     }
   }
   #if CYTHON_FAST_PYCALL
-  if (PyFunction_Check(__pyx_t_10)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s__63, __pyx_t_11};
-    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 491, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  if (PyFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_s__64, __pyx_t_10};
+    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
-  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s__63, __pyx_t_11};
-    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 491, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_s__64, __pyx_t_10};
+    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   } else
   #endif
   {
-    __pyx_t_12 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 491, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_12);
-    if (__pyx_t_5) {
-      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL;
+    __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 491, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_11);
+    if (__pyx_t_8) {
+      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL;
     }
-    __Pyx_INCREF(__pyx_kp_s__63);
-    __Pyx_GIVEREF(__pyx_kp_s__63);
-    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_kp_s__63);
-    __Pyx_GIVEREF(__pyx_t_11);
-    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_11);
-    __pyx_t_11 = 0;
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 491, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+    __Pyx_INCREF(__pyx_kp_s__64);
+    __Pyx_GIVEREF(__pyx_kp_s__64);
+    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_kp_s__64);
+    __Pyx_GIVEREF(__pyx_t_10);
+    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_10);
+    __pyx_t_10 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   }
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sub); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 491, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_substitute_comments, __pyx_t_10) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sub); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 491, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_substitute_comments, __pyx_t_7) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "lxml/html/clean.py":493
  *     _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
@@ -16453,10 +16567,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         """
  *         Depending on the browser, stuff like ``e x p r e s s i o n(...)``
  */
-  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_17_has_sneaky_javascript, 0, __pyx_n_s_Cleaner__has_sneaky_javascript, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 493, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_10);
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_has_sneaky_javascript, __pyx_t_10) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_17_has_sneaky_javascript, 0, __pyx_n_s_Cleaner__has_sneaky_javascript, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_has_sneaky_javascript, __pyx_t_7) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "lxml/html/clean.py":514
  *         return False
@@ -16465,10 +16579,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *         result_type = type(html)
  *         if isinstance(html, basestring):
  */
-  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_19clean_html, 0, __pyx_n_s_Cleaner_clean_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 514, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_10);
-  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_clean_html, __pyx_t_10) < 0) __PYX_ERR(0, 514, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_19clean_html, 0, __pyx_n_s_Cleaner_clean_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 514, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyObject_SetItem(__pyx_t_9, __pyx_n_s_clean_html, __pyx_t_7) < 0) __PYX_ERR(0, 514, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "lxml/html/clean.py":99
  * 
@@ -16477,11 +16591,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     """
  *     Instances cleans the document of each of the possible offending
  */
-  __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_9, __pyx_n_s_Cleaner, __pyx_t_1, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 99, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_10);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Cleaner, __pyx_t_10) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Cleaner, __pyx_tuple__46, __pyx_t_9, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Cleaner, __pyx_t_7) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -16494,19 +16607,19 @@ PyMODINIT_FUNC PyInit_clean(void)
  */
   __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Cleaner); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_8 = NULL;
+  __pyx_t_7 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
-    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
-    if (likely(__pyx_t_8)) {
+    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
+    if (likely(__pyx_t_7)) {
       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
-      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(__pyx_t_7);
       __Pyx_INCREF(function);
       __Pyx_DECREF_SET(__pyx_t_9, function);
     }
   }
-  if (__pyx_t_8) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  if (__pyx_t_7) {
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   } else {
     __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
   }
@@ -16539,61 +16652,61 @@ PyMODINIT_FUNC PyInit_clean(void)
  */
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 531, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 531, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = NULL;
   __pyx_t_6 = 0;
-  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
-    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
     if (likely(__pyx_t_1)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
       __Pyx_INCREF(__pyx_t_1);
       __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_8, function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
       __pyx_t_6 = 1;
     }
   }
   #if CYTHON_FAST_PYCALL
-  if (PyFunction_Check(__pyx_t_8)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_P_body_https_P_host_a_z0_9, __pyx_t_10};
-    __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 531, __pyx_L1_error)
+  if (PyFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_P_body_https_P_host_a_z0_9, __pyx_t_5};
+    __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 531, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
-  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_P_body_https_P_host_a_z0_9, __pyx_t_10};
-    __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 531, __pyx_L1_error)
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_P_body_https_P_host_a_z0_9, __pyx_t_5};
+    __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 531, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 531, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_11);
     if (__pyx_t_1) {
-      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
+      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
     }
     __Pyx_INCREF(__pyx_kp_s_P_body_https_P_host_a_z0_9);
     __Pyx_GIVEREF(__pyx_kp_s_P_body_https_P_host_a_z0_9);
-    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_P_body_https_P_host_a_z0_9);
-    __Pyx_GIVEREF(__pyx_t_10);
-    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_10);
-    __pyx_t_10 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 531, __pyx_L1_error)
+    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_kp_s_P_body_https_P_host_a_z0_9);
+    __Pyx_GIVEREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 531, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   }
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "lxml/html/clean.py":533
  *     re.compile(r'(?P<body>https?://(?P<host>[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?(?:\([/\-_.,a-z0-9%&?;=~]*\))?)', re.I),
@@ -16602,63 +16715,63 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     ]
  * 
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 533, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_10);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 533, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 533, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = NULL;
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  __pyx_t_11 = NULL;
   __pyx_t_6 = 0;
-  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
-    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
-    if (likely(__pyx_t_7)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
-      __Pyx_INCREF(__pyx_t_7);
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_11)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_11);
       __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_10, function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
       __pyx_t_6 = 1;
     }
   }
   #if CYTHON_FAST_PYCALL
-  if (PyFunction_Check(__pyx_t_10)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_mailto_P_body_a_z0_9___P_host_a, __pyx_t_1};
-    __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 533, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_GOTREF(__pyx_t_8);
+  if (PyFunction_Check(__pyx_t_5)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_kp_s_mailto_P_body_a_z0_9___P_host_a, __pyx_t_1};
+    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
-  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_mailto_P_body_a_z0_9___P_host_a, __pyx_t_1};
-    __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 533, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_GOTREF(__pyx_t_8);
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_kp_s_mailto_P_body_a_z0_9___P_host_a, __pyx_t_1};
+    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else
   #endif
   {
-    __pyx_t_12 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 533, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_12);
-    if (__pyx_t_7) {
-      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
+    __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 533, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_10);
+    if (__pyx_t_11) {
+      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
     }
     __Pyx_INCREF(__pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
     __Pyx_GIVEREF(__pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
-    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
+    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
     __Pyx_GIVEREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 533, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   }
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":530
  * ############################################################
@@ -16667,16 +16780,16 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     re.compile(r'(?P<body>https?://(?P<host>[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?(?:\([/\-_.,a-z0-9%&?;=~]*\))?)', re.I),
  *     # This is conservative, but autolinking can be a bit conservative:
  */
-  __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 530, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_9);
-  PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
-  __Pyx_GIVEREF(__pyx_t_8);
-  PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
   __pyx_t_9 = 0;
-  __pyx_t_8 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_regexes_2, __pyx_t_10) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_regexes_2, __pyx_t_5) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":536
  *     ]
@@ -16685,28 +16798,28 @@ PyMODINIT_FUNC PyInit_clean(void)
  * 
  * _avoid_hosts = [
  */
-  __pyx_t_10 = PyList_New(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 536, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_5 = PyList_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_n_s_textarea);
   __Pyx_GIVEREF(__pyx_n_s_textarea);
-  PyList_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_textarea);
+  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_textarea);
   __Pyx_INCREF(__pyx_n_s_pre);
   __Pyx_GIVEREF(__pyx_n_s_pre);
-  PyList_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_pre);
+  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_pre);
   __Pyx_INCREF(__pyx_n_s_code);
   __Pyx_GIVEREF(__pyx_n_s_code);
-  PyList_SET_ITEM(__pyx_t_10, 2, __pyx_n_s_code);
+  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_n_s_code);
   __Pyx_INCREF(__pyx_n_s_head);
   __Pyx_GIVEREF(__pyx_n_s_head);
-  PyList_SET_ITEM(__pyx_t_10, 3, __pyx_n_s_head);
+  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_n_s_head);
   __Pyx_INCREF(__pyx_n_s_select);
   __Pyx_GIVEREF(__pyx_n_s_select);
-  PyList_SET_ITEM(__pyx_t_10, 4, __pyx_n_s_select);
+  PyList_SET_ITEM(__pyx_t_5, 4, __pyx_n_s_select);
   __Pyx_INCREF(__pyx_n_s_a);
   __Pyx_GIVEREF(__pyx_n_s_a);
-  PyList_SET_ITEM(__pyx_t_10, 5, __pyx_n_s_a);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_elements_2, __pyx_t_10) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  PyList_SET_ITEM(__pyx_t_5, 5, __pyx_n_s_a);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_elements_2, __pyx_t_5) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "lxml/html/clean.py":539
  * 
@@ -16715,23 +16828,23 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     re.compile(r'\bexample\.(?:com|org|net)$', re.I),
  *     re.compile(r'^127\.0\.0\.1$'),
  */
-  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 539, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_I); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 539, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = NULL;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = NULL;
   __pyx_t_6 = 0;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
-    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
-    if (likely(__pyx_t_8)) {
+    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
+    if (likely(__pyx_t_7)) {
       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
-      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(__pyx_t_7);
       __Pyx_INCREF(function);
       __Pyx_DECREF_SET(__pyx_t_9, function);
       __pyx_t_6 = 1;
@@ -16739,36 +16852,36 @@ PyMODINIT_FUNC PyInit_clean(void)
   }
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_9)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_s_localhost, __pyx_t_12};
-    __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 539, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_localhost, __pyx_t_10};
+    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_s_localhost, __pyx_t_12};
-    __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 539, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_localhost, __pyx_t_10};
+    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   } else
   #endif
   {
     __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    if (__pyx_t_8) {
-      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL;
+    if (__pyx_t_7) {
+      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL;
     }
     __Pyx_INCREF(__pyx_kp_s_localhost);
     __Pyx_GIVEREF(__pyx_kp_s_localhost);
     PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_kp_s_localhost);
-    __Pyx_GIVEREF(__pyx_t_12);
-    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_t_12);
-    __pyx_t_12 = 0;
-    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 539, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_10);
+    __Pyx_GIVEREF(__pyx_t_10);
+    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_t_10);
+    __pyx_t_10 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
@@ -16782,61 +16895,61 @@ PyMODINIT_FUNC PyInit_clean(void)
  */
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 540, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = NULL;
   __pyx_t_6 = 0;
-  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
-    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
+    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
     if (likely(__pyx_t_1)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
       __Pyx_INCREF(__pyx_t_1);
       __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_12, function);
+      __Pyx_DECREF_SET(__pyx_t_10, function);
       __pyx_t_6 = 1;
     }
   }
   #if CYTHON_FAST_PYCALL
-  if (PyFunction_Check(__pyx_t_12)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_bexample_com_org_net, __pyx_t_8};
-    __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 540, __pyx_L1_error)
+  if (PyFunction_Check(__pyx_t_10)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_bexample_com_org_net, __pyx_t_7};
+    __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 540, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
-  if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_bexample_com_org_net, __pyx_t_8};
-    __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 540, __pyx_L1_error)
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_bexample_com_org_net, __pyx_t_7};
+    __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 540, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 540, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_11);
     if (__pyx_t_1) {
-      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
+      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
     }
     __Pyx_INCREF(__pyx_kp_s_bexample_com_org_net);
     __Pyx_GIVEREF(__pyx_kp_s_bexample_com_org_net);
-    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_bexample_com_org_net);
-    __Pyx_GIVEREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_8);
-    __pyx_t_8 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 540, __pyx_L1_error)
+    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_kp_s_bexample_com_org_net);
+    __Pyx_GIVEREF(__pyx_t_7);
+    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_7);
+    __pyx_t_7 = 0;
+    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 540, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   }
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
 
   /* "lxml/html/clean.py":541
  *     re.compile(r'^localhost', re.I),
@@ -16845,14 +16958,14 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     ]
  * 
  */
-  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 541, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_compile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 541, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 541, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_compile); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 541, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 541, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":538
  * _avoid_elements = ['textarea', 'pre', 'code', 'head', 'select', 'a']
@@ -16861,19 +16974,19 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     re.compile(r'^localhost', re.I),
  *     re.compile(r'\bexample\.(?:com|org|net)$', re.I),
  */
-  __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_10);
-  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_10);
+  __pyx_t_11 = PyList_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 538, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_9);
-  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
-  __Pyx_GIVEREF(__pyx_t_12);
-  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_12);
-  __pyx_t_10 = 0;
+  PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_10);
+  PyList_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
+  __pyx_t_5 = 0;
   __pyx_t_9 = 0;
-  __pyx_t_12 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_hosts_2, __pyx_t_7) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_10 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_hosts_2, __pyx_t_11) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":544
  *     ]
@@ -16882,13 +16995,13 @@ PyMODINIT_FUNC PyInit_clean(void)
  * 
  * def autolink(el, link_regexes=_link_regexes,
  */
-  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 544, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 544, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
   __Pyx_INCREF(__pyx_n_s_nolink);
   __Pyx_GIVEREF(__pyx_n_s_nolink);
-  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_nolink);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_classes_2, __pyx_t_7) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  PyList_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_nolink);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_classes_2, __pyx_t_11) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":546
  * _avoid_classes = ['nolink']
@@ -16897,14 +17010,14 @@ PyMODINIT_FUNC PyInit_clean(void)
  *              avoid_elements=_avoid_elements,
  *              avoid_hosts=_avoid_hosts,
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_3autolink, 0, __pyx_n_s_autolink, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 546, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults), 4)) __PYX_ERR(0, 546, __pyx_L1_error)
-  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_link_regexes_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 546, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_7)->__pyx_arg_link_regexes = __pyx_t_12;
-  __Pyx_GIVEREF(__pyx_t_12);
-  __pyx_t_12 = 0;
+  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_3autolink, 0, __pyx_n_s_autolink, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 546, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_11, sizeof(__pyx_defaults), 4)) __PYX_ERR(0, 546, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_link_regexes_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 546, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_11)->__pyx_arg_link_regexes = __pyx_t_10;
+  __Pyx_GIVEREF(__pyx_t_10);
+  __pyx_t_10 = 0;
 
   /* "lxml/html/clean.py":547
  * 
@@ -16913,11 +17026,11 @@ PyMODINIT_FUNC PyInit_clean(void)
  *              avoid_hosts=_avoid_hosts,
  *              avoid_classes=_avoid_classes):
  */
-  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_avoid_elements_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 547, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_7)->__pyx_arg_avoid_elements = __pyx_t_12;
-  __Pyx_GIVEREF(__pyx_t_12);
-  __pyx_t_12 = 0;
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_avoid_elements_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 547, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_11)->__pyx_arg_avoid_elements = __pyx_t_10;
+  __Pyx_GIVEREF(__pyx_t_10);
+  __pyx_t_10 = 0;
 
   /* "lxml/html/clean.py":548
  * def autolink(el, link_regexes=_link_regexes,
@@ -16926,11 +17039,11 @@ PyMODINIT_FUNC PyInit_clean(void)
  *              avoid_classes=_avoid_classes):
  *     """
  */
-  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_avoid_hosts_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 548, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_7)->__pyx_arg_avoid_hosts = __pyx_t_12;
-  __Pyx_GIVEREF(__pyx_t_12);
-  __pyx_t_12 = 0;
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_avoid_hosts_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 548, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_11)->__pyx_arg_avoid_hosts = __pyx_t_10;
+  __Pyx_GIVEREF(__pyx_t_10);
+  __pyx_t_10 = 0;
 
   /* "lxml/html/clean.py":549
  *              avoid_elements=_avoid_elements,
@@ -16939,14 +17052,14 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     """
  *     Turn any URLs into links.
  */
-  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_avoid_classes_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 549, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_7)->__pyx_arg_avoid_classes = __pyx_t_12;
-  __Pyx_GIVEREF(__pyx_t_12);
-  __pyx_t_12 = 0;
-  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_4lxml_4html_5clean_16__defaults__);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink, __pyx_t_7) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_avoid_classes_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 549, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_11)->__pyx_arg_avoid_classes = __pyx_t_10;
+  __Pyx_GIVEREF(__pyx_t_10);
+  __pyx_t_10 = 0;
+  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_11, __pyx_pf_4lxml_4html_5clean_16__defaults__);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink, __pyx_t_11) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":591
  *             el[:0] = pre_children
@@ -16955,10 +17068,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     leading_text = ''
  *     links = []
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_5_link_text, 0, __pyx_n_s_link_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 591, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_text, __pyx_t_7) < 0) __PYX_ERR(0, 591, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_5_link_text, 0, __pyx_n_s_link_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 591, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_text, __pyx_t_11) < 0) __PYX_ERR(0, 591, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":649
  *     return leading_text, links
@@ -16967,10 +17080,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     result_type = type(html)
  *     if isinstance(html, basestring):
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7autolink_html, 0, __pyx_n_s_autolink_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 649, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink_html, __pyx_t_7) < 0) __PYX_ERR(0, 649, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_7autolink_html, 0, __pyx_n_s_autolink_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 649, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink_html, __pyx_t_11) < 0) __PYX_ERR(0, 649, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":658
  *     return _transform_result(result_type, doc)
@@ -16979,16 +17092,16 @@ PyMODINIT_FUNC PyInit_clean(void)
  * 
  * ############################################################
  */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_autolink); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 658, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_doc_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 658, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_autolink_html); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 658, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_n_s_doc_2, __pyx_t_12) < 0) __PYX_ERR(0, 658, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_autolink); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 658, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_doc_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 658, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_autolink_html); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 658, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  if (__Pyx_PyObject_SetAttrStr(__pyx_t_11, __pyx_n_s_doc_2, __pyx_t_10) < 0) __PYX_ERR(0, 658, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":664
  * ############################################################
@@ -16997,19 +17110,19 @@ PyMODINIT_FUNC PyInit_clean(void)
  * _avoid_word_break_classes = ['nobreak']
  * 
  */
-  __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 664, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_11 = PyList_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 664, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
   __Pyx_INCREF(__pyx_n_s_pre);
   __Pyx_GIVEREF(__pyx_n_s_pre);
-  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_pre);
+  PyList_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_pre);
   __Pyx_INCREF(__pyx_n_s_textarea);
   __Pyx_GIVEREF(__pyx_n_s_textarea);
-  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_textarea);
+  PyList_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_textarea);
   __Pyx_INCREF(__pyx_n_s_code);
   __Pyx_GIVEREF(__pyx_n_s_code);
-  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_s_code);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_elements, __pyx_t_7) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  PyList_SET_ITEM(__pyx_t_11, 2, __pyx_n_s_code);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_elements, __pyx_t_11) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":665
  * 
@@ -17018,13 +17131,13 @@ PyMODINIT_FUNC PyInit_clean(void)
  * 
  * def word_break(el, max_width=40,
  */
-  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 665, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
   __Pyx_INCREF(__pyx_n_s_nobreak);
   __Pyx_GIVEREF(__pyx_n_s_nobreak);
-  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_nobreak);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_classes, __pyx_t_7) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  PyList_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_nobreak);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_classes, __pyx_t_11) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":667
  * _avoid_word_break_classes = ['nobreak']
@@ -17033,9 +17146,9 @@ PyMODINIT_FUNC PyInit_clean(void)
  *                avoid_elements=_avoid_word_break_elements,
  *                avoid_classes=_avoid_word_break_classes,
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_9word_break, 0, __pyx_n_s_word_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults1), 3)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_9word_break, 0, __pyx_n_s_word_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_11, sizeof(__pyx_defaults1), 3)) __PYX_ERR(0, 667, __pyx_L1_error)
 
   /* "lxml/html/clean.py":668
  * 
@@ -17044,11 +17157,11 @@ PyMODINIT_FUNC PyInit_clean(void)
  *                avoid_classes=_avoid_word_break_classes,
  *                break_character=unichr(0x200b)):
  */
-  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 668, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_7)->__pyx_arg_avoid_elements = __pyx_t_12;
-  __Pyx_GIVEREF(__pyx_t_12);
-  __pyx_t_12 = 0;
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 668, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_11)->__pyx_arg_avoid_elements = __pyx_t_10;
+  __Pyx_GIVEREF(__pyx_t_10);
+  __pyx_t_10 = 0;
 
   /* "lxml/html/clean.py":669
  * def word_break(el, max_width=40,
@@ -17057,11 +17170,11 @@ PyMODINIT_FUNC PyInit_clean(void)
  *                break_character=unichr(0x200b)):
  *     """
  */
-  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_avoid_word_break_classes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 669, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_7)->__pyx_arg_avoid_classes = __pyx_t_12;
-  __Pyx_GIVEREF(__pyx_t_12);
-  __pyx_t_12 = 0;
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_avoid_word_break_classes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 669, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_11)->__pyx_arg_avoid_classes = __pyx_t_10;
+  __Pyx_GIVEREF(__pyx_t_10);
+  __pyx_t_10 = 0;
 
   /* "lxml/html/clean.py":670
  *                avoid_elements=_avoid_word_break_elements,
@@ -17070,17 +17183,17 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     """
  *     Breaks any long words found in the body of the text (not attributes).
  */
-  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_unichr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 670, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
-  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 670, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_unichr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 670, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 670, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_7)->__pyx_arg_break_character = __pyx_t_9;
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_11)->__pyx_arg_break_character = __pyx_t_9;
   __Pyx_GIVEREF(__pyx_t_9);
   __pyx_t_9 = 0;
-  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_4lxml_4html_5clean_18__defaults__);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break, __pyx_t_7) < 0) __PYX_ERR(0, 667, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_11, __pyx_pf_4lxml_4html_5clean_18__defaults__);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break, __pyx_t_11) < 0) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":708
  *             child.tail = _break_text(child.tail, max_width, break_character)
@@ -17089,10 +17202,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     result_type = type(html)
  *     doc = fromstring(html)
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_11word_break_html, 0, __pyx_n_s_word_break_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 708, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break_html, __pyx_t_7) < 0) __PYX_ERR(0, 708, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_11word_break_html, 0, __pyx_n_s_word_break_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 708, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break_html, __pyx_t_11) < 0) __PYX_ERR(0, 708, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":714
  *     return _transform_result(result_type, doc)
@@ -17101,10 +17214,10 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     words = text.split()
  *     for word in words:
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_13_break_text, 0, __pyx_n_s_break_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 714, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_text, __pyx_t_7) < 0) __PYX_ERR(0, 714, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_13_break_text, 0, __pyx_n_s_break_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 714, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_text, __pyx_t_11) < 0) __PYX_ERR(0, 714, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":722
  *     return text
@@ -17115,63 +17228,63 @@ PyMODINIT_FUNC PyInit_clean(void)
  */
   __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 722, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 722, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 722, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 722, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_I); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 722, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 722, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __pyx_t_9 = NULL;
   __pyx_t_6 = 0;
-  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
-    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12);
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
+    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
     if (likely(__pyx_t_9)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
       __Pyx_INCREF(__pyx_t_9);
       __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_12, function);
+      __Pyx_DECREF_SET(__pyx_t_10, function);
       __pyx_t_6 = 1;
     }
   }
   #if CYTHON_FAST_PYCALL
-  if (PyFunction_Check(__pyx_t_12)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_s_a_z, __pyx_t_10};
-    __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_error)
+  if (PyFunction_Check(__pyx_t_10)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_s_a_z, __pyx_t_5};
+    __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 722, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_GOTREF(__pyx_t_11);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
-  if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_s_a_z, __pyx_t_10};
-    __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_error)
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_kp_s_a_z, __pyx_t_5};
+    __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 722, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_GOTREF(__pyx_t_11);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   } else
   #endif
   {
-    __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 722, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_9) {
-      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
+      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
     }
     __Pyx_INCREF(__pyx_kp_s_a_z);
     __Pyx_GIVEREF(__pyx_kp_s_a_z);
-    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_kp_s_a_z);
-    __Pyx_GIVEREF(__pyx_t_10);
-    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_t_10);
-    __pyx_t_10 = 0;
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_a_z);
+    __Pyx_GIVEREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 722, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_11);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_prefer_re, __pyx_t_7) < 0) __PYX_ERR(0, 722, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_prefer_re, __pyx_t_11) < 0) __PYX_ERR(0, 722, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":724
  * _break_prefer_re = re.compile(r'[^a-z]', re.I)
@@ -17180,20 +17293,20 @@ PyMODINIT_FUNC PyInit_clean(void)
  *     orig_word = word
  *     result = ''
  */
-  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_15_insert_break, 0, __pyx_n_s_insert_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_insert_break, __pyx_t_7) < 0) __PYX_ERR(0, 724, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_4html_5clean_15_insert_break, 0, __pyx_n_s_insert_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 724, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_insert_break, __pyx_t_11) < 0) __PYX_ERR(0, 724, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /* "lxml/html/clean.py":1
  * """A cleanup tool for HTML.             # <<<<<<<<<<<<<<
  * 
  * Removes unwanted tags and content.  See the `Cleaner` class for
  */
-  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_11 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_11) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
 
   /*--- Wrapped vars code ---*/
 
@@ -17207,7 +17320,6 @@ PyMODINIT_FUNC PyInit_clean(void)
   __Pyx_XDECREF(__pyx_t_9);
   __Pyx_XDECREF(__pyx_t_10);
   __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_XDECREF(__pyx_t_12);
   if (__pyx_m) {
     if (__pyx_d) {
       __Pyx_AddTraceback("init lxml.html.clean", 0, __pyx_lineno, __pyx_filename);
@@ -17218,10 +17330,12 @@ PyMODINIT_FUNC PyInit_clean(void)
   }
   __pyx_L0:;
   __Pyx_RefNannyFinishContext();
-  #if PY_MAJOR_VERSION < 3
-  return;
-  #else
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  return (__pyx_m != NULL) ? 0 : -1;
+  #elif PY_MAJOR_VERSION >= 3
   return __pyx_m;
+  #else
+  return;
   #endif
 }
 
@@ -17267,42 +17381,43 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__44);
   Py_CLEAR(__pyx_tuple__45);
   Py_CLEAR(__pyx_tuple__46);
-  Py_CLEAR(__pyx_codeobj__47);
-  Py_CLEAR(__pyx_tuple__48);
-  Py_CLEAR(__pyx_codeobj__49);
-  Py_CLEAR(__pyx_tuple__50);
-  Py_CLEAR(__pyx_codeobj__51);
-  Py_CLEAR(__pyx_tuple__52);
-  Py_CLEAR(__pyx_codeobj__53);
-  Py_CLEAR(__pyx_tuple__54);
-  Py_CLEAR(__pyx_codeobj__55);
-  Py_CLEAR(__pyx_tuple__56);
-  Py_CLEAR(__pyx_codeobj__57);
-  Py_CLEAR(__pyx_tuple__58);
-  Py_CLEAR(__pyx_codeobj__59);
-  Py_CLEAR(__pyx_tuple__60);
+  Py_CLEAR(__pyx_tuple__47);
+  Py_CLEAR(__pyx_codeobj__48);
+  Py_CLEAR(__pyx_tuple__49);
+  Py_CLEAR(__pyx_codeobj__50);
+  Py_CLEAR(__pyx_tuple__51);
+  Py_CLEAR(__pyx_codeobj__52);
+  Py_CLEAR(__pyx_tuple__53);
+  Py_CLEAR(__pyx_codeobj__54);
+  Py_CLEAR(__pyx_tuple__55);
+  Py_CLEAR(__pyx_codeobj__56);
+  Py_CLEAR(__pyx_tuple__57);
+  Py_CLEAR(__pyx_codeobj__58);
+  Py_CLEAR(__pyx_tuple__59);
+  Py_CLEAR(__pyx_codeobj__60);
   Py_CLEAR(__pyx_tuple__61);
-  Py_CLEAR(__pyx_codeobj__62);
-  Py_CLEAR(__pyx_tuple__64);
-  Py_CLEAR(__pyx_codeobj__65);
-  Py_CLEAR(__pyx_tuple__66);
-  Py_CLEAR(__pyx_codeobj__67);
-  Py_CLEAR(__pyx_tuple__68);
+  Py_CLEAR(__pyx_tuple__62);
+  Py_CLEAR(__pyx_codeobj__63);
+  Py_CLEAR(__pyx_tuple__65);
+  Py_CLEAR(__pyx_codeobj__66);
+  Py_CLEAR(__pyx_tuple__67);
+  Py_CLEAR(__pyx_codeobj__68);
   Py_CLEAR(__pyx_tuple__69);
-  Py_CLEAR(__pyx_codeobj__70);
-  Py_CLEAR(__pyx_tuple__71);
-  Py_CLEAR(__pyx_codeobj__72);
-  Py_CLEAR(__pyx_tuple__73);
-  Py_CLEAR(__pyx_codeobj__74);
-  Py_CLEAR(__pyx_tuple__75);
-  Py_CLEAR(__pyx_codeobj__76);
-  Py_CLEAR(__pyx_tuple__77);
+  Py_CLEAR(__pyx_tuple__70);
+  Py_CLEAR(__pyx_codeobj__71);
+  Py_CLEAR(__pyx_tuple__72);
+  Py_CLEAR(__pyx_codeobj__73);
+  Py_CLEAR(__pyx_tuple__74);
+  Py_CLEAR(__pyx_codeobj__75);
+  Py_CLEAR(__pyx_tuple__76);
+  Py_CLEAR(__pyx_codeobj__77);
   Py_CLEAR(__pyx_tuple__78);
-  Py_CLEAR(__pyx_codeobj__79);
-  Py_CLEAR(__pyx_tuple__80);
-  Py_CLEAR(__pyx_codeobj__81);
-  Py_CLEAR(__pyx_tuple__82);
-  Py_CLEAR(__pyx_codeobj__83);
+  Py_CLEAR(__pyx_tuple__79);
+  Py_CLEAR(__pyx_codeobj__80);
+  Py_CLEAR(__pyx_tuple__81);
+  Py_CLEAR(__pyx_codeobj__82);
+  Py_CLEAR(__pyx_tuple__83);
+  Py_CLEAR(__pyx_codeobj__84);
   /* CodeObjectCache.cleanup */
   if (__pyx_code_cache.entries) {
       __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
@@ -17416,7 +17531,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, P
 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                                PyObject *globals) {
     PyFrameObject *f;
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject **fastlocals;
     Py_ssize_t i;
     PyObject *result;
@@ -17761,7 +17876,7 @@ bad:
     target->method = method;
 #if CYTHON_COMPILING_IN_CPYTHON
     #if PY_MAJOR_VERSION >= 3
-    if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
+    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
     #endif
     {
         PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
@@ -17815,10 +17930,10 @@ bad:
 /* IterFinish */
   static CYTHON_INLINE int __Pyx_IterFinish(void) {
 #if CYTHON_FAST_THREAD_STATE
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject* exc_type = tstate->curexc_type;
     if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
+        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
             PyObject *exc_value, *exc_tb;
             exc_value = tstate->curexc_value;
             exc_tb = tstate->curexc_traceback;
@@ -17861,7 +17976,7 @@ bad:
 
 /* GetAttr */
   static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_USE_TYPE_SLOTS
 #if PY_MAJOR_VERSION >= 3
     if (likely(PyUnicode_Check(n)))
 #else
@@ -18030,11 +18145,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             "raise: exception class must be a subclass of BaseException");
         goto bad;
     }
-#if PY_VERSION_HEX >= 0x03030000
     if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
         PyObject *fixed_cause;
         if (cause == Py_None) {
             fixed_cause = NULL;
@@ -18062,7 +18173,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         PyErr_Restore(tmp_type, tmp_value, tb);
         Py_XDECREF(tmp_tb);
 #else
-        PyThreadState *tstate = PyThreadState_GET();
+        PyThreadState *tstate = __Pyx_PyThreadState_Current;
         PyObject* tmp_tb = tstate->curexc_traceback;
         if (tb != tmp_tb) {
             Py_INCREF(tb);
@@ -18078,7 +18189,7 @@ bad:
 #endif
 
 /* PyObjectCallNoArg */
-    #if CYTHON_COMPILING_IN_CPYTHON
+  #if CYTHON_COMPILING_IN_CPYTHON
 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(func)) {
@@ -18086,7 +18197,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
     }
 #endif
 #ifdef __Pyx_CyFunction_USED
-    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+    if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
 #else
     if (likely(PyCFunction_Check(func))) {
 #endif
@@ -18099,7 +18210,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 #endif
 
 /* BytesEquals */
-      static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+    static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
 #if CYTHON_COMPILING_IN_PYPY
     return PyObject_RichCompareBool(s1, s2, equals);
 #else
@@ -18146,7 +18257,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
 }
 
 /* UnicodeEquals */
-      static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+    static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
 #if CYTHON_COMPILING_IN_PYPY
     return PyObject_RichCompareBool(s1, s2, equals);
 #else
@@ -18245,7 +18356,7 @@ return_ne:
 }
 
 /* GetItemInt */
-      static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+    static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
     PyObject *r;
     if (!j) return NULL;
     r = PyObject_GetItem(o, j);
@@ -18332,10 +18443,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
 }
 
 /* PyObjectCallMethod1 */
-      static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
-    PyObject *method, *result = NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto done;
+    static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
+    PyObject *result = NULL;
 #if CYTHON_UNPACK_METHODS
     if (likely(PyMethod_Check(method))) {
         PyObject *self = PyMethod_GET_SELF(method);
@@ -18363,7 +18472,6 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
             Py_INCREF(arg);
             PyTuple_SET_ITEM(args, 1, arg);
             Py_INCREF(function);
-            Py_DECREF(method); method = NULL;
             result = __Pyx_PyObject_Call(function, args, NULL);
             Py_DECREF(args);
             Py_DECREF(function);
@@ -18372,13 +18480,22 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
     }
 #endif
     result = __Pyx_PyObject_CallOneArg(method, arg);
+    goto done;
+done:
+    return result;
+}
+static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
+    PyObject *method, *result = NULL;
+    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
+    if (unlikely(!method)) goto done;
+    result = __Pyx__PyObject_CallMethod1(method, arg);
 done:
     Py_XDECREF(method);
     return result;
 }
 
 /* pop_index */
-      static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
+    static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
     PyObject *r;
     if (unlikely(!py_ix)) return NULL;
     r = __Pyx__PyObject_PopIndex(L, py_ix);
@@ -18413,7 +18530,7 @@ static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t
 #endif
 
 /* FetchCommonType */
-      static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+    static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
     PyObject* fake_module;
     PyTypeObject* cached_type = NULL;
     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
@@ -18452,7 +18569,7 @@ bad:
 }
 
 /* CythonFunction */
-      static PyObject *
+    static PyObject *
 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
 {
     if (unlikely(op->func_doc == NULL)) {
@@ -18812,14 +18929,18 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
     }
     return 0;
 }
-static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
 {
-    PyObject_GC_UnTrack(m);
     if (__Pyx_CyFunction_weakreflist(m) != NULL)
         PyObject_ClearWeakRefs((PyObject *) m);
     __Pyx_CyFunction_clear(m);
     PyObject_GC_Del(m);
 }
+static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+{
+    PyObject_GC_UnTrack(m);
+    __Pyx__CyFunction_dealloc(m);
+}
 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
 {
     Py_VISIT(m->func_closure);
@@ -18894,10 +19015,16 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py
         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
             size = PyTuple_GET_SIZE(arg);
             if (likely(size == 1)) {
-                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
-                if (unlikely(!arg0)) return NULL;
+                PyObject *result, *arg0;
+                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+                arg0 = PyTuple_GET_ITEM(arg, 0);
+                #else
+                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
+                #endif
                 result = (*meth)(self, arg0);
+                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                 Py_DECREF(arg0);
+                #endif
                 return result;
             }
             PyErr_Format(PyExc_TypeError,
@@ -19004,7 +19131,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
 };
 static int __pyx_CyFunction_init(void) {
     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
-    if (__pyx_CyFunctionType == NULL) {
+    if (unlikely(__pyx_CyFunctionType == NULL)) {
         return -1;
     }
     return 0;
@@ -19012,7 +19139,7 @@ static int __pyx_CyFunction_init(void) {
 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
     m->defaults = PyObject_Malloc(size);
-    if (!m->defaults)
+    if (unlikely(!m->defaults))
         return PyErr_NoMemory();
     memset(m->defaults, 0, size);
     m->defaults_pyobjects = pyobjects;
@@ -19035,7 +19162,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
 }
 
 /* PyIntBinop */
-          #if !CYTHON_COMPILING_IN_PYPY
+        #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_CheckExact(op1))) {
@@ -19151,7 +19278,7 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
 #endif
 
 /* SliceObject */
-          static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
+        static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
         Py_ssize_t cstart, Py_ssize_t cstop,
         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
@@ -19249,12 +19376,12 @@ bad:
 }
 
 /* None */
-          static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+        static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
 }
 
 /* PyIntBinop */
-          #if !CYTHON_COMPILING_IN_PYPY
+        #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_CheckExact(op1))) {
@@ -19370,7 +19497,7 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_U
 #endif
 
 /* SliceObject */
-          static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
+        static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
         Py_ssize_t cstart, Py_ssize_t cstop,
         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
@@ -19467,13 +19594,13 @@ bad:
 }
 
 /* Import */
-          static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+        static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     PyObject *empty_list = 0;
     PyObject *module = 0;
     PyObject *global_dict = 0;
     PyObject *empty_dict = 0;
     PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     PyObject *py_import;
     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
@@ -19497,17 +19624,8 @@ bad:
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
             if (strchr(__Pyx_MODULE_NAME, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                PyObject *py_level = PyInt_FromLong(1);
-                if (!py_level)
-                    goto bad;
-                module = PyObject_CallFunctionObjArgs(py_import,
-                    name, global_dict, empty_dict, list, py_level, NULL);
-                Py_DECREF(py_level);
-                #else
                 module = PyImport_ImportModuleLevelObject(
                     name, global_dict, empty_dict, list, 1);
-                #endif
                 if (!module) {
                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
                         goto bad;
@@ -19518,7 +19636,7 @@ bad:
         }
         #endif
         if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
+            #if PY_MAJOR_VERSION < 3
             PyObject *py_level = PyInt_FromLong(level);
             if (!py_level)
                 goto bad;
@@ -19532,7 +19650,7 @@ bad:
         }
     }
 bad:
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     Py_XDECREF(py_import);
     #endif
     Py_XDECREF(empty_list);
@@ -19541,7 +19659,7 @@ bad:
 }
 
 /* ImportFrom */
-          static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+        static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
         PyErr_Format(PyExc_ImportError,
@@ -19555,7 +19673,7 @@ bad:
 }
 
 /* SaveResetException */
-          #if CYTHON_FAST_THREAD_STATE
+        #if CYTHON_FAST_THREAD_STATE
 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
     *type = tstate->exc_type;
     *value = tstate->exc_value;
@@ -19579,17 +19697,32 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject
 #endif
 
 /* PyErrExceptionMatches */
-          #if CYTHON_FAST_THREAD_STATE
+        #if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+    Py_ssize_t i, n;
+    n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+    for (i=0; i<n; i++) {
+        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+    }
+#endif
+    for (i=0; i<n; i++) {
+        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
+    }
+    return 0;
+}
 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
     PyObject *exc_type = tstate->curexc_type;
     if (exc_type == err) return 1;
     if (unlikely(!exc_type)) return 0;
-    return PyErr_GivenExceptionMatches(exc_type, err);
+    if (unlikely(PyTuple_Check(err)))
+        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
 }
 #endif
 
 /* GetException */
-          #if CYTHON_FAST_THREAD_STATE
+        #if CYTHON_FAST_THREAD_STATE
 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
 #else
 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
@@ -19650,7 +19783,7 @@ bad:
 }
 
 /* CalculateMetaclass */
-            static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
+          static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
     Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
     for (i=0; i < nbases; i++) {
         PyTypeObject *tmptype;
@@ -19689,7 +19822,7 @@ bad:
 }
 
 /* Py3ClassCreate */
-            static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
+          static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                            PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
     PyObject *ns;
     if (metaclass) {
@@ -19756,7 +19889,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj
 }
 
 /* ModuleImport */
-            #ifndef __PYX_HAVE_RT_ImportModule
+          #ifndef __PYX_HAVE_RT_ImportModule
 #define __PYX_HAVE_RT_ImportModule
 static PyObject *__Pyx_ImportModule(const char *name) {
     PyObject *py_name = 0;
@@ -19774,7 +19907,7 @@ bad:
 #endif
 
 /* RegisterModuleCleanup */
-            #if PY_MAJOR_VERSION < 3
+          #if PY_MAJOR_VERSION < 3
 static PyObject* __pyx_module_cleanup_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) {
     __pyx_module_cleanup(module);
     Py_INCREF(Py_None); return Py_None;
@@ -19841,7 +19974,7 @@ static int __Pyx_RegisterCleanup(void) {
 #endif
 
 /* CLineInTraceback */
-            static int __Pyx_CLineForTraceback(int c_line) {
+          static int __Pyx_CLineForTraceback(int c_line) {
 #ifdef CYTHON_CLINE_IN_TRACEBACK
     return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0;
 #else
@@ -19877,7 +20010,7 @@ static int __Pyx_RegisterCleanup(void) {
 }
 
 /* CodeObjectCache */
-            static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+          static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
     int start = 0, mid = 0, end = count - 1;
     if (end >= 0 && code_line > entries[end].code_line) {
         return count;
@@ -19957,7 +20090,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
 }
 
 /* AddTraceback */
-            #include "compile.h"
+          #include "compile.h"
 #include "frameobject.h"
 #include "traceback.h"
 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -20027,10 +20160,10 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
     }
     py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        __pyx_d,      /*PyObject *globals,*/
-        0                    /*PyObject *locals*/
+        __Pyx_PyThreadState_Current, /*PyThreadState *tstate,*/
+        py_code,                     /*PyCodeObject *code,*/
+        __pyx_d,              /*PyObject *globals,*/
+        0                            /*PyObject *locals*/
     );
     if (!py_frame) goto bad;
     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
@@ -20041,7 +20174,7 @@ bad:
 }
 
 /* CIntToPy */
-            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -20072,7 +20205,7 @@ bad:
 }
 
 /* CIntFromPyVerify */
-            #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+          #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
@@ -20094,7 +20227,7 @@ bad:
     }
 
 /* CIntFromPy */
-            static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+          static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -20283,7 +20416,7 @@ raise_neg_overflow:
 }
 
 /* CIntFromPy */
-            static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+          static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
     const int neg_one = (int) -1, const_zero = (int) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -20471,8 +20604,80 @@ raise_neg_overflow:
     return (int) -1;
 }
 
+/* FastTypeChecks */
+          #if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+    while (a) {
+        a = a->tp_base;
+        if (a == b)
+            return 1;
+    }
+    return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+    PyObject *mro;
+    if (a == b) return 1;
+    mro = a->tp_mro;
+    if (likely(mro)) {
+        Py_ssize_t i, n;
+        n = PyTuple_GET_SIZE(mro);
+        for (i = 0; i < n; i++) {
+            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+                return 1;
+        }
+        return 0;
+    }
+    return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+    PyObject *exception, *value, *tb;
+    int res;
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    __Pyx_ErrFetch(&exception, &value, &tb);
+    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+    if (unlikely(res == -1)) {
+        PyErr_WriteUnraisable(err);
+        res = 0;
+    }
+    if (!res) {
+        res = PyObject_IsSubclass(err, exc_type2);
+        if (unlikely(res == -1)) {
+            PyErr_WriteUnraisable(err);
+            res = 0;
+        }
+    }
+    __Pyx_ErrRestore(exception, value, tb);
+    return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+    if (!res) {
+        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+    }
+    return res;
+}
+#endif
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+    if (likely(err == exc_type)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+    }
+    return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+    if (likely(err == exc_type1 || err == exc_type2)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+    }
+    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
 /* CheckBinaryVersion */
-            static int __Pyx_check_binary_version(void) {
+          static int __Pyx_check_binary_version(void) {
     char ctversion[4], rtversion[4];
     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -20488,7 +20693,7 @@ raise_neg_overflow:
 }
 
 /* InitStrings */
-            static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+          static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
         if (t->is_unicode) {
@@ -20527,46 +20732,53 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
     Py_ssize_t ignore;
     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
 }
-static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    char* defenc_c;
+    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+    if (!defenc) return NULL;
+    defenc_c = PyBytes_AS_STRING(defenc);
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
+    {
+        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+        char* c;
+        for (c = defenc_c; c < end; c++) {
+            if ((unsigned char) (*c) >= 128) {
+                PyUnicode_AsASCIIString(o);
+                return NULL;
             }
         }
+    }
 #endif
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
+    *length = PyBytes_GET_SIZE(defenc);
+    return defenc_c;
+}
 #else
-        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_LENGTH(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
+    if (likely(PyUnicode_IS_ASCII(o))) {
+        *length = PyUnicode_GET_LENGTH(o);
+        return PyUnicode_AsUTF8(o);
+    } else {
+        PyUnicode_AsASCIIString(o);
+        return NULL;
+    }
 #else
-        return PyUnicode_AsUTF8AndSize(o, length);
+    return PyUnicode_AsUTF8AndSize(o, length);
 #endif
+}
 #endif
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+    if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+            __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+            PyUnicode_Check(o)) {
+        return __Pyx_PyUnicode_AsStringAndSize(o, length);
     } else
 #endif
 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
@@ -20590,6 +20802,26 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
    else return PyObject_IsTrue(x);
 }
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+    if (PyLong_Check(result)) {
+        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+                "__int__ returned non-int (type %.200s).  "
+                "The ability to return an instance of a strict subclass of int "
+                "is deprecated, and may be removed in a future version of Python.",
+                Py_TYPE(result)->tp_name)) {
+            Py_DECREF(result);
+            return NULL;
+        }
+        return result;
+    }
+#endif
+    PyErr_Format(PyExc_TypeError,
+                 "__%.4s__ returned non-%.4s (type %.200s)",
+                 type_name, type_name, Py_TYPE(result)->tp_name);
+    Py_DECREF(result);
+    return NULL;
+}
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
 #if CYTHON_USE_TYPE_SLOTS
   PyNumberMethods *m;
@@ -20597,9 +20829,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   const char *name = NULL;
   PyObject *res = NULL;
 #if PY_MAJOR_VERSION < 3
-  if (PyInt_Check(x) || PyLong_Check(x))
+  if (likely(PyInt_Check(x) || PyLong_Check(x)))
 #else
-  if (PyLong_Check(x))
+  if (likely(PyLong_Check(x)))
 #endif
     return __Pyx_NewRef(x);
 #if CYTHON_USE_TYPE_SLOTS
@@ -20607,32 +20839,30 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   #if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
-    res = PyNumber_Int(x);
+    res = m->nb_int(x);
   }
   else if (m && m->nb_long) {
     name = "long";
-    res = PyNumber_Long(x);
+    res = m->nb_long(x);
   }
   #else
-  if (m && m->nb_int) {
+  if (likely(m && m->nb_int)) {
     name = "int";
-    res = PyNumber_Long(x);
+    res = m->nb_int(x);
   }
   #endif
 #else
-  res = PyNumber_Int(x);
+  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+    res = PyNumber_Int(x);
+  }
 #endif
-  if (res) {
+  if (likely(res)) {
 #if PY_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
+    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
 #else
-    if (!PyLong_Check(res)) {
+    if (unlikely(!PyLong_CheckExact(res))) {
 #endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (type %.200s)",
-                   name, name, Py_TYPE(res)->tp_name);
-      Py_DECREF(res);
-      return NULL;
+        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
     }
   }
   else if (!PyErr_Occurred()) {
index b294826540f038f85b82a02937c65f1dd73ab9f0..50b6a5b3537ec57717152d12385735dbbc14058c 100644 (file)
@@ -1,8 +1,14 @@
-/* Generated by Cython 0.26.1 */
+/* Generated by Cython 0.27.1 */
 
 /* BEGIN: Cython Metadata
 {
     "distutils": {
+        "define_macros": [
+            [
+                "CYTHON_CLINE_IN_TRACEBACK", 
+                "1"
+            ]
+        ], 
         "extra_compile_args": [
             "-w"
         ], 
@@ -32,10 +38,11 @@ END: Cython Metadata */
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
-    #error Cython requires Python 2.6+ or Python 3.2+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+    #error Cython requires Python 2.6+ or Python 3.3+.
 #else
-#define CYTHON_ABI "0_26_1"
+#define CYTHON_ABI "0_27_1"
+#define CYTHON_FUTURE_DIVISION 0
 #include <stddef.h>
 #ifndef offsetof
   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
@@ -59,7 +66,7 @@ END: Cython Metadata */
 #endif
 #define __PYX_COMMA ,
 #ifndef HAVE_LONG_LONG
-  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+  #if PY_VERSION_HEX >= 0x02070000
     #define HAVE_LONG_LONG
   #endif
 #endif
@@ -77,8 +84,12 @@ END: Cython Metadata */
   #define CYTHON_USE_TYPE_SLOTS 0
   #undef CYTHON_USE_PYTYPE_LOOKUP
   #define CYTHON_USE_PYTYPE_LOOKUP 0
-  #undef CYTHON_USE_ASYNC_SLOTS
-  #define CYTHON_USE_ASYNC_SLOTS 0
+  #if PY_VERSION_HEX < 0x03050000
+    #undef CYTHON_USE_ASYNC_SLOTS
+    #define CYTHON_USE_ASYNC_SLOTS 0
+  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+    #define CYTHON_USE_ASYNC_SLOTS 1
+  #endif
   #undef CYTHON_USE_PYLIST_INTERNALS
   #define CYTHON_USE_PYLIST_INTERNALS 0
   #undef CYTHON_USE_UNICODE_INTERNALS
@@ -97,6 +108,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #elif defined(PYSTON_VERSION)
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 1
@@ -130,6 +145,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #else
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 0
@@ -182,6 +201,12 @@ END: Cython Metadata */
   #ifndef CYTHON_FAST_PYCALL
     #define CYTHON_FAST_PYCALL 1
   #endif
+  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+    #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
+  #endif
+  #ifndef CYTHON_USE_TP_FINALIZE
+    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+  #endif
 #endif
 #if !defined(CYTHON_FAST_PYCCALL)
 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
@@ -237,6 +262,27 @@ END: Cython Metadata */
 #else
 #define __Pyx_PyFastCFunction_Check(func) 0
 #endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+  #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
+#else
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
@@ -320,7 +366,6 @@ END: Cython Metadata */
 #ifndef PySet_CheckExact
   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
 #endif
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
 #if PY_MAJOR_VERSION >= 3
   #define PyIntObject                  PyLongObject
@@ -371,15 +416,17 @@ END: Cython Metadata */
     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
   #else
+    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+  #endif
+#else
+  #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
     typedef struct {
         unaryfunc am_await;
         unaryfunc am_aiter;
         unaryfunc am_anext;
     } __Pyx_PyAsyncMethodsStruct;
-    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
-  #endif
-#else
-  #define __Pyx_PyType_AsAsync(obj) NULL
 #endif
 #ifndef CYTHON_RESTRICT
   #if defined(__GNUC__)
@@ -489,14 +536,6 @@ static CYTHON_INLINE float __PYX_NAN() {
   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
 }
 
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
-#else
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
-#endif
-
 #ifndef __PYX_EXTERN_C
   #ifdef __cplusplus
     #define __PYX_EXTERN_C extern "C"
@@ -511,7 +550,7 @@ static CYTHON_INLINE float __PYX_NAN() {
 #include <omp.h>
 #endif /* _OPENMP */
 
-#ifdef PYREX_WITHOUT_ASSERTIONS
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
@@ -542,8 +581,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc
     #define __Pyx_sst_abs(value) abs(value)
 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
     #define __Pyx_sst_abs(value) labs(value)
-#elif defined (_MSC_VER) && defined (_M_X64)
-    #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (_MSC_VER)
+    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
     #define __Pyx_sst_abs(value) llabs(value)
 #elif defined (__GNUC__)
@@ -565,6 +604,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
 #endif
+#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
@@ -575,16 +620,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
     const Py_UNICODE *u_end = u;
     while (*u_end++) ;
     return (size_t)(u_end - u - 1);
 }
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
@@ -593,6 +633,8 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 #if CYTHON_ASSUME_SAFE_MACROS
@@ -693,7 +735,7 @@ bad:
 #endif /* __GNUC__ */
 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
 
-static PyObject *__pyx_m;
+static PyObject *__pyx_m = NULL;
 static PyObject *__pyx_d;
 static PyObject *__pyx_b;
 static PyObject *__pyx_cython_runtime;
@@ -971,7 +1013,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                               int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                      int is_list, int wraparound, int boundscheck);
 
@@ -1068,6 +1110,7 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
 
 /* PyObjectCallMethod1.proto */
 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
+static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
 
 /* append.proto */
 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
@@ -1078,17 +1121,19 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
     __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
     (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
                __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
+static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                                int is_list, int wraparound, int boundscheck);
 
 /* PyThreadStateGet.proto */
 #if CYTHON_FAST_THREAD_STATE
 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
+#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
 #else
 #define __Pyx_PyThreadState_declare
 #define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
 #endif
 
 /* SaveResetException.proto */
@@ -1182,13 +1227,21 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
 
 /* PyErrFetchRestore.proto */
 #if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
 #else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
@@ -1372,6 +1425,18 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 /* CIntFromPy.proto */
 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+
 /* SwapException.proto */
 #if CYTHON_FAST_THREAD_STATE
 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
@@ -1381,7 +1446,7 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
 #endif
 
 /* CoroutineBase.proto */
-typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *);
+typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
 typedef struct {
     PyObject_HEAD
     __pyx_coroutine_body_t body;
@@ -1401,12 +1466,30 @@ typedef struct {
 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
     PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure,
     PyObject *name, PyObject *qualname, PyObject *module_name);
+static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
+            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
+            PyObject *name, PyObject *qualname, PyObject *module_name);
 static int __Pyx_Coroutine_clear(PyObject *self);
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
+static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
+static PyObject *__Pyx_Coroutine_Close(PyObject *self);
+static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
+#define __Pyx_Coroutine_SwapException(self) {\
+    __Pyx_ExceptionSwap(&(self)->exc_type, &(self)->exc_value, &(self)->exc_traceback);\
+    __Pyx_Coroutine_ResetFrameBackpointer(self);\
+    }
+#define __Pyx_Coroutine_ResetAndClearException(self) {\
+    __Pyx_ExceptionReset((self)->exc_type, (self)->exc_value, (self)->exc_traceback);\
+    (self)->exc_type = (self)->exc_value = (self)->exc_traceback = NULL;\
+    }
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
+    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
 #else
-#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
+#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
+    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
 #endif
+static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
+static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *self);
 
 /* PatchModuleWithCoroutine.proto */
 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
@@ -2685,7 +2768,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_2html_annotate(CYTHON_UNUSED PyObjec
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 58, __pyx_L1_error)
         }
         break;
@@ -3201,7 +3284,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_4tokenize_annotated(CYTHON_UNUSED Py
   __Pyx_INCREF(__pyx_v_doc);
   __Pyx_GIVEREF(__pyx_v_doc);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_doc);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_include_hrefs, Py_False) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
@@ -3251,7 +3334,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_4tokenize_annotated(CYTHON_UNUSED Py
       if (unlikely(!__pyx_t_3)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 75, __pyx_L1_error)
         }
         break;
@@ -3423,7 +3506,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_6html_annotate_merge_annotations(CYT
  */
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_InsensitiveSequenceMatcher); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_a, __pyx_v_tokens_old) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_b, __pyx_v_tokens_new) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
@@ -3503,7 +3586,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_6html_annotate_merge_annotations(CYT
       if (unlikely(!__pyx_t_2)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 86, __pyx_L1_error)
         }
         break;
@@ -3829,8 +3912,8 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_8copy_annotations(CYTHON_UNUSED PyOb
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
   if (unlikely(!Py_OptimizeFlag)) {
-    __pyx_t_1 = PyObject_Length(__pyx_v_src); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 96, __pyx_L1_error)
-    __pyx_t_2 = PyObject_Length(__pyx_v_dest); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 96, __pyx_L1_error)
+    __pyx_t_1 = PyObject_Length(__pyx_v_src); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 96, __pyx_L1_error)
+    __pyx_t_2 = PyObject_Length(__pyx_v_dest); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 96, __pyx_L1_error)
     if (unlikely(!((__pyx_t_1 == __pyx_t_2) != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
       __PYX_ERR(0, 96, __pyx_L1_error)
@@ -3889,7 +3972,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_8copy_annotations(CYTHON_UNUSED PyOb
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 97, __pyx_L1_error)
         }
         break;
@@ -4101,7 +4184,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_10compress_tokens(CYTHON_UNUSED PyOb
       if (unlikely(!__pyx_t_2)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 106, __pyx_L1_error)
         }
         break;
@@ -4255,7 +4338,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_10compress_tokens(CYTHON_UNUSED PyOb
  * 
  */
     /*else*/ {
-      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_tok); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 112, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_tok); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 112, __pyx_L1_error)
     }
     __pyx_L5:;
 
@@ -4438,7 +4521,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_12compress_merge_back(CYTHON_UNUSED
  *     else:
  *         text = _unicode(last)
  */
-    __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_tokens, __pyx_v_tok); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 120, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_tokens, __pyx_v_tok); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 120, __pyx_L1_error)
 
     /* "lxml/html/diff.py":119
  *     tokens in-place).  """
@@ -4577,7 +4660,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_12compress_merge_back(CYTHON_UNUSED
  *                        post_tags=tok.post_tags,
  *                        trailing_whitespace=tok.trailing_whitespace)
  */
-    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 127, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_last, __pyx_n_s_pre_tags); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
@@ -4672,7 +4755,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_12compress_merge_back(CYTHON_UNUSED
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "lxml/html/diff.py":133
  *         tokens[-1] = merged
@@ -4781,7 +4864,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_14markup_serialize_tokens(CYTHON_UNU
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct__markup_serialize_tokens *__pyx_cur_scope = ((struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct__markup_serialize_tokens *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -4798,7 +4881,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *_
   PyObject *__pyx_t_11 = NULL;
   int __pyx_t_12;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("markup_serialize_tokens", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L8_resume_from_yield;
@@ -4850,7 +4933,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *_
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 138, __pyx_L1_error)
         }
         break;
@@ -4904,7 +4987,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *_
         if (unlikely(!__pyx_t_4)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 139, __pyx_L1_error)
           }
           break;
@@ -4935,6 +5018,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *_
       __pyx_cur_scope->__pyx_t_5 = __pyx_t_7;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -5109,6 +5193,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *_
     __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
     __Pyx_XGIVEREF(__pyx_r);
     __Pyx_RefNannyFinishContext();
+    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
     /* return from generator, yielding value */
     __pyx_generator->resume_label = 2;
     return __pyx_r;
@@ -5162,7 +5247,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *_
         if (unlikely(!__pyx_t_8)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 146, __pyx_L1_error)
           }
           break;
@@ -5193,6 +5278,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *_
       __pyx_cur_scope->__pyx_t_5 = __pyx_t_7;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 3;
       return __pyx_r;
@@ -5251,6 +5337,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_16generator(__pyx_CoroutineObject *_
   __Pyx_AddTraceback("markup_serialize_tokens", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -5732,7 +5819,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_19htmldiff_tokens(CYTHON_UNUSED PyOb
  */
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_InsensitiveSequenceMatcher); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_a, __pyx_v_html1_tokens) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_b, __pyx_v_html2_tokens) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
@@ -5824,7 +5911,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_19htmldiff_tokens(CYTHON_UNUSED PyOb
       if (unlikely(!__pyx_t_2)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 197, __pyx_L1_error)
         }
         break;
@@ -5936,7 +6023,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_19htmldiff_tokens(CYTHON_UNUSED PyOb
       __Pyx_GIVEREF(__pyx_t_7);
       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
       __pyx_t_7 = 0;
-      __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 199, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 199, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_equal, Py_True) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
@@ -6409,7 +6496,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_19htmldiff_tokens(CYTHON_UNUSED PyOb
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "lxml/html/diff.py":215
  *     return result
@@ -6522,7 +6609,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_21expand_tokens(CYTHON_UNUSED PyObje
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct_1_expand_tokens *__pyx_cur_scope = ((struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct_1_expand_tokens *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -6538,7 +6625,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *
   int __pyx_t_10;
   PyObject *__pyx_t_11 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("expand_tokens", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L8_resume_from_yield;
@@ -6591,7 +6678,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 219, __pyx_L1_error)
         }
         break;
@@ -6645,7 +6732,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *
         if (unlikely(!__pyx_t_4)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 220, __pyx_L1_error)
           }
           break;
@@ -6676,6 +6763,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *
       __pyx_cur_scope->__pyx_t_5 = __pyx_t_7;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -6779,6 +6867,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *
         __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
         __Pyx_XGIVEREF(__pyx_r);
         __Pyx_RefNannyFinishContext();
+        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
         /* return from generator, yielding value */
         __pyx_generator->resume_label = 2;
         return __pyx_r;
@@ -6836,6 +6925,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *
         __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
         __Pyx_XGIVEREF(__pyx_r);
         __Pyx_RefNannyFinishContext();
+        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
         /* return from generator, yielding value */
         __pyx_generator->resume_label = 3;
         return __pyx_r;
@@ -6900,7 +6990,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *
         if (unlikely(!__pyx_t_11)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 227, __pyx_L1_error)
           }
           break;
@@ -6931,6 +7021,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *
       __pyx_cur_scope->__pyx_t_5 = __pyx_t_7;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 4;
       return __pyx_r;
@@ -6987,6 +7078,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_23generator1(__pyx_CoroutineObject *
   __Pyx_AddTraceback("expand_tokens", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -7313,7 +7405,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_24merge_insert(CYTHON_UNUSED PyObjec
  *     if balanced and balanced[-1].endswith(' '):
  *         # We move space outside of </ins>
  */
-  __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_kp_s_ins); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 242, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_kp_s_ins); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 242, __pyx_L1_error)
 
   /* "lxml/html/diff.py":243
  *         doc[-1] += ' '
@@ -7427,7 +7519,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_24merge_insert(CYTHON_UNUSED PyObjec
  *     doc.extend(unbalanced_end)
  * 
  */
-  __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_kp_s_ins_2); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 247, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_kp_s_ins_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 247, __pyx_L1_error)
 
   /* "lxml/html/diff.py":248
  *     doc.extend(balanced)
@@ -7601,7 +7693,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_26merge_delete(CYTHON_UNUSED PyObjec
  */
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEL_START); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 266, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 266, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "lxml/html/diff.py":267
@@ -7667,7 +7759,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_26merge_delete(CYTHON_UNUSED PyObjec
  */
   __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEL_END); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 268, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "lxml/html/diff.py":262
@@ -7899,7 +7991,6 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_28cleanup_delete(CYTHON_UNUSED PyObj
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       goto __pyx_L12_try_end;
       __pyx_L5_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -7948,14 +8039,12 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_28cleanup_delete(CYTHON_UNUSED PyObj
  *             pre_delete, delete, post_delete = split_delete(chunks)
  *         except NoDeletes:
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_1);
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
       __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
       goto __pyx_L1_error;
       __pyx_L10_try_break:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_1);
       __Pyx_XGIVEREF(__pyx_t_2);
       __Pyx_XGIVEREF(__pyx_t_3);
@@ -8268,7 +8357,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_28cleanup_delete(CYTHON_UNUSED PyObj
  *         if balanced and balanced[-1].endswith(' '):
  *             # We move space outside of </del>
  */
-    __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_kp_s_del); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 299, __pyx_L1_error)
+    __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_kp_s_del); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 299, __pyx_L1_error)
 
     /* "lxml/html/diff.py":300
  *             doc[-1] += ' '
@@ -8382,7 +8471,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_28cleanup_delete(CYTHON_UNUSED PyObj
  *         doc.extend(post_delete)
  *         chunks = doc
  */
-    __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_kp_s_del_2); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 304, __pyx_L1_error)
+    __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_doc, __pyx_kp_s_del_2); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 304, __pyx_L1_error)
 
     /* "lxml/html/diff.py":305
  *         doc.extend(balanced)
@@ -8632,7 +8721,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 321, __pyx_L1_error)
         }
         break;
@@ -8666,7 +8755,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
  *             continue
  *         endtag = chunk[1] == '/'
  */
-      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_balanced, __pyx_v_chunk); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 323, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_balanced, __pyx_v_chunk); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 323, __pyx_L1_error)
 
       /* "lxml/html/diff.py":324
  *         if not chunk.startswith('<'):
@@ -8760,7 +8849,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
  *             continue
  *         if endtag:
  */
-      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_balanced, __pyx_v_chunk); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 328, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_balanced, __pyx_v_chunk); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error)
 
       /* "lxml/html/diff.py":329
  *         if name in empty_tags:
@@ -8823,7 +8912,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
  *                 name, pos, tag = tag_stack.pop()
  *                 balanced[pos] = tag
  */
-        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_balanced, __pyx_v_chunk); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 332, __pyx_L1_error)
+        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_balanced, __pyx_v_chunk); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 332, __pyx_L1_error)
 
         /* "lxml/html/diff.py":333
  *             if tag_stack and tag_stack[-1][0] == name:
@@ -9011,7 +9100,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
           if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_v_tag))) __PYX_ERR(0, 336, __pyx_L1_error)
         }
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_start, __pyx_t_5); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 336, __pyx_L1_error)
+        __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_start, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 336, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
         /* "lxml/html/diff.py":337
@@ -9033,7 +9122,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
  *             else:
  *                 end.append(chunk)
  */
-        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_end, __pyx_v_chunk); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 338, __pyx_L1_error)
+        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_end, __pyx_v_chunk); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 338, __pyx_L1_error)
 
         /* "lxml/html/diff.py":335
  *                 name, pos, tag = tag_stack.pop()
@@ -9053,7 +9142,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
  *             tag_stack.append((name, len(balanced), chunk))
  */
       /*else*/ {
-        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_end, __pyx_v_chunk); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 340, __pyx_L1_error)
+        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_end, __pyx_v_chunk); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 340, __pyx_L1_error)
       }
       __pyx_L8:;
 
@@ -9075,7 +9164,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
  *     start.extend(
  */
     /*else*/ {
-      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_balanced); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 342, __pyx_L1_error)
+      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_balanced); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 342, __pyx_L1_error)
       __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 342, __pyx_L1_error)
@@ -9089,7 +9178,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
       __Pyx_GIVEREF(__pyx_v_chunk);
       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_chunk);
       __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_tag_stack, __pyx_t_10); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 342, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_tag_stack, __pyx_t_10); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 342, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
 
       /* "lxml/html/diff.py":343
@@ -9099,7 +9188,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
  *     start.extend(
  *         [chunk for name, pos, chunk in tag_stack])
  */
-      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_balanced, Py_None); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 343, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_balanced, Py_None); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 343, __pyx_L1_error)
     }
     __pyx_L7:;
 
@@ -9206,7 +9295,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_30split_unbalanced(CYTHON_UNUSED PyO
  *         [chunk for name, pos, chunk in tag_stack])
  *     balanced = [chunk for chunk in balanced if chunk is not None]
  */
-  __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_start, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_start, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 344, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "lxml/html/diff.py":346
@@ -9425,7 +9514,6 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_32split_delete(CYTHON_UNUSED PyObjec
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -9470,7 +9558,6 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_32split_delete(CYTHON_UNUSED PyObjec
  *         pos = chunks.index(DEL_START)
  *     except ValueError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -10032,7 +10119,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_34locate_unbalanced_start(CYTHON_UNU
  */
       __pyx_t_4 = __Pyx_PyObject_PopIndex(__pyx_v_post_delete, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_pre_delete, __pyx_t_4); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 406, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_pre_delete, __pyx_t_4); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 406, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
       /* "lxml/html/diff.py":404
@@ -11354,7 +11441,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_9tag_token___new__(CYTHON_UNUSED PyO
  *                             post_tags=post_tags,
  *                             trailing_whitespace=trailing_whitespace)
  */
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pre_tags, __pyx_v_pre_tags) < 0) __PYX_ERR(0, 487, __pyx_L1_error)
 
@@ -11926,7 +12013,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_38tokenize(CYTHON_UNUSED PyObject *_
     __Pyx_INCREF(__pyx_v_html);
     __Pyx_GIVEREF(__pyx_v_html);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_html);
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cleanup, Py_True) < 0) __PYX_ERR(0, 534, __pyx_L1_error)
     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error)
@@ -11953,7 +12040,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_38tokenize(CYTHON_UNUSED PyObject *_
   __Pyx_INCREF(__pyx_v_body_el);
   __Pyx_GIVEREF(__pyx_v_body_el);
   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_body_el);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_skip_tag, Py_True) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_include_hrefs, __pyx_v_include_hrefs) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
@@ -12221,7 +12308,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_40parse_html(CYTHON_UNUSED PyObject
   __Pyx_INCREF(__pyx_v_html);
   __Pyx_GIVEREF(__pyx_v_html);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_html);
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_create_parent, Py_True) < 0) __PYX_ERR(0, 551, __pyx_L1_error)
   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
@@ -12668,7 +12755,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_44split_trailing_whitespace(CYTHON_U
   }
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 577, __pyx_L1_error)
+  __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 577, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_stripped_length = __pyx_t_4;
 
@@ -12838,7 +12925,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 588, __pyx_L1_error)
         }
         break;
@@ -13013,7 +13100,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
         __Pyx_INCREF(__pyx_v_src);
         __Pyx_GIVEREF(__pyx_v_src);
         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_src);
-        __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L1_error)
+        __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_html_repr, __pyx_v_tag) < 0) __PYX_ERR(0, 593, __pyx_L1_error)
 
@@ -13069,7 +13156,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
  * 
  *             elif chunk[0] == 'href':
  */
-        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_cur_word); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 597, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_cur_word); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 597, __pyx_L1_error)
 
         /* "lxml/html/diff.py":590
  *     for chunk in chunks:
@@ -13120,7 +13207,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
         __Pyx_INCREF(__pyx_v_href);
         __Pyx_GIVEREF(__pyx_v_href);
         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_href);
-        __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 601, __pyx_L1_error)
+        __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 601, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
         if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_pre_tags, __pyx_v_tag_accum) < 0) __PYX_ERR(0, 601, __pyx_L1_error)
         if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_trailing_whitespace, __pyx_kp_s__3) < 0) __PYX_ERR(0, 601, __pyx_L1_error)
@@ -13151,7 +13238,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
  *             continue
  * 
  */
-        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_cur_word); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 603, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_cur_word); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 603, __pyx_L1_error)
 
         /* "lxml/html/diff.py":599
  *                 result.append(cur_word)
@@ -13358,7 +13445,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
       __Pyx_INCREF(__pyx_v_chunk);
       __Pyx_GIVEREF(__pyx_v_chunk);
       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chunk);
-      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 608, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 608, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_10);
       if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_pre_tags, __pyx_v_tag_accum) < 0) __PYX_ERR(0, 608, __pyx_L1_error)
       if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_trailing_whitespace, __pyx_v_trailing_whitespace) < 0) __PYX_ERR(0, 608, __pyx_L1_error)
@@ -13389,7 +13476,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
  * 
  *         elif is_start_tag(chunk):
  */
-      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_cur_word); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 610, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_cur_word); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 610, __pyx_L1_error)
 
       /* "lxml/html/diff.py":606
  *             continue
@@ -13464,7 +13551,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
  * 
  *         elif is_end_tag(chunk):
  */
-      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_tag_accum, __pyx_v_chunk); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 613, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_tag_accum, __pyx_v_chunk); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 613, __pyx_L1_error)
 
       /* "lxml/html/diff.py":612
  *             result.append(cur_word)
@@ -13549,7 +13636,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
  *             else:
  *                 assert cur_word, (
  */
-        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_tag_accum, __pyx_v_chunk); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 617, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_tag_accum, __pyx_v_chunk); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 617, __pyx_L1_error)
 
         /* "lxml/html/diff.py":616
  * 
@@ -13614,7 +13701,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
  */
         __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur_word, __pyx_n_s_post_tags); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 622, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_10, __pyx_v_chunk); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 622, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_10, __pyx_v_chunk); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 622, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       }
       __pyx_L12:;
@@ -13680,7 +13767,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
     __Pyx_XDECREF(__pyx_r);
     __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_token); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 627, __pyx_L1_error)
+    __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 627, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
     if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_pre_tags, __pyx_v_tag_accum) < 0) __PYX_ERR(0, 627, __pyx_L1_error)
     __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 627, __pyx_L1_error)
@@ -13810,7 +13897,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_46fixup_chunks(CYTHON_UNUSED PyObjec
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
 /* "lxml/html/diff.py":680
  * 
@@ -13937,7 +14024,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_48flatten_el(CYTHON_UNUSED PyObject
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
 {
   struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct_2_flatten_el *__pyx_cur_scope = ((struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct_2_flatten_el *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
@@ -13954,7 +14041,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
   Py_ssize_t __pyx_t_11;
   PyObject *(*__pyx_t_12)(PyObject *);
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
+  __Pyx_RefNannySetupContext("flatten_el", 0);
   switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L6_resume_from_yield;
@@ -14067,6 +14154,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
       __pyx_t_5 = 0;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 1;
       return __pyx_r;
@@ -14140,6 +14228,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
       __pyx_t_5 = 0;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 2;
       return __pyx_r;
@@ -14187,7 +14276,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
     __pyx_t_2 = __pyx_t_1;
     goto __pyx_L9_bool_binop_done;
   }
-  __pyx_t_9 = PyObject_Length(__pyx_cur_scope->__pyx_v_el); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
+  __pyx_t_9 = PyObject_Length(__pyx_cur_scope->__pyx_v_el); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 692, __pyx_L1_error)
   __pyx_t_1 = ((!(__pyx_t_9 != 0)) != 0);
   if (__pyx_t_1) {
   } else {
@@ -14323,7 +14412,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 695, __pyx_L1_error)
         }
         break;
@@ -14395,6 +14484,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
     __pyx_cur_scope->__pyx_t_2 = __pyx_t_10;
     __Pyx_XGIVEREF(__pyx_r);
     __Pyx_RefNannyFinishContext();
+    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
     /* return from generator, yielding value */
     __pyx_generator->resume_label = 3;
     return __pyx_r;
@@ -14455,7 +14545,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 697, __pyx_L1_error)
         }
         break;
@@ -14481,7 +14571,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
     __Pyx_INCREF(__pyx_cur_scope->__pyx_v_child);
     __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_child);
     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_child);
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_include_hrefs, __pyx_cur_scope->__pyx_v_include_hrefs) < 0) __PYX_ERR(0, 698, __pyx_L1_error)
     __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 698, __pyx_L1_error)
@@ -14522,7 +14612,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
         if (unlikely(!__pyx_t_7)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 698, __pyx_L1_error)
           }
           break;
@@ -14553,6 +14643,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
       __pyx_cur_scope->__pyx_t_5 = __pyx_t_12;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 4;
       return __pyx_r;
@@ -14646,6 +14737,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
     __pyx_t_4 = 0;
     __Pyx_XGIVEREF(__pyx_r);
     __Pyx_RefNannyFinishContext();
+    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
     /* return from generator, yielding value */
     __pyx_generator->resume_label = 5;
     return __pyx_r;
@@ -14728,6 +14820,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
     __pyx_t_4 = 0;
     __Pyx_XGIVEREF(__pyx_r);
     __Pyx_RefNannyFinishContext();
+    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
     /* return from generator, yielding value */
     __pyx_generator->resume_label = 6;
     return __pyx_r;
@@ -14834,7 +14927,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
         if (unlikely(!__pyx_t_3)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 705, __pyx_L1_error)
           }
           break;
@@ -14906,6 +14999,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
       __pyx_cur_scope->__pyx_t_2 = __pyx_t_10;
       __Pyx_XGIVEREF(__pyx_r);
       __Pyx_RefNannyFinishContext();
+      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
       /* return from generator, yielding value */
       __pyx_generator->resume_label = 7;
       return __pyx_r;
@@ -14957,6 +15051,7 @@ static PyObject *__pyx_gb_4lxml_4html_4diff_50generator2(__pyx_CoroutineObject *
   __Pyx_AddTraceback("flatten_el", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
   __pyx_generator->resume_label = -1;
   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
@@ -15281,7 +15376,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_53start_tag(CYTHON_UNUSED PyObject *
       if (unlikely(!__pyx_t_3)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 727, __pyx_L1_error)
         }
         break;
@@ -15951,7 +16046,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_63fixup_ins_del_tags(CYTHON_UNUSED P
   __Pyx_INCREF(__pyx_v_html);
   __Pyx_GIVEREF(__pyx_v_html);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_html);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_cleanup, Py_False) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error)
@@ -16030,7 +16125,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_63fixup_ins_del_tags(CYTHON_UNUSED P
   __Pyx_INCREF(__pyx_v_doc);
   __Pyx_GIVEREF(__pyx_v_doc);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_doc);
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_skip_outer, Py_True) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
   __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
@@ -16174,7 +16269,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_65serialize_html_fragment(CYTHON_UNU
   if (unlikely(!Py_OptimizeFlag)) {
     __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_IsInstance(__pyx_v_el, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 762, __pyx_L1_error)
+    __pyx_t_2 = PyObject_IsInstance(__pyx_v_el, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 762, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (unlikely(!((!(__pyx_t_2 != 0)) != 0))) {
 
@@ -16211,7 +16306,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_65serialize_html_fragment(CYTHON_UNU
   __Pyx_INCREF(__pyx_v_el);
   __Pyx_GIVEREF(__pyx_v_el);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_el);
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_method, __pyx_n_s_html) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
   __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 764, __pyx_L1_error)
@@ -16503,7 +16598,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_67_fixup_ins_del_tags(CYTHON_UNUSED
         if (unlikely(!__pyx_t_3)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 778, __pyx_L1_error)
           }
           break;
@@ -16602,7 +16697,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_67_fixup_ins_del_tags(CYTHON_UNUSED
       __Pyx_INCREF(__pyx_v_el);
       __Pyx_GIVEREF(__pyx_v_el);
       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_el);
-      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 781, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 781, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(0, 781, __pyx_L1_error)
       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 781, __pyx_L1_error)
@@ -16821,7 +16916,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_69_contains_block_level_tag(CYTHON_U
       if (unlikely(!__pyx_t_3)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 790, __pyx_L1_error)
         }
         break;
@@ -17088,7 +17183,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_71_move_el_inside_block(CYTHON_UNUSE
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 798, __pyx_L1_error)
         }
         break;
@@ -17843,7 +17938,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_71_move_el_inside_block(CYTHON_UNUSE
  *     if el.text:
  *         text_tag = etree.Element(tag)
  */
-      __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_child_tag, __pyx_v_child); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 821, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_child_tag, __pyx_v_child); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 821, __pyx_L1_error)
     }
     __pyx_L9:;
 
@@ -18160,7 +18255,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_73_merge_element_contents(CYTHON_UNU
  *             text += el.tail
  *         else:
  */
-    __pyx_t_5 = PyObject_Length(__pyx_v_el); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 837, __pyx_L1_error)
+    __pyx_t_5 = PyObject_Length(__pyx_v_el); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 837, __pyx_L1_error)
     __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0);
     if (__pyx_t_4) {
 
@@ -18627,11 +18722,11 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_26InsensitiveSequenceMatcher_get_mat
  */
   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 871, __pyx_L1_error)
+  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 871, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 871, __pyx_L1_error)
+  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 871, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (((__pyx_t_2 < __pyx_t_3) != 0)) {
     __pyx_t_4 = __pyx_t_2;
@@ -18743,14 +18838,6 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_26InsensitiveSequenceMatcher_get_mat
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-
-  /* "lxml/html/diff.py":875
- *         actual = difflib.SequenceMatcher.get_matching_blocks(self)
- *         return [item for item in actual
- *                 if item[2] > threshold             # <<<<<<<<<<<<<<
- *                 or not item[2]]
- * 
- */
   if (likely(PyList_CheckExact(__pyx_v_actual)) || PyTuple_CheckExact(__pyx_v_actual)) {
     __pyx_t_6 = __pyx_v_actual; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0;
     __pyx_t_9 = NULL;
@@ -18760,14 +18847,6 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_26InsensitiveSequenceMatcher_get_mat
     __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 874, __pyx_L1_error)
   }
   for (;;) {
-
-    /* "lxml/html/diff.py":874
- *         threshold = min(self.threshold, size / 4)
- *         actual = difflib.SequenceMatcher.get_matching_blocks(self)
- *         return [item for item in actual             # <<<<<<<<<<<<<<
- *                 if item[2] > threshold
- *                 or not item[2]]
- */
     if (likely(!__pyx_t_9)) {
       if (likely(PyList_CheckExact(__pyx_t_6))) {
         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break;
@@ -18791,7 +18870,7 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_26InsensitiveSequenceMatcher_get_mat
       if (unlikely(!__pyx_t_7)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 874, __pyx_L1_error)
         }
         break;
@@ -18810,24 +18889,8 @@ static PyObject *__pyx_pf_4lxml_4html_4diff_26InsensitiveSequenceMatcher_get_mat
  */
     __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_item, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 875, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
-
-    /* "lxml/html/diff.py":876
- *         return [item for item in actual
- *                 if item[2] > threshold
- *                 or not item[2]]             # <<<<<<<<<<<<<<
- * 
- * if __name__ == '__main__':
- */
     __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_v_threshold, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 875, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-    /* "lxml/html/diff.py":875
- *         actual = difflib.SequenceMatcher.get_matching_blocks(self)
- *         return [item for item in actual
- *                 if item[2] > threshold             # <<<<<<<<<<<<<<
- *                 or not item[2]]
- * 
- */
     __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 875, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     if (!__pyx_t_10) {
@@ -18982,19 +19045,6 @@ static int __pyx_tp_traverse_4lxml_4html_4diff___pyx_scope_struct__markup_serial
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_4html_4diff___pyx_scope_struct__markup_serialize_tokens(PyObject *o) {
-  struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct__markup_serialize_tokens *p = (struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct__markup_serialize_tokens *)o;
-  Py_CLEAR(p->__pyx_v_html);
-  Py_CLEAR(p->__pyx_v_markup_func);
-  Py_CLEAR(p->__pyx_v_post);
-  Py_CLEAR(p->__pyx_v_pre);
-  Py_CLEAR(p->__pyx_v_token);
-  Py_CLEAR(p->__pyx_v_tokens);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_3);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_4html_4diff___pyx_scope_struct__markup_serialize_tokens = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.html.diff.__pyx_scope_struct__markup_serialize_tokens", /*tp_name*/
@@ -19023,7 +19073,7 @@ static PyTypeObject __pyx_type_4lxml_4html_4diff___pyx_scope_struct__markup_seri
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_4html_4diff___pyx_scope_struct__markup_serialize_tokens, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_4html_4diff___pyx_scope_struct__markup_serialize_tokens, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -19114,18 +19164,6 @@ static int __pyx_tp_traverse_4lxml_4html_4diff___pyx_scope_struct_1_expand_token
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_4html_4diff___pyx_scope_struct_1_expand_tokens(PyObject *o) {
-  struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct_1_expand_tokens *p = (struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct_1_expand_tokens *)o;
-  Py_CLEAR(p->__pyx_v_equal);
-  Py_CLEAR(p->__pyx_v_post);
-  Py_CLEAR(p->__pyx_v_pre);
-  Py_CLEAR(p->__pyx_v_token);
-  Py_CLEAR(p->__pyx_v_tokens);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_3);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_4html_4diff___pyx_scope_struct_1_expand_tokens = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.html.diff.__pyx_scope_struct_1_expand_tokens", /*tp_name*/
@@ -19154,7 +19192,7 @@ static PyTypeObject __pyx_type_4lxml_4html_4diff___pyx_scope_struct_1_expand_tok
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_4html_4diff___pyx_scope_struct_1_expand_tokens, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_4html_4diff___pyx_scope_struct_1_expand_tokens, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -19257,21 +19295,6 @@ static int __pyx_tp_traverse_4lxml_4html_4diff___pyx_scope_struct_2_flatten_el(P
   return 0;
 }
 
-static int __pyx_tp_clear_4lxml_4html_4diff___pyx_scope_struct_2_flatten_el(PyObject *o) {
-  struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct_2_flatten_el *p = (struct __pyx_obj_4lxml_4html_4diff___pyx_scope_struct_2_flatten_el *)o;
-  Py_CLEAR(p->__pyx_v_child);
-  Py_CLEAR(p->__pyx_v_el);
-  Py_CLEAR(p->__pyx_v_end_words);
-  Py_CLEAR(p->__pyx_v_include_hrefs);
-  Py_CLEAR(p->__pyx_v_item);
-  Py_CLEAR(p->__pyx_v_skip_tag);
-  Py_CLEAR(p->__pyx_v_start_words);
-  Py_CLEAR(p->__pyx_v_word);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_3);
-  return 0;
-}
-
 static PyTypeObject __pyx_type_4lxml_4html_4diff___pyx_scope_struct_2_flatten_el = {
   PyVarObject_HEAD_INIT(0, 0)
   "lxml.html.diff.__pyx_scope_struct_2_flatten_el", /*tp_name*/
@@ -19300,7 +19323,7 @@ static PyTypeObject __pyx_type_4lxml_4html_4diff___pyx_scope_struct_2_flatten_el
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
   0, /*tp_doc*/
   __pyx_tp_traverse_4lxml_4html_4diff___pyx_scope_struct_2_flatten_el, /*tp_traverse*/
-  __pyx_tp_clear_4lxml_4html_4diff___pyx_scope_struct_2_flatten_el, /*tp_clear*/
+  0, /*tp_clear*/
   0, /*tp_richcompare*/
   0, /*tp_weaklistoffset*/
   0, /*tp_iter*/
@@ -19335,17 +19358,31 @@ static PyMethodDef __pyx_methods[] = {
 };
 
 #if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec_diff(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+  {Py_mod_create, (void*)__pyx_pymod_create},
+  {Py_mod_exec, (void*)__pyx_pymod_exec_diff},
+  {0, NULL}
+};
+#endif
+
 static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
     PyModuleDef_HEAD_INIT,
-  #endif
     "diff",
     0, /* m_doc */
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    0, /* m_size */
+  #else
     -1, /* m_size */
+  #endif
     __pyx_methods /* m_methods */,
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    __pyx_moduledef_slots, /* m_slots */
+  #else
     NULL, /* m_reload */
+  #endif
     NULL, /* m_traverse */
     NULL, /* m_clear */
     (freefunc)__pyx_module_cleanup /* m_free */
@@ -19988,7 +20025,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_text, __pyx_n_s_version); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 27, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__36);
   __Pyx_GIVEREF(__pyx_tuple__36);
-  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_default_markup, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_default_markup, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 27, __pyx_L1_error)
 
   /* "lxml/html/diff.py":31
  *         html_escape(_unicode(version), 1), text)
@@ -20000,7 +20037,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__38 = PyTuple_Pack(8, __pyx_n_s_doclist, __pyx_n_s_markup, __pyx_n_s_tokenlist, __pyx_n_s_cur_tokens, __pyx_n_s_tokens, __pyx_n_s_result, __pyx_n_s_doc, __pyx_n_s_version); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 31, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__38);
   __Pyx_GIVEREF(__pyx_tuple__38);
-  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_html_annotate, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_html_annotate, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 31, __pyx_L1_error)
 
   /* "lxml/html/diff.py":71
  *     return ''.join(result).strip()
@@ -20012,7 +20049,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_doc, __pyx_n_s_annotation, __pyx_n_s_tokens, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 71, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__40);
   __Pyx_GIVEREF(__pyx_tuple__40);
-  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_tokenize_annotated, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 71, __pyx_L1_error)
+  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_tokenize_annotated, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 71, __pyx_L1_error)
 
   /* "lxml/html/diff.py":79
  *     return tokens
@@ -20024,7 +20061,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__42 = PyTuple_Pack(11, __pyx_n_s_tokens_old, __pyx_n_s_tokens_new, __pyx_n_s_s, __pyx_n_s_commands, __pyx_n_s_command, __pyx_n_s_i1, __pyx_n_s_i2, __pyx_n_s_j1, __pyx_n_s_j2, __pyx_n_s_eq_old, __pyx_n_s_eq_new); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 79, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__42);
   __Pyx_GIVEREF(__pyx_tuple__42);
-  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_html_annotate_merge_annotations, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_html_annotate_merge_annotations, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 79, __pyx_L1_error)
 
   /* "lxml/html/diff.py":92
  *             copy_annotations(eq_old, eq_new)
@@ -20036,7 +20073,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__44 = PyTuple_Pack(4, __pyx_n_s_src, __pyx_n_s_dest, __pyx_n_s_src_tok, __pyx_n_s_dest_tok); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 92, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__44);
   __Pyx_GIVEREF(__pyx_tuple__44);
-  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_copy_annotations, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_copy_annotations, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 92, __pyx_L1_error)
 
   /* "lxml/html/diff.py":100
  *         dest_tok.annotation = src_tok.annotation
@@ -20048,7 +20085,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__46 = PyTuple_Pack(3, __pyx_n_s_tokens, __pyx_n_s_result, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 100, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__46);
   __Pyx_GIVEREF(__pyx_tuple__46);
-  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_compress_tokens, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_compress_tokens, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 100, __pyx_L1_error)
 
   /* "lxml/html/diff.py":115
  *     return result
@@ -20060,7 +20097,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__48 = PyTuple_Pack(5, __pyx_n_s_tokens, __pyx_n_s_tok, __pyx_n_s_last, __pyx_n_s_text, __pyx_n_s_merged); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 115, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__48);
   __Pyx_GIVEREF(__pyx_tuple__48);
-  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_compress_merge_back, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_compress_merge_back, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 115, __pyx_L1_error)
 
   /* "lxml/html/diff.py":133
  *         tokens[-1] = merged
@@ -20072,7 +20109,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__50 = PyTuple_Pack(6, __pyx_n_s_tokens, __pyx_n_s_markup_func, __pyx_n_s_token, __pyx_n_s_pre, __pyx_n_s_html, __pyx_n_s_post); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 133, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__50);
   __Pyx_GIVEREF(__pyx_tuple__50);
-  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_markup_serialize_tokens, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_markup_serialize_tokens, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 133, __pyx_L1_error)
 
   /* "lxml/html/diff.py":154
  * ############################################################
@@ -20084,7 +20121,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_old_html, __pyx_n_s_new_html, __pyx_n_s_old_html_tokens, __pyx_n_s_new_html_tokens, __pyx_n_s_result); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 154, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__52);
   __Pyx_GIVEREF(__pyx_tuple__52);
-  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_htmldiff, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_htmldiff, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 154, __pyx_L1_error)
 
   /* "lxml/html/diff.py":177
  *     return fixup_ins_del_tags(result)
@@ -20096,7 +20133,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__54 = PyTuple_Pack(12, __pyx_n_s_html1_tokens, __pyx_n_s_html2_tokens, __pyx_n_s_s, __pyx_n_s_commands, __pyx_n_s_result, __pyx_n_s_command, __pyx_n_s_i1, __pyx_n_s_i2, __pyx_n_s_j1, __pyx_n_s_j2, __pyx_n_s_ins_tokens, __pyx_n_s_del_tokens); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 177, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__54);
   __Pyx_GIVEREF(__pyx_tuple__54);
-  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_htmldiff_tokens, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 177, __pyx_L1_error)
+  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_htmldiff_tokens, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 177, __pyx_L1_error)
 
   /* "lxml/html/diff.py":215
  *     return result
@@ -20108,7 +20145,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_tokens, __pyx_n_s_equal, __pyx_n_s_token, __pyx_n_s_pre, __pyx_n_s_post); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 215, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__56);
   __Pyx_GIVEREF(__pyx_tuple__56);
-  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_expand_tokens, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_expand_tokens, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 215, __pyx_L1_error)
   __pyx_tuple__58 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 215, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__58);
   __Pyx_GIVEREF(__pyx_tuple__58);
@@ -20123,7 +20160,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__59 = PyTuple_Pack(5, __pyx_n_s_ins_chunks, __pyx_n_s_doc, __pyx_n_s_unbalanced_start, __pyx_n_s_balanced, __pyx_n_s_unbalanced_end); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 230, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__59);
   __Pyx_GIVEREF(__pyx_tuple__59);
-  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_merge_insert, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 230, __pyx_L1_error)
+  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_merge_insert, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 230, __pyx_L1_error)
 
   /* "lxml/html/diff.py":262
  *     (DEL_START/DEL_END) """
@@ -20135,7 +20172,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_del_chunks, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 262, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__61);
   __Pyx_GIVEREF(__pyx_tuple__61);
-  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_merge_delete, 262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 262, __pyx_L1_error)
+  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_merge_delete, 262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 262, __pyx_L1_error)
 
   /* "lxml/html/diff.py":270
  *     doc.append(DEL_END)
@@ -20147,7 +20184,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__63 = PyTuple_Pack(8, __pyx_n_s_chunks, __pyx_n_s_pre_delete, __pyx_n_s_delete, __pyx_n_s_post_delete, __pyx_n_s_unbalanced_start, __pyx_n_s_balanced, __pyx_n_s_unbalanced_end, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 270, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__63);
   __Pyx_GIVEREF(__pyx_tuple__63);
-  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_cleanup_delete, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 270, __pyx_L1_error)
+  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_cleanup_delete, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 270, __pyx_L1_error)
 
   /* "lxml/html/diff.py":309
  *     return chunks
@@ -20159,7 +20196,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__65 = PyTuple_Pack(10, __pyx_n_s_chunks, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_tag_stack, __pyx_n_s_balanced, __pyx_n_s_chunk, __pyx_n_s_endtag, __pyx_n_s_name, __pyx_n_s_pos, __pyx_n_s_tag); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 309, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__65);
   __Pyx_GIVEREF(__pyx_tuple__65);
-  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_split_unbalanced, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 309, __pyx_L1_error)
+  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_split_unbalanced, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 309, __pyx_L1_error)
 
   /* "lxml/html/diff.py":349
  *     return start, balanced, end
@@ -20171,7 +20208,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__67 = PyTuple_Pack(3, __pyx_n_s_chunks, __pyx_n_s_pos, __pyx_n_s_pos2); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 349, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__67);
   __Pyx_GIVEREF(__pyx_tuple__67);
-  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_split_delete, 349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 349, __pyx_L1_error)
+  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_split_delete, 349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 349, __pyx_L1_error)
 
   /* "lxml/html/diff.py":361
  *     return chunks[:pos], chunks[pos+1:pos2], chunks[pos2+1:]
@@ -20183,7 +20220,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__69 = PyTuple_Pack(7, __pyx_n_s_unbalanced_start, __pyx_n_s_pre_delete, __pyx_n_s_post_delete, __pyx_n_s_finding, __pyx_n_s_finding_name, __pyx_n_s_next, __pyx_n_s_name); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 361, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__69);
   __Pyx_GIVEREF(__pyx_tuple__69);
-  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_locate_unbalanced_start, 361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 361, __pyx_L1_error)
+  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_locate_unbalanced_start, 361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 361, __pyx_L1_error)
 
   /* "lxml/html/diff.py":411
  *             break
@@ -20195,7 +20232,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__71 = PyTuple_Pack(7, __pyx_n_s_unbalanced_end, __pyx_n_s_pre_delete, __pyx_n_s_post_delete, __pyx_n_s_finding, __pyx_n_s_finding_name, __pyx_n_s_next, __pyx_n_s_name); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 411, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__71);
   __Pyx_GIVEREF(__pyx_tuple__71);
-  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_locate_unbalanced_end, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 411, __pyx_L1_error)
+  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_locate_unbalanced_end, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 411, __pyx_L1_error)
 
   /* "lxml/html/diff.py":454
  *     hide_when_equal = False
@@ -20207,7 +20244,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__73 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_text, __pyx_n_s_pre_tags, __pyx_n_s_post_tags, __pyx_n_s_trailing_whitespace, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 454, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__73);
   __Pyx_GIVEREF(__pyx_tuple__73);
-  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_new, 454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 454, __pyx_L1_error)
+  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_new, 454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 454, __pyx_L1_error)
   __pyx_tuple__75 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_kp_s_)); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 454, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__75);
   __Pyx_GIVEREF(__pyx_tuple__75);
@@ -20222,7 +20259,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 471, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__76);
   __Pyx_GIVEREF(__pyx_tuple__76);
-  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_repr, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 471, __pyx_L1_error)
+  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_repr, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 471, __pyx_L1_error)
 
   /* "lxml/html/diff.py":475
  *                                           self.post_tags, self.trailing_whitespace)
@@ -20234,7 +20271,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__78 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 475, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__78);
   __Pyx_GIVEREF(__pyx_tuple__78);
-  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_html, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 475, __pyx_L1_error)
+  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_html, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 475, __pyx_L1_error)
 
   /* "lxml/html/diff.py":484
  *     is only represented in a document by a tag.  """
@@ -20246,7 +20283,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__80 = PyTuple_Pack(8, __pyx_n_s_cls, __pyx_n_s_tag, __pyx_n_s_data, __pyx_n_s_html_repr, __pyx_n_s_pre_tags, __pyx_n_s_post_tags, __pyx_n_s_trailing_whitespace, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 484, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__80);
   __Pyx_GIVEREF(__pyx_tuple__80);
-  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_new, 484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 484, __pyx_L1_error)
+  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_new, 484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 484, __pyx_L1_error)
   __pyx_tuple__82 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_kp_s_)); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 484, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__82);
   __Pyx_GIVEREF(__pyx_tuple__82);
@@ -20261,7 +20298,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 495, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__83);
   __Pyx_GIVEREF(__pyx_tuple__83);
-  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_repr, 495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 495, __pyx_L1_error)
+  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_repr, 495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 495, __pyx_L1_error)
 
   /* "lxml/html/diff.py":503
  *             self.post_tags,
@@ -20273,7 +20310,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 503, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__85);
   __Pyx_GIVEREF(__pyx_tuple__85);
-  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_html, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 503, __pyx_L1_error)
+  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_html, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 503, __pyx_L1_error)
 
   /* "lxml/html/diff.py":513
  *     hide_when_equal = True
@@ -20285,7 +20322,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 513, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__87);
   __Pyx_GIVEREF(__pyx_tuple__87);
-  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_html, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 513, __pyx_L1_error)
+  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_html, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 513, __pyx_L1_error)
 
   /* "lxml/html/diff.py":516
  *         return ' Link: %s' % self
@@ -20297,7 +20334,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__89 = PyTuple_Pack(4, __pyx_n_s_html, __pyx_n_s_include_hrefs, __pyx_n_s_body_el, __pyx_n_s_chunks); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 516, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__89);
   __Pyx_GIVEREF(__pyx_tuple__89);
-  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_tokenize, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 516, __pyx_L1_error)
+  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_tokenize, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 516, __pyx_L1_error)
   __pyx_tuple__91 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 516, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__91);
   __Pyx_GIVEREF(__pyx_tuple__91);
@@ -20312,7 +20349,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__92 = PyTuple_Pack(2, __pyx_n_s_html, __pyx_n_s_cleanup); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 540, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__92);
   __Pyx_GIVEREF(__pyx_tuple__92);
-  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_parse_html, 540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_parse_html, 540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 540, __pyx_L1_error)
   __pyx_tuple__94 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 540, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__94);
   __Pyx_GIVEREF(__pyx_tuple__94);
@@ -20327,7 +20364,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__95 = PyTuple_Pack(2, __pyx_n_s_html, __pyx_n_s_match); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 557, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__95);
   __Pyx_GIVEREF(__pyx_tuple__95);
-  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_cleanup_html, 557, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_cleanup_html, 557, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 557, __pyx_L1_error)
 
   /* "lxml/html/diff.py":571
  * 
@@ -20350,7 +20387,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_word, __pyx_n_s_stripped_length); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 573, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__98);
   __Pyx_GIVEREF(__pyx_tuple__98);
-  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_split_trailing_whitespace, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 573, __pyx_L1_error)
+  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_split_trailing_whitespace, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 573, __pyx_L1_error)
 
   /* "lxml/html/diff.py":581
  * 
@@ -20362,7 +20399,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__100 = PyTuple_Pack(9, __pyx_n_s_chunks, __pyx_n_s_tag_accum, __pyx_n_s_cur_word, __pyx_n_s_result, __pyx_n_s_chunk, __pyx_n_s_src, __pyx_n_s_tag, __pyx_n_s_trailing_whitespace, __pyx_n_s_href); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 581, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__100);
   __Pyx_GIVEREF(__pyx_tuple__100);
-  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_fixup_chunks, 581, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 581, __pyx_L1_error)
+  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_fixup_chunks, 581, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 581, __pyx_L1_error)
 
   /* "lxml/html/diff.py":636
  * # All the tags in HTML that don't require end tags:
@@ -20407,7 +20444,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__105 = PyTuple_Pack(8, __pyx_n_s_el, __pyx_n_s_include_hrefs, __pyx_n_s_skip_tag, __pyx_n_s_start_words, __pyx_n_s_word, __pyx_n_s_child, __pyx_n_s_item, __pyx_n_s_end_words); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 680, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__105);
   __Pyx_GIVEREF(__pyx_tuple__105);
-  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_flatten_el, 680, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 680, __pyx_L1_error)
+  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_flatten_el, 680, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 680, __pyx_L1_error)
   __pyx_tuple__107 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 680, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__107);
   __Pyx_GIVEREF(__pyx_tuple__107);
@@ -20422,7 +20459,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__108 = PyTuple_Pack(2, __pyx_n_s_text, __pyx_n_s_words); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 710, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__108);
   __Pyx_GIVEREF(__pyx_tuple__108);
-  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_split_words, 710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 710, __pyx_L1_error)
+  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_split_words, 710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 710, __pyx_L1_error)
 
   /* "lxml/html/diff.py":719
  *     return words
@@ -20445,7 +20482,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__111 = PyTuple_Pack(3, __pyx_n_s_el, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 721, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__111);
   __Pyx_GIVEREF(__pyx_tuple__111);
-  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_start_tag, 721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 721, __pyx_L1_error)
+  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_start_tag, 721, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 721, __pyx_L1_error)
 
   /* "lxml/html/diff.py":729
  *                          for name, value in el.attrib.items()]))
@@ -20457,7 +20494,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__113 = PyTuple_Pack(2, __pyx_n_s_el, __pyx_n_s_extra); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 729, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__113);
   __Pyx_GIVEREF(__pyx_tuple__113);
-  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_end_tag, 729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 729, __pyx_L1_error)
+  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_end_tag, 729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 729, __pyx_L1_error)
 
   /* "lxml/html/diff.py":738
  *     return '</%s>%s' % (el.tag, extra)
@@ -20469,7 +20506,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__115 = PyTuple_Pack(1, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 738, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__115);
   __Pyx_GIVEREF(__pyx_tuple__115);
-  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_is_word, 738, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 738, __pyx_L1_error)
+  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_is_word, 738, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 738, __pyx_L1_error)
 
   /* "lxml/html/diff.py":741
  *     return not tok.startswith('<')
@@ -20481,7 +20518,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__117 = PyTuple_Pack(1, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 741, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__117);
   __Pyx_GIVEREF(__pyx_tuple__117);
-  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_is_end_tag, 741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 741, __pyx_L1_error)
+  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_is_end_tag, 741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 741, __pyx_L1_error)
 
   /* "lxml/html/diff.py":744
  *     return tok.startswith('</')
@@ -20493,7 +20530,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__119 = PyTuple_Pack(1, __pyx_n_s_tok); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 744, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__119);
   __Pyx_GIVEREF(__pyx_tuple__119);
-  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_is_start_tag, 744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 744, __pyx_L1_error)
+  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_is_start_tag, 744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 744, __pyx_L1_error)
 
   /* "lxml/html/diff.py":747
  *     return tok.startswith('<') and not tok.startswith('</')
@@ -20505,7 +20542,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__121 = PyTuple_Pack(2, __pyx_n_s_html, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 747, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__121);
   __Pyx_GIVEREF(__pyx_tuple__121);
-  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_fixup_ins_del_tags, 747, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 747, __pyx_L1_error)
+  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_fixup_ins_del_tags, 747, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 747, __pyx_L1_error)
 
   /* "lxml/html/diff.py":756
  *     return html
@@ -20517,7 +20554,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__123 = PyTuple_Pack(3, __pyx_n_s_el, __pyx_n_s_skip_outer, __pyx_n_s_html); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 756, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__123);
   __Pyx_GIVEREF(__pyx_tuple__123);
-  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_serialize_html_fragment, 756, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 756, __pyx_L1_error)
+  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_serialize_html_fragment, 756, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 756, __pyx_L1_error)
   __pyx_tuple__125 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 756, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__125);
   __Pyx_GIVEREF(__pyx_tuple__125);
@@ -20532,7 +20569,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__126 = PyTuple_Pack(3, __pyx_n_s_doc, __pyx_n_s_tag, __pyx_n_s_el); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 774, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__126);
   __Pyx_GIVEREF(__pyx_tuple__126);
-  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_fixup_ins_del_tags_2, 774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 774, __pyx_L1_error)
+  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_fixup_ins_del_tags_2, 774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 774, __pyx_L1_error)
 
   /* "lxml/html/diff.py":785
  *             #_merge_element_contents(el)
@@ -20544,7 +20581,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__128 = PyTuple_Pack(2, __pyx_n_s_el, __pyx_n_s_child); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 785, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__128);
   __Pyx_GIVEREF(__pyx_tuple__128);
-  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_contains_block_level_tag, 785, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 785, __pyx_L1_error)
+  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_contains_block_level_tag, 785, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 785, __pyx_L1_error)
 
   /* "lxml/html/diff.py":795
  *     return False
@@ -20556,7 +20593,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__130 = PyTuple_Pack(8, __pyx_n_s_el, __pyx_n_s_tag, __pyx_n_s_child, __pyx_n_s_sys, __pyx_n_s_children_tag, __pyx_n_s_tail_tag, __pyx_n_s_child_tag, __pyx_n_s_text_tag); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 795, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__130);
   __Pyx_GIVEREF(__pyx_tuple__130);
-  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_move_el_inside_block, 795, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 795, __pyx_L1_error)
+  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_move_el_inside_block, 795, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 795, __pyx_L1_error)
 
   /* "lxml/html/diff.py":828
  *         el.insert(0, text_tag)
@@ -20568,7 +20605,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__132 = PyTuple_Pack(5, __pyx_n_s_el, __pyx_n_s_parent, __pyx_n_s_text, __pyx_n_s_index, __pyx_n_s_previous); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 828, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__132);
   __Pyx_GIVEREF(__pyx_tuple__132);
-  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_merge_element_contents, 828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 828, __pyx_L1_error)
+  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_merge_element_contents, 828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 828, __pyx_L1_error)
 
   /* "lxml/html/diff.py":870
  *     threshold = 2
@@ -20580,7 +20617,7 @@ static int __Pyx_InitCachedConstants(void) {
   __pyx_tuple__134 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_size, __pyx_n_s_threshold, __pyx_n_s_actual, __pyx_n_s_item); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 870, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__134);
   __Pyx_GIVEREF(__pyx_tuple__134);
-  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_get_matching_blocks, 870, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 870, __pyx_L1_error)
+  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_diff_py, __pyx_n_s_get_matching_blocks, 870, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 870, __pyx_L1_error)
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -20607,6 +20644,47 @@ PyMODINIT_FUNC initdiff(void)
 #else
 PyMODINIT_FUNC PyInit_diff(void); /*proto*/
 PyMODINIT_FUNC PyInit_diff(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+  return PyModuleDef_Init(&__pyx_moduledef);
+}
+static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
+    PyObject *value = PyObject_GetAttrString(spec, from_name);
+    int result = 0;
+    if (likely(value)) {
+        result = PyDict_SetItemString(moddict, to_name, value);
+        Py_DECREF(value);
+    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+        PyErr_Clear();
+    } else {
+        result = -1;
+    }
+    return result;
+}
+static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+    PyObject *module = NULL, *moddict, *modname;
+    if (__pyx_m)
+        return __Pyx_NewRef(__pyx_m);
+    modname = PyObject_GetAttrString(spec, "name");
+    if (unlikely(!modname)) goto bad;
+    module = PyModule_NewObject(modname);
+    Py_DECREF(modname);
+    if (unlikely(!module)) goto bad;
+    moddict = PyModule_GetDict(module);
+    if (unlikely(!moddict)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
+    return module;
+bad:
+    Py_XDECREF(module);
+    return NULL;
+}
+
+
+static int __pyx_pymod_exec_diff(PyObject *__pyx_pyinit_module)
+#endif
 #endif
 {
   PyObject *__pyx_t_1 = NULL;
@@ -20620,6 +20698,9 @@ PyMODINIT_FUNC PyInit_diff(void)
   PyObject *__pyx_t_9 = NULL;
   int __pyx_t_10;
   __Pyx_RefNannyDeclarations
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
+  #endif
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
   if (!__Pyx_RefNanny) {
@@ -20646,6 +20727,9 @@ PyMODINIT_FUNC PyInit_diff(void)
   #ifdef __Pyx_Generator_USED
   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
+  #ifdef __Pyx_AsyncGen_USED
+  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   #ifdef __Pyx_StopAsyncIteration_USED
   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
@@ -20657,12 +20741,17 @@ PyMODINIT_FUNC PyInit_diff(void)
   #endif
   #endif
   /*--- Module creation code ---*/
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  __pyx_m = __pyx_pyinit_module;
+  Py_INCREF(__pyx_m);
+  #else
   #if PY_MAJOR_VERSION < 3
   __pyx_m = Py_InitModule4("diff", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
   Py_INCREF(__pyx_d);
   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
@@ -20843,7 +20932,6 @@ PyMODINIT_FUNC PyInit_diff(void)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L7_try_end;
     __pyx_L2_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
 
@@ -20897,14 +20985,12 @@ PyMODINIT_FUNC PyInit_diff(void)
  *     from html import escape as html_escape
  * except ImportError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
     goto __pyx_L1_error;
     __pyx_L3_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
@@ -20950,7 +21036,6 @@ PyMODINIT_FUNC PyInit_diff(void)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L15_try_end;
     __pyx_L10_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -20995,14 +21080,12 @@ PyMODINIT_FUNC PyInit_diff(void)
  *     _unicode = unicode
  * except NameError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L11_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -21050,7 +21133,6 @@ PyMODINIT_FUNC PyInit_diff(void)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L23_try_end;
     __pyx_L18_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -21095,14 +21177,12 @@ PyMODINIT_FUNC PyInit_diff(void)
  *     basestring
  * except NameError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
     goto __pyx_L1_error;
     __pyx_L19_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
@@ -22309,7 +22389,7 @@ PyMODINIT_FUNC PyInit_diff(void)
  * from lxml import etree
  * from lxml.html import fragment_fromstring
  */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_html_annotate_line_31, __pyx_kp_u_doclist_should_be_ordered_from) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_locate_unbalanced_start_line_361, __pyx_kp_u_pre_delete_and_post_delete_impl) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
@@ -22336,10 +22416,12 @@ PyMODINIT_FUNC PyInit_diff(void)
   }
   __pyx_L0:;
   __Pyx_RefNannyFinishContext();
-  #if PY_MAJOR_VERSION < 3
-  return;
-  #else
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  return (__pyx_m != NULL) ? 0 : -1;
+  #elif PY_MAJOR_VERSION >= 3
   return __pyx_m;
+  #else
+  return;
   #endif
 }
 
@@ -22736,7 +22818,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, P
 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                                PyObject *globals) {
     PyFrameObject *f;
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject **fastlocals;
     Py_ssize_t i;
     PyObject *result;
@@ -22946,10 +23028,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
 /* IterFinish */
   static CYTHON_INLINE int __Pyx_IterFinish(void) {
 #if CYTHON_FAST_THREAD_STATE
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject* exc_type = tstate->curexc_type;
     if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
+        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
             PyObject *exc_value, *exc_tb;
             exc_value = tstate->curexc_value;
             exc_tb = tstate->curexc_traceback;
@@ -22991,7 +23073,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
 }
 
 /* GetItemInt */
-  static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+  static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
     PyObject *r;
     if (!j) return NULL;
     r = PyObject_GetItem(o, j);
@@ -23152,7 +23234,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
     }
 #endif
 #ifdef __Pyx_CyFunction_USED
-    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+    if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
 #else
     if (likely(PyCFunction_Check(func))) {
 #endif
@@ -23408,10 +23490,8 @@ bad:
 }
 
 /* PyObjectCallMethod1 */
-    static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
-    PyObject *method, *result = NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto done;
+    static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
+    PyObject *result = NULL;
 #if CYTHON_UNPACK_METHODS
     if (likely(PyMethod_Check(method))) {
         PyObject *self = PyMethod_GET_SELF(method);
@@ -23439,7 +23519,6 @@ bad:
             Py_INCREF(arg);
             PyTuple_SET_ITEM(args, 1, arg);
             Py_INCREF(function);
-            Py_DECREF(method); method = NULL;
             result = __Pyx_PyObject_Call(function, args, NULL);
             Py_DECREF(args);
             Py_DECREF(function);
@@ -23448,6 +23527,15 @@ bad:
     }
 #endif
     result = __Pyx_PyObject_CallOneArg(method, arg);
+    goto done;
+done:
+    return result;
+}
+static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
+    PyObject *method, *result = NULL;
+    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
+    if (unlikely(!method)) goto done;
+    result = __Pyx__PyObject_CallMethod1(method, arg);
 done:
     Py_XDECREF(method);
     return result;
@@ -23467,7 +23555,7 @@ done:
 }
 
 /* SetItemInt */
-    static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
+    static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
     int r;
     if (!j) return -1;
     r = PyObject_SetItem(o, j, v);
@@ -23540,11 +23628,26 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject
 
 /* PyErrExceptionMatches */
       #if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+    Py_ssize_t i, n;
+    n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+    for (i=0; i<n; i++) {
+        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+    }
+#endif
+    for (i=0; i<n; i++) {
+        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
+    }
+    return 0;
+}
 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
     PyObject *exc_type = tstate->curexc_type;
     if (exc_type == err) return 1;
     if (unlikely(!exc_type)) return 0;
-    return PyErr_GivenExceptionMatches(exc_type, err);
+    if (unlikely(PyTuple_Check(err)))
+        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
 }
 #endif
 
@@ -23640,7 +23743,7 @@ bad:
     target->method = method;
 #if CYTHON_COMPILING_IN_CPYTHON
     #if PY_MAJOR_VERSION >= 3
-    if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
+    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
     #endif
     {
         PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
@@ -23827,11 +23930,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             "raise: exception class must be a subclass of BaseException");
         goto bad;
     }
-#if PY_VERSION_HEX >= 0x03030000
     if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
         PyObject *fixed_cause;
         if (cause == Py_None) {
             fixed_cause = NULL;
@@ -23859,7 +23958,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         PyErr_Restore(tmp_type, tmp_value, tb);
         Py_XDECREF(tmp_tb);
 #else
-        PyThreadState *tstate = PyThreadState_GET();
+        PyThreadState *tstate = __Pyx_PyThreadState_Current;
         PyObject* tmp_tb = tstate->curexc_traceback;
         if (tb != tmp_tb) {
             Py_INCREF(tb);
@@ -23875,7 +23974,7 @@ bad:
 #endif
 
 /* PyIntBinop */
-          #if !CYTHON_COMPILING_IN_PYPY
+        #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_CheckExact(op1))) {
@@ -23991,7 +24090,7 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
 #endif
 
 /* pop_index */
-          static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
+        static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
     PyObject *r;
     if (unlikely(!py_ix)) return NULL;
     r = __Pyx__PyObject_PopIndex(L, py_ix);
@@ -24026,13 +24125,13 @@ static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t
 #endif
 
 /* Import */
-          static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+        static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     PyObject *empty_list = 0;
     PyObject *module = 0;
     PyObject *global_dict = 0;
     PyObject *empty_dict = 0;
     PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     PyObject *py_import;
     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
@@ -24056,17 +24155,8 @@ static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
             if (strchr(__Pyx_MODULE_NAME, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                PyObject *py_level = PyInt_FromLong(1);
-                if (!py_level)
-                    goto bad;
-                module = PyObject_CallFunctionObjArgs(py_import,
-                    name, global_dict, empty_dict, list, py_level, NULL);
-                Py_DECREF(py_level);
-                #else
                 module = PyImport_ImportModuleLevelObject(
                     name, global_dict, empty_dict, list, 1);
-                #endif
                 if (!module) {
                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
                         goto bad;
@@ -24077,7 +24167,7 @@ static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t
         }
         #endif
         if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
+            #if PY_MAJOR_VERSION < 3
             PyObject *py_level = PyInt_FromLong(level);
             if (!py_level)
                 goto bad;
@@ -24091,7 +24181,7 @@ static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t
         }
     }
 bad:
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     Py_XDECREF(py_import);
     #endif
     Py_XDECREF(empty_list);
@@ -24100,7 +24190,7 @@ bad:
 }
 
 /* SliceObject */
-          static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
+        static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
         Py_ssize_t cstart, Py_ssize_t cstop,
         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
@@ -24198,7 +24288,7 @@ bad:
 }
 
 /* PyIntBinop */
-          #if !CYTHON_COMPILING_IN_PYPY
+        #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     if (op1 == op2) {
         Py_RETURN_TRUE;
@@ -24283,7 +24373,7 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
 #endif
 
 /* PyIntBinop */
-          #if !CYTHON_COMPILING_IN_PYPY
+        #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_CheckExact(op1))) {
@@ -24399,7 +24489,7 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_U
 #endif
 
 /* ImportFrom */
-          static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+        static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
         PyErr_Format(PyExc_ImportError,
@@ -24413,7 +24503,7 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_U
 }
 
 /* FetchCommonType */
-          static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+        static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
     PyObject* fake_module;
     PyTypeObject* cached_type = NULL;
     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
@@ -24452,7 +24542,7 @@ bad:
 }
 
 /* CythonFunction */
-          static PyObject *
+        static PyObject *
 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
 {
     if (unlikely(op->func_doc == NULL)) {
@@ -24812,14 +24902,18 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
     }
     return 0;
 }
-static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
 {
-    PyObject_GC_UnTrack(m);
     if (__Pyx_CyFunction_weakreflist(m) != NULL)
         PyObject_ClearWeakRefs((PyObject *) m);
     __Pyx_CyFunction_clear(m);
     PyObject_GC_Del(m);
 }
+static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+{
+    PyObject_GC_UnTrack(m);
+    __Pyx__CyFunction_dealloc(m);
+}
 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
 {
     Py_VISIT(m->func_closure);
@@ -24894,10 +24988,16 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py
         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
             size = PyTuple_GET_SIZE(arg);
             if (likely(size == 1)) {
-                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
-                if (unlikely(!arg0)) return NULL;
+                PyObject *result, *arg0;
+                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+                arg0 = PyTuple_GET_ITEM(arg, 0);
+                #else
+                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
+                #endif
                 result = (*meth)(self, arg0);
+                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                 Py_DECREF(arg0);
+                #endif
                 return result;
             }
             PyErr_Format(PyExc_TypeError,
@@ -25004,7 +25104,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
 };
 static int __pyx_CyFunction_init(void) {
     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
-    if (__pyx_CyFunctionType == NULL) {
+    if (unlikely(__pyx_CyFunctionType == NULL)) {
         return -1;
     }
     return 0;
@@ -25012,7 +25112,7 @@ static int __pyx_CyFunction_init(void) {
 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
     m->defaults = PyObject_Malloc(size);
-    if (!m->defaults)
+    if (unlikely(!m->defaults))
         return PyErr_NoMemory();
     memset(m->defaults, 0, size);
     m->defaults_pyobjects = pyobjects;
@@ -25035,7 +25135,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
 }
 
 /* CalculateMetaclass */
-              static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
+            static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
     Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
     for (i=0; i < nbases; i++) {
         PyTypeObject *tmptype;
@@ -25074,7 +25174,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
 }
 
 /* Py3ClassCreate */
-              static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
+            static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                            PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
     PyObject *ns;
     if (metaclass) {
@@ -25141,7 +25241,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj
 }
 
 /* ModuleImport */
-              #ifndef __PYX_HAVE_RT_ImportModule
+            #ifndef __PYX_HAVE_RT_ImportModule
 #define __PYX_HAVE_RT_ImportModule
 static PyObject *__Pyx_ImportModule(const char *name) {
     PyObject *py_name = 0;
@@ -25159,7 +25259,7 @@ bad:
 #endif
 
 /* RegisterModuleCleanup */
-              #if PY_MAJOR_VERSION < 3
+            #if PY_MAJOR_VERSION < 3
 static PyObject* __pyx_module_cleanup_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) {
     __pyx_module_cleanup(module);
     Py_INCREF(Py_None); return Py_None;
@@ -25226,7 +25326,7 @@ static int __Pyx_RegisterCleanup(void) {
 #endif
 
 /* CLineInTraceback */
-              static int __Pyx_CLineForTraceback(int c_line) {
+            static int __Pyx_CLineForTraceback(int c_line) {
 #ifdef CYTHON_CLINE_IN_TRACEBACK
     return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0;
 #else
@@ -25262,7 +25362,7 @@ static int __Pyx_RegisterCleanup(void) {
 }
 
 /* CodeObjectCache */
-              static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+            static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
     int start = 0, mid = 0, end = count - 1;
     if (end >= 0 && code_line > entries[end].code_line) {
         return count;
@@ -25342,7 +25442,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
 }
 
 /* AddTraceback */
-              #include "compile.h"
+            #include "compile.h"
 #include "frameobject.h"
 #include "traceback.h"
 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -25412,10 +25512,10 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
     }
     py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        __pyx_d,      /*PyObject *globals,*/
-        0                    /*PyObject *locals*/
+        __Pyx_PyThreadState_Current, /*PyThreadState *tstate,*/
+        py_code,                     /*PyCodeObject *code,*/
+        __pyx_d,              /*PyObject *globals,*/
+        0                            /*PyObject *locals*/
     );
     if (!py_frame) goto bad;
     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
@@ -25426,7 +25526,7 @@ bad:
 }
 
 /* CIntToPy */
-              static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -25457,7 +25557,7 @@ bad:
 }
 
 /* CIntFromPyVerify */
-              #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+            #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
@@ -25479,7 +25579,7 @@ bad:
     }
 
 /* CIntFromPy */
-              static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+            static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -25668,7 +25768,7 @@ raise_neg_overflow:
 }
 
 /* CIntFromPy */
-              static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+            static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
     const int neg_one = (int) -1, const_zero = (int) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -25856,8 +25956,80 @@ raise_neg_overflow:
     return (int) -1;
 }
 
+/* FastTypeChecks */
+            #if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+    while (a) {
+        a = a->tp_base;
+        if (a == b)
+            return 1;
+    }
+    return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+    PyObject *mro;
+    if (a == b) return 1;
+    mro = a->tp_mro;
+    if (likely(mro)) {
+        Py_ssize_t i, n;
+        n = PyTuple_GET_SIZE(mro);
+        for (i = 0; i < n; i++) {
+            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+                return 1;
+        }
+        return 0;
+    }
+    return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+    PyObject *exception, *value, *tb;
+    int res;
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    __Pyx_ErrFetch(&exception, &value, &tb);
+    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+    if (unlikely(res == -1)) {
+        PyErr_WriteUnraisable(err);
+        res = 0;
+    }
+    if (!res) {
+        res = PyObject_IsSubclass(err, exc_type2);
+        if (unlikely(res == -1)) {
+            PyErr_WriteUnraisable(err);
+            res = 0;
+        }
+    }
+    __Pyx_ErrRestore(exception, value, tb);
+    return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+    if (!res) {
+        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+    }
+    return res;
+}
+#endif
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+    if (likely(err == exc_type)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+    }
+    return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+    if (likely(err == exc_type1 || err == exc_type2)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+    }
+    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
 /* SwapException */
-              #if CYTHON_FAST_THREAD_STATE
+            #if CYTHON_FAST_THREAD_STATE
 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
     PyObject *tmp_type, *tmp_value, *tmp_tb;
     tmp_type = tstate->exc_type;
@@ -25882,18 +26054,12 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value,
 #endif
 
 /* CoroutineBase */
-              #include <structmember.h>
+            #include <structmember.h>
 #include <frameobject.h>
-static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
-static PyObject *__Pyx_Coroutine_Close(PyObject *self);
-static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
+static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
     PyObject *et, *ev, *tb;
     PyObject *value = NULL;
-    __Pyx_PyThreadState_declare
-    __Pyx_PyThreadState_assign
     __Pyx_ErrFetch(&et, &ev, &tb);
     if (!et) {
         Py_XDECREF(tb);
@@ -25928,7 +26094,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
             }
             Py_DECREF(ev);
         }
-        else if (!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
+        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
             value = ev;
         }
         if (likely(value)) {
@@ -25937,7 +26103,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
             *pvalue = value;
             return 0;
         }
-    } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
+    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
         __Pyx_ErrRestore(et, ev, tb);
         return -1;
     }
@@ -25970,7 +26136,6 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
     *pvalue = value;
     return 0;
 }
-#endif
 static CYTHON_INLINE
 void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
     PyObject *exc_type = self->exc_type;
@@ -25983,72 +26148,121 @@ void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
     Py_XDECREF(exc_value);
     Py_XDECREF(exc_traceback);
 }
-static CYTHON_INLINE
-int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
-    if (unlikely(gen->is_running)) {
-        PyErr_SetString(PyExc_ValueError,
-                        "generator already executing");
-        return 1;
+#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
+static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
+    const char *msg;
+    if (0) {
+    #ifdef __Pyx_Coroutine_USED
+    } else if (__Pyx_Coroutine_CheckExact((PyObject*)gen)) {
+        msg = "coroutine already executing";
+    #endif
+    #ifdef __Pyx_AsyncGen_USED
+    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
+        msg = "async generator already executing";
+    #endif
+    } else {
+        msg = "generator already executing";
     }
-    return 0;
+    PyErr_SetString(PyExc_ValueError, msg);
 }
-static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
-    PyObject *retval;
+#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
+static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
+    const char *msg;
+    if (0) {
+    #ifdef __Pyx_Coroutine_USED
+    } else if (__Pyx_Coroutine_CheckExact(gen)) {
+        msg = "can't send non-None value to a just-started coroutine";
+    #endif
+    #ifdef __Pyx_AsyncGen_USED
+    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
+        msg = "can't send non-None value to a just-started async generator";
+    #endif
+    } else {
+        msg = "can't send non-None value to a just-started generator";
+    }
+    PyErr_SetString(PyExc_TypeError, msg);
+}
+#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
+static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
+    #ifdef __Pyx_Coroutine_USED
+    if (!closing && __Pyx_Coroutine_CheckExact(gen)) {
+        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
+    } else
+    #endif
+    if (value) {
+        #ifdef __Pyx_AsyncGen_USED
+        if (__Pyx_AsyncGen_CheckExact(gen))
+            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
+        else
+        #endif
+        PyErr_SetNone(PyExc_StopIteration);
+    }
+}
+static
+PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
     __Pyx_PyThreadState_declare
+    PyThreadState *tstate;
+    PyObject *retval;
     assert(!self->is_running);
     if (unlikely(self->resume_label == 0)) {
         if (unlikely(value && value != Py_None)) {
-            PyErr_SetString(PyExc_TypeError,
-                            "can't send non-None value to a "
-                            "just-started generator");
-            return NULL;
+            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
         }
     }
     if (unlikely(self->resume_label == -1)) {
-        PyErr_SetNone(PyExc_StopIteration);
-        return NULL;
+        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
     }
+#if CYTHON_FAST_THREAD_STATE
     __Pyx_PyThreadState_assign
-    if (value) {
+    tstate = __pyx_tstate;
+#else
+    tstate = __Pyx_PyThreadState_Current;
+#endif
+    if (self->exc_type) {
 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
 #else
         if (self->exc_traceback) {
             PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
             PyFrameObject *f = tb->tb_frame;
-            Py_XINCREF(__pyx_tstate->frame);
+            Py_XINCREF(tstate->frame);
             assert(f->f_back == NULL);
-            f->f_back = __pyx_tstate->frame;
+            f->f_back = tstate->frame;
         }
 #endif
         __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                             &self->exc_traceback);
     } else {
         __Pyx_Coroutine_ExceptionClear(self);
+        __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
     }
     self->is_running = 1;
-    retval = self->body((PyObject *) self, value);
+    retval = self->body((PyObject *) self, tstate, value);
     self->is_running = 0;
-    if (retval) {
-        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
-                            &self->exc_traceback);
+    return retval;
+}
+static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *self) {
+    if (likely(self->exc_traceback)) {
 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
 #else
-        if (self->exc_traceback) {
-            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
-            PyFrameObject *f = tb->tb_frame;
-            Py_CLEAR(f->f_back);
-        }
+        PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
+        PyFrameObject *f = tb->tb_frame;
+        Py_CLEAR(f->f_back);
 #endif
-    } else {
-        __Pyx_Coroutine_ExceptionClear(self);
     }
-    return retval;
 }
 static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
-    if (unlikely(!retval && !PyErr_Occurred())) {
-        PyErr_SetNone(PyExc_StopIteration);
+PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
+    if (unlikely(!retval)) {
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        if (!__Pyx_PyErr_Occurred()) {
+            PyObject *exc = PyExc_StopIteration;
+            #ifdef __Pyx_AsyncGen_USED
+            if (__Pyx_AsyncGen_CheckExact(gen))
+                exc = __Pyx_PyExc_StopAsyncIteration;
+            #endif
+            __Pyx_PyErr_SetNone(exc);
+        }
     }
     return retval;
 }
@@ -26057,8 +26271,8 @@ PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
     PyObject *ret;
     PyObject *val = NULL;
     __Pyx_Coroutine_Undelegate(gen);
-    __Pyx_PyGen_FetchStopIterationValue(&val);
-    ret = __Pyx_Coroutine_SendEx(gen, val);
+    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
+    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
     Py_XDECREF(val);
     return ret;
 }
@@ -26066,8 +26280,8 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
     PyObject *retval;
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
     PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         PyObject *ret;
         gen->is_running = 1;
@@ -26081,6 +26295,21 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
             ret = __Pyx_Coroutine_Send(yf, value);
         } else
         #endif
+        #ifdef __Pyx_AsyncGen_USED
+        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
+            ret = __Pyx_async_gen_asend_send(yf, value);
+        } else
+        #endif
+        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000)
+        if (PyGen_CheckExact(yf)) {
+            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
+        } else
+        #endif
+        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000)
+        if (PyCoro_CheckExact(yf)) {
+            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
+        } else
+        #endif
         {
             if (value == Py_None)
                 ret = Py_TYPE(yf)->tp_iternext(yf);
@@ -26093,9 +26322,9 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
         }
         retval = __Pyx_Coroutine_FinishDelegation(gen);
     } else {
-        retval = __Pyx_Coroutine_SendEx(gen, value);
+        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
     }
-    return __Pyx_Coroutine_MethodReturn(retval);
+    return __Pyx_Coroutine_MethodReturn(self, retval);
 }
 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
     PyObject *retval = NULL;
@@ -26113,6 +26342,19 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
         if (!retval)
             return -1;
     } else
+    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
+        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
+        if (!retval)
+            return -1;
+    } else
+    #endif
+    #ifdef __Pyx_AsyncGen_USED
+    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
+        retval = __Pyx_async_gen_asend_close(yf, NULL);
+    } else
+    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
+        retval = __Pyx_async_gen_athrow_close(yf, NULL);
+    } else
     #endif
     {
         PyObject *meth;
@@ -26137,8 +26379,8 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
 static PyObject *__Pyx_Generator_Next(PyObject *self) {
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
     PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         PyObject *ret;
         gen->is_running = 1;
@@ -26146,6 +26388,11 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
         if (__Pyx_Generator_CheckExact(yf)) {
             ret = __Pyx_Generator_Next(yf);
         } else
+        #endif
+        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000)
+        if (PyGen_CheckExact(yf)) {
+            ret = _PyGen_Send((PyGenObject*)yf, NULL);
+        } else
         #endif
             ret = Py_TYPE(yf)->tp_iternext(yf);
         gen->is_running = 0;
@@ -26154,15 +26401,15 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
         }
         return __Pyx_Coroutine_FinishDelegation(gen);
     }
-    return __Pyx_Coroutine_SendEx(gen, Py_None);
+    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
 }
 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
     PyObject *retval, *raised_exception;
     PyObject *yf = gen->yieldfrom;
     int err = 0;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         Py_INCREF(yf);
         err = __Pyx_Coroutine_CloseIter(gen, yf);
@@ -26171,59 +26418,69 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
     }
     if (err == 0)
         PyErr_SetNone(PyExc_GeneratorExit);
-    retval = __Pyx_Coroutine_SendEx(gen, NULL);
-    if (retval) {
+    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
+    if (unlikely(retval)) {
+        const char *msg;
         Py_DECREF(retval);
-        PyErr_SetString(PyExc_RuntimeError,
-                        "generator ignored GeneratorExit");
+        if ((0)) {
+        #ifdef __Pyx_Coroutine_USED
+        } else if (__Pyx_Coroutine_CheckExact(self)) {
+            msg = "coroutine ignored GeneratorExit";
+        #endif
+        #ifdef __Pyx_AsyncGen_USED
+        } else if (__Pyx_AsyncGen_CheckExact(self)) {
+#if PY_VERSION_HEX < 0x03060000
+            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
+#else
+            msg = "async generator ignored GeneratorExit";
+#endif
+        #endif
+        } else {
+            msg = "generator ignored GeneratorExit";
+        }
+        PyErr_SetString(PyExc_RuntimeError, msg);
         return NULL;
     }
     raised_exception = PyErr_Occurred();
-    if (!raised_exception
-        || raised_exception == PyExc_StopIteration
-        || raised_exception == PyExc_GeneratorExit
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
-    {
+    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
         if (raised_exception) PyErr_Clear();
         Py_INCREF(Py_None);
         return Py_None;
     }
     return NULL;
 }
-static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
+static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
+                                        PyObject *args, int close_on_genexit) {
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
-    PyObject *typ;
-    PyObject *tb = NULL;
-    PyObject *val = NULL;
     PyObject *yf = gen->yieldfrom;
-    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
-        return NULL;
-    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
-        return NULL;
+    if (unlikely(gen->is_running))
+        return __Pyx_Coroutine_AlreadyRunningError(gen);
     if (yf) {
         PyObject *ret;
         Py_INCREF(yf);
-        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
+        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
             int err = __Pyx_Coroutine_CloseIter(gen, yf);
             Py_DECREF(yf);
             __Pyx_Coroutine_Undelegate(gen);
             if (err < 0)
-                return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
+                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
             goto throw_here;
         }
         gen->is_running = 1;
+        if (0
         #ifdef __Pyx_Generator_USED
-        if (__Pyx_Generator_CheckExact(yf)) {
-            ret = __Pyx_Coroutine_Throw(yf, args);
-        } else
+            || __Pyx_Generator_CheckExact(yf)
         #endif
         #ifdef __Pyx_Coroutine_USED
-        if (__Pyx_Coroutine_CheckExact(yf)) {
-            ret = __Pyx_Coroutine_Throw(yf, args);
-        } else
+            || __Pyx_Coroutine_CheckExact(yf)
         #endif
-        {
+            ) {
+            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
+        #ifdef __Pyx_Coroutine_USED
+        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
+            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
+        #endif
+        } else {
             PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
             if (unlikely(!meth)) {
                 Py_DECREF(yf);
@@ -26236,7 +26493,11 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
                 gen->is_running = 0;
                 goto throw_here;
             }
-            ret = PyObject_CallObject(meth, args);
+            if (likely(args)) {
+                ret = PyObject_CallObject(meth, args);
+            } else {
+                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
+            }
             Py_DECREF(meth);
         }
         gen->is_running = 0;
@@ -26244,14 +26505,21 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
         if (!ret) {
             ret = __Pyx_Coroutine_FinishDelegation(gen);
         }
-        return __Pyx_Coroutine_MethodReturn(ret);
+        return __Pyx_Coroutine_MethodReturn(self, ret);
     }
 throw_here:
     __Pyx_Raise(typ, val, tb, NULL);
-    return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
+    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
 }
-static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
-    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
+static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
+    PyObject *typ;
+    PyObject *val = NULL;
+    PyObject *tb = NULL;
+    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
+        return NULL;
+    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
+}
+static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
     Py_VISIT(gen->closure);
     Py_VISIT(gen->classobj);
     Py_VISIT(gen->yieldfrom);
@@ -26268,6 +26536,11 @@ static int __Pyx_Coroutine_clear(PyObject *self) {
     Py_CLEAR(gen->exc_type);
     Py_CLEAR(gen->exc_value);
     Py_CLEAR(gen->exc_traceback);
+#ifdef __Pyx_AsyncGen_USED
+    if (__Pyx_AsyncGen_CheckExact(self)) {
+        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
+    }
+#endif
     Py_CLEAR(gen->gi_name);
     Py_CLEAR(gen->gi_qualname);
     return 0;
@@ -26277,9 +26550,9 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) {
     PyObject_GC_UnTrack(gen);
     if (gen->gi_weakreflist != NULL)
         PyObject_ClearWeakRefs(self);
-    if (gen->resume_label > 0) {
+    if (gen->resume_label >= 0) {
         PyObject_GC_Track(self);
-#if PY_VERSION_HEX >= 0x030400a1
+#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
         if (PyObject_CallFinalizerFromDealloc(self))
 #else
         Py_TYPE(gen)->tp_del(self);
@@ -26290,29 +26563,93 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) {
         }
         PyObject_GC_UnTrack(self);
     }
+#ifdef __Pyx_AsyncGen_USED
+    if (__Pyx_AsyncGen_CheckExact(self)) {
+        /* We have to handle this case for asynchronous generators
+           right here, because this code has to be between UNTRACK
+           and GC_Del. */
+        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
+    }
+#endif
     __Pyx_Coroutine_clear(self);
     PyObject_GC_Del(gen);
 }
 static void __Pyx_Coroutine_del(PyObject *self) {
-    PyObject *res;
     PyObject *error_type, *error_value, *error_traceback;
     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
     __Pyx_PyThreadState_declare
-    if (gen->resume_label <= 0)
-        return ;
-#if PY_VERSION_HEX < 0x030400a1
+    if (gen->resume_label < 0) {
+        return;
+    }
+#if !CYTHON_USE_TP_FINALIZE
     assert(self->ob_refcnt == 0);
     self->ob_refcnt = 1;
 #endif
     __Pyx_PyThreadState_assign
     __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
-    res = __Pyx_Coroutine_Close(self);
-    if (res == NULL)
-        PyErr_WriteUnraisable(self);
-    else
-        Py_DECREF(res);
+#ifdef __Pyx_AsyncGen_USED
+    if (__Pyx_AsyncGen_CheckExact(self)) {
+        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
+        PyObject *finalizer = agen->ag_finalizer;
+        if (finalizer && !agen->ag_closed) {
+            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
+            if (unlikely(!res)) {
+                PyErr_WriteUnraisable(self);
+            } else {
+                Py_DECREF(res);
+            }
+            __Pyx_ErrRestore(error_type, error_value, error_traceback);
+            return;
+        }
+    }
+#endif
+    if (unlikely(gen->resume_label == 0 && !error_value)) {
+#ifdef __Pyx_Coroutine_USED
+#ifdef __Pyx_Generator_USED
+    if (!__Pyx_Generator_CheckExact(self))
+#endif
+        {
+        PyObject_GC_UnTrack(self);
+#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
+        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
+            PyErr_WriteUnraisable(self);
+#else
+        {PyObject *msg;
+        char *cmsg;
+        #if CYTHON_COMPILING_IN_PYPY
+        msg = NULL;
+        cmsg = (char*) "coroutine was never awaited";
+        #else
+        char *cname;
+        PyObject *qualname;
+        qualname = gen->gi_qualname;
+        cname = PyString_AS_STRING(qualname);
+        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
+        if (unlikely(!msg)) {
+            PyErr_Clear();
+            cmsg = (char*) "coroutine was never awaited";
+        } else {
+            cmsg = PyString_AS_STRING(msg);
+        }
+        #endif
+        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
+            PyErr_WriteUnraisable(self);
+        Py_XDECREF(msg);}
+#endif
+        PyObject_GC_Track(self);
+        }
+#endif
+    } else {
+        PyObject *res = __Pyx_Coroutine_Close(self);
+        if (unlikely(!res)) {
+            if (PyErr_Occurred())
+                PyErr_WriteUnraisable(self);
+        } else {
+            Py_DECREF(res);
+        }
+    }
     __Pyx_ErrRestore(error_type, error_value, error_traceback);
-#if PY_VERSION_HEX < 0x030400a1
+#if !CYTHON_USE_TP_FINALIZE
     assert(self->ob_refcnt > 0);
     if (--self->ob_refcnt == 0) {
         return;
@@ -26391,8 +26728,13 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_New(
             PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure,
             PyObject *name, PyObject *qualname, PyObject *module_name) {
     __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
-    if (gen == NULL)
+    if (unlikely(!gen))
         return NULL;
+    return __Pyx__Coroutine_NewInit(gen, body, closure, name, qualname, module_name);
+}
+static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
+            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *closure,
+            PyObject *name, PyObject *qualname, PyObject *module_name) {
     gen->body = body;
     gen->closure = closure;
     Py_XINCREF(closure);
@@ -26415,7 +26757,7 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_New(
 }
 
 /* PatchModuleWithCoroutine */
-                  static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
+                static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
     int result;
     PyObject *globals, *result_obj;
@@ -26455,7 +26797,7 @@ ignore:
 }
 
 /* PatchGeneratorABC */
-                  #ifndef CYTHON_REGISTER_ABCS
+                #ifndef CYTHON_REGISTER_ABCS
 #define CYTHON_REGISTER_ABCS 1
 #endif
 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
@@ -26480,11 +26822,11 @@ static int __Pyx_patch_abc(void) {
     static int abc_patched = 0;
     if (CYTHON_REGISTER_ABCS && !abc_patched) {
         PyObject *module;
-        module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
+        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
         if (!module) {
             PyErr_WriteUnraisable(NULL);
             if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
-                    ((PY_VERSION_HEX >= 0x03030000) ?
+                    ((PY_MAJOR_VERSION >= 3) ?
                         "Cython module failed to register with collections.abc module" :
                         "Cython module failed to register with collections module"), 1) < 0)) {
                 return -1;
@@ -26512,7 +26854,7 @@ static int __Pyx_patch_abc(void) {
 }
 
 /* Generator */
-                  static PyMethodDef __pyx_Generator_methods[] = {
+                static PyMethodDef __pyx_Generator_methods[] = {
     {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
      (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
     {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
@@ -26580,14 +26922,16 @@ static PyTypeObject __pyx_GeneratorType_type = {
     0,
     0,
     0,
-#if PY_VERSION_HEX >= 0x030400a1
+#if CYTHON_USE_TP_FINALIZE
     0,
 #else
     __Pyx_Coroutine_del,
 #endif
     0,
-#if PY_VERSION_HEX >= 0x030400a1
+#if CYTHON_USE_TP_FINALIZE
     __Pyx_Coroutine_del,
+#elif PY_VERSION_HEX >= 0x030400a1
+    0,
 #endif
 };
 static int __pyx_Generator_init(void) {
@@ -26601,7 +26945,7 @@ static int __pyx_Generator_init(void) {
 }
 
 /* CheckBinaryVersion */
-                  static int __Pyx_check_binary_version(void) {
+                static int __Pyx_check_binary_version(void) {
     char ctversion[4], rtversion[4];
     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -26617,7 +26961,7 @@ static int __pyx_Generator_init(void) {
 }
 
 /* InitStrings */
-                  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+                static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
         if (t->is_unicode) {
@@ -26656,46 +27000,53 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
     Py_ssize_t ignore;
     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
 }
-static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    char* defenc_c;
+    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+    if (!defenc) return NULL;
+    defenc_c = PyBytes_AS_STRING(defenc);
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
+    {
+        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+        char* c;
+        for (c = defenc_c; c < end; c++) {
+            if ((unsigned char) (*c) >= 128) {
+                PyUnicode_AsASCIIString(o);
+                return NULL;
             }
         }
+    }
 #endif
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
+    *length = PyBytes_GET_SIZE(defenc);
+    return defenc_c;
+}
 #else
-        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_LENGTH(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
+    if (likely(PyUnicode_IS_ASCII(o))) {
+        *length = PyUnicode_GET_LENGTH(o);
+        return PyUnicode_AsUTF8(o);
+    } else {
+        PyUnicode_AsASCIIString(o);
+        return NULL;
+    }
 #else
-        return PyUnicode_AsUTF8AndSize(o, length);
+    return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+}
 #endif
 #endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+    if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+            __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+            PyUnicode_Check(o)) {
+        return __Pyx_PyUnicode_AsStringAndSize(o, length);
     } else
 #endif
 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
@@ -26719,6 +27070,26 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
    else return PyObject_IsTrue(x);
 }
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+    if (PyLong_Check(result)) {
+        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+                "__int__ returned non-int (type %.200s).  "
+                "The ability to return an instance of a strict subclass of int "
+                "is deprecated, and may be removed in a future version of Python.",
+                Py_TYPE(result)->tp_name)) {
+            Py_DECREF(result);
+            return NULL;
+        }
+        return result;
+    }
+#endif
+    PyErr_Format(PyExc_TypeError,
+                 "__%.4s__ returned non-%.4s (type %.200s)",
+                 type_name, type_name, Py_TYPE(result)->tp_name);
+    Py_DECREF(result);
+    return NULL;
+}
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
 #if CYTHON_USE_TYPE_SLOTS
   PyNumberMethods *m;
@@ -26726,9 +27097,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   const char *name = NULL;
   PyObject *res = NULL;
 #if PY_MAJOR_VERSION < 3
-  if (PyInt_Check(x) || PyLong_Check(x))
+  if (likely(PyInt_Check(x) || PyLong_Check(x)))
 #else
-  if (PyLong_Check(x))
+  if (likely(PyLong_Check(x)))
 #endif
     return __Pyx_NewRef(x);
 #if CYTHON_USE_TYPE_SLOTS
@@ -26736,32 +27107,30 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   #if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
-    res = PyNumber_Int(x);
+    res = m->nb_int(x);
   }
   else if (m && m->nb_long) {
     name = "long";
-    res = PyNumber_Long(x);
+    res = m->nb_long(x);
   }
   #else
-  if (m && m->nb_int) {
+  if (likely(m && m->nb_int)) {
     name = "int";
-    res = PyNumber_Long(x);
+    res = m->nb_int(x);
   }
   #endif
 #else
-  res = PyNumber_Int(x);
+  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+    res = PyNumber_Int(x);
+  }
 #endif
-  if (res) {
+  if (likely(res)) {
 #if PY_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
+    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
 #else
-    if (!PyLong_Check(res)) {
+    if (unlikely(!PyLong_CheckExact(res))) {
 #endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (type %.200s)",
-                   name, name, Py_TYPE(res)->tp_name);
-      Py_DECREF(res);
-      return NULL;
+        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
     }
   }
   else if (!PyErr_Occurred()) {
index b59248a18b0284662b81d75b96031541da49ccf3..7db1592bd2b0286aa46dd3531d955567eb72074d 100644 (file)
@@ -1,3 +1,3 @@
 #ifndef LXML_VERSION_STRING
-#define LXML_VERSION_STRING "4.0.0"
+#define LXML_VERSION_STRING "4.1.0"
 #endif
index 3517768502fcb241f8f552b2a32857990590b14d..9960cc95f831d9fd4b963d62697a030a9dae1a8d 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.26.1 */
+/* Generated by Cython 0.27.1 */
 
 #ifndef __PYX_HAVE__lxml__etree
 #define __PYX_HAVE__lxml__etree
@@ -12,7 +12,7 @@ struct LxmlElementBase;
 struct LxmlElementClassLookup;
 struct LxmlFallbackElementClassLookup;
 
-/* "lxml/etree.pyx":327
+/* "lxml/etree.pyx":330
  * 
  * # type of a function that steps from node to node
  * ctypedef public xmlNode* (*_node_to_node_function)(xmlNode*)             # <<<<<<<<<<<<<<
@@ -21,7 +21,7 @@ struct LxmlFallbackElementClassLookup;
  */
 typedef xmlNode *(*_node_to_node_function)(xmlNode *);
 
-/* "lxml/etree.pyx":343
+/* "lxml/etree.pyx":346
  * @cython.final
  * @cython.freelist(8)
  * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]:             # <<<<<<<<<<<<<<
@@ -37,7 +37,7 @@ struct LxmlDocument {
   struct __pyx_obj_4lxml_5etree__BaseParser *_parser;
 };
 
-/* "lxml/etree.pyx":695
+/* "lxml/etree.pyx":698
  * 
  * @cython.no_gc_clear
  * cdef public class _Element [ type LxmlElementType, object LxmlElement ]:             # <<<<<<<<<<<<<<
@@ -51,7 +51,7 @@ struct LxmlElement {
   PyObject *_tag;
 };
 
-/* "lxml/etree.pyx":1857
+/* "lxml/etree.pyx":1860
  * 
  * 
  * cdef public class _ElementTree [ type LxmlElementTreeType,             # <<<<<<<<<<<<<<
@@ -65,7 +65,7 @@ struct LxmlElementTree {
   struct LxmlElement *_context_node;
 };
 
-/* "lxml/etree.pyx":2586
+/* "lxml/etree.pyx":2589
  * 
  * 
  * cdef public class _ElementTagMatcher [ object LxmlElementTagMatcher,             # <<<<<<<<<<<<<<
@@ -81,7 +81,7 @@ struct LxmlElementTagMatcher {
   char *_name;
 };
 
-/* "lxml/etree.pyx":2617
+/* "lxml/etree.pyx":2620
  *                 self._name = NULL
  * 
  * cdef public class _ElementIterator(_ElementTagMatcher) [             # <<<<<<<<<<<<<<
@@ -126,8 +126,8 @@ struct LxmlElementClassLookup {
   _element_class_lookup_function _lookup_function;
 };
 
-/* "src/lxml/classlookup.pxi":223
- *         self._lookup_function = NULL # use default lookup
+/* "src/lxml/classlookup.pxi":222
+ * 
  * 
  * cdef public class FallbackElementClassLookup(ElementClassLookup) \             # <<<<<<<<<<<<<<
  *          [ type LxmlFallbackElementClassLookupType,
@@ -211,6 +211,9 @@ __PYX_EXTERN_C xmlNs *findOrBuildNodeNsPrefix(struct LxmlDocument *, xmlNode *,
 
 #endif /* !__PYX_HAVE_API__lxml__etree */
 
+/* WARNING: the interface of the module init function changed in CPython 3.5. */
+/* It now returns a PyModuleDef instance instead of a PyModule instance. */
+
 #if PY_MAJOR_VERSION < 3
 PyMODINIT_FUNC initetree(void);
 #else
index 9b95062964849327da6db616036da96a7c541522..5866efa6ed7e179ba6469dcbfed2de7ac163f03b 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.26.1 */
+/* Generated by Cython 0.27.1 */
 
 #ifndef __PYX_HAVE_API__lxml__etree
 #define __PYX_HAVE_API__lxml__etree
index a236952a1969882a40462dc045a66ddb3917dff4..274277dcd5378e5d9007cacfdadae81baac0746d 100644 (file)
@@ -80,12 +80,33 @@ cdef class _NamespaceRegistry:
     def clear(self):
         self._entries.clear()
 
+    def __call__(self, obj):
+        # Usage as decorator:
+        #   ns = lookup.get_namespace("...")
+        #   @ns('abc')
+        #   class element(ElementBase): pass
+        #
+        #   @ns
+        #   class elementname(ElementBase): pass
+
+        if obj is None or python._isString(obj):
+            # @ns(None) or @ns('tag')
+            return partial(self.__deco, obj)
+        # plain @ns decorator
+        self[obj.__name__] = obj
+        return obj
+
+    def __deco(self, name, obj):
+        self[name] = obj
+        return obj
+
+
 @cython.final
 @cython.internal
 cdef class _ClassNamespaceRegistry(_NamespaceRegistry):
     u"Dictionary-like registry for namespace implementation classes"
     def __setitem__(self, name, item):
-        if not python.PyType_Check(item) or not issubclass(item, ElementBase):
+        if not isinstance(item, type) or not issubclass(item, ElementBase):
             raise NamespaceRegistryError, \
                 u"Registered element classes must be subtypes of ElementBase"
         if name is not None:
@@ -101,6 +122,19 @@ cdef class ElementNamespaceClassLookup(FallbackElementClassLookup):
 
     Element class lookup scheme that searches the Element class in the
     Namespace registry.
+
+    Usage:
+
+    >>> lookup = ElementNamespaceClassLookup()
+    >>> ns_elements = lookup.get_namespace("http://schema.org/Movie")
+
+    >>> @ns_elements
+    ... class movie(ElementBase):
+    ...     "Element implementation for 'movie' tag (using class name) in schema namespace."
+
+    >>> @ns_elements("movie")
+    ... class MovieElement(ElementBase):
+    ...     "Element implementation for 'movie' tag (explicit tag name) in schema namespace."
     """
     cdef dict _namespace_registries
     def __cinit__(self):
@@ -177,7 +211,20 @@ def FunctionNamespace(ns_uri):
     URI.
 
     Creates a new one if it does not yet exist. A function namespace
-    can only be used to register extension functions."""
+    can only be used to register extension functions.
+
+    Usage:
+
+    >>> ns_functions = FunctionNamespace("http://schema.org/Movie")
+
+    >>> @ns_functions  # uses function name
+    ... def add2(x):
+    ...     return x + 2
+
+    >>> @ns_functions("add3")  # uses explicit name
+    ... def add_three(x):
+    ...     return x + 3
+    """
     ns_utf = _utf8(ns_uri) if ns_uri else None
     try:
         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
@@ -219,10 +266,7 @@ cdef class _XPathFunctionNamespaceRegistry(_FunctionNamespaceRegistry):
         def __set__(self, prefix):
             if prefix == '':
                 prefix = None # empty prefix
-            if prefix is None:
-                self._prefix_utf = None
-            else:
-                self._prefix_utf = _utf8(prefix)
+            self._prefix_utf = _utf8(prefix) if prefix is not None else None
             self._prefix = prefix
 
 cdef list _find_all_extension_prefixes():
index bf4b32ff33cfa981cfe94cf3fb734926f58e4e86..6701c923e0b4682adc62d44a739ef14feb454dca 100644 (file)
@@ -1,8 +1,14 @@
-/* Generated by Cython 0.26.1 */
+/* Generated by Cython 0.27.1 */
 
 /* BEGIN: Cython Metadata
 {
     "distutils": {
+        "define_macros": [
+            [
+                "CYTHON_CLINE_IN_TRACEBACK", 
+                "1"
+            ]
+        ], 
         "depends": [
             "/usr/include/libxml2/libxml/HTMLtree.h", 
             "/usr/include/libxml2/libxml/chvalid.h", 
@@ -66,10 +72,11 @@ END: Cython Metadata */
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
-    #error Cython requires Python 2.6+ or Python 3.2+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+    #error Cython requires Python 2.6+ or Python 3.3+.
 #else
-#define CYTHON_ABI "0_26_1"
+#define CYTHON_ABI "0_27_1"
+#define CYTHON_FUTURE_DIVISION 0
 #include <stddef.h>
 #ifndef offsetof
   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
@@ -93,7 +100,7 @@ END: Cython Metadata */
 #endif
 #define __PYX_COMMA ,
 #ifndef HAVE_LONG_LONG
-  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+  #if PY_VERSION_HEX >= 0x02070000
     #define HAVE_LONG_LONG
   #endif
 #endif
@@ -111,8 +118,12 @@ END: Cython Metadata */
   #define CYTHON_USE_TYPE_SLOTS 0
   #undef CYTHON_USE_PYTYPE_LOOKUP
   #define CYTHON_USE_PYTYPE_LOOKUP 0
-  #undef CYTHON_USE_ASYNC_SLOTS
-  #define CYTHON_USE_ASYNC_SLOTS 0
+  #if PY_VERSION_HEX < 0x03050000
+    #undef CYTHON_USE_ASYNC_SLOTS
+    #define CYTHON_USE_ASYNC_SLOTS 0
+  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+    #define CYTHON_USE_ASYNC_SLOTS 1
+  #endif
   #undef CYTHON_USE_PYLIST_INTERNALS
   #define CYTHON_USE_PYLIST_INTERNALS 0
   #undef CYTHON_USE_UNICODE_INTERNALS
@@ -131,6 +142,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #elif defined(PYSTON_VERSION)
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 1
@@ -164,6 +179,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #else
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 0
@@ -216,6 +235,12 @@ END: Cython Metadata */
   #ifndef CYTHON_FAST_PYCALL
     #define CYTHON_FAST_PYCALL 1
   #endif
+  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+    #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
+  #endif
+  #ifndef CYTHON_USE_TP_FINALIZE
+    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+  #endif
 #endif
 #if !defined(CYTHON_FAST_PYCCALL)
 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
@@ -271,6 +296,27 @@ END: Cython Metadata */
 #else
 #define __Pyx_PyFastCFunction_Check(func) 0
 #endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+  #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
+#else
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+#endif
 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
   #define CYTHON_PEP393_ENABLED 1
   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
@@ -354,7 +400,6 @@ END: Cython Metadata */
 #ifndef PySet_CheckExact
   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
 #endif
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
 #if PY_MAJOR_VERSION >= 3
   #define PyIntObject                  PyLongObject
@@ -405,15 +450,17 @@ END: Cython Metadata */
     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
   #else
+    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+  #endif
+#else
+  #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
     typedef struct {
         unaryfunc am_await;
         unaryfunc am_aiter;
         unaryfunc am_anext;
     } __Pyx_PyAsyncMethodsStruct;
-    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
-  #endif
-#else
-  #define __Pyx_PyType_AsAsync(obj) NULL
 #endif
 #ifndef CYTHON_RESTRICT
   #if defined(__GNUC__)
@@ -523,14 +570,6 @@ static CYTHON_INLINE float __PYX_NAN() {
   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
 }
 
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
-#else
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
-#endif
-
 #ifndef __PYX_EXTERN_C
   #ifdef __cplusplus
     #define __PYX_EXTERN_C extern "C"
@@ -566,7 +605,7 @@ static CYTHON_INLINE float __PYX_NAN() {
 #include <omp.h>
 #endif /* _OPENMP */
 
-#ifdef PYREX_WITHOUT_ASSERTIONS
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
 #define CYTHON_WITHOUT_ASSERTIONS
 #endif
 
@@ -597,8 +636,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc
     #define __Pyx_sst_abs(value) abs(value)
 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
     #define __Pyx_sst_abs(value) labs(value)
-#elif defined (_MSC_VER) && defined (_M_X64)
-    #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (_MSC_VER)
+    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
     #define __Pyx_sst_abs(value) llabs(value)
 #elif defined (__GNUC__)
@@ -620,6 +659,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
 #endif
+#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
@@ -630,16 +675,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
     const Py_UNICODE *u_end = u;
     while (*u_end++) ;
     return (size_t)(u_end - u - 1);
 }
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
@@ -648,6 +688,8 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 #if CYTHON_ASSUME_SAFE_MACROS
@@ -748,7 +790,7 @@ bad:
 #endif /* __GNUC__ */
 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
 
-static PyObject *__pyx_m;
+static PyObject *__pyx_m = NULL;
 static PyObject *__pyx_d;
 static PyObject *__pyx_b;
 static PyObject *__pyx_cython_runtime;
@@ -1219,21 +1261,31 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
 /* PyThreadStateGet.proto */
 #if CYTHON_FAST_THREAD_STATE
 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
+#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
 #else
 #define __Pyx_PyThreadState_declare
 #define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
 #endif
 
 /* PyErrFetchRestore.proto */
 #if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
 #else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
@@ -1290,7 +1342,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                               int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                      int is_list, int wraparound, int boundscheck);
 
@@ -1405,14 +1457,16 @@ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObje
 static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
 
 /* KeywordStringCheck.proto */
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
+static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
 
 /* py_dict_clear.proto */
 #define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0)
 
 /* ArgTypeTest.proto */
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact);
+#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
+    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
+        __Pyx__ArgTypeTest(obj, type, name, exact))
+static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
 
 /* SliceObject.proto */
 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
@@ -1437,7 +1491,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
     __Pyx_DelItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound) :\
     (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
                __Pyx_DelItem_Generic(o, to_py_func(i))))
-static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j);
+static int __Pyx_DelItem_Generic(PyObject *o, PyObject *j);
 static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                int is_list, int wraparound);
 
@@ -1563,6 +1617,18 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
 /* CIntFromPy.proto */
 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
 
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+
 /* CheckBinaryVersion.proto */
 static int __Pyx_check_binary_version(void);
 
@@ -1726,7 +1792,7 @@ static const char __pyx_k__9[] = "{";
   static const char __pyx_k__10[] = "    ";
   static const char __pyx_k__12[] = ":";
   static const char __pyx_k__17[] = "{}";
-  static const char __pyx_k__18[] = "__.*__$";
+  static const char __pyx_k__19[] = "__.*__$";
   static const char __pyx_k_all[] = "__all__";
   static const char __pyx_k_end[] = "end";
   static const char __pyx_k_get[] = "get";
@@ -2066,7 +2132,7 @@ static PyObject *__pyx_kp_u__10;
 static PyObject *__pyx_kp_b__12;
 static PyObject *__pyx_kp_u__12;
 static PyObject *__pyx_kp_u__17;
-static PyObject *__pyx_kp_u__18;
+static PyObject *__pyx_kp_u__19;
 static PyObject *__pyx_kp_s__2;
 static PyObject *__pyx_kp_u__2;
 static PyObject *__pyx_kp_u__3;
@@ -2463,96 +2529,97 @@ static PyObject *__pyx_tuple__13;
 static PyObject *__pyx_tuple__14;
 static PyObject *__pyx_tuple__15;
 static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__19;
+static PyObject *__pyx_tuple__18;
 static PyObject *__pyx_tuple__20;
-static PyObject *__pyx_tuple__22;
+static PyObject *__pyx_tuple__21;
 static PyObject *__pyx_tuple__23;
-static PyObject *__pyx_tuple__25;
-static PyObject *__pyx_tuple__27;
-static PyObject *__pyx_tuple__29;
-static PyObject *__pyx_tuple__31;
-static PyObject *__pyx_tuple__33;
-static PyObject *__pyx_tuple__35;
-static PyObject *__pyx_tuple__37;
-static PyObject *__pyx_tuple__39;
-static PyObject *__pyx_tuple__41;
-static PyObject *__pyx_tuple__43;
-static PyObject *__pyx_tuple__45;
-static PyObject *__pyx_tuple__47;
-static PyObject *__pyx_tuple__49;
-static PyObject *__pyx_tuple__51;
-static PyObject *__pyx_tuple__53;
-static PyObject *__pyx_tuple__55;
-static PyObject *__pyx_tuple__57;
-static PyObject *__pyx_tuple__59;
-static PyObject *__pyx_tuple__61;
-static PyObject *__pyx_tuple__63;
-static PyObject *__pyx_tuple__65;
-static PyObject *__pyx_tuple__67;
+static PyObject *__pyx_tuple__24;
+static PyObject *__pyx_tuple__26;
+static PyObject *__pyx_tuple__28;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__32;
+static PyObject *__pyx_tuple__34;
+static PyObject *__pyx_tuple__36;
+static PyObject *__pyx_tuple__38;
+static PyObject *__pyx_tuple__40;
+static PyObject *__pyx_tuple__42;
+static PyObject *__pyx_tuple__44;
+static PyObject *__pyx_tuple__46;
+static PyObject *__pyx_tuple__48;
+static PyObject *__pyx_tuple__50;
+static PyObject *__pyx_tuple__52;
+static PyObject *__pyx_tuple__54;
+static PyObject *__pyx_tuple__56;
+static PyObject *__pyx_tuple__58;
+static PyObject *__pyx_tuple__60;
+static PyObject *__pyx_tuple__62;
+static PyObject *__pyx_tuple__64;
+static PyObject *__pyx_tuple__66;
 static PyObject *__pyx_tuple__68;
-static PyObject *__pyx_tuple__70;
-static PyObject *__pyx_tuple__72;
-static PyObject *__pyx_tuple__74;
-static PyObject *__pyx_tuple__76;
-static PyObject *__pyx_tuple__78;
-static PyObject *__pyx_tuple__80;
-static PyObject *__pyx_tuple__82;
-static PyObject *__pyx_tuple__84;
+static PyObject *__pyx_tuple__69;
+static PyObject *__pyx_tuple__71;
+static PyObject *__pyx_tuple__73;
+static PyObject *__pyx_tuple__75;
+static PyObject *__pyx_tuple__77;
+static PyObject *__pyx_tuple__79;
+static PyObject *__pyx_tuple__81;
+static PyObject *__pyx_tuple__83;
 static PyObject *__pyx_tuple__85;
-static PyObject *__pyx_tuple__87;
-static PyObject *__pyx_tuple__89;
+static PyObject *__pyx_tuple__86;
+static PyObject *__pyx_tuple__88;
 static PyObject *__pyx_tuple__90;
-static PyObject *__pyx_tuple__92;
+static PyObject *__pyx_tuple__91;
 static PyObject *__pyx_tuple__93;
-static PyObject *__pyx_tuple__95;
+static PyObject *__pyx_tuple__94;
 static PyObject *__pyx_tuple__96;
-static PyObject *__pyx_tuple__98;
+static PyObject *__pyx_tuple__97;
 static PyObject *__pyx_tuple__99;
-static PyObject *__pyx_tuple__101;
+static PyObject *__pyx_tuple__100;
 static PyObject *__pyx_tuple__102;
-static PyObject *__pyx_tuple__104;
-static PyObject *__pyx_tuple__106;
-static PyObject *__pyx_tuple__108;
-static PyObject *__pyx_codeobj__21;
-static PyObject *__pyx_codeobj__24;
-static PyObject *__pyx_codeobj__26;
-static PyObject *__pyx_codeobj__28;
-static PyObject *__pyx_codeobj__30;
-static PyObject *__pyx_codeobj__32;
-static PyObject *__pyx_codeobj__34;
-static PyObject *__pyx_codeobj__36;
-static PyObject *__pyx_codeobj__38;
-static PyObject *__pyx_codeobj__40;
-static PyObject *__pyx_codeobj__42;
-static PyObject *__pyx_codeobj__44;
-static PyObject *__pyx_codeobj__46;
-static PyObject *__pyx_codeobj__48;
-static PyObject *__pyx_codeobj__50;
-static PyObject *__pyx_codeobj__52;
-static PyObject *__pyx_codeobj__54;
-static PyObject *__pyx_codeobj__56;
-static PyObject *__pyx_codeobj__58;
-static PyObject *__pyx_codeobj__60;
-static PyObject *__pyx_codeobj__62;
-static PyObject *__pyx_codeobj__64;
-static PyObject *__pyx_codeobj__66;
-static PyObject *__pyx_codeobj__69;
-static PyObject *__pyx_codeobj__71;
-static PyObject *__pyx_codeobj__73;
-static PyObject *__pyx_codeobj__75;
-static PyObject *__pyx_codeobj__77;
-static PyObject *__pyx_codeobj__79;
-static PyObject *__pyx_codeobj__81;
-static PyObject *__pyx_codeobj__83;
-static PyObject *__pyx_codeobj__86;
-static PyObject *__pyx_codeobj__88;
-static PyObject *__pyx_codeobj__91;
-static PyObject *__pyx_codeobj__94;
-static PyObject *__pyx_codeobj__97;
-static PyObject *__pyx_codeobj__100;
-static PyObject *__pyx_codeobj__103;
-static PyObject *__pyx_codeobj__105;
-static PyObject *__pyx_codeobj__107;
+static PyObject *__pyx_tuple__103;
+static PyObject *__pyx_tuple__105;
+static PyObject *__pyx_tuple__107;
+static PyObject *__pyx_tuple__109;
+static PyObject *__pyx_codeobj__22;
+static PyObject *__pyx_codeobj__25;
+static PyObject *__pyx_codeobj__27;
+static PyObject *__pyx_codeobj__29;
+static PyObject *__pyx_codeobj__31;
+static PyObject *__pyx_codeobj__33;
+static PyObject *__pyx_codeobj__35;
+static PyObject *__pyx_codeobj__37;
+static PyObject *__pyx_codeobj__39;
+static PyObject *__pyx_codeobj__41;
+static PyObject *__pyx_codeobj__43;
+static PyObject *__pyx_codeobj__45;
+static PyObject *__pyx_codeobj__47;
+static PyObject *__pyx_codeobj__49;
+static PyObject *__pyx_codeobj__51;
+static PyObject *__pyx_codeobj__53;
+static PyObject *__pyx_codeobj__55;
+static PyObject *__pyx_codeobj__57;
+static PyObject *__pyx_codeobj__59;
+static PyObject *__pyx_codeobj__61;
+static PyObject *__pyx_codeobj__63;
+static PyObject *__pyx_codeobj__65;
+static PyObject *__pyx_codeobj__67;
+static PyObject *__pyx_codeobj__70;
+static PyObject *__pyx_codeobj__72;
+static PyObject *__pyx_codeobj__74;
+static PyObject *__pyx_codeobj__76;
+static PyObject *__pyx_codeobj__78;
+static PyObject *__pyx_codeobj__80;
+static PyObject *__pyx_codeobj__82;
+static PyObject *__pyx_codeobj__84;
+static PyObject *__pyx_codeobj__87;
+static PyObject *__pyx_codeobj__89;
+static PyObject *__pyx_codeobj__92;
+static PyObject *__pyx_codeobj__95;
+static PyObject *__pyx_codeobj__98;
+static PyObject *__pyx_codeobj__101;
+static PyObject *__pyx_codeobj__104;
+static PyObject *__pyx_codeobj__106;
+static PyObject *__pyx_codeobj__108;
 
 /* "lxml/objectify.pyx":49
  * # Duplicated from apihelpers.pxi, since dependencies obstruct
@@ -3046,7 +3113,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_set_pytype_attribute_tag(CYTHON_UNUSE
  * 
  */
     if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8 == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
       __PYX_ERR(0, 103, __pyx_L1_error)
     }
     __pyx_t_3 = __Pyx_decode_bytes(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
@@ -3064,7 +3131,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_set_pytype_attribute_tag(CYTHON_UNUSE
  *     _PYTYPE_NAMESPACE      = PYTYPE_NAMESPACE_UTF8
  */
     if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8 == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
       __PYX_ERR(0, 104, __pyx_L1_error)
     }
     __pyx_t_3 = __Pyx_decode_bytes(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
@@ -3083,7 +3150,11 @@ static PyObject *__pyx_pf_4lxml_9objectify_set_pytype_attribute_tag(CYTHON_UNUSE
  *     _PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8
  *     PYTYPE_ATTRIBUTE = cetree.namespacedNameFromNsName(
  */
-  __pyx_t_6 = __Pyx_PyObject_AsUString(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error)
+  if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8 == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+    __PYX_ERR(0, 106, __pyx_L1_error)
+  }
+  __pyx_t_6 = __Pyx_PyBytes_AsUString(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error)
   __pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE = __pyx_t_6;
 
   /* "lxml/objectify.pyx":107
@@ -3093,7 +3164,11 @@ static PyObject *__pyx_pf_4lxml_9objectify_set_pytype_attribute_tag(CYTHON_UNUSE
  *     PYTYPE_ATTRIBUTE = cetree.namespacedNameFromNsName(
  *         _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
  */
-  __pyx_t_6 = __Pyx_PyObject_AsUString(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error)
+  if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8 == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+    __PYX_ERR(0, 107, __pyx_L1_error)
+  }
+  __pyx_t_6 = __Pyx_PyBytes_AsUString(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error)
   __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME = __pyx_t_6;
 
   /* "lxml/objectify.pyx":108
@@ -3253,7 +3328,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement___iter__(struct
   __Pyx_INCREF(__pyx_v_parent);
   __Pyx_GIVEREF(__pyx_v_parent);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_parent);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
@@ -3665,7 +3740,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8__dict_____get_
  *             for child in etree.ElementChildIterator(self, tag=tag):
  *                 if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_children = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -3684,7 +3759,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8__dict_____get_
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
@@ -3725,7 +3800,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8__dict_____get_
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 179, __pyx_L1_error)
         }
         break;
@@ -4141,7 +4216,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_10getchildren(st
       __pyx_t_4 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_1), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 220, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 220, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
       /* "lxml/objectify.pyx":219
@@ -4507,7 +4582,7 @@ static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_14__setattr__(struct _
  *             return
  *         elif tag == u'tag':
  */
-    __pyx_t_5 = setTailText(__pyx_v_self->__pyx_base.__pyx_base._c_node, __pyx_v_value); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 244, __pyx_L1_error)
+    __pyx_t_5 = setTailText(__pyx_v_self->__pyx_base.__pyx_base._c_node, __pyx_v_value); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 244, __pyx_L1_error)
 
     /* "lxml/objectify.pyx":245
  *         elif tag == u'tail':
@@ -5903,7 +5978,7 @@ static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_24__delitem__(struct _
         if (unlikely(!__pyx_t_1)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 363, __pyx_L1_error)
           }
           break;
@@ -7697,7 +7772,7 @@ static PyObject *__pyx_f_4lxml_9objectify__appendValue(struct LxmlElement *__pyx
  *     elif isinstance(value, (list, tuple)):
  *         for item in value:
  */
-    __pyx_t_5 = appendChildToElement(__pyx_v_parent, __pyx_v_new_element); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 482, __pyx_L1_error)
+    __pyx_t_5 = appendChildToElement(__pyx_v_parent, __pyx_v_new_element); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 482, __pyx_L1_error)
 
     /* "lxml/objectify.pyx":477
  * cdef _appendValue(_Element parent, tag, value):
@@ -7769,7 +7844,7 @@ static PyObject *__pyx_f_4lxml_9objectify__appendValue(struct LxmlElement *__pyx
         if (unlikely(!__pyx_t_3)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
             else __PYX_ERR(0, 484, __pyx_L1_error)
           }
           break;
@@ -7860,7 +7935,7 @@ static PyObject *__pyx_f_4lxml_9objectify__appendValue(struct LxmlElement *__pyx
  * 
  * cdef _setElementValue(_Element element, value):
  */
-    __pyx_t_5 = appendChildToElement(__pyx_v_parent, __pyx_v_new_element); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 490, __pyx_L1_error)
+    __pyx_t_5 = appendChildToElement(__pyx_v_parent, __pyx_v_new_element); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 490, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -7939,7 +8014,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setElementValue(struct LxmlElement *_
  *             element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
  *     elif isinstance(value, _Element):
  */
-    __pyx_t_4 = setAttributeValue(__pyx_v_element, __pyx_t_3, __pyx_n_u_true); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 494, __pyx_L1_error)
+    __pyx_t_4 = setAttributeValue(__pyx_v_element, __pyx_t_3, __pyx_n_u_true); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 494, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
     /* "lxml/objectify.pyx":493
@@ -8040,7 +8115,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setElementValue(struct LxmlElement *_
  *             pytype_name = _typename(value)
  */
       if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
         __PYX_ERR(0, 504, __pyx_L1_error)
       }
       __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_pytype_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
@@ -8082,7 +8157,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setElementValue(struct LxmlElement *_
  *                 value = py_type.stringify(value)
  */
       if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
         __PYX_ERR(0, 507, __pyx_L1_error)
       }
       __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_pytype_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error)
@@ -8211,7 +8286,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setElementValue(struct LxmlElement *_
  */
       __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = setAttributeValue(__pyx_v_element, __pyx_t_5, __pyx_v_pytype_name); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 513, __pyx_L1_error)
+      __pyx_t_4 = setAttributeValue(__pyx_v_element, __pyx_t_5, __pyx_v_pytype_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 513, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
       /* "lxml/objectify.pyx":512
@@ -8253,7 +8328,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setElementValue(struct LxmlElement *_
  * 
  * cdef _setSlice(sliceobject, _Element target, items):
  */
-  __pyx_t_4 = setNodeText(__pyx_v_element->_c_node, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 517, __pyx_L1_error)
+  __pyx_t_4 = setNodeText(__pyx_v_element->_c_node, __pyx_v_value); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 517, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":492
  *         cetree.appendChildToElement(parent, new_element)
@@ -8469,7 +8544,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
       if (unlikely(!__pyx_t_6)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 535, __pyx_L1_error)
         }
         break;
@@ -8584,7 +8659,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
  * 
  *     # sanity check - raise what a list would raise
  */
-    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_new_items, ((PyObject *)__pyx_v_new_element)); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 545, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_new_items, ((PyObject *)__pyx_v_new_element)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 545, __pyx_L1_error)
 
     /* "lxml/objectify.pyx":535
  *     new_items = []
@@ -8613,8 +8688,8 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(0, 548, __pyx_L1_error)
   }
-  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 548, __pyx_L1_error)
-  __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 548, __pyx_L1_error)
+  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 548, __pyx_L1_error)
+  __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 548, __pyx_L1_error)
   __pyx_t_2 = ((__pyx_t_3 != __pyx_t_9) != 0);
   __pyx_t_1 = __pyx_t_2;
   __pyx_L9_bool_binop_done:;
@@ -8627,14 +8702,14 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
  * 
  *     # replace existing items
  */
-    __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 551, __pyx_L1_error)
+    __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 551, __pyx_L1_error)
     __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (unlikely(__pyx_v_del_items == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
       __PYX_ERR(0, 551, __pyx_L1_error)
     }
-    __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 551, __pyx_L1_error)
+    __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 551, __pyx_L1_error)
     __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L1_error)
@@ -8729,7 +8804,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
  *         pos += 1
  */
   while (1) {
-    __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 557, __pyx_L1_error)
+    __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 557, __pyx_L1_error)
     __pyx_t_2 = ((__pyx_v_pos < __pyx_t_9) != 0);
     if (__pyx_t_2) {
     } else {
@@ -8740,7 +8815,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
       __PYX_ERR(0, 557, __pyx_L1_error)
     }
-    __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 557, __pyx_L1_error)
+    __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 557, __pyx_L1_error)
     __pyx_t_2 = ((__pyx_v_pos < __pyx_t_9) != 0);
     __pyx_t_1 = __pyx_t_2;
     __pyx_L13_bool_binop_done:;
@@ -8834,7 +8909,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(0, 561, __pyx_L1_error)
   }
-  __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 561, __pyx_L1_error)
+  __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 561, __pyx_L1_error)
   __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
   if (__pyx_t_1) {
 
@@ -8862,7 +8937,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
         PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
         __PYX_ERR(0, 563, __pyx_L1_error)
       }
-      __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 563, __pyx_L1_error)
+      __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 563, __pyx_L1_error)
       __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
       if (!__pyx_t_1) break;
 
@@ -8954,7 +9029,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
  *         # the sanity check above guarantees (step == 1)
  *         if pos > 0:
  */
-  __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 567, __pyx_L1_error)
+  __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 567, __pyx_L1_error)
   __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
   if (__pyx_t_1) {
 
@@ -9076,7 +9151,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
  *                     pos += 1
  */
         while (1) {
-          __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 580, __pyx_L1_error)
+          __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 580, __pyx_L1_error)
           __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
           if (!__pyx_t_1) break;
 
@@ -9090,7 +9165,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
           __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_new_items, __pyx_v_pos, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_4lxml_8includes_11etreepublic__Element))))) __PYX_ERR(0, 581, __pyx_L1_error)
-          __pyx_t_12 = appendChildToElement(__pyx_v_parent, ((struct LxmlElement *)__pyx_t_6)); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 581, __pyx_L1_error)
+          __pyx_t_12 = appendChildToElement(__pyx_v_parent, ((struct LxmlElement *)__pyx_t_6)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 581, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
           /* "lxml/objectify.pyx":582
@@ -9148,7 +9223,7 @@ static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobjec
  *             item = new_items[pos]
  */
     while (1) {
-      __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 585, __pyx_L1_error)
+      __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 585, __pyx_L1_error)
       __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
       if (!__pyx_t_1) break;
 
@@ -9532,7 +9607,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_4_setText(st
  * 
  * cdef class NumberElement(ObjectifiedDataElement):
  */
-  __pyx_t_1 = setNodeText(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node, __pyx_v_s); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 612, __pyx_L1_error)
+  __pyx_t_1 = setNodeText(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node, __pyx_v_s); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 612, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":608
  *         return strrepr(textOf(self._c_node) or '')
@@ -10325,7 +10400,7 @@ static Py_hash_t __pyx_pf_4lxml_9objectify_13NumberElement_20__hash__(struct __p
  */
   __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 655, __pyx_L1_error)
+  __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(0, 655, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_2;
   goto __pyx_L0;
@@ -11960,7 +12035,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_2strlen(struct __pyx_
  */
   /*else*/ {
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = PyObject_Length(__pyx_v_text); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 742, __pyx_L1_error)
+    __pyx_t_4 = PyObject_Length(__pyx_v_text); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 742, __pyx_L1_error)
     __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_r = __pyx_t_1;
@@ -12159,7 +12234,7 @@ static Py_hash_t __pyx_pf_4lxml_9objectify_13StringElement_8__hash__(struct __py
   __Pyx_INCREF(__pyx_kp_u__2);
   __pyx_t_1 = __pyx_kp_u__2;
   __pyx_L3_bool_binop_done:;
-  __pyx_t_4 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 751, __pyx_L1_error)
+  __pyx_t_4 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(0, 751, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_4;
   goto __pyx_L0;
@@ -13154,7 +13229,7 @@ static Py_hash_t __pyx_pf_4lxml_9objectify_11NoneElement_8__hash__(CYTHON_UNUSED
  * 
  *     property pyval:
  */
-  __pyx_t_1 = PyObject_Hash(Py_None); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 804, __pyx_L1_error)
+  __pyx_t_1 = PyObject_Hash(Py_None); if (unlikely(__pyx_t_1 == ((Py_hash_t)-1))) __PYX_ERR(0, 804, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -13330,7 +13405,7 @@ static int __pyx_pf_4lxml_9objectify_11BoolElement_2__nonzero__(struct __pyx_obj
  */
   __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 820, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 820, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_2;
   goto __pyx_L0;
@@ -13451,11 +13526,11 @@ static Py_hash_t __pyx_pf_4lxml_9objectify_11BoolElement_6__hash__(struct __pyx_
  */
   __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 826, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 826, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 826, __pyx_L1_error)
+  __pyx_t_3 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_hash_t)-1))) __PYX_ERR(0, 826, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_3;
   goto __pyx_L0;
@@ -13518,7 +13593,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_8__str__(struct __pyx_o
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 829, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 829, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
@@ -13593,7 +13668,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_10__repr__(struct __pyx
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 832, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 832, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
@@ -13662,7 +13737,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_5pyval___get__(struct _
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 836, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 836, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
@@ -13747,7 +13822,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_2__checkBool(CYTHON_UNUSED PyObject *
  *     if value == -1:
  *         raise ValueError
  */
-    __pyx_t_3 = __pyx_f_4lxml_9objectify___parseBoolAsInt(__pyx_v_s); if (unlikely(__pyx_t_3 == -2)) __PYX_ERR(0, 841, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_9objectify___parseBoolAsInt(__pyx_v_s); if (unlikely(__pyx_t_3 == ((int)-2))) __PYX_ERR(0, 841, __pyx_L1_error)
     __pyx_v_value = __pyx_t_3;
 
     /* "lxml/objectify.pyx":840
@@ -13864,7 +13939,7 @@ static int __pyx_f_4lxml_9objectify___parseBool(PyObject *__pyx_v_s, CYTHON_UNUS
  *     if value == -1:
  *         raise ValueError, u"Invalid boolean value: '%s'" % s
  */
-  __pyx_t_3 = __pyx_f_4lxml_9objectify___parseBoolAsInt(__pyx_v_s); if (unlikely(__pyx_t_3 == -2)) __PYX_ERR(0, 849, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_9objectify___parseBoolAsInt(__pyx_v_s); if (unlikely(__pyx_t_3 == ((int)-2))) __PYX_ERR(0, 849, __pyx_L1_error)
   __pyx_v_value = __pyx_t_3;
 
   /* "lxml/objectify.pyx":850
@@ -13948,7 +14023,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_4__parseBool(CYTHON_UNUSED PyObject *
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__parseBool", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_9objectify___parseBool(__pyx_v_s, 0); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 845, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_9objectify___parseBool(__pyx_v_s, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 845, __pyx_L1_error)
   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
@@ -14484,7 +14559,6 @@ static PyObject *__pyx_f_4lxml_9objectify__numericValueOf(PyObject *__pyx_v_obj)
  */
     }
     __pyx_L4_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
     /* "lxml/objectify.pyx":883
@@ -14509,21 +14583,18 @@ static PyObject *__pyx_f_4lxml_9objectify__numericValueOf(PyObject *__pyx_v_obj)
  *         # not always numeric, but Python will raise the right exception
  *         return obj.pyval
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L1_error;
     __pyx_L8_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L0;
     __pyx_L5_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
@@ -14761,7 +14832,7 @@ static int __pyx_pf_4lxml_9objectify_6PyType___init__(struct __pyx_obj_4lxml_9ob
  *             raise TypeError, u"Type name must be a string"
  */
     if (unlikely(__pyx_v_name == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
       __PYX_ERR(0, 923, __pyx_L1_error)
     }
     __pyx_t_3 = __Pyx_decode_bytes(((PyObject*)__pyx_v_name), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
@@ -14824,7 +14895,7 @@ static int __pyx_pf_4lxml_9objectify_6PyType___init__(struct __pyx_obj_4lxml_9ob
     __pyx_t_1 = __pyx_t_4;
     goto __pyx_L5_bool_binop_done;
   }
-  __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_type_check); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 926, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_type_check); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 926, __pyx_L1_error)
   __pyx_t_2 = ((!(__pyx_t_4 != 0)) != 0);
   __pyx_t_1 = __pyx_t_2;
   __pyx_L5_bool_binop_done:;
@@ -14870,7 +14941,7 @@ static int __pyx_pf_4lxml_9objectify_6PyType___init__(struct __pyx_obj_4lxml_9ob
  *             raise TypeError, \
  *                 u"Data classes must inherit from ObjectifiedDataElement"
  */
-  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_type_class, ((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedDataElement)); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 929, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_type_class, ((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedDataElement)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 929, __pyx_L1_error)
   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
   __pyx_t_1 = __pyx_t_4;
   __pyx_L8_bool_binop_done:;
@@ -15679,10 +15750,10 @@ static PyObject *__pyx_pf_4lxml_9objectify_6PyType_4register(struct __pyx_obj_4l
  *                 raise ValueError, u"inconsistent before/after dependencies"
  */
       if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
         __PYX_ERR(0, 974, __pyx_L1_error)
       }
-      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_4lxml_9objectify__TYPE_CHECKS, __pyx_v_entry); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 974, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_4lxml_9objectify__TYPE_CHECKS, __pyx_v_entry); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 974, __pyx_L1_error)
 
       /* "lxml/objectify.pyx":973
  *                     if pytype.name in after:
@@ -15734,11 +15805,11 @@ static PyObject *__pyx_pf_4lxml_9objectify_6PyType_4register(struct __pyx_obj_4l
  */
     /*else*/ {
       if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "insert");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "insert");
         __PYX_ERR(0, 978, __pyx_L1_error)
       }
       __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_last_pos); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L1_error)
-      __pyx_t_12 = PyList_Insert(__pyx_v_4lxml_9objectify__TYPE_CHECKS, __pyx_t_4, __pyx_v_entry); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 978, __pyx_L1_error)
+      __pyx_t_12 = PyList_Insert(__pyx_v_4lxml_9objectify__TYPE_CHECKS, __pyx_t_4, __pyx_v_entry); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 978, __pyx_L1_error)
     }
     __pyx_L20:;
 
@@ -15897,7 +15968,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_6PyType_6unregister(struct __pyx_obj_
  *         for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
  */
   if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
     __PYX_ERR(0, 986, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_self->name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error)
@@ -15937,7 +16008,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_6PyType_6unregister(struct __pyx_obj_
  *                 del _SCHEMA_TYPE_DICT[xs_type]
  */
   if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
     __PYX_ERR(0, 988, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error)
@@ -16178,7 +16249,6 @@ static PyObject *__pyx_pf_4lxml_9objectify_6PyType_6unregister(struct __pyx_obj_
     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
     goto __pyx_L15_try_end;
     __pyx_L10_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -16207,14 +16277,12 @@ static PyObject *__pyx_pf_4lxml_9objectify_6PyType_6unregister(struct __pyx_obj_
  *             _TYPE_CHECKS.remove( (self.type_check, self) )
  *         except ValueError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_XGIVEREF(__pyx_t_11);
     __Pyx_XGIVEREF(__pyx_t_12);
     __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
     goto __pyx_L1_error;
     __pyx_L11_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_10);
     __Pyx_XGIVEREF(__pyx_t_11);
     __Pyx_XGIVEREF(__pyx_t_12);
@@ -17308,7 +17376,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_10getRegisteredTypes(CYTHON_UNUSED Py
  *             types.append(pytype)
  *     for pytype in _PYTYPE_DICT.values():
  */
-      __pyx_t_10 = PySet_Add(__pyx_v_known, __pyx_v_name); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1085, __pyx_L1_error)
+      __pyx_t_10 = PySet_Add(__pyx_v_known, __pyx_v_name); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1085, __pyx_L1_error)
 
       /* "lxml/objectify.pyx":1086
  *         if name not in known:
@@ -17317,7 +17385,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_10getRegisteredTypes(CYTHON_UNUSED Py
  *     for pytype in _PYTYPE_DICT.values():
  *         name = pytype.name
  */
-      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_types, __pyx_v_pytype); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1086, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_types, __pyx_v_pytype); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1086, __pyx_L1_error)
 
       /* "lxml/objectify.pyx":1084
  *     for check, pytype in _TYPE_CHECKS:
@@ -17346,7 +17414,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_10getRegisteredTypes(CYTHON_UNUSED Py
  *         if name not in known:
  */
   if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
     __PYX_ERR(0, 1087, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyDict_Values(__pyx_v_4lxml_9objectify__PYTYPE_DICT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1087, __pyx_L1_error)
@@ -17384,7 +17452,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_10getRegisteredTypes(CYTHON_UNUSED Py
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 1087, __pyx_L1_error)
         }
         break;
@@ -17424,7 +17492,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_10getRegisteredTypes(CYTHON_UNUSED Py
  *             types.append(pytype)
  *     return types
  */
-      __pyx_t_10 = PySet_Add(__pyx_v_known, __pyx_v_name); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1090, __pyx_L1_error)
+      __pyx_t_10 = PySet_Add(__pyx_v_known, __pyx_v_name); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1090, __pyx_L1_error)
 
       /* "lxml/objectify.pyx":1091
  *         if name not in known:
@@ -17433,7 +17501,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_10getRegisteredTypes(CYTHON_UNUSED Py
  *     return types
  * 
  */
-      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_types, __pyx_v_pytype); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1091, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_types, __pyx_v_pytype); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1091, __pyx_L1_error)
 
       /* "lxml/objectify.pyx":1089
  *     for pytype in _PYTYPE_DICT.values():
@@ -17720,7 +17788,6 @@ static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_f_4lxml_9objectify__guess
  */
       }
       __pyx_L8_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -17748,21 +17815,18 @@ static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_f_4lxml_9objectify__guess
  *             type_check(value)
  *             return <PyType>tested_pytype
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_12);
       __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
       goto __pyx_L1_error;
       __pyx_L12_try_return:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_12);
       __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
       goto __pyx_L0;
       __pyx_L9_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_12);
@@ -18086,7 +18150,6 @@ static PyObject *__pyx_f_4lxml_9objectify__guessElementClass(xmlNode *__pyx_v_c_
  */
       }
       __pyx_L9_error:;
-      __Pyx_PyThreadState_assign
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -18114,21 +18177,18 @@ static PyObject *__pyx_f_4lxml_9objectify__guessElementClass(xmlNode *__pyx_v_c_
  *             type_check(value)
  *             return (<PyType>pytype)._type
  */
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_12);
       __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
       goto __pyx_L1_error;
       __pyx_L13_try_return:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_12);
       __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
       goto __pyx_L0;
       __pyx_L10_exception_handled:;
-      __Pyx_PyThreadState_assign
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_XGIVEREF(__pyx_t_11);
       __Pyx_XGIVEREF(__pyx_t_12);
@@ -18412,7 +18472,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call
  *                     cetree.setAttributeValue(
  *                         element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
  */
-      __pyx_t_9 = PyTuple_GET_SIZE(__pyx_v_children); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1149, __pyx_L1_error)
+      __pyx_t_9 = PyTuple_GET_SIZE(__pyx_v_children); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1149, __pyx_L1_error)
       __pyx_t_1 = ((__pyx_t_9 == 1) != 0);
       if (__pyx_t_1) {
 
@@ -18433,7 +18493,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call
  *                         element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
  *             elif python._isString(child):
  */
-        __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_t_4, __pyx_n_u_true); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1150, __pyx_L1_error)
+        __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_t_4, __pyx_n_u_true); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1150, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
         /* "lxml/objectify.pyx":1149
@@ -18513,7 +18573,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call
  *                 has_children = True
  *             elif isinstance(child, _ObjectifyElementMakerCaller):
  */
-      __pyx_t_6 = appendChildToElement(__pyx_v_element, ((struct LxmlElement *)__pyx_v_child)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1156, __pyx_L1_error)
+      __pyx_t_6 = appendChildToElement(__pyx_v_element, ((struct LxmlElement *)__pyx_v_child)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1156, __pyx_L1_error)
 
       /* "lxml/objectify.pyx":1157
  *             elif isinstance(child, _Element):
@@ -18679,7 +18739,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call
  *                 has_children = True
  *             elif isinstance(child, dict):
  */
-        __pyx_t_6 = appendChildToElement(__pyx_v_element, __pyx_v_childElement); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1166, __pyx_L1_error)
+        __pyx_t_6 = appendChildToElement(__pyx_v_element, __pyx_v_childElement); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1166, __pyx_L1_error)
       }
       __pyx_L8:;
 
@@ -18773,7 +18833,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call
           if (unlikely(!__pyx_t_7)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(0, 1169, __pyx_L1_error)
             }
             break;
@@ -18872,7 +18932,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call
  *                         value = (<PyType>pytype).stringify(value)
  */
         if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
           __PYX_ERR(0, 1173, __pyx_L1_error)
         }
         __pyx_t_7 = __pyx_f_4lxml_9objectify__typename(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1173, __pyx_L1_error)
@@ -19003,7 +19063,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call
  *             else:
  *                 if pytype_name is not None:
  */
-        __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1178, __pyx_L1_error)
+        __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1178, __pyx_L1_error)
 
         /* "lxml/objectify.pyx":1169
  *                 has_children = True
@@ -19076,7 +19136,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call
  *                     _add_text(element, (<PyType>pytype).stringify(child))
  */
       if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
         __PYX_ERR(0, 1184, __pyx_L1_error)
       }
       __pyx_t_4 = __pyx_f_4lxml_9objectify__typename(__pyx_v_child); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1184, __pyx_L1_error)
@@ -19254,7 +19314,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call
  */
       __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1194, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_t_5, __pyx_n_u_str); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1194, __pyx_L1_error)
+      __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_t_5, __pyx_n_u_str); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1194, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
       /* "lxml/objectify.pyx":1193
@@ -19287,7 +19347,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call
  */
       __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1196, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_t_5, __pyx_v_pytype_name); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1196, __pyx_L1_error)
+      __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_t_5, __pyx_v_pytype_name); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1196, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
       /* "lxml/objectify.pyx":1195
@@ -19443,7 +19503,7 @@ static PyObject *__pyx_f_4lxml_9objectify__add_text(struct LxmlElement *__pyx_v_
  *     else:
  *         old = cetree.textOf(elem._c_node)
  */
-    __pyx_t_4 = setTailText(__pyx_v_c_child, __pyx_v_text); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1209, __pyx_L1_error)
+    __pyx_t_4 = setTailText(__pyx_v_c_child, __pyx_v_text); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1209, __pyx_L1_error)
 
     /* "lxml/objectify.pyx":1205
  *     cdef tree.xmlNode* c_child
@@ -19507,7 +19567,7 @@ static PyObject *__pyx_f_4lxml_9objectify__add_text(struct LxmlElement *__pyx_v_
  * 
  * cdef class ElementMaker:
  */
-    __pyx_t_4 = setNodeText(__pyx_v_elem->_c_node, __pyx_v_text); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1214, __pyx_L1_error)
+    __pyx_t_4 = setNodeText(__pyx_v_elem->_c_node, __pyx_v_text); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1214, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -19650,7 +19710,7 @@ static int __pyx_pf_4lxml_9objectify_12ElementMaker___init__(struct __pyx_obj_4l
       __Pyx_INCREF(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
       __pyx_t_3 = __pyx_v_4lxml_9objectify__DEFAULT_NSMAP;
     } else {
-      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_t_3 = __pyx_t_4;
       __pyx_t_4 = 0;
@@ -19731,7 +19791,7 @@ static int __pyx_pf_4lxml_9objectify_12ElementMaker___init__(struct __pyx_obj_4l
  *                 raise TypeError(
  *                     "argument of 'makeelement' parameter must be callable, got %s" %
  */
-    __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_makeelement); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1255, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_makeelement); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1255, __pyx_L1_error)
     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
     if (__pyx_t_2) {
 
@@ -19819,7 +19879,7 @@ static int __pyx_pf_4lxml_9objectify_12ElementMaker___init__(struct __pyx_obj_4l
  * 
  *     @cython.final
  */
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_3);
   __Pyx_GOTREF(__pyx_v_self->_cache);
@@ -20008,7 +20068,7 @@ static PyObject *__pyx_f_4lxml_9objectify_12ElementMaker__build_element_maker(st
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
       __PYX_ERR(0, 1276, __pyx_L1_error)
     }
-    __pyx_t_5 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 1276, __pyx_L1_error)
+    __pyx_t_5 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1276, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_2 = ((__pyx_t_5 > 0xC8) != 0);
     if (__pyx_t_2) {
@@ -20021,10 +20081,10 @@ static PyObject *__pyx_f_4lxml_9objectify_12ElementMaker__build_element_maker(st
  *         return element_maker
  */
       if (unlikely(__pyx_v_self->_cache == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "clear");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
         __PYX_ERR(0, 1277, __pyx_L1_error)
       }
-      __pyx_t_6 = __Pyx_PyDict_Clear(__pyx_v_self->_cache); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1277, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyDict_Clear(__pyx_v_self->_cache); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1277, __pyx_L1_error)
 
       /* "lxml/objectify.pyx":1276
  *         element_maker._element_factory = self._makeelement
@@ -20131,7 +20191,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_12ElementMaker_2__getattr__(struct __
  *             if is_special_method(tag):
  */
   if (unlikely(__pyx_v_self->_cache == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
     __PYX_ERR(0, 1282, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_cache, __pyx_v_tag, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error)
@@ -20429,7 +20489,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_12ElementMaker_4__call__(struct __pyx
  *             element_maker = self._build_element_maker(
  */
   if (unlikely(__pyx_v_self->_cache == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
     __PYX_ERR(0, 1290, __pyx_L1_error)
   }
   __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_cache, __pyx_v_tag, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __pyx_L1_error)
@@ -21024,7 +21084,7 @@ static PyObject *__pyx_f_4lxml_9objectify__dump(struct LxmlElement *__pyx_v_elem
       if (unlikely(!__pyx_t_1)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 1332, __pyx_L1_error)
         }
         break;
@@ -21381,7 +21441,7 @@ static PyObject *__pyx_f_4lxml_9objectify__dump(struct LxmlElement *__pyx_v_elem
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(0, 1343, __pyx_L1_error)
         }
         break;
@@ -22321,7 +22381,7 @@ static PyObject *__pyx_f_4lxml_9objectify__lookupElementClass(PyObject *__pyx_v_
  *             return py_type._type
  */
     if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
       __PYX_ERR(0, 1415, __pyx_L1_error)
     }
     __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_value, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1415, __pyx_L1_error)
@@ -22404,7 +22464,7 @@ static PyObject *__pyx_f_4lxml_9objectify__lookupElementClass(PyObject *__pyx_v_
  *             prefix, value = value.split(u':', 1)
  */
     if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
       __PYX_ERR(0, 1425, __pyx_L1_error)
     }
     __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_value, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1425, __pyx_L1_error)
@@ -22510,7 +22570,7 @@ static PyObject *__pyx_f_4lxml_9objectify__lookupElementClass(PyObject *__pyx_v_
  *             return schema_type._type
  */
       if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
         __PYX_ERR(0, 1428, __pyx_L1_error)
       }
       __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_value, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1428, __pyx_L1_error)
@@ -22852,7 +22912,6 @@ static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_f_4lxml_9objectify__check
  */
     }
     __pyx_L4_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -22880,21 +22939,18 @@ static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_f_4lxml_9objectify__check
  *         pytype.type_check(value)
  *         return pytype
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L1_error;
     __pyx_L8_try_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L0;
     __pyx_L5_exception_handled:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
@@ -23503,7 +23559,7 @@ static PyObject *__pyx_f_4lxml_9objectify__annotate(struct LxmlElement *__pyx_v_
  *     elif empty_pytype_name is not None:
  */
       if (unlikely(__pyx_v_empty_type_name == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
         __PYX_ERR(0, 1561, __pyx_L1_error)
       }
       __pyx_t_3 = __Pyx_decode_bytes(((PyObject*)__pyx_v_empty_type_name), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L1_error)
@@ -23528,7 +23584,7 @@ static PyObject *__pyx_f_4lxml_9objectify__annotate(struct LxmlElement *__pyx_v_
  *         if isinstance(empty_pytype_name, bytes):
  */
     if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
       __PYX_ERR(0, 1562, __pyx_L1_error)
     }
     __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_empty_type_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error)
@@ -23579,7 +23635,7 @@ static PyObject *__pyx_f_4lxml_9objectify__annotate(struct LxmlElement *__pyx_v_
  *     else:
  */
       if (unlikely(__pyx_v_empty_pytype_name == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
         __PYX_ERR(0, 1565, __pyx_L1_error)
       }
       __pyx_t_4 = __Pyx_decode_bytes(((PyObject*)__pyx_v_empty_pytype_name), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1565, __pyx_L1_error)
@@ -23604,7 +23660,7 @@ static PyObject *__pyx_f_4lxml_9objectify__annotate(struct LxmlElement *__pyx_v_
  *         empty_pytype = None
  */
     if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
       __PYX_ERR(0, 1566, __pyx_L1_error)
     }
     __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_empty_pytype_name, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L1_error)
@@ -23646,7 +23702,7 @@ static PyObject *__pyx_f_4lxml_9objectify__annotate(struct LxmlElement *__pyx_v_
  * 
  */
   if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
     __PYX_ERR(0, 1570, __pyx_L1_error)
   }
   __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_n_u_str, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error)
@@ -23665,7 +23721,7 @@ static PyObject *__pyx_f_4lxml_9objectify__annotate(struct LxmlElement *__pyx_v_
  *     doc = element._doc
  */
   if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
     __PYX_ERR(0, 1571, __pyx_L1_error)
   }
   __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_n_u_NoneType, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1571, __pyx_L1_error)
@@ -23724,7 +23780,7 @@ static PyObject *__pyx_f_4lxml_9objectify__annotate(struct LxmlElement *__pyx_v_
  *                           ignore_xsi, ignore_pytype,
  *                           empty_type_name, empty_pytype, StrType, NoneType)
  */
-    __pyx_t_6 = __pyx_f_4lxml_9objectify__annotate_element(__pyx_v_c_node, __pyx_v_doc, __pyx_v_annotate_xsi, __pyx_v_annotate_pytype, __pyx_v_ignore_xsi, __pyx_v_ignore_pytype, __pyx_v_empty_type_name, __pyx_v_empty_pytype, __pyx_v_StrType, __pyx_v_NoneType); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1577, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_9objectify__annotate_element(__pyx_v_c_node, __pyx_v_doc, __pyx_v_annotate_xsi, __pyx_v_annotate_pytype, __pyx_v_ignore_xsi, __pyx_v_ignore_pytype, __pyx_v_empty_type_name, __pyx_v_empty_pytype, __pyx_v_StrType, __pyx_v_NoneType); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1577, __pyx_L1_error)
 
     /* "lxml/objectify.pyx":1576
  *     c_node = element._c_node
@@ -23913,7 +23969,7 @@ static int __pyx_f_4lxml_9objectify__annotate_element(xmlNode *__pyx_v_c_node, s
  *                 prefix, typename = typename.split(u':', 1)
  */
       if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
         __PYX_ERR(0, 1602, __pyx_L1_error)
       }
       __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_typename, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
@@ -24019,7 +24075,7 @@ static int __pyx_f_4lxml_9objectify__annotate_element(xmlNode *__pyx_v_c_node, s
  *                 # StrType does not have a typecheck but is the default
  */
         if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
-          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
           __PYX_ERR(0, 1605, __pyx_L1_error)
         }
         __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_typename, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1605, __pyx_L1_error)
@@ -24257,7 +24313,7 @@ static int __pyx_f_4lxml_9objectify__annotate_element(xmlNode *__pyx_v_c_node, s
  *                     # StrType does not have a typecheck but is the
  */
         if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
           __PYX_ERR(0, 1628, __pyx_L1_error)
         }
         __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_old_pytypename, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1628, __pyx_L1_error)
@@ -25268,7 +25324,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_26deannotate(CYTHON_UNUSED PyObject *
  */
     __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1726, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_attribute_names, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1726, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_attribute_names, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1726, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
     /* "lxml/objectify.pyx":1725
@@ -25299,7 +25355,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_26deannotate(CYTHON_UNUSED PyObject *
  */
     __pyx_t_1 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR;
     __Pyx_INCREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_attribute_names, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1728, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_attribute_names, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1728, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
     /* "lxml/objectify.pyx":1727
@@ -25330,7 +25386,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_26deannotate(CYTHON_UNUSED PyObject *
  */
     __pyx_t_1 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR;
     __Pyx_INCREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_attribute_names, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1730, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_attribute_names, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1730, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
     /* "lxml/objectify.pyx":1729
@@ -25578,7 +25634,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_28set_default_parser(CYTHON_UNUSED Py
  */
   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_XMLParser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1759, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = PyObject_IsInstance(__pyx_v_new_parser, __pyx_t_3); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1759, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v_new_parser, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1759, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
@@ -26013,7 +26069,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_32fromstring(CYTHON_UNUSED PyObject *
   __Pyx_INCREF(__pyx_v_parser);
   __Pyx_GIVEREF(__pyx_v_parser);
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_parser);
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1805, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1805, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(0, 1805, __pyx_L1_error)
   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_4lxml_9objectify__fromstring, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1805, __pyx_L1_error)
@@ -26186,7 +26242,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_34XML(CYTHON_UNUSED PyObject *__pyx_s
   __Pyx_INCREF(__pyx_v_parser);
   __Pyx_GIVEREF(__pyx_v_parser);
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_parser);
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1821, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1821, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(0, 1821, __pyx_L1_error)
   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_4lxml_9objectify__fromstring, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1821, __pyx_L1_error)
@@ -26359,7 +26415,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_36parse(CYTHON_UNUSED PyObject *__pyx
   __Pyx_INCREF(__pyx_v_parser);
   __Pyx_GIVEREF(__pyx_v_parser);
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_parser);
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1839, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1839, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(0, 1839, __pyx_L1_error)
   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_4lxml_9objectify__parse, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1839, __pyx_L1_error)
@@ -27849,7 +27905,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_40DataElement(CYTHON_UNUSED PyObject
           if (unlikely(!__pyx_t_4)) {
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
               else __PYX_ERR(0, 1926, __pyx_L1_error)
             }
             break;
@@ -28045,7 +28101,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_40DataElement(CYTHON_UNUSED PyObject
  *                 py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
  */
       if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
         __PYX_ERR(0, 1936, __pyx_L1_error)
       }
       __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v__xsi, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1936, __pyx_L1_error)
@@ -28075,7 +28131,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_40DataElement(CYTHON_UNUSED PyObject
  *                 _pytype = py_type.name
  */
         if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
-          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
           __PYX_ERR(0, 1938, __pyx_L1_error)
         }
         __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1938, __pyx_L1_error)
@@ -28275,7 +28331,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_40DataElement(CYTHON_UNUSED PyObject
  */
   __pyx_t_8 = ((PyObject*)&PyBool_Type);
   __Pyx_INCREF(__pyx_t_8);
-  __pyx_t_2 = PyObject_IsInstance(__pyx_v__value, __pyx_t_8); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1950, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v__value, __pyx_t_8); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1950, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
@@ -28342,7 +28398,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_40DataElement(CYTHON_UNUSED PyObject
  */
   /*else*/ {
     if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
       __PYX_ERR(0, 1956, __pyx_L1_error)
     }
     __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v__pytype, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1956, __pyx_L1_error)
@@ -28494,7 +28550,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_40DataElement(CYTHON_UNUSED PyObject
  */
     /*else*/ {
       if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
-        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
         __PYX_ERR(0, 1966, __pyx_L1_error)
       }
       __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v__pytype, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1966, __pyx_L1_error)
@@ -28831,7 +28887,7 @@ static int __pyx_pf_4lxml_9objectify_10ObjectPath___init__(struct __pyx_obj_4lxm
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(1, 31, __pyx_L1_error)
   }
-  __pyx_t_3 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 31, __pyx_L1_error)
+  __pyx_t_3 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 31, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_self->_path_len = __pyx_t_3;
 
@@ -28844,7 +28900,7 @@ static int __pyx_pf_4lxml_9objectify_10ObjectPath___init__(struct __pyx_obj_4lxm
  */
   __pyx_t_2 = __pyx_v_self->_path;
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_4 = __pyx_f_4lxml_9objectify__build_object_path_segments(((PyObject*)__pyx_t_2)); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(1, 32, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_9objectify__build_object_path_segments(((PyObject*)__pyx_t_2)); if (unlikely(__pyx_t_4 == ((__pyx_t_4lxml_9objectify__ObjectPath *)NULL))) __PYX_ERR(1, 32, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_self->_c_path = __pyx_t_4;
 
@@ -29107,7 +29163,7 @@ static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_6__call__(struct __pyx_o
  *                 raise TypeError, u"invalid number of arguments: needs one or two"
  *             default = _default[0]
  */
-    __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v__default); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 50, __pyx_L1_error)
+    __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v__default); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 50, __pyx_L1_error)
     __pyx_t_1 = ((__pyx_t_2 > 1) != 0);
     if (__pyx_t_1) {
 
@@ -29282,7 +29338,6 @@ static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_8hasattr(struct __pyx_ob
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L8_try_end;
     __pyx_L3_error:;
-    __Pyx_PyThreadState_assign
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -29326,14 +29381,12 @@ static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_8hasattr(struct __pyx_ob
  *             _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
  *         except AttributeError:
  */
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
     __pyx_L6_except_return:;
-    __Pyx_PyThreadState_assign
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
@@ -29706,7 +29759,7 @@ static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_string(PyObject *__
  *         path = unicode(_path)
  */
     if (unlikely(__pyx_v__path == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
       __PYX_ERR(1, 98, __pyx_L1_error)
     }
     __pyx_t_1 = __Pyx_decode_bytes(((PyObject*)__pyx_v__path), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 98, __pyx_L1_error)
@@ -30115,7 +30168,7 @@ static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_string(PyObject *__
  */
         __pyx_t_4 = __pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT;
         __Pyx_INCREF(__pyx_t_4);
-        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_new_path, __pyx_t_4); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 118, __pyx_L1_error)
+        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_new_path, __pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 118, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
         /* "src/lxml/objectpath.pxi":116
@@ -30260,7 +30313,7 @@ static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_string(PyObject *__
     __Pyx_INCREF(__pyx_v_index);
     __Pyx_GIVEREF(__pyx_v_index);
     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_index);
-    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_new_path, __pyx_t_4); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 126, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_new_path, __pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 126, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "src/lxml/objectpath.pxi":128
@@ -30313,7 +30366,7 @@ static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_string(PyObject *__
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(1, 129, __pyx_L1_error)
   }
-  __pyx_t_13 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_path); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(1, 129, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_path); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
   __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 129, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_v_path_pos, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 129, __pyx_L1_error)
@@ -30469,7 +30522,7 @@ static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_list(PyObject *__py
       if (unlikely(!__pyx_t_4)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
           else __PYX_ERR(1, 138, __pyx_L1_error)
         }
         break;
@@ -30781,7 +30834,7 @@ static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_list(PyObject *__py
     __Pyx_INCREF(__pyx_v_index);
     __Pyx_GIVEREF(__pyx_v_index);
     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_index);
-    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_path, __pyx_t_4); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(1, 158, __pyx_L1_error)
+    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_path, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 158, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "src/lxml/objectpath.pxi":138
@@ -30903,7 +30956,7 @@ static __pyx_t_4lxml_9objectify__ObjectPath *__pyx_f_4lxml_9objectify__build_obj
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
     __PYX_ERR(1, 167, __pyx_L1_error)
   }
-  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_path_list); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(1, 167, __pyx_L1_error)
+  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_path_list); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 167, __pyx_L1_error)
   __pyx_v_c_path_segments = ((__pyx_t_4lxml_9objectify__ObjectPath *)lxml_malloc(__pyx_t_1, (sizeof(__pyx_t_4lxml_9objectify__ObjectPath))));
 
   /* "src/lxml/objectpath.pxi":168
@@ -32375,7 +32428,7 @@ static PyObject *__pyx_f_4lxml_9objectify__build_descendant_paths(xmlNode *__pyx
  *     return path_list
  * 
  */
-  __pyx_t_3 = __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(__pyx_v_c_node, __pyx_v_path, __pyx_v_path_list); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 296, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(__pyx_v_c_node, __pyx_v_path, __pyx_v_path_list); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 296, __pyx_L1_error)
 
   /* "src/lxml/objectpath.pxi":297
  *     path_list = []
@@ -32444,7 +32497,7 @@ static int __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(xmlNode *_
  *     path_list.append(u'.'.join(path))
  *     c_href = tree._getNs(c_node)
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 306, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 306, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_tags = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -32457,12 +32510,12 @@ static int __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(xmlNode *_
  *     c_child = c_node.children
  */
   if (unlikely(__pyx_v_path_list == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
     __PYX_ERR(1, 307, __pyx_L1_error)
   }
   __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__3, __pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 307, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_path_list, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 307, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_path_list, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 307, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "src/lxml/objectpath.pxi":308
@@ -32716,10 +32769,10 @@ static int __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(xmlNode *_
  *         del path[-1]
  */
     if (unlikely(__pyx_v_path == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
       __PYX_ERR(1, 328, __pyx_L1_error)
     }
-    __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_path, __pyx_v_tag); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(1, 328, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_path, __pyx_v_tag); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 328, __pyx_L1_error)
 
     /* "src/lxml/objectpath.pxi":329
  *             tag += u'[%d]' % count
@@ -32728,7 +32781,7 @@ static int __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(xmlNode *_
  *         del path[-1]
  *         c_child = c_child.next
  */
-    __pyx_t_7 = __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(__pyx_v_c_child, __pyx_v_path, __pyx_v_path_list); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 329, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(__pyx_v_c_child, __pyx_v_path, __pyx_v_path_list); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 329, __pyx_L1_error)
 
     /* "src/lxml/objectpath.pxi":330
  *         path.append(tag)
@@ -32790,7 +32843,7 @@ static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifiedElement(PyTypeObject *
 }
 
 static void __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -33039,7 +33092,7 @@ static PyObject *__pyx_tp_new_4lxml_9objectify_NumberElement(PyTypeObject *t, Py
 
 static void __pyx_tp_dealloc_4lxml_9objectify_NumberElement(PyObject *o) {
   struct __pyx_obj_4lxml_9objectify_NumberElement *p = (struct __pyx_obj_4lxml_9objectify_NumberElement *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -33989,7 +34042,7 @@ static PyObject *__pyx_tp_new_4lxml_9objectify_PyType(PyTypeObject *t, CYTHON_UN
 
 static void __pyx_tp_dealloc_4lxml_9objectify_PyType(PyObject *o) {
   struct __pyx_obj_4lxml_9objectify_PyType *p = (struct __pyx_obj_4lxml_9objectify_PyType *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -34259,7 +34312,7 @@ static PyObject *__pyx_tp_new_4lxml_9objectify_ElementMaker(PyTypeObject *t, CYT
 
 static void __pyx_tp_dealloc_4lxml_9objectify_ElementMaker(PyObject *o) {
   struct __pyx_obj_4lxml_9objectify_ElementMaker *p = (struct __pyx_obj_4lxml_9objectify_ElementMaker *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -34383,7 +34436,7 @@ static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifyElementClassLookup(PyTyp
 
 static void __pyx_tp_dealloc_4lxml_9objectify_ObjectifyElementClassLookup(PyObject *o) {
   struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *p = (struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -34499,7 +34552,7 @@ static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectPath(PyTypeObject *t, CYTHO
 
 static void __pyx_tp_dealloc_4lxml_9objectify_ObjectPath(PyObject *o) {
   struct __pyx_obj_4lxml_9objectify_ObjectPath *p = (struct __pyx_obj_4lxml_9objectify_ObjectPath *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
+  #if CYTHON_USE_TP_FINALIZE
   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
     if (PyObject_CallFinalizerFromDealloc(o)) return;
   }
@@ -34621,17 +34674,31 @@ static PyMethodDef __pyx_methods[] = {
 };
 
 #if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec_objectify(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+  {Py_mod_create, (void*)__pyx_pymod_create},
+  {Py_mod_exec, (void*)__pyx_pymod_exec_objectify},
+  {0, NULL}
+};
+#endif
+
 static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
     PyModuleDef_HEAD_INIT,
-  #endif
     "objectify",
     __pyx_k_The_lxml_objectify_module_imple, /* m_doc */
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    0, /* m_size */
+  #else
     -1, /* m_size */
+  #endif
     __pyx_methods /* m_methods */,
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+    __pyx_moduledef_slots, /* m_slots */
+  #else
     NULL, /* m_reload */
+  #endif
     NULL, /* m_traverse */
     NULL, /* m_clear */
     (freefunc)__pyx_module_cleanup /* m_free */
@@ -34718,7 +34785,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_kp_b__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 0, 0},
   {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
   {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
-  {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0},
+  {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
   {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
   {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
   {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
@@ -35097,6 +35164,17 @@ static int __Pyx_InitCachedConstants(void) {
   __Pyx_GOTREF(__pyx_tuple__16);
   __Pyx_GIVEREF(__pyx_tuple__16);
 
+  /* "lxml/objectify.pyx":43
+ * import re
+ * 
+ * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError)             # <<<<<<<<<<<<<<
+ * cdef object is_special_method = re.compile(u'__.*__$').match
+ * 
+ */
+  __pyx_tuple__18 = PyTuple_Pack(2, __pyx_builtin_ValueError, __pyx_builtin_TypeError); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__18);
+  __Pyx_GIVEREF(__pyx_tuple__18);
+
   /* "lxml/objectify.pyx":44
  * 
  * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError)
@@ -35104,9 +35182,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  * 
  */
-  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u__18); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 44, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__19);
-  __Pyx_GIVEREF(__pyx_tuple__19);
+  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u__19); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__20);
+  __Pyx_GIVEREF(__pyx_tuple__20);
 
   /* "lxml/objectify.pyx":81
  *     return (s, python.PyUnicode_AsUTF8String(s))
@@ -35115,13 +35193,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""set_pytype_attribute_tag(attribute_tag=None)
  *     Change name and namespace of the XML attribute that holds Python type
  */
-  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_attribute_tag); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 81, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__20);
-  __Pyx_GIVEREF(__pyx_tuple__20);
-  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_set_pytype_attribute_tag, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 81, __pyx_L1_error)
-  __pyx_tuple__22 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 81, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__22);
-  __Pyx_GIVEREF(__pyx_tuple__22);
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_attribute_tag); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_set_pytype_attribute_tag, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __pyx_tuple__23 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
 
   /* "lxml/objectify.pyx":161
  * 
@@ -35130,10 +35208,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return (fromstring, (etree.tostring(self),))
  * 
  */
-  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 161, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__23);
-  __Pyx_GIVEREF(__pyx_tuple__23);
-  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_reduce, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__24);
+  __Pyx_GIVEREF(__pyx_tuple__24);
+  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_reduce, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 161, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":192
  *         return _countSiblings(self._c_node)
@@ -35142,10 +35220,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""countchildren(self)
  * 
  */
-  __pyx_tuple__25 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 192, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__25);
-  __Pyx_GIVEREF(__pyx_tuple__25);
-  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_countchildren, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 192, __pyx_L1_error)
+  __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 192, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__26);
+  __Pyx_GIVEREF(__pyx_tuple__26);
+  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_countchildren, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 192, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":209
  *         return c
@@ -35154,10 +35232,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""getchildren(self)
  * 
  */
-  __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_node, __pyx_n_s_result); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 209, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
-  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_getchildren, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 209, __pyx_L1_error)
+  __pyx_tuple__28 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_node, __pyx_n_s_result); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 209, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
+  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_getchildren, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 209, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":263
  *         self.remove(child)
@@ -35166,10 +35244,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""addattr(self, tag, value)
  * 
  */
-  __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 263, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__29);
-  __Pyx_GIVEREF(__pyx_tuple__29);
-  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_addattr, 263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 263, __pyx_L1_error)
+  __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 263, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__30);
+  __Pyx_GIVEREF(__pyx_tuple__30);
+  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_addattr, 263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 263, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":370
  *             parent.remove(sibling)
@@ -35178,10 +35256,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""descendantpaths(self, prefix=None)
  * 
  */
-  __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_prefix); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 370, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__31);
-  __Pyx_GIVEREF(__pyx_tuple__31);
-  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_descendantpaths, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_prefix); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__32);
+  __Pyx_GIVEREF(__pyx_tuple__32);
+  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_descendantpaths, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 370, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":608
  *         return strrepr(textOf(self._c_node) or '')
@@ -35190,10 +35268,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""For use in subclasses only. Don't use unless you know what you are
  *         doing.
  */
-  __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_s_3); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 608, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__33);
-  __Pyx_GIVEREF(__pyx_tuple__33);
-  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_setText, 608, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 608, __pyx_L1_error)
+  __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_s_3); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 608, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__34);
+  __Pyx_GIVEREF(__pyx_tuple__34);
+  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_setText, 608, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 608, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":616
  * cdef class NumberElement(ObjectifiedDataElement):
@@ -35202,10 +35280,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""Set the function that parses the Python value from a string.
  * 
  */
-  __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_function); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 616, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__35);
-  __Pyx_GIVEREF(__pyx_tuple__35);
-  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_setValueParser, 616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 616, __pyx_L1_error)
+  __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_function); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 616, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__36);
+  __Pyx_GIVEREF(__pyx_tuple__36);
+  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_setValueParser, 616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 616, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":636
  *         return float(_parseNumber(self))
@@ -35214,10 +35292,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return complex(_parseNumber(self))
  * 
  */
-  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 636, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__37);
-  __Pyx_GIVEREF(__pyx_tuple__37);
-  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_complex, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 636, __pyx_L1_error)
+  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 636, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__38);
+  __Pyx_GIVEREF(__pyx_tuple__38);
+  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_complex, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 636, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":712
  * 
@@ -35226,10 +35304,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._parse_value = int
  * 
  */
-  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 712, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__39);
-  __Pyx_GIVEREF(__pyx_tuple__39);
-  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 712, __pyx_L1_error)
+  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 712, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__40);
+  __Pyx_GIVEREF(__pyx_tuple__40);
+  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 712, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":716
  * 
@@ -35238,10 +35316,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._parse_value = long
  * 
  */
-  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 716, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__41);
-  __Pyx_GIVEREF(__pyx_tuple__41);
-  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 716, __pyx_L1_error)
+  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 716, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__42);
+  __Pyx_GIVEREF(__pyx_tuple__42);
+  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 716, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":720
  * 
@@ -35250,10 +35328,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._parse_value = float
  * 
  */
-  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 720, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__43);
-  __Pyx_GIVEREF(__pyx_tuple__43);
-  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 720, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 720, __pyx_L1_error)
+  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 720, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__44);
+  __Pyx_GIVEREF(__pyx_tuple__44);
+  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 720, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 720, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":737
  *         return repr(textOf(self._c_node) or u'')
@@ -35262,10 +35340,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         text = textOf(self._c_node)
  *         if text is None:
  */
-  __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_text); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 737, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__45);
-  __Pyx_GIVEREF(__pyx_tuple__45);
-  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_strlen, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 737, __pyx_L1_error)
+  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_text); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 737, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__46);
+  __Pyx_GIVEREF(__pyx_tuple__46);
+  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_strlen, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 737, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":782
  *         return float(textOf(self._c_node))
@@ -35274,10 +35352,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         return complex(textOf(self._c_node))
  * 
  */
-  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 782, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__47);
-  __Pyx_GIVEREF(__pyx_tuple__47);
-  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_complex, 782, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 782, __pyx_L1_error)
+  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 782, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__48);
+  __Pyx_GIVEREF(__pyx_tuple__48);
+  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_complex, 782, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 782, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":816
  *     Python's bool type.
@@ -35286,10 +35364,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         self._parse_value = __parseBool
  * 
  */
-  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 816, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__49);
-  __Pyx_GIVEREF(__pyx_tuple__49);
-  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 816, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 816, __pyx_L1_error)
+  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 816, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__50);
+  __Pyx_GIVEREF(__pyx_tuple__50);
+  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 816, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 816, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":838
  *             return __parseBool(textOf(self._c_node))
@@ -35298,10 +35376,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     cdef int value = -1
  *     if s is not None:
  */
-  __pyx_tuple__51 = PyTuple_Pack(2, __pyx_n_s_s_3, __pyx_n_s_value); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 838, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__51);
-  __Pyx_GIVEREF(__pyx_tuple__51);
-  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_checkBool, 838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 838, __pyx_L1_error)
+  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_s_3, __pyx_n_s_value); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 838, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__52);
+  __Pyx_GIVEREF(__pyx_tuple__52);
+  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_checkBool, 838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 838, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":845
  *         raise ValueError
@@ -35310,10 +35388,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     cdef int value
  *     if s is None:
  */
-  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_s_3); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 845, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__53);
-  __Pyx_GIVEREF(__pyx_tuple__53);
-  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_parseBool, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 845, __pyx_L1_error)
+  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_s_3); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 845, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__54);
+  __Pyx_GIVEREF(__pyx_tuple__54);
+  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_parseBool, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 845, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":943
  *         return "PyType(%s, %s)" % (self.name, self._type.__name__)
@@ -35322,10 +35400,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""register(self, before=None, after=None)
  * 
  */
-  __pyx_tuple__55 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_before, __pyx_n_s_after, __pyx_n_s_item, __pyx_n_s_entry, __pyx_n_s_first_pos, __pyx_n_s_last_pos, __pyx_n_s_i, __pyx_n_s_check, __pyx_n_s_pytype, __pyx_n_s_xs_type); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 943, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__55);
-  __Pyx_GIVEREF(__pyx_tuple__55);
-  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_register, 943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 943, __pyx_L1_error)
+  __pyx_tuple__56 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_before, __pyx_n_s_after, __pyx_n_s_item, __pyx_n_s_entry, __pyx_n_s_first_pos, __pyx_n_s_last_pos, __pyx_n_s_i, __pyx_n_s_check, __pyx_n_s_pytype, __pyx_n_s_xs_type); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 943, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__56);
+  __Pyx_GIVEREF(__pyx_tuple__56);
+  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_register, 943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 943, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":984
  *             _SCHEMA_TYPE_DICT[xs_type] = self
@@ -35334,10 +35412,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"unregister(self)"
  *         if _PYTYPE_DICT.get(self.name) is self:
  */
-  __pyx_tuple__57 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xs_type, __pyx_n_s_pytype); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 984, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__57);
-  __Pyx_GIVEREF(__pyx_tuple__57);
-  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_unregister, 984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 984, __pyx_L1_error)
+  __pyx_tuple__58 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xs_type, __pyx_n_s_pytype); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 984, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__58);
+  __Pyx_GIVEREF(__pyx_tuple__58);
+  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_unregister, 984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 984, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1013
  * cdef list _TYPE_CHECKS = []
@@ -35346,10 +35424,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     return u"true" if b else u"false"
  * 
  */
-  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_b); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1013, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__59);
-  __Pyx_GIVEREF(__pyx_tuple__59);
-  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_lower_bool, 1013, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 1013, __pyx_L1_error)
+  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_b); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 1013, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__60);
+  __Pyx_GIVEREF(__pyx_tuple__60);
+  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_lower_bool, 1013, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 1013, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1019
  *     return u"str" if python._isString(obj) else _typename(obj)
@@ -35358,10 +35436,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""pytypename(obj)
  * 
  */
-  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1019, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__61);
-  __Pyx_GIVEREF(__pyx_tuple__61);
-  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_pytypename, 1019, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 1019, __pyx_L1_error)
+  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 1019, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__62);
+  __Pyx_GIVEREF(__pyx_tuple__62);
+  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_pytypename, 1019, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 1019, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1065
  * _registerPyTypes()
@@ -35370,10 +35448,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""getRegisteredTypes()
  * 
  */
-  __pyx_tuple__63 = PyTuple_Pack(5, __pyx_n_s_types, __pyx_n_s_known, __pyx_n_s_check, __pyx_n_s_pytype, __pyx_n_s_name); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1065, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__63);
-  __Pyx_GIVEREF(__pyx_tuple__63);
-  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_getRegisteredTypes, 1065, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 1065, __pyx_L1_error)
+  __pyx_tuple__64 = PyTuple_Pack(5, __pyx_n_s_types, __pyx_n_s_known, __pyx_n_s_check, __pyx_n_s_pytype, __pyx_n_s_name); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1065, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__64);
+  __Pyx_GIVEREF(__pyx_tuple__64);
+  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_getRegisteredTypes, 1065, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 1065, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1301
  * cdef bint __RECURSIVE_STR = 0 # default: off
@@ -35382,13 +35460,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""enable_recursive_str(on=True)
  * 
  */
-  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_on); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1301, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__65);
-  __Pyx_GIVEREF(__pyx_tuple__65);
-  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_enable_recursive_str, 1301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 1301, __pyx_L1_error)
-  __pyx_tuple__67 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1301, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__67);
-  __Pyx_GIVEREF(__pyx_tuple__67);
+  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_on); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1301, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__66);
+  __Pyx_GIVEREF(__pyx_tuple__66);
+  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_enable_recursive_str, 1301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1301, __pyx_L1_error)
+  __pyx_tuple__68 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1301, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__68);
+  __Pyx_GIVEREF(__pyx_tuple__68);
 
   /* "lxml/objectify.pyx":1310
  *     __RECURSIVE_STR = on
@@ -35397,10 +35475,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""dump(_Element element not None)
  * 
  */
-  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_element); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1310, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__68);
-  __Pyx_GIVEREF(__pyx_tuple__68);
-  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_dump, 1310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1310, __pyx_L1_error)
+  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_element); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1310, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__69);
+  __Pyx_GIVEREF(__pyx_tuple__69);
+  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_dump, 1310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 1310, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1354
  * # Pickle support for objectified ElementTree
@@ -35409,10 +35487,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     return etree.ElementTree(fromstring(data))
  * 
  */
-  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_data); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1354, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__70);
-  __Pyx_GIVEREF(__pyx_tuple__70);
-  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_unpickleElementTree, 1354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 1354, __pyx_L1_error)
+  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_data); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1354, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__71);
+  __Pyx_GIVEREF(__pyx_tuple__71);
+  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_unpickleElementTree, 1354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 1354, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1365
  *                    elementTreeReduceFunction, __unpickleElementTree)
@@ -35421,10 +35499,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     return (__unpickleElementTree, (etree.tostring(obj),))
  * 
  */
-  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1365, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__72);
-  __Pyx_GIVEREF(__pyx_tuple__72);
-  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_pickleReduceElementTree, 1365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 1365, __pyx_L1_error)
+  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1365, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__73);
+  __Pyx_GIVEREF(__pyx_tuple__73);
+  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_pickleReduceElementTree, 1365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 1365, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1459
  *     return None
@@ -35433,10 +35511,10 @@ static int __Pyx_InitCachedConstants(void) {
  *              empty_pytype=None):
  *     u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
  */
-  __pyx_tuple__74 = PyTuple_Pack(5, __pyx_n_s_element_or_tree, __pyx_n_s_ignore_old, __pyx_n_s_ignore_xsi, __pyx_n_s_empty_pytype, __pyx_n_s_element); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1459, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__74);
-  __Pyx_GIVEREF(__pyx_tuple__74);
-  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 3, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_pyannotate, 1459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 1459, __pyx_L1_error)
+  __pyx_tuple__75 = PyTuple_Pack(5, __pyx_n_s_element_or_tree, __pyx_n_s_ignore_old, __pyx_n_s_ignore_xsi, __pyx_n_s_empty_pytype, __pyx_n_s_element); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1459, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__75);
+  __Pyx_GIVEREF(__pyx_tuple__75);
+  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 3, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_pyannotate, 1459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 1459, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1482
  *     _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
@@ -35445,10 +35523,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                 empty_type=None):
  *     u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
  */
-  __pyx_tuple__76 = PyTuple_Pack(5, __pyx_n_s_element_or_tree, __pyx_n_s_ignore_old, __pyx_n_s_ignore_pytype, __pyx_n_s_empty_type, __pyx_n_s_element); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1482, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__76);
-  __Pyx_GIVEREF(__pyx_tuple__76);
-  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 3, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_xsiannotate, 1482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 1482, __pyx_L1_error)
+  __pyx_tuple__77 = PyTuple_Pack(5, __pyx_n_s_element_or_tree, __pyx_n_s_ignore_old, __pyx_n_s_ignore_pytype, __pyx_n_s_empty_type, __pyx_n_s_element); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1482, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__77);
+  __Pyx_GIVEREF(__pyx_tuple__77);
+  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 3, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_xsiannotate, 1482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 1482, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1510
  *     _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
@@ -35457,10 +35535,10 @@ static int __Pyx_InitCachedConstants(void) {
  *              empty_pytype=None, empty_type=None, annotate_xsi=0,
  *              annotate_pytype=1):
  */
-  __pyx_tuple__78 = PyTuple_Pack(8, __pyx_n_s_element_or_tree, __pyx_n_s_ignore_old, __pyx_n_s_ignore_xsi, __pyx_n_s_empty_pytype, __pyx_n_s_empty_type, __pyx_n_s_annotate_xsi, __pyx_n_s_annotate_pytype, __pyx_n_s_element); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1510, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__78);
-  __Pyx_GIVEREF(__pyx_tuple__78);
-  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 6, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_annotate, 1510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 1510, __pyx_L1_error)
+  __pyx_tuple__79 = PyTuple_Pack(8, __pyx_n_s_element_or_tree, __pyx_n_s_ignore_old, __pyx_n_s_ignore_xsi, __pyx_n_s_empty_pytype, __pyx_n_s_empty_type, __pyx_n_s_annotate_xsi, __pyx_n_s_annotate_pytype, __pyx_n_s_element); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1510, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__79);
+  __Pyx_GIVEREF(__pyx_tuple__79);
+  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 6, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_annotate, 1510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 1510, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1706
  * cdef object _cleanup_namespaces = etree.cleanup_namespaces
@@ -35469,10 +35547,10 @@ static int __Pyx_InitCachedConstants(void) {
  *                bint xsi_nil=False, bint cleanup_namespaces=False):
  *     u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
  */
-  __pyx_tuple__80 = PyTuple_Pack(6, __pyx_n_s_element_or_tree, __pyx_n_s_pytype, __pyx_n_s_xsi_2, __pyx_n_s_xsi_nil, __pyx_n_s_cleanup_namespaces, __pyx_n_s_attribute_names); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 1706, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__80);
-  __Pyx_GIVEREF(__pyx_tuple__80);
-  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 4, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_deannotate, 1706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 1706, __pyx_L1_error)
+  __pyx_tuple__81 = PyTuple_Pack(6, __pyx_n_s_element_or_tree, __pyx_n_s_pytype, __pyx_n_s_xsi_2, __pyx_n_s_xsi_nil, __pyx_n_s_cleanup_namespaces, __pyx_n_s_attribute_names); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1706, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__81);
+  __Pyx_GIVEREF(__pyx_tuple__81);
+  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 4, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_deannotate, 1706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 1706, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1746
  * objectify_parser = __DEFAULT_PARSER
@@ -35481,13 +35559,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""set_default_parser(new_parser = None)
  * 
  */
-  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_new_parser); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1746, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__82);
-  __Pyx_GIVEREF(__pyx_tuple__82);
-  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_set_default_parser, 1746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 1746, __pyx_L1_error)
-  __pyx_tuple__84 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1746, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__84);
-  __Pyx_GIVEREF(__pyx_tuple__84);
+  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_new_parser); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1746, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__83);
+  __Pyx_GIVEREF(__pyx_tuple__83);
+  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_set_default_parser, 1746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 1746, __pyx_L1_error)
+  __pyx_tuple__85 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 1746, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__85);
+  __Pyx_GIVEREF(__pyx_tuple__85);
 
   /* "lxml/objectify.pyx":1764
  *         raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
@@ -35496,10 +35574,10 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""makeparser(remove_blank_text=True, **kw)
  * 
  */
-  __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_kw, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 1764, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__85);
-  __Pyx_GIVEREF(__pyx_tuple__85);
-  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_makeparser, 1764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 1764, __pyx_L1_error)
+  __pyx_tuple__86 = PyTuple_Pack(2, __pyx_n_s_kw, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 1764, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__86);
+  __Pyx_GIVEREF(__pyx_tuple__86);
+  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_makeparser, 1764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 1764, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":1791
  * SubElement = etree.SubElement
@@ -35508,13 +35586,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""fromstring(xml, parser=None, base_url=None)
  * 
  */
-  __pyx_tuple__87 = PyTuple_Pack(3, __pyx_n_s_xml, __pyx_n_s_parser, __pyx_n_s_base_url); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 1791, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__87);
-  __Pyx_GIVEREF(__pyx_tuple__87);
-  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 1, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_fromstring, 1791, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 1791, __pyx_L1_error)
-  __pyx_tuple__89 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 1791, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__89);
-  __Pyx_GIVEREF(__pyx_tuple__89);
+  __pyx_tuple__88 = PyTuple_Pack(3, __pyx_n_s_xml, __pyx_n_s_parser, __pyx_n_s_base_url); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 1791, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__88);
+  __Pyx_GIVEREF(__pyx_tuple__88);
+  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_fromstring, 1791, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 1791, __pyx_L1_error)
+  __pyx_tuple__90 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1791, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__90);
+  __Pyx_GIVEREF(__pyx_tuple__90);
 
   /* "lxml/objectify.pyx":1807
  *     return _fromstring(xml, parser, base_url=base_url)
@@ -35523,13 +35601,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""XML(xml, parser=None, base_url=None)
  * 
  */
-  __pyx_tuple__90 = PyTuple_Pack(3, __pyx_n_s_xml, __pyx_n_s_parser, __pyx_n_s_base_url); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1807, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__90);
-  __Pyx_GIVEREF(__pyx_tuple__90);
-  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(2, 1, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_XML, 1807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 1807, __pyx_L1_error)
-  __pyx_tuple__92 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 1807, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__92);
-  __Pyx_GIVEREF(__pyx_tuple__92);
+  __pyx_tuple__91 = PyTuple_Pack(3, __pyx_n_s_xml, __pyx_n_s_parser, __pyx_n_s_base_url); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 1807, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__91);
+  __Pyx_GIVEREF(__pyx_tuple__91);
+  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(2, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_XML, 1807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 1807, __pyx_L1_error)
+  __pyx_tuple__93 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 1807, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__93);
+  __Pyx_GIVEREF(__pyx_tuple__93);
 
   /* "lxml/objectify.pyx":1826
  * _parse = etree.parse
@@ -35538,13 +35616,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""parse(f, parser=None, base_url=None)
  * 
  */
-  __pyx_tuple__93 = PyTuple_Pack(3, __pyx_n_s_f, __pyx_n_s_parser, __pyx_n_s_base_url); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 1826, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__93);
-  __Pyx_GIVEREF(__pyx_tuple__93);
-  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 1, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_parse, 1826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 1826, __pyx_L1_error)
-  __pyx_tuple__95 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 1826, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__95);
-  __Pyx_GIVEREF(__pyx_tuple__95);
+  __pyx_tuple__94 = PyTuple_Pack(3, __pyx_n_s_f, __pyx_n_s_parser, __pyx_n_s_base_url); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 1826, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__94);
+  __Pyx_GIVEREF(__pyx_tuple__94);
+  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_parse, 1826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 1826, __pyx_L1_error)
+  __pyx_tuple__96 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 1826, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__96);
+  __Pyx_GIVEREF(__pyx_tuple__96);
 
   /* "lxml/objectify.pyx":1849
  * E = ElementMaker()
@@ -35553,13 +35631,13 @@ static int __Pyx_InitCachedConstants(void) {
  *     u"""Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)
  * 
  */
-  __pyx_tuple__96 = PyTuple_Pack(5, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_pytype_2, __pyx_n_s_attributes); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 1849, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__96);
-  __Pyx_GIVEREF(__pyx_tuple__96);
-  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(3, 1, 5, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_Element, 1849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 1849, __pyx_L1_error)
-  __pyx_tuple__98 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 1849, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__98);
-  __Pyx_GIVEREF(__pyx_tuple__98);
+  __pyx_tuple__97 = PyTuple_Pack(5, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_pytype_2, __pyx_n_s_attributes); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 1849, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__97);
+  __Pyx_GIVEREF(__pyx_tuple__97);
+  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(3, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_Element, 1849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 1849, __pyx_L1_error)
+  __pyx_tuple__99 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 1849, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__99);
+  __Pyx_GIVEREF(__pyx_tuple__99);
 
   /* "lxml/objectify.pyx":1869
  *     return _makeElement(_tag, None, _attributes, nsmap)
@@ -35568,13 +35646,13 @@ static int __Pyx_InitCachedConstants(void) {
  *                 **_attributes):
  *     u"""DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)
  */
-  __pyx_tuple__99 = PyTuple_Pack(13, __pyx_n_s_value_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_pytype_2, __pyx_n_s_xsi_3, __pyx_n_s_attributes, __pyx_n_s_temp, __pyx_n_s_prefix, __pyx_n_s_name, __pyx_n_s_ns, __pyx_n_s_py_type, __pyx_n_s_strval, __pyx_n_s_stringify); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 1869, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__99);
-  __Pyx_GIVEREF(__pyx_tuple__99);
-  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(3, 2, 13, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_DataElement, 1869, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 1869, __pyx_L1_error)
-  __pyx_tuple__101 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 1869, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__101);
-  __Pyx_GIVEREF(__pyx_tuple__101);
+  __pyx_tuple__100 = PyTuple_Pack(13, __pyx_n_s_value_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_pytype_2, __pyx_n_s_xsi_3, __pyx_n_s_attributes, __pyx_n_s_temp, __pyx_n_s_prefix, __pyx_n_s_name, __pyx_n_s_ns, __pyx_n_s_py_type, __pyx_n_s_strval, __pyx_n_s_stringify); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 1869, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__100);
+  __Pyx_GIVEREF(__pyx_tuple__100);
+  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(3, 2, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_DataElement, 1869, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 1869, __pyx_L1_error)
+  __pyx_tuple__102 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 1869, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__102);
+  __Pyx_GIVEREF(__pyx_tuple__102);
 
   /* "src/lxml/objectpath.pxi":57
  *         return _find_object_path(root, self._c_path, self._path_len, default)
@@ -35583,10 +35661,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"hasattr(self, root)"
  *         try:
  */
-  __pyx_tuple__102 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_root); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(1, 57, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__102);
-  __Pyx_GIVEREF(__pyx_tuple__102);
-  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectpath_pxi, __pyx_n_s_hasattr, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(1, 57, __pyx_L1_error)
+  __pyx_tuple__103 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_root); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(1, 57, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__103);
+  __Pyx_GIVEREF(__pyx_tuple__103);
+  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectpath_pxi, __pyx_n_s_hasattr, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(1, 57, __pyx_L1_error)
 
   /* "src/lxml/objectpath.pxi":65
  *         return True
@@ -35595,10 +35673,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""setattr(self, root, value)
  * 
  */
-  __pyx_tuple__104 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_root, __pyx_n_s_value); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(1, 65, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__104);
-  __Pyx_GIVEREF(__pyx_tuple__104);
-  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectpath_pxi, __pyx_n_s_setattr, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(1, 65, __pyx_L1_error)
+  __pyx_tuple__105 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_root, __pyx_n_s_value); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(1, 65, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__105);
+  __Pyx_GIVEREF(__pyx_tuple__105);
+  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectpath_pxi, __pyx_n_s_setattr, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(1, 65, __pyx_L1_error)
 
   /* "src/lxml/objectpath.pxi":74
  *         _create_object_path(root, self._c_path, self._path_len, 1, value)
@@ -35607,10 +35685,10 @@ static int __Pyx_InitCachedConstants(void) {
  *         u"""addattr(self, root, value)
  * 
  */
-  __pyx_tuple__106 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_root, __pyx_n_s_value); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(1, 74, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__106);
-  __Pyx_GIVEREF(__pyx_tuple__106);
-  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectpath_pxi, __pyx_n_s_addattr, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(1, 74, __pyx_L1_error)
+  __pyx_tuple__107 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_root, __pyx_n_s_value); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(1, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__107);
+  __Pyx_GIVEREF(__pyx_tuple__107);
+  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectpath_pxi, __pyx_n_s_addattr, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(1, 74, __pyx_L1_error)
 
   /* "src/lxml/objectpath.pxi":88
  *     re.U).match
@@ -35619,9 +35697,9 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  * 
  */
-  __pyx_tuple__108 = PyTuple_Pack(3, Py_None, Py_None, __pyx_int_0); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(1, 88, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__108);
-  __Pyx_GIVEREF(__pyx_tuple__108);
+  __pyx_tuple__109 = PyTuple_Pack(3, Py_None, Py_None, __pyx_int_0); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(1, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__109);
+  __Pyx_GIVEREF(__pyx_tuple__109);
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -35647,6 +35725,47 @@ PyMODINIT_FUNC initobjectify(void)
 #else
 PyMODINIT_FUNC PyInit_objectify(void); /*proto*/
 PyMODINIT_FUNC PyInit_objectify(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+  return PyModuleDef_Init(&__pyx_moduledef);
+}
+static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
+    PyObject *value = PyObject_GetAttrString(spec, from_name);
+    int result = 0;
+    if (likely(value)) {
+        result = PyDict_SetItemString(moddict, to_name, value);
+        Py_DECREF(value);
+    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+        PyErr_Clear();
+    } else {
+        result = -1;
+    }
+    return result;
+}
+static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+    PyObject *module = NULL, *moddict, *modname;
+    if (__pyx_m)
+        return __Pyx_NewRef(__pyx_m);
+    modname = PyObject_GetAttrString(spec, "name");
+    if (unlikely(!modname)) goto bad;
+    module = PyModule_NewObject(modname);
+    Py_DECREF(modname);
+    if (unlikely(!module)) goto bad;
+    moddict = PyModule_GetDict(module);
+    if (unlikely(!moddict)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
+    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
+    return module;
+bad:
+    Py_XDECREF(module);
+    return NULL;
+}
+
+
+static int __pyx_pymod_exec_objectify(PyObject *__pyx_pyinit_module)
+#endif
 #endif
 {
   PyObject *__pyx_t_1 = NULL;
@@ -35656,6 +35775,9 @@ PyMODINIT_FUNC PyInit_objectify(void)
   PyObject *__pyx_t_5 = NULL;
   PyObject *__pyx_t_6 = NULL;
   __Pyx_RefNannyDeclarations
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
+  #endif
   #if CYTHON_REFNANNY
   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
   if (!__Pyx_RefNanny) {
@@ -35682,6 +35804,9 @@ PyMODINIT_FUNC PyInit_objectify(void)
   #ifdef __Pyx_Generator_USED
   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
+  #ifdef __Pyx_AsyncGen_USED
+  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   #ifdef __Pyx_StopAsyncIteration_USED
   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   #endif
@@ -35693,12 +35818,17 @@ PyMODINIT_FUNC PyInit_objectify(void)
   #endif
   #endif
   /*--- Module creation code ---*/
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  __pyx_m = __pyx_pyinit_module;
+  Py_INCREF(__pyx_m);
+  #else
   #if PY_MAJOR_VERSION < 3
   __pyx_m = Py_InitModule4("objectify", __pyx_methods, __pyx_k_The_lxml_objectify_module_imple, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+  #endif
   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
   Py_INCREF(__pyx_d);
   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
@@ -36073,7 +36203,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  * 
  * __version__ = etree.__version__
  */
-  __pyx_t_3 = import_lxml__etree(); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 36, __pyx_L1_error)
+  __pyx_t_3 = import_lxml__etree(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 36, __pyx_L1_error)
 
   /* "lxml/objectify.pyx":38
  * import_lxml__etree()
@@ -36108,18 +36238,10 @@ PyMODINIT_FUNC PyInit_objectify(void)
  * cdef object is_special_method = re.compile(u'__.*__$').match
  * 
  */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_builtin_ValueError);
-  __Pyx_GIVEREF(__pyx_builtin_ValueError);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_ValueError);
-  __Pyx_INCREF(__pyx_builtin_TypeError);
-  __Pyx_GIVEREF(__pyx_builtin_TypeError);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_TypeError);
+  __Pyx_INCREF(__pyx_tuple__18);
   __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS, ((PyObject*)__pyx_t_2));
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS, __pyx_tuple__18);
+  __Pyx_GIVEREF(__pyx_tuple__18);
 
   /* "lxml/objectify.pyx":44
  * 
@@ -36130,7 +36252,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  */
   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_match); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
@@ -36169,9 +36291,9 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""set_pytype_attribute_tag(attribute_tag=None)
  *     Change name and namespace of the XML attribute that holds Python type
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_1set_pytype_attribute_tag, 0, __pyx_n_s_set_pytype_attribute_tag, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_1set_pytype_attribute_tag, 0, __pyx_n_s_set_pytype_attribute_tag, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__22);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__23);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pytype_attribute_tag, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
@@ -36369,7 +36491,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         return (fromstring, (etree.tostring(self),))
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement___reduce, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement___reduce, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement->tp_dict, __pyx_n_s_reduce, __pyx_t_2) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36382,7 +36504,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"""countchildren(self)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_9countchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_countchildren, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_9countchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_countchildren, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement->tp_dict, __pyx_n_s_countchildren, __pyx_t_2) < 0) __PYX_ERR(0, 192, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36395,7 +36517,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"""getchildren(self)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_11getchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_getchildren, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_11getchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_getchildren, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement->tp_dict, __pyx_n_s_getchildren, __pyx_t_2) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36408,7 +36530,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"""addattr(self, tag, value)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_19addattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_addattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_19addattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_addattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement->tp_dict, __pyx_n_s_addattr, __pyx_t_2) < 0) __PYX_ERR(0, 263, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36421,7 +36543,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"""descendantpaths(self, prefix=None)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_27descendantpaths, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_descendantpat, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_27descendantpaths, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_descendantpat, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement->tp_dict, __pyx_n_s_descendantpaths, __pyx_t_2) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36434,7 +36556,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"""For use in subclasses only. Don't use unless you know what you are
  *         doing.
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_22ObjectifiedDataElement_5_setText, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedDataElement__setText, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_22ObjectifiedDataElement_5_setText, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedDataElement__setText, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedDataElement->tp_dict, __pyx_n_s_setText, __pyx_t_2) < 0) __PYX_ERR(0, 608, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36447,7 +36569,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"""Set the function that parses the Python value from a string.
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_13NumberElement_1_setValueParser, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NumberElement__setValueParser, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_13NumberElement_1_setValueParser, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NumberElement__setValueParser, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_NumberElement->tp_dict, __pyx_n_s_setValueParser, __pyx_t_2) < 0) __PYX_ERR(0, 616, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36460,7 +36582,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         return complex(_parseNumber(self))
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_13NumberElement_9__complex__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NumberElement___complex, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_13NumberElement_9__complex__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NumberElement___complex, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_NumberElement->tp_dict, __pyx_n_s_complex, __pyx_t_2) < 0) __PYX_ERR(0, 636, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36473,7 +36595,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         self._parse_value = int
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_10IntElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IntElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_10IntElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IntElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement->tp_dict, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36486,7 +36608,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         self._parse_value = long
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_11LongElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LongElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_11LongElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LongElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_LongElement->tp_dict, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36499,7 +36621,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         self._parse_value = float
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_12FloatElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FloatElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_12FloatElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FloatElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_FloatElement->tp_dict, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 720, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36512,7 +36634,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         text = textOf(self._c_node)
  *         if text is None:
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_13StringElement_3strlen, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StringElement_strlen, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_13StringElement_3strlen, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StringElement_strlen, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement->tp_dict, __pyx_n_s_strlen, __pyx_t_2) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36525,7 +36647,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         return complex(textOf(self._c_node))
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_13StringElement_23__complex__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StringElement___complex, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_13StringElement_23__complex__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StringElement___complex, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement->tp_dict, __pyx_n_s_complex, __pyx_t_2) < 0) __PYX_ERR(0, 782, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36538,7 +36660,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         self._parse_value = __parseBool
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_11BoolElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoolElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_11BoolElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoolElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_BoolElement->tp_dict, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 816, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36551,7 +36673,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     cdef int value = -1
  *     if s is not None:
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_3__checkBool, 0, __pyx_n_s_checkBool, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_3__checkBool, 0, __pyx_n_s_checkBool, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_checkBool, __pyx_t_2) < 0) __PYX_ERR(0, 838, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36563,7 +36685,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     cdef int value
  *     if s is None:
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_5__parseBool, 0, __pyx_n_s_parseBool, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_5__parseBool, 0, __pyx_n_s_parseBool, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_parseBool, __pyx_t_2) < 0) __PYX_ERR(0, 845, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36575,7 +36697,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"""register(self, before=None, after=None)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_6PyType_5register, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyType_register, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_6PyType_5register, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyType_register, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_PyType->tp_dict, __pyx_n_s_register, __pyx_t_2) < 0) __PYX_ERR(0, 943, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36588,7 +36710,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"unregister(self)"
  *         if _PYTYPE_DICT.get(self.name) is self:
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_6PyType_7unregister, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyType_unregister, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_6PyType_7unregister, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyType_unregister, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_PyType->tp_dict, __pyx_n_s_unregister, __pyx_t_2) < 0) __PYX_ERR(0, 984, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36601,7 +36723,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  * cdef dict _SCHEMA_TYPE_DICT = {}
  * cdef list _TYPE_CHECKS = []
  */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__PYTYPE_DICT);
   __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__PYTYPE_DICT, ((PyObject*)__pyx_t_2));
@@ -36615,7 +36737,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  * cdef list _TYPE_CHECKS = []
  * 
  */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT);
   __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, ((PyObject*)__pyx_t_2));
@@ -36643,7 +36765,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     return u"true" if b else u"false"
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_7__lower_bool, 0, __pyx_n_s_lower_bool, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_7__lower_bool, 0, __pyx_n_s_lower_bool, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_lower_bool, __pyx_t_2) < 0) __PYX_ERR(0, 1013, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36655,7 +36777,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""pytypename(obj)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_9pytypename, 0, __pyx_n_s_pytypename, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1019, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_9pytypename, 0, __pyx_n_s_pytypename, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1019, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytypename, __pyx_t_2) < 0) __PYX_ERR(0, 1019, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36704,7 +36826,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""getRegisteredTypes()
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_11getRegisteredTypes, 0, __pyx_n_s_getRegisteredTypes, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_11getRegisteredTypes, 0, __pyx_n_s_getRegisteredTypes, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_getRegisteredTypes, __pyx_t_1) < 0) __PYX_ERR(0, 1065, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -36725,9 +36847,9 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""enable_recursive_str(on=True)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_13enable_recursive_str, 0, __pyx_n_s_enable_recursive_str, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_13enable_recursive_str, 0, __pyx_n_s_enable_recursive_str, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__67);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__68);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_enable_recursive_str, __pyx_t_1) < 0) __PYX_ERR(0, 1301, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -36738,7 +36860,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""dump(_Element element not None)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_15dump, 0, __pyx_n_s_dump, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_15dump, 0, __pyx_n_s_dump, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_dump, __pyx_t_1) < 0) __PYX_ERR(0, 1310, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -36750,7 +36872,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     return etree.ElementTree(fromstring(data))
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_17__unpickleElementTree, 0, __pyx_n_s_unpickleElementTree, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_17__unpickleElementTree, 0, __pyx_n_s_unpickleElementTree, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpickleElementTree, __pyx_t_1) < 0) __PYX_ERR(0, 1354, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -36762,7 +36884,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     return (__unpickleElementTree, (etree.tostring(obj),))
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_19pickleReduceElementTree, 0, __pyx_n_s_pickleReduceElementTree, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_19pickleReduceElementTree, 0, __pyx_n_s_pickleReduceElementTree, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickleReduceElementTree, __pyx_t_1) < 0) __PYX_ERR(0, 1365, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -36797,12 +36919,12 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *              empty_pytype=None):
  *     u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
  */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ignore_old, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ignore_xsi, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_empty_pytype, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_21pyannotate, 0, __pyx_n_s_pyannotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1459, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_21pyannotate, 0, __pyx_n_s_pyannotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1459, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36816,12 +36938,12 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *                 empty_type=None):
  *     u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_old, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1482, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_pytype, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1482, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_empty_type, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1482, __pyx_L1_error)
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_23xsiannotate, 0, __pyx_n_s_xsiannotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_23xsiannotate, 0, __pyx_n_s_xsiannotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -36835,7 +36957,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *              empty_pytype=None, empty_type=None, annotate_xsi=0,
  *              annotate_pytype=1):
  */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ignore_old, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 1510, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ignore_xsi, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1510, __pyx_L1_error)
@@ -36843,7 +36965,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_empty_type, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1510, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_annotate_xsi, ((PyObject *)__pyx_int_0)) < 0) __PYX_ERR(0, 1510, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_annotate_pytype, ((PyObject *)__pyx_int_1)) < 0) __PYX_ERR(0, 1510, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_25annotate, 0, __pyx_n_s_annotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_25annotate, 0, __pyx_n_s_annotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -36885,7 +37007,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *                bint xsi_nil=False, bint cleanup_namespaces=False):
  *     u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1706, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1706, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1706, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
@@ -36919,7 +37041,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *                bint xsi_nil=False, bint cleanup_namespaces=False):
  *     u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
  */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_27deannotate, 0, __pyx_n_s_deannotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1706, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_27deannotate, 0, __pyx_n_s_deannotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1706, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -36935,7 +37057,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  */
   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_XMLParser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1740, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1740, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1740, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_remove_blank_text, Py_True) < 0) __PYX_ERR(0, 1740, __pyx_L1_error)
   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1740, __pyx_L1_error)
@@ -37025,9 +37147,9 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""set_default_parser(new_parser = None)
  * 
  */
-  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_29set_default_parser, 0, __pyx_n_s_set_default_parser, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1746, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_29set_default_parser, 0, __pyx_n_s_set_default_parser, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1746, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__84);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__85);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_parser, __pyx_t_4) < 0) __PYX_ERR(0, 1746, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
@@ -37038,7 +37160,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""makeparser(remove_blank_text=True, **kw)
  * 
  */
-  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_31makeparser, 0, __pyx_n_s_makeparser, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1764, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_31makeparser, 0, __pyx_n_s_makeparser, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1764, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_makeparser, __pyx_t_4) < 0) __PYX_ERR(0, 1764, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -37076,12 +37198,12 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""fromstring(xml, parser=None, base_url=None)
  * 
  */
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1791, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1791, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1791, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_33fromstring, 0, __pyx_n_s_fromstring, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1791, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_33fromstring, 0, __pyx_n_s_fromstring, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1791, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__89);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__90);
   __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_4);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstring, __pyx_t_1) < 0) __PYX_ERR(0, 1791, __pyx_L1_error)
@@ -37094,12 +37216,12 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""XML(xml, parser=None, base_url=None)
  * 
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1807, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1807, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1807, __pyx_L1_error)
-  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_35XML, 0, __pyx_n_s_XML, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1807, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_35XML, 0, __pyx_n_s_XML, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1807, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__92);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__93);
   __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_XML, __pyx_t_4) < 0) __PYX_ERR(0, 1807, __pyx_L1_error)
@@ -37126,12 +37248,12 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""parse(f, parser=None, base_url=None)
  * 
  */
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1826, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1826, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1826, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_37parse, 0, __pyx_n_s_parse, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1826, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_37parse, 0, __pyx_n_s_parse, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1826, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__95);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__96);
   __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_4);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse, __pyx_t_1) < 0) __PYX_ERR(0, 1826, __pyx_L1_error)
@@ -37144,7 +37266,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     "xsi" : XML_SCHEMA_INSTANCE_NS,
  *     "xsd" : XML_SCHEMA_NS
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1842, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_py_2, __pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE) < 0) __PYX_ERR(0, 1842, __pyx_L1_error)
 
@@ -37157,12 +37279,12 @@ PyMODINIT_FUNC PyInit_objectify(void)
  */
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_xsi_2, __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS) < 0) __PYX_ERR(0, 1842, __pyx_L1_error)
 
-  /* "lxml/objectify.pyx":1845
+  /* "lxml/objectify.pyx":1844
+ *     "py"  : PYTYPE_NAMESPACE,
  *     "xsi" : XML_SCHEMA_INSTANCE_NS,
- *     "xsd" : XML_SCHEMA_NS
- * }             # <<<<<<<<<<<<<<
+ *     "xsd" : XML_SCHEMA_NS             # <<<<<<<<<<<<<<
+ * }
  * 
- * E = ElementMaker()
  */
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_xsd_2, __pyx_v_4lxml_9objectify_XML_SCHEMA_NS) < 0) __PYX_ERR(0, 1842, __pyx_L1_error)
   __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
@@ -37189,12 +37311,12 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *     u"""Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)
  * 
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1849, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1849, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pytype_2, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1849, __pyx_L1_error)
-  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_39Element, 0, __pyx_n_s_Element, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_39Element, 0, __pyx_n_s_Element, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__98);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__99);
   __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_Element, __pyx_t_4) < 0) __PYX_ERR(0, 1849, __pyx_L1_error)
@@ -37207,13 +37329,13 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *                 **_attributes):
  *     u"""DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)
  */
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1869, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1869, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pytype_2, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1869, __pyx_L1_error)
   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_xsi_3, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1869, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_41DataElement, 0, __pyx_n_s_DataElement, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1869, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_41DataElement, 0, __pyx_n_s_DataElement, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1869, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__101);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__102);
   __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_4);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_DataElement, __pyx_t_1) < 0) __PYX_ERR(0, 1869, __pyx_L1_error)
@@ -37240,7 +37362,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"hasattr(self, root)"
  *         try:
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_10ObjectPath_9hasattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectPath_hasattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 57, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_10ObjectPath_9hasattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectPath_hasattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 57, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectPath->tp_dict, __pyx_n_s_hasattr, __pyx_t_1) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -37253,7 +37375,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"""setattr(self, root, value)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_10ObjectPath_11setattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectPath_setattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_10ObjectPath_11setattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectPath_setattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectPath->tp_dict, __pyx_n_s_setattr, __pyx_t_1) < 0) __PYX_ERR(1, 65, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -37266,7 +37388,7 @@ PyMODINIT_FUNC PyInit_objectify(void)
  *         u"""addattr(self, root, value)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_10ObjectPath_13addattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectPath_addattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4lxml_9objectify_10ObjectPath_13addattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectPath_addattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectPath->tp_dict, __pyx_n_s_addattr, __pyx_t_1) < 0) __PYX_ERR(1, 74, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -37353,17 +37475,17 @@ PyMODINIT_FUNC PyInit_objectify(void)
  * 
  * 
  */
-  __Pyx_INCREF(__pyx_tuple__108);
+  __Pyx_INCREF(__pyx_tuple__109);
   __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT, __pyx_tuple__108);
-  __Pyx_GIVEREF(__pyx_tuple__108);
+  __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT, __pyx_tuple__109);
+  __Pyx_GIVEREF(__pyx_tuple__109);
 
   /* "lxml/objectify.pyx":1
  * # cython: binding=True             # <<<<<<<<<<<<<<
  * # cython: auto_pickle=False
  * 
  */
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -37388,10 +37510,12 @@ PyMODINIT_FUNC PyInit_objectify(void)
   }
   __pyx_L0:;
   __Pyx_RefNannyFinishContext();
-  #if PY_MAJOR_VERSION < 3
-  return;
-  #else
+  #if CYTHON_PEP489_MULTI_PHASE_INIT
+  return (__pyx_m != NULL) ? 0 : -1;
+  #elif PY_MAJOR_VERSION >= 3
   return __pyx_m;
+  #else
+  return;
   #endif
 }
 
@@ -37407,96 +37531,97 @@ static void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_tuple__14);
   Py_CLEAR(__pyx_tuple__15);
   Py_CLEAR(__pyx_tuple__16);
-  Py_CLEAR(__pyx_tuple__19);
+  Py_CLEAR(__pyx_tuple__18);
   Py_CLEAR(__pyx_tuple__20);
-  Py_CLEAR(__pyx_codeobj__21);
-  Py_CLEAR(__pyx_tuple__22);
+  Py_CLEAR(__pyx_tuple__21);
+  Py_CLEAR(__pyx_codeobj__22);
   Py_CLEAR(__pyx_tuple__23);
-  Py_CLEAR(__pyx_codeobj__24);
-  Py_CLEAR(__pyx_tuple__25);
-  Py_CLEAR(__pyx_codeobj__26);
-  Py_CLEAR(__pyx_tuple__27);
-  Py_CLEAR(__pyx_codeobj__28);
-  Py_CLEAR(__pyx_tuple__29);
-  Py_CLEAR(__pyx_codeobj__30);
-  Py_CLEAR(__pyx_tuple__31);
-  Py_CLEAR(__pyx_codeobj__32);
-  Py_CLEAR(__pyx_tuple__33);
-  Py_CLEAR(__pyx_codeobj__34);
-  Py_CLEAR(__pyx_tuple__35);
-  Py_CLEAR(__pyx_codeobj__36);
-  Py_CLEAR(__pyx_tuple__37);
-  Py_CLEAR(__pyx_codeobj__38);
-  Py_CLEAR(__pyx_tuple__39);
-  Py_CLEAR(__pyx_codeobj__40);
-  Py_CLEAR(__pyx_tuple__41);
-  Py_CLEAR(__pyx_codeobj__42);
-  Py_CLEAR(__pyx_tuple__43);
-  Py_CLEAR(__pyx_codeobj__44);
-  Py_CLEAR(__pyx_tuple__45);
-  Py_CLEAR(__pyx_codeobj__46);
-  Py_CLEAR(__pyx_tuple__47);
-  Py_CLEAR(__pyx_codeobj__48);
-  Py_CLEAR(__pyx_tuple__49);
-  Py_CLEAR(__pyx_codeobj__50);
-  Py_CLEAR(__pyx_tuple__51);
-  Py_CLEAR(__pyx_codeobj__52);
-  Py_CLEAR(__pyx_tuple__53);
-  Py_CLEAR(__pyx_codeobj__54);
-  Py_CLEAR(__pyx_tuple__55);
-  Py_CLEAR(__pyx_codeobj__56);
-  Py_CLEAR(__pyx_tuple__57);
-  Py_CLEAR(__pyx_codeobj__58);
-  Py_CLEAR(__pyx_tuple__59);
-  Py_CLEAR(__pyx_codeobj__60);
-  Py_CLEAR(__pyx_tuple__61);
-  Py_CLEAR(__pyx_codeobj__62);
-  Py_CLEAR(__pyx_tuple__63);
-  Py_CLEAR(__pyx_codeobj__64);
-  Py_CLEAR(__pyx_tuple__65);
-  Py_CLEAR(__pyx_codeobj__66);
-  Py_CLEAR(__pyx_tuple__67);
+  Py_CLEAR(__pyx_tuple__24);
+  Py_CLEAR(__pyx_codeobj__25);
+  Py_CLEAR(__pyx_tuple__26);
+  Py_CLEAR(__pyx_codeobj__27);
+  Py_CLEAR(__pyx_tuple__28);
+  Py_CLEAR(__pyx_codeobj__29);
+  Py_CLEAR(__pyx_tuple__30);
+  Py_CLEAR(__pyx_codeobj__31);
+  Py_CLEAR(__pyx_tuple__32);
+  Py_CLEAR(__pyx_codeobj__33);
+  Py_CLEAR(__pyx_tuple__34);
+  Py_CLEAR(__pyx_codeobj__35);
+  Py_CLEAR(__pyx_tuple__36);
+  Py_CLEAR(__pyx_codeobj__37);
+  Py_CLEAR(__pyx_tuple__38);
+  Py_CLEAR(__pyx_codeobj__39);
+  Py_CLEAR(__pyx_tuple__40);
+  Py_CLEAR(__pyx_codeobj__41);
+  Py_CLEAR(__pyx_tuple__42);
+  Py_CLEAR(__pyx_codeobj__43);
+  Py_CLEAR(__pyx_tuple__44);
+  Py_CLEAR(__pyx_codeobj__45);
+  Py_CLEAR(__pyx_tuple__46);
+  Py_CLEAR(__pyx_codeobj__47);
+  Py_CLEAR(__pyx_tuple__48);
+  Py_CLEAR(__pyx_codeobj__49);
+  Py_CLEAR(__pyx_tuple__50);
+  Py_CLEAR(__pyx_codeobj__51);
+  Py_CLEAR(__pyx_tuple__52);
+  Py_CLEAR(__pyx_codeobj__53);
+  Py_CLEAR(__pyx_tuple__54);
+  Py_CLEAR(__pyx_codeobj__55);
+  Py_CLEAR(__pyx_tuple__56);
+  Py_CLEAR(__pyx_codeobj__57);
+  Py_CLEAR(__pyx_tuple__58);
+  Py_CLEAR(__pyx_codeobj__59);
+  Py_CLEAR(__pyx_tuple__60);
+  Py_CLEAR(__pyx_codeobj__61);
+  Py_CLEAR(__pyx_tuple__62);
+  Py_CLEAR(__pyx_codeobj__63);
+  Py_CLEAR(__pyx_tuple__64);
+  Py_CLEAR(__pyx_codeobj__65);
+  Py_CLEAR(__pyx_tuple__66);
+  Py_CLEAR(__pyx_codeobj__67);
   Py_CLEAR(__pyx_tuple__68);
-  Py_CLEAR(__pyx_codeobj__69);
-  Py_CLEAR(__pyx_tuple__70);
-  Py_CLEAR(__pyx_codeobj__71);
-  Py_CLEAR(__pyx_tuple__72);
-  Py_CLEAR(__pyx_codeobj__73);
-  Py_CLEAR(__pyx_tuple__74);
-  Py_CLEAR(__pyx_codeobj__75);
-  Py_CLEAR(__pyx_tuple__76);
-  Py_CLEAR(__pyx_codeobj__77);
-  Py_CLEAR(__pyx_tuple__78);
-  Py_CLEAR(__pyx_codeobj__79);
-  Py_CLEAR(__pyx_tuple__80);
-  Py_CLEAR(__pyx_codeobj__81);
-  Py_CLEAR(__pyx_tuple__82);
-  Py_CLEAR(__pyx_codeobj__83);
-  Py_CLEAR(__pyx_tuple__84);
+  Py_CLEAR(__pyx_tuple__69);
+  Py_CLEAR(__pyx_codeobj__70);
+  Py_CLEAR(__pyx_tuple__71);
+  Py_CLEAR(__pyx_codeobj__72);
+  Py_CLEAR(__pyx_tuple__73);
+  Py_CLEAR(__pyx_codeobj__74);
+  Py_CLEAR(__pyx_tuple__75);
+  Py_CLEAR(__pyx_codeobj__76);
+  Py_CLEAR(__pyx_tuple__77);
+  Py_CLEAR(__pyx_codeobj__78);
+  Py_CLEAR(__pyx_tuple__79);
+  Py_CLEAR(__pyx_codeobj__80);
+  Py_CLEAR(__pyx_tuple__81);
+  Py_CLEAR(__pyx_codeobj__82);
+  Py_CLEAR(__pyx_tuple__83);
+  Py_CLEAR(__pyx_codeobj__84);
   Py_CLEAR(__pyx_tuple__85);
-  Py_CLEAR(__pyx_codeobj__86);
-  Py_CLEAR(__pyx_tuple__87);
-  Py_CLEAR(__pyx_codeobj__88);
-  Py_CLEAR(__pyx_tuple__89);
+  Py_CLEAR(__pyx_tuple__86);
+  Py_CLEAR(__pyx_codeobj__87);
+  Py_CLEAR(__pyx_tuple__88);
+  Py_CLEAR(__pyx_codeobj__89);
   Py_CLEAR(__pyx_tuple__90);
-  Py_CLEAR(__pyx_codeobj__91);
-  Py_CLEAR(__pyx_tuple__92);
+  Py_CLEAR(__pyx_tuple__91);
+  Py_CLEAR(__pyx_codeobj__92);
   Py_CLEAR(__pyx_tuple__93);
-  Py_CLEAR(__pyx_codeobj__94);
-  Py_CLEAR(__pyx_tuple__95);
+  Py_CLEAR(__pyx_tuple__94);
+  Py_CLEAR(__pyx_codeobj__95);
   Py_CLEAR(__pyx_tuple__96);
-  Py_CLEAR(__pyx_codeobj__97);
-  Py_CLEAR(__pyx_tuple__98);
+  Py_CLEAR(__pyx_tuple__97);
+  Py_CLEAR(__pyx_codeobj__98);
   Py_CLEAR(__pyx_tuple__99);
-  Py_CLEAR(__pyx_codeobj__100);
-  Py_CLEAR(__pyx_tuple__101);
+  Py_CLEAR(__pyx_tuple__100);
+  Py_CLEAR(__pyx_codeobj__101);
   Py_CLEAR(__pyx_tuple__102);
-  Py_CLEAR(__pyx_codeobj__103);
-  Py_CLEAR(__pyx_tuple__104);
-  Py_CLEAR(__pyx_codeobj__105);
-  Py_CLEAR(__pyx_tuple__106);
-  Py_CLEAR(__pyx_codeobj__107);
-  Py_CLEAR(__pyx_tuple__108);
+  Py_CLEAR(__pyx_tuple__103);
+  Py_CLEAR(__pyx_codeobj__104);
+  Py_CLEAR(__pyx_tuple__105);
+  Py_CLEAR(__pyx_codeobj__106);
+  Py_CLEAR(__pyx_tuple__107);
+  Py_CLEAR(__pyx_codeobj__108);
+  Py_CLEAR(__pyx_tuple__109);
   /* CodeObjectCache.cleanup */
   if (__pyx_code_cache.entries) {
       __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
@@ -37841,7 +37966,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, P
 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                                PyObject *globals) {
     PyFrameObject *f;
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject **fastlocals;
     Py_ssize_t i;
     PyObject *result;
@@ -38024,7 +38149,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
     }
 #endif
 #ifdef __Pyx_CyFunction_USED
-    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
+    if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
 #else
     if (likely(PyCFunction_Check(func))) {
 #endif
@@ -38060,7 +38185,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
         PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
-    if (likely(PyObject_TypeCheck(obj, type)))
+    if (likely(__Pyx_TypeCheck(obj, type)))
         return 1;
     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                  Py_TYPE(obj)->tp_name, type->tp_name);
@@ -38353,11 +38478,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             "raise: exception class must be a subclass of BaseException");
         goto bad;
     }
-#if PY_VERSION_HEX >= 0x03030000
     if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
         PyObject *fixed_cause;
         if (cause == Py_None) {
             fixed_cause = NULL;
@@ -38385,7 +38506,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         PyErr_Restore(tmp_type, tmp_value, tb);
         Py_XDECREF(tmp_tb);
 #else
-        PyThreadState *tstate = PyThreadState_GET();
+        PyThreadState *tstate = __Pyx_PyThreadState_Current;
         PyObject* tmp_tb = tstate->curexc_traceback;
         if (tb != tmp_tb) {
             Py_INCREF(tb);
@@ -38401,7 +38522,7 @@ bad:
 #endif
 
 /* SliceObject */
-      static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
+    static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
         Py_ssize_t cstart, Py_ssize_t cstop,
         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
@@ -38499,7 +38620,7 @@ bad:
 }
 
 /* dict_getitem_default */
-      static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
+    static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
     PyObject* value;
 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
     value = PyDict_GetItemWithError(d, key);
@@ -38527,7 +38648,7 @@ bad:
 }
 
 /* GetItemInt */
-      static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+    static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
     PyObject *r;
     if (!j) return NULL;
     r = PyObject_GetItem(o, j);
@@ -38614,7 +38735,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
 }
 
 /* PyIntBinop */
-      #if !CYTHON_COMPILING_IN_PYPY
+    #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_CheckExact(op1))) {
@@ -38730,7 +38851,7 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_U
 #endif
 
 /* SaveResetException */
-      #if CYTHON_FAST_THREAD_STATE
+    #if CYTHON_FAST_THREAD_STATE
 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
     *type = tstate->exc_type;
     *value = tstate->exc_value;
@@ -38754,18 +38875,33 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject
 #endif
 
 /* PyErrExceptionMatches */
-      #if CYTHON_FAST_THREAD_STATE
+    #if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+    Py_ssize_t i, n;
+    n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+    for (i=0; i<n; i++) {
+        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+    }
+#endif
+    for (i=0; i<n; i++) {
+        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
+    }
+    return 0;
+}
 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
     PyObject *exc_type = tstate->curexc_type;
     if (exc_type == err) return 1;
     if (unlikely(!exc_type)) return 0;
-    return PyErr_GivenExceptionMatches(exc_type, err);
+    if (unlikely(PyTuple_Check(err)))
+        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
 }
 #endif
 
 /* GetAttr */
-      static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
-#if CYTHON_COMPILING_IN_CPYTHON
+    static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_USE_TYPE_SLOTS
 #if PY_MAJOR_VERSION >= 3
     if (likely(PyUnicode_Check(n)))
 #else
@@ -38777,27 +38913,27 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta
 }
 
 /* GetAttr3 */
-      static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
+    static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
+        return NULL;
+    __Pyx_PyErr_Clear();
+    Py_INCREF(d);
+    return d;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
     PyObject *r = __Pyx_GetAttr(o, n);
-    if (unlikely(!r)) {
-        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
-            goto bad;
-        PyErr_Clear();
-        r = d;
-        Py_INCREF(d);
-    }
-    return r;
-bad:
-    return NULL;
+    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
 }
 
 /* IterFinish */
-      static CYTHON_INLINE int __Pyx_IterFinish(void) {
+    static CYTHON_INLINE int __Pyx_IterFinish(void) {
 #if CYTHON_FAST_THREAD_STATE
-    PyThreadState *tstate = PyThreadState_GET();
+    PyThreadState *tstate = __Pyx_PyThreadState_Current;
     PyObject* exc_type = tstate->curexc_type;
     if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
+        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
             PyObject *exc_value, *exc_tb;
             exc_value = tstate->curexc_value;
             exc_tb = tstate->curexc_traceback;
@@ -38827,7 +38963,7 @@ bad:
 }
 
 /* UnpackItemEndCheck */
-      static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+    static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
     if (unlikely(retval)) {
         Py_DECREF(retval);
         __Pyx_RaiseTooManyValuesError(expected);
@@ -38839,7 +38975,7 @@ bad:
 }
 
 /* PyIntBinop */
-      #if !CYTHON_COMPILING_IN_PYPY
+    #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     #if PY_MAJOR_VERSION < 3
     if (likely(PyInt_CheckExact(op1))) {
@@ -38955,7 +39091,7 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
 #endif
 
 /* PyIntBinop */
-      #if !CYTHON_COMPILING_IN_PYPY
+    #if !CYTHON_COMPILING_IN_PYPY
 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
     if (op1 == op2) {
         Py_RETURN_TRUE;
@@ -39040,7 +39176,7 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
 #endif
 
 /* UnpackUnboundCMethod */
-      static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
+    static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
     PyObject *method;
     method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
     if (unlikely(!method))
@@ -39048,7 +39184,7 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
     target->method = method;
 #if CYTHON_COMPILING_IN_CPYTHON
     #if PY_MAJOR_VERSION >= 3
-    if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
+    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
     #endif
     {
         PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
@@ -39060,7 +39196,7 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
 }
 
 /* CallUnboundCMethod0 */
-      static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
+    static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
     PyObject *args, *result = NULL;
     if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
 #if CYTHON_ASSUME_SAFE_MACROS
@@ -39079,7 +39215,7 @@ bad:
 }
 
 /* py_dict_items */
-      static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
+    static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
     if (PY_MAJOR_VERSION >= 3)
         return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
     else
@@ -39087,7 +39223,7 @@ bad:
 }
 
 /* py_dict_values */
-      static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
+    static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
     if (PY_MAJOR_VERSION >= 3)
         return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
     else
@@ -39095,7 +39231,7 @@ bad:
 }
 
 /* KeywordStringCheck */
-      static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
+    static int __Pyx_CheckKeywordStrings(
     PyObject *kwdict,
     const char* function_name,
     int kw_allowed)
@@ -39109,7 +39245,7 @@ bad:
 #else
     while (PyDict_Next(kwdict, &pos, &key, 0)) {
         #if PY_MAJOR_VERSION < 3
-        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
+        if (unlikely(!PyString_Check(key)))
         #endif
             if (unlikely(!PyUnicode_Check(key)))
                 goto invalid_keyword_type;
@@ -39135,34 +39271,28 @@ invalid_keyword:
 }
 
 /* ArgTypeTest */
-      static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
-}
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact)
+    static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
 {
     if (unlikely(!type)) {
         PyErr_SetString(PyExc_SystemError, "Missing type object");
         return 0;
     }
-    if (none_allowed && obj == Py_None) return 1;
     else if (exact) {
-        if (likely(Py_TYPE(obj) == type)) return 1;
         #if PY_MAJOR_VERSION == 2
-        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
         #endif
     }
     else {
-        if (likely(PyObject_TypeCheck(obj, type))) return 1;
+        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
     }
-    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
+    PyErr_Format(PyExc_TypeError,
+        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+        name, type->tp_name, Py_TYPE(obj)->tp_name);
     return 0;
 }
 
 /* SliceObject */
-      static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
+    static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
         Py_ssize_t cstart, Py_ssize_t cstop,
         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
@@ -39259,13 +39389,13 @@ bad:
 }
 
 /* Import */
-      static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
     PyObject *empty_list = 0;
     PyObject *module = 0;
     PyObject *global_dict = 0;
     PyObject *empty_dict = 0;
     PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     PyObject *py_import;
     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
     if (!py_import)
@@ -39289,17 +39419,8 @@ bad:
         #if PY_MAJOR_VERSION >= 3
         if (level == -1) {
             if (strchr(__Pyx_MODULE_NAME, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                PyObject *py_level = PyInt_FromLong(1);
-                if (!py_level)
-                    goto bad;
-                module = PyObject_CallFunctionObjArgs(py_import,
-                    name, global_dict, empty_dict, list, py_level, NULL);
-                Py_DECREF(py_level);
-                #else
                 module = PyImport_ImportModuleLevelObject(
                     name, global_dict, empty_dict, list, 1);
-                #endif
                 if (!module) {
                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
                         goto bad;
@@ -39310,7 +39431,7 @@ bad:
         }
         #endif
         if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
+            #if PY_MAJOR_VERSION < 3
             PyObject *py_level = PyInt_FromLong(level);
             if (!py_level)
                 goto bad;
@@ -39324,7 +39445,7 @@ bad:
         }
     }
 bad:
-    #if PY_VERSION_HEX < 0x03030000
+    #if PY_MAJOR_VERSION < 3
     Py_XDECREF(py_import);
     #endif
     Py_XDECREF(empty_list);
@@ -39333,7 +39454,7 @@ bad:
 }
 
 /* GetException */
-      #if CYTHON_FAST_THREAD_STATE
+    #if CYTHON_FAST_THREAD_STATE
 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
 #else
 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
@@ -39394,7 +39515,7 @@ bad:
 }
 
 /* DelItemInt */
-        static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
+      static int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
     int r;
     if (!j) return -1;
     r = PyObject_DelItem(o, j);
@@ -39427,7 +39548,7 @@ static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
 }
 
 /* CallNextTpDealloc */
-        static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
+      static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
     PyTypeObject* type = Py_TYPE(obj);
     while (type && type->tp_dealloc != current_tp_dealloc)
         type = type->tp_base;
@@ -39438,7 +39559,7 @@ static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
 }
 
 /* CallNextTpTraverse */
-        static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
+      static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
     PyTypeObject* type = Py_TYPE(obj);
     while (type && type->tp_traverse != current_tp_traverse)
         type = type->tp_base;
@@ -39450,7 +39571,7 @@ static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
 }
 
 /* CallNextTpClear */
-        static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
+      static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
     PyTypeObject* type = Py_TYPE(obj);
     while (type && type->tp_clear != current_tp_clear)
         type = type->tp_base;
@@ -39461,7 +39582,7 @@ static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
 }
 
 /* SetVTable */
-        static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+      static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
 #if PY_VERSION_HEX >= 0x02070000
     PyObject *ob = PyCapsule_New(vtable, 0, 0);
 #else
@@ -39479,7 +39600,7 @@ bad:
 }
 
 /* ImportFrom */
-        static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+      static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
         PyErr_Format(PyExc_ImportError,
@@ -39493,7 +39614,7 @@ bad:
 }
 
 /* FetchCommonType */
-        static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+      static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
     PyObject* fake_module;
     PyTypeObject* cached_type = NULL;
     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
@@ -39532,7 +39653,7 @@ bad:
 }
 
 /* CythonFunction */
-        static PyObject *
+      static PyObject *
 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
 {
     if (unlikely(op->func_doc == NULL)) {
@@ -39892,14 +40013,18 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
     }
     return 0;
 }
-static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
 {
-    PyObject_GC_UnTrack(m);
     if (__Pyx_CyFunction_weakreflist(m) != NULL)
         PyObject_ClearWeakRefs((PyObject *) m);
     __Pyx_CyFunction_clear(m);
     PyObject_GC_Del(m);
 }
+static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
+{
+    PyObject_GC_UnTrack(m);
+    __Pyx__CyFunction_dealloc(m);
+}
 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
 {
     Py_VISIT(m->func_closure);
@@ -39974,10 +40099,16 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py
         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
             size = PyTuple_GET_SIZE(arg);
             if (likely(size == 1)) {
-                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
-                if (unlikely(!arg0)) return NULL;
+                PyObject *result, *arg0;
+                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+                arg0 = PyTuple_GET_ITEM(arg, 0);
+                #else
+                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
+                #endif
                 result = (*meth)(self, arg0);
+                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                 Py_DECREF(arg0);
+                #endif
                 return result;
             }
             PyErr_Format(PyExc_TypeError,
@@ -40084,7 +40215,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
 };
 static int __pyx_CyFunction_init(void) {
     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
-    if (__pyx_CyFunctionType == NULL) {
+    if (unlikely(__pyx_CyFunctionType == NULL)) {
         return -1;
     }
     return 0;
@@ -40092,7 +40223,7 @@ static int __pyx_CyFunction_init(void) {
 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
     m->defaults = PyObject_Malloc(size);
-    if (!m->defaults)
+    if (unlikely(!m->defaults))
         return PyErr_NoMemory();
     memset(m->defaults, 0, size);
     m->defaults_pyobjects = pyobjects;
@@ -40115,7 +40246,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
 }
 
 /* ModuleImport */
-            #ifndef __PYX_HAVE_RT_ImportModule
+          #ifndef __PYX_HAVE_RT_ImportModule
 #define __PYX_HAVE_RT_ImportModule
 static PyObject *__Pyx_ImportModule(const char *name) {
     PyObject *py_name = 0;
@@ -40133,7 +40264,7 @@ bad:
 #endif
 
 /* RegisterModuleCleanup */
-            #if PY_MAJOR_VERSION < 3
+          #if PY_MAJOR_VERSION < 3
 static PyObject* __pyx_module_cleanup_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) {
     __pyx_module_cleanup(module);
     Py_INCREF(Py_None); return Py_None;
@@ -40200,7 +40331,7 @@ static int __Pyx_RegisterCleanup(void) {
 #endif
 
 /* CLineInTraceback */
-            static int __Pyx_CLineForTraceback(int c_line) {
+          static int __Pyx_CLineForTraceback(int c_line) {
 #ifdef CYTHON_CLINE_IN_TRACEBACK
     return ((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0;
 #else
@@ -40236,7 +40367,7 @@ static int __Pyx_RegisterCleanup(void) {
 }
 
 /* CodeObjectCache */
-            static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+          static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
     int start = 0, mid = 0, end = count - 1;
     if (end >= 0 && code_line > entries[end].code_line) {
         return count;
@@ -40316,7 +40447,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
 }
 
 /* AddTraceback */
-            #include "compile.h"
+          #include "compile.h"
 #include "frameobject.h"
 #include "traceback.h"
 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -40386,10 +40517,10 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
     }
     py_frame = PyFrame_New(
-        PyThreadState_GET(), /*PyThreadState *tstate,*/
-        py_code,             /*PyCodeObject *code,*/
-        __pyx_d,      /*PyObject *globals,*/
-        0                    /*PyObject *locals*/
+        __Pyx_PyThreadState_Current, /*PyThreadState *tstate,*/
+        py_code,                     /*PyCodeObject *code,*/
+        __pyx_d,              /*PyObject *globals,*/
+        0                            /*PyObject *locals*/
     );
     if (!py_frame) goto bad;
     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
@@ -40400,7 +40531,7 @@ bad:
 }
 
 /* CIntFromPyVerify */
-            #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+          #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
@@ -40422,7 +40553,7 @@ bad:
     }
 
 /* CIntToPy */
-            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -40453,7 +40584,7 @@ bad:
 }
 
 /* CIntToPy */
-            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
     const int neg_one = (int) -1, const_zero = (int) 0;
     const int is_unsigned = neg_one > const_zero;
     if (is_unsigned) {
@@ -40484,7 +40615,7 @@ bad:
 }
 
 /* CIntFromPy */
-            static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+          static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
     const int neg_one = (int) -1, const_zero = (int) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -40673,7 +40804,7 @@ raise_neg_overflow:
 }
 
 /* CIntFromPy */
-            static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+          static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
     const long neg_one = (long) -1, const_zero = (long) 0;
     const int is_unsigned = neg_one > const_zero;
 #if PY_MAJOR_VERSION < 3
@@ -40861,8 +40992,80 @@ raise_neg_overflow:
     return (long) -1;
 }
 
+/* FastTypeChecks */
+          #if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+    while (a) {
+        a = a->tp_base;
+        if (a == b)
+            return 1;
+    }
+    return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+    PyObject *mro;
+    if (a == b) return 1;
+    mro = a->tp_mro;
+    if (likely(mro)) {
+        Py_ssize_t i, n;
+        n = PyTuple_GET_SIZE(mro);
+        for (i = 0; i < n; i++) {
+            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+                return 1;
+        }
+        return 0;
+    }
+    return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+    PyObject *exception, *value, *tb;
+    int res;
+    __Pyx_PyThreadState_declare
+    __Pyx_PyThreadState_assign
+    __Pyx_ErrFetch(&exception, &value, &tb);
+    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+    if (unlikely(res == -1)) {
+        PyErr_WriteUnraisable(err);
+        res = 0;
+    }
+    if (!res) {
+        res = PyObject_IsSubclass(err, exc_type2);
+        if (unlikely(res == -1)) {
+            PyErr_WriteUnraisable(err);
+            res = 0;
+        }
+    }
+    __Pyx_ErrRestore(exception, value, tb);
+    return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+    if (!res) {
+        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+    }
+    return res;
+}
+#endif
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+    if (likely(err == exc_type)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+    }
+    return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+    if (likely(err == exc_type1 || err == exc_type2)) return 1;
+    if (likely(PyExceptionClass_Check(err))) {
+        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+    }
+    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
 /* CheckBinaryVersion */
-            static int __Pyx_check_binary_version(void) {
+          static int __Pyx_check_binary_version(void) {
     char ctversion[4], rtversion[4];
     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -40878,7 +41081,7 @@ raise_neg_overflow:
 }
 
 /* TypeImport */
-            #ifndef __PYX_HAVE_RT_ImportType
+          #ifndef __PYX_HAVE_RT_ImportType
 #define __PYX_HAVE_RT_ImportType
 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
     size_t size, int strict)
@@ -40943,7 +41146,7 @@ bad:
 #endif
 
 /* InitStrings */
-            static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+          static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     while (t->p) {
         #if PY_MAJOR_VERSION < 3
         if (t->is_unicode) {
@@ -40982,46 +41185,53 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
     Py_ssize_t ignore;
     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
 }
-static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    char* defenc_c;
+    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+    if (!defenc) return NULL;
+    defenc_c = PyBytes_AS_STRING(defenc);
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
+    {
+        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+        char* c;
+        for (c = defenc_c; c < end; c++) {
+            if ((unsigned char) (*c) >= 128) {
+                PyUnicode_AsASCIIString(o);
+                return NULL;
             }
         }
+    }
 #endif
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
+    *length = PyBytes_GET_SIZE(defenc);
+    return defenc_c;
+}
 #else
-        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_LENGTH(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
+    if (likely(PyUnicode_IS_ASCII(o))) {
+        *length = PyUnicode_GET_LENGTH(o);
+        return PyUnicode_AsUTF8(o);
+    } else {
+        PyUnicode_AsASCIIString(o);
+        return NULL;
+    }
 #else
-        return PyUnicode_AsUTF8AndSize(o, length);
+    return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+}
+#endif
 #endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+    if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+            __Pyx_sys_getdefaultencoding_not_ascii &&
 #endif
+            PyUnicode_Check(o)) {
+        return __Pyx_PyUnicode_AsStringAndSize(o, length);
     } else
 #endif
 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
@@ -41045,6 +41255,26 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
    else return PyObject_IsTrue(x);
 }
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+    if (PyLong_Check(result)) {
+        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+                "__int__ returned non-int (type %.200s).  "
+                "The ability to return an instance of a strict subclass of int "
+                "is deprecated, and may be removed in a future version of Python.",
+                Py_TYPE(result)->tp_name)) {
+            Py_DECREF(result);
+            return NULL;
+        }
+        return result;
+    }
+#endif
+    PyErr_Format(PyExc_TypeError,
+                 "__%.4s__ returned non-%.4s (type %.200s)",
+                 type_name, type_name, Py_TYPE(result)->tp_name);
+    Py_DECREF(result);
+    return NULL;
+}
 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
 #if CYTHON_USE_TYPE_SLOTS
   PyNumberMethods *m;
@@ -41052,9 +41282,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   const char *name = NULL;
   PyObject *res = NULL;
 #if PY_MAJOR_VERSION < 3
-  if (PyInt_Check(x) || PyLong_Check(x))
+  if (likely(PyInt_Check(x) || PyLong_Check(x)))
 #else
-  if (PyLong_Check(x))
+  if (likely(PyLong_Check(x)))
 #endif
     return __Pyx_NewRef(x);
 #if CYTHON_USE_TYPE_SLOTS
@@ -41062,32 +41292,30 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
   #if PY_MAJOR_VERSION < 3
   if (m && m->nb_int) {
     name = "int";
-    res = PyNumber_Int(x);
+    res = m->nb_int(x);
   }
   else if (m && m->nb_long) {
     name = "long";
-    res = PyNumber_Long(x);
+    res = m->nb_long(x);
   }
   #else
-  if (m && m->nb_int) {
+  if (likely(m && m->nb_int)) {
     name = "int";
-    res = PyNumber_Long(x);
+    res = m->nb_int(x);
   }
   #endif
 #else
-  res = PyNumber_Int(x);
+  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+    res = PyNumber_Int(x);
+  }
 #endif
-  if (res) {
+  if (likely(res)) {
 #if PY_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
+    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
 #else
-    if (!PyLong_Check(res)) {
+    if (unlikely(!PyLong_CheckExact(res))) {
 #endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (type %.200s)",
-                   name, name, Py_TYPE(res)->tp_name);
-      Py_DECREF(res);
-      return NULL;
+        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
     }
   }
   else if (!PyErr_Occurred()) {
index dcdfc871d57c8426bcc3579a30812e2fed93581f..4f955ef95bd1052e048caf28b0690773e1c12433 100644 (file)
@@ -7,9 +7,22 @@ Tests for the ElementPath implementation.
 from __future__ import absolute_import
 
 import unittest
+from copy import deepcopy
 from .common_imports import etree, HelperTestCase
 
 
+def summarize(elem):
+    return elem.tag
+
+def summarize_list(seq):
+    return list(map(summarize, seq))
+
+def normalize_crlf(tree):
+    for elem in tree.getiterator():
+        if elem.text: elem.text = elem.text.replace("\r\n", "\n")
+        if elem.tail: elem.tail = elem.tail.replace("\r\n", "\n")
+
+
 class EtreeElementPathTestCase(HelperTestCase):
     etree = etree
     from lxml import _elementpath
@@ -30,10 +43,11 @@ class EtreeElementPathTestCase(HelperTestCase):
         self.assertTrue(el.findall('b/c'))
         self.assertEqual(2, len(self._elementpath._cache))
 
-    def test_tokenizer(self):
-        def assert_tokens(tokens, path, namespaces=None):
-            self.assertEqual(tokens, list(self._elementpath.xpath_tokenizer(path, namespaces)))
+    def _assert_tokens(self, tokens, path, namespaces=None):
+        self.assertEqual(tokens, list(self._elementpath.xpath_tokenizer(path, namespaces)))
 
+    def test_tokenizer(self):
+        assert_tokens = self._assert_tokens
         assert_tokens(
             [('/', '')],
             '/',
@@ -57,6 +71,161 @@ class EtreeElementPathTestCase(HelperTestCase):
             {'x': 'nsx', 'y': 'nsy', None: 'nsnone'},
         )
 
+    def test_tokenizer_predicates(self):
+        assert_tokens = self._assert_tokens
+        assert_tokens(
+            [('', 'a'), ('[', ''), ('', 'b'), (']', '')],
+            'a[b]',
+        )
+        assert_tokens(
+            [('', 'a'), ('[', ''), ('', 'b'), ('=', ''), ('"abc"', ''), (']', '')],
+            'a[b="abc"]',
+        )
+        assert_tokens(
+            [('', 'a'), ('[', ''), ('.', ''), ('', ''), ('=', ''), ('', ''), ('"abc"', ''), (']', '')],
+            'a[. = "abc"]',
+        )
+
+    def test_find(self):
+        """
+        Test find methods (including xpath syntax).
+        Originally copied from 'selftest.py'.
+        """
+        elem = etree.XML("""
+        <body>
+          <tag class='a'>text</tag>
+          <tag class='b' />
+          <section>
+            <tag class='b' id='inner'>subtext</tag>
+          </section>
+        </body>
+        """)
+
+        self.assertEqual(elem.find("tag").tag,
+                         'tag')
+        self.assertEqual(etree.ElementTree(elem).find("tag").tag,
+                         'tag')
+        self.assertEqual(elem.find("section/tag").tag,
+                         'tag')
+        self.assertEqual(etree.ElementTree(elem).find("section/tag").tag,
+                         'tag')
+
+        self.assertEqual(elem.findtext("tag"),
+                         'text')
+        self.assertEqual(elem.findtext("tog"),
+                         None)
+        self.assertEqual(elem.findtext("tog", "default"),
+                         'default')
+        self.assertEqual(etree.ElementTree(elem).findtext("tag"),
+                         'text')
+        self.assertEqual(elem.findtext("section/tag"),
+                         'subtext')
+        self.assertEqual(etree.ElementTree(elem).findtext("section/tag"),
+                         'subtext')
+
+        self.assertEqual(summarize_list(elem.findall("tag")),
+                         ['tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall("*")),
+                         ['tag', 'tag', 'section'])
+        self.assertEqual(summarize_list(elem.findall(".//tag")),
+                         ['tag', 'tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall("section/tag")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall("section//tag")),
+                         ['tag'])
+
+        self.assertEqual(summarize_list(elem.findall("section/*")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall("section//*")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall("section/.//*")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall("*/*")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall("*//*")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall("*/tag")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall("*/./tag")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall("./tag")),
+                         ['tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag")),
+                         ['tag', 'tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall("././tag")),
+                         ['tag', 'tag'])
+
+        self.assertEqual(summarize_list(elem.findall(".//tag[@class]")),
+                         ['tag', 'tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[ @class]")),
+                         ['tag', 'tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[@class ]")),
+                         ['tag', 'tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[  @class  ]")),
+                         ['tag', 'tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[@class='a']")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall('.//tag[@class="a"]')),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[@class='b']")),
+                         ['tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall('.//tag[@class="b"]')),
+                         ['tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall('.//tag[@class = "b"]')),
+                         ['tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[@id]")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[@class][@id]")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall(".//section[tag]")),
+                         ['section'])
+        self.assertEqual(summarize_list(elem.findall(".//section[element]")),
+                         [])
+
+        self.assertEqual(summarize_list(elem.findall(".//section[tag='subtext']")),
+                         ['section'])
+        self.assertEqual(summarize_list(elem.findall(".//section[tag ='subtext']")),
+                         ['section'])
+        self.assertEqual(summarize_list(elem.findall(".//section[tag= 'subtext']")),
+                         ['section'])
+        self.assertEqual(summarize_list(elem.findall(".//section[tag = 'subtext']")),
+                         ['section'])
+        self.assertEqual(summarize_list(elem.findall(".//section[  tag   =   'subtext'  ]")),
+                         ['section'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[.='subtext']")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[. ='subtext']")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall('.//tag[.= "subtext"]')),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[. = 'subtext']")),
+                         ['tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[. = 'subtext ']")),
+                         [])
+        self.assertEqual(summarize_list(elem.findall(".//tag[.= ' subtext']")),
+                         [])
+
+        self.assertEqual(summarize_list(elem.findall("../tag")),
+                         [])
+        self.assertEqual(summarize_list(elem.findall("section/../tag")),
+                         ['tag', 'tag'])
+        self.assertEqual(summarize_list(etree.ElementTree(elem).findall("./tag")),
+                         ['tag', 'tag'])
+
+        # FIXME: ET's Path module handles this case incorrectly; this gives
+        # a warning in 1.3, and the behaviour will be modified in 1.4.
+        self.assertEqual(summarize_list(etree.ElementTree(elem).findall("/tag")),
+                         ['tag', 'tag'])
+
+        # duplicate section => 2x tag matches
+        elem[1] = deepcopy(elem[2])
+        self.assertEqual(summarize_list(elem.findall(".//section[tag = 'subtext']")),
+                         ['section', 'section'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[. = 'subtext']")),
+                         ['tag', 'tag'])
+        self.assertEqual(summarize_list(elem.findall(".//tag[@class][@id]")),
+                         ['tag', 'tag'])
+
 
 #class ElementTreeElementPathTestCase(EtreeElementPathTestCase):
 #    import xml.etree.ElementTree as etree
index a54d776ff55ac38a78b51aa005a6fbc516620623..cb4eb5dcf26cdd5f07b7fdc97dfd23bc5c65e6d1 100644 (file)
@@ -335,6 +335,15 @@ class PyClassLookupTestCase(HelperTestCase):
         self.assertNotEqual(None, el_class.PREV)
         self.assertEqual(root[0][1].getprevious().tag, el_class.PREV)
 
+    def test_comments_fallback(self):
+        def return_none(*args):
+            return None
+
+        self._setClassLookup(return_none)
+        el = self.XML('<a><!-- hello world --></a>')
+        self.assertEqual(el[0].tag, self.etree.Comment)
+        self.assertEqual(el[0].text, " hello world ")
+
 
 def test_suite():
     suite = unittest.TestSuite()
index 3a2e5a4df296a22873e1e52f9ff15276bc7ecddb..8bcce7bef38ab8aca7771c5eccb5550a42837cac 100755 (executable)
@@ -5,9 +5,10 @@ echo "Started $0 $@"
 
 set -e -x
 REQUIREMENTS=/io/requirements.txt
-WHEELHOUSE=/io/wheelhouse
+[ -n "$WHEELHOUSE" ] || WHEELHOUSE=wheelhouse
 SDIST=$1
 PACKAGE=$(basename ${SDIST%-*})
+SDIST_PREFIX=$(basename ${SDIST%%.tar.gz})
 
 build_wheel() {
     pybin="$1"
@@ -20,13 +21,13 @@ build_wheel() {
         ${pybin}/pip \
             wheel \
             "$source" \
-            -w $WHEELHOUSE
+            -w /io/$WHEELHOUSE
 }
 
 assert_importable() {
     # Install packages and test
     for PYBIN in /opt/python/*/bin/; do
-        ${PYBIN}/pip install $PACKAGE --no-index -f $WHEELHOUSE
+        ${PYBIN}/pip install $PACKAGE --no-index -f /io/$WHEELHOUSE
 
         (cd $HOME; ${PYBIN}/python -c 'import lxml.etree, lxml.objectify')
     done
@@ -60,14 +61,13 @@ build_wheels() {
 
 repair_wheels() {
     # Bundle external shared libraries into the wheels
-    for whl in $WHEELHOUSE/*.whl; do
-        auditwheel repair $whl -w $WHEELHOUSE
+    for whl in /io/$WHEELHOUSE/${SDIST_PREFIX}-*.whl; do
+        auditwheel repair $whl -w /io/$WHEELHOUSE
     done
 }
 
 show_wheels() {
-    filename=${SDIST##*/}
-    ls -l $WHEELHOUSE/${filename%%.tar.gz}*
+    ls -l /io/$WHEELHOUSE/${SDIST_PREFIX}-*.whl
 }
 
 prepare_system
index fcdb2e109f68cff5600955a73908885fe8599bb4..ee74734aa2258df77aa09402d55798a1e2e55212 100644 (file)
@@ -1 +1 @@
-4.0.0
+4.1.0