{
  "id": 9385271,
  "title": "Unmasking Python's Triple Quotes: Why My 'Comments' Weren't Documenting Anything!",
  "url": "https://urgent.news/2026/09/23/unmasking-pythons-triple-quotes-why-my-comments-werent-documenting",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-23T18:06:50.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/_rakesh_ranjan/unmasking-pythons-triple-quotes-why-my-comments-werent-documenting-anything-1fd"
  },
  "original_language": "en",
  "account": "Python's triple quotes can be confusing for newcomers, as they serve a specific purpose beyond simple comments. Initially, the author thought they were multi-line comments, similar to the # symbol, but discovered they are actually called docstrings. Docstrings are used to provide formal documentation for code components like functions, classes, or modules. They explain what these components do, their arguments, return values, and any exceptions they might raise. Unlike # comments, which are purely for human readers and ignored by Python during execution, docstrings become part of the code and can be accessed programmatically using tools like IDE tooltips or the help() function. The author emphasizes the importance of placing docstrings correctly—immediately after a def, class, or at the top of a module file—to ensure they are recognized and utilized for documentation purposes.",
  "summary": "Okay, so I've been diving deeper into Python lately, and it's been an absolute blast! But like any new adventure, there have been a few head-scratching moments. One recently involved comments. I thought I had them all figured out, you know, # for quick notes, right? Simple. Then I started looking at more seasoned Python code, and I kept seeing these things wrapped in triple quotes . My initial…",
  "key_points": [
    "Triple quotes in Python serve a specific purpose beyond simple comments.",
    "Docstrings provide formal documentation for code components.",
    "Docstrings become part of the code and can be accessed programmatically."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}