Skip to content

pyexpat: xmlparser is actually XMLParserType #140771

Open

Description

@serhiy-storchaka

The type of the Expat parser is referred everywhere as xmlparser, although no anchor for this reference is defined. But this type is actually exposed in the pyexpat (public API is xml.parsers.expat) module as XMLParserType since 2000 (4ba298c). The class name is xmlparser.

>>> import xml.parsers.expat
>>> xml.parsers.expat.__name__
'xml.parsers.expat'
>>> xml.parsers.expat.XMLParserType
<class 'pyexpat.xmlparser'>
>>> xml.parsers.expat.XMLParserType.__name__
'xmlparser'
>>> xml.parsers.expat.XMLParserType.__qualname__
'xmlparser'
>>> xml.parsers.expat.XMLParserType.__module__
'pyexpat'

I was planned to add an anchor for the xmlparser class, but since it is available as XMLParserType, should not we simply change its name and all references in the documentation to XMLParserType? Or add an alias xmlparser? (the question is why it was not used from the beginning.)

Linked PRs

Activity

  1. added
    docs
    extension-modules
    3.13
    3.14
    3.15
    on Oct 29, 2025
  2. Krishna-web-hub commented on Dec 8, 2025

    @Krishna-web-hub
    Contributor

    Hi @serhiy-storchaka,
    I’d like to work on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.133.143.15docsextension-modulestopic-XML

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions