{
  "id": "python-typing-self-table",
  "kind": "table",
  "slug": "python-typing-self",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/python-typing-self/",
  "title": "Annotate a method that returns its class with typing.Self",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "Self",
      "source": "Python PEPs",
      "detail": "Special type for the current enclosed class"
    },
    {
      "name": "return self",
      "source": "Python PEPs",
      "detail": "Common method annotation"
    },
    {
      "name": "subclass",
      "source": "Python PEPs",
      "detail": "The return type follows the subclass"
    },
    {
      "name": "PEP 673",
      "source": "Python PEPs",
      "detail": "More concise than the PEP 484 TypeVar approach"
    }
  ],
  "related_slugs": [
    "python-typing-annotations",
    "python-dataclasses",
    "python-contextlib"
  ],
  "license": "CC-BY-4.0",
  "source_license": "Public-Domain (Python PEPs); PSF-2.0 (Python docs); prose restates cited source lines in own words",
  "as_of": "2026-11-19",
  "status": "deep-draft-20261119",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}