{
  "id": 22435611,
  "title": "I ran every example in a popular library's README. 11 of 25 worked.",
  "url": "https://urgent.news/2026/11/28/i-ran-every-example-in-a-popular-librarys-readme-11-of-25-worked",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-28T20:01:04.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/szabolcskeri/i-ran-every-example-in-a-popular-librarys-readme-11-of-25-worked-4dkc"
  },
  "original_language": null,
  "account": "Documentation often becomes outdated as the code it describes evolves. New users who copy example code from a library's README may encounter errors because their environment differs from what the example assumes. To assess the state of a well-maintained Python library, xmltodict, I executed every interactive example in its README. Utilizing Python's doctest module, I parsed fenced code blocks within Markdown and executed them. Of the 25 examples, 11 succeeded, while 14 failed, primarily due to missing imports of xmltodict and json modules at the top of the example.\n\nFurther investigation revealed additional issues: a namespace example with incorrect logic, an example dependent on context from a previous code block, and an example requiring external files. These examples were documented accurately, yet the codebase had diverged. My audit of the library uncovered 15 discrepancies between the documentation and the actual code. Some issues were limited to shell scripts, while others manifested in CLI pipelines producing incorrect output.\n\nThe doctest-based verification offers a quick, cheap initial screening for documentation discrepancies. However, it's not a substitute for a comprehensive review. To ensure the documentation remains accurate, I recommend pinning the library version used for verification, documenting any assumptions made during the process, and storing the verification script alongside the documentation. This allows for repeatable audits in future releases.",
  "summary": "Documentation rots quietly. Nobody gets a failing CI run when a README example stops matching the code. The first person to notice is a new user who copies the example, gets an error, and wonders what they did wrong. I wanted to know how bad it is on a mature, widely used project. So I took the README of xmltodict , a small, well-maintained Python library that has been around for over a decade,…",
  "summary_source": "publisher",
  "key_points": [
    "11 out of 25 examples in xmltodict's README worked",
    "14 examples failed due to missing module imports",
    "Audit revealed 15 discrepancies between documentation and code"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}