python / python/cpython

pyexpat: xmlparser is actually XMLParserType

Aperta
#140,771 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

3.13 3.14 3.15 docs extension-modules topic-XML
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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 (4ba298c3253d5c4d11cf822619457701b7b248c0). 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
  • gh-144456

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo questa issue e la PR collegata gh-144456, quindi determina se la documentazione debba usare XMLParserType o xmlparser. L’attività è completata quando il nome pubblico scelto ha un’ancora definita e i riferimenti nella documentazione sono coerenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.