Title: Incorrect and missing statements in the xml.parsers.expat documentation · Issue #156821 · python/cpython · GitHub
Open Graph Title: Incorrect and missing statements in the xml.parsers.expat documentation · Issue #156821 · python/cpython
X Title: Incorrect and missing statements in the xml.parsers.expat documentation · Issue #156821 · python/cpython
Description: Several statements in the documentation of xml.parsers.expat do not match the behaviour, and a part of the API is not documented at all. Some docstrings have the same problems. Incorrect: GetInputContext() is described as returning a str...
Open Graph Description: Several statements in the documentation of xml.parsers.expat do not match the behaviour, and a part of the API is not documented at all. Some docstrings have the same problems. Incorrect: GetInputC...
X Description: Several statements in the documentation of xml.parsers.expat do not match the behaviour, and a part of the API is not documented at all. Some docstrings have the same problems. Incorrect: GetInputC...
Opengraph URL: https://github.com/python/cpython/issues/156821
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect and missing statements in the xml.parsers.expat documentation","articleBody":"Several statements in the documentation of `xml.parsers.expat` do not match the behaviour, and a part of the API is not documented at all. Some docstrings have the same problems.\n\nIncorrect:\n\n* `GetInputContext()` is described as returning a string, but it returns bytes. Its result also extends to the end of the currently buffered input, so it can contain the data of the following events.\n* `Parse()` is described as parsing \"the string *data*\", but *data* can be a bytes-like object as well as a string, and if it is a string, the encoding declaration is ignored.\n* `ParseFile()` is described as reading from a file whose `read()` returns \"the empty string when there's no more data\", but only binary files are supported (gh-60930).\n* `XML_ERROR_XML_DECL` is described as \"The document contained no document element at all\". It means \"XML declaration not well-formed\"; the given description belongs to `XML_ERROR_NO_ELEMENTS`.\n* `UnparsedEntityDeclHandler` is described as \"only present for version 1.2 of the Expat library\", but it is present and called with Expat 2.8.4.\n* The docstring of `GetSpecifiedAttributeCount()` omits that the result is only meaningful if `ordered_attributes` is true.\n\nNot documented:\n\n* the *intern* parameter of `ParserCreate()` and the `intern` attribute, which `xml.sax` uses for the string interning feature;\n* the `namespace_prefixes` attribute;\n* the `SkippedEntityHandler` handler;\n* `XML_CTYPE_MIXED` and `XML_CTYPE_NAME`, whose descriptions are empty;\n* `EXPAT_VERSION`, `version_info` and `features`, although the XML security documentation already refers to `EXPAT_VERSION`.\n\nAlso, the notes about Expat versions 1.2 and 1.95.0 are obsolete, the list of attribute types in `AttlistDeclHandler` ends with \"...\", and all content model constants are marked with `:noindex:` although they have no other description, so they cannot be referenced.\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-156822\n* gh-156852\n* gh-156853\n* gh-156854\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2026-09-02T11:17:40Z","url":"https://github.com/python/cpython/issues/156821"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f513a08a-295e-8064-aef0-6091d2ec4149 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EAC6:158DF1:163F0E8:1D5FFE2:6B01FEA3 |
| html-safe-nonce | 846bae4c0a329d4632c6132ef220f815e3fecf522edf4b3e4fb7815537517754 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUM2OjE1OERGMToxNjNGMEU4OjFENUZGRTI6NkIwMUZFQTMiLCJ2aXNpdG9yX2lkIjoiMzc2MzAwMTE3ODMxNzc4MjY5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5ae85b14dc3e1be50c0103ce0896900ffbc8f9a8464afdfbee26a0445480a230 |
| hovercard-subject-tag | issue:5323185142 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/156821/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3901a2103fced709c2d0a2f230ee885615ef0970340ce993a94dc55cc233eb41/python/cpython/issues/156821 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3901a2103fced709c2d0a2f230ee885615ef0970340ce993a94dc55cc233eb41/python/cpython/issues/156821 |
| og:image:alt | Several statements in the documentation of xml.parsers.expat do not match the behaviour, and a part of the API is not documented at all. Some docstrings have the same problems. Incorrect: GetInputC... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width