Skip to content
This repository was archived by the owner on Oct 20, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pytkdocs/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
iterating over their members, etc.
"""

from __future__ import annotations

import importlib
import inspect
import pkgutil
Expand Down
10 changes: 10 additions & 0 deletions tests/fixtures/final.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# from __future__ import annotations

from typing import Final, get_type_hints

name: Final[str] = "final"

class Class:
value: Final = 3000

# get_type_hints(Class)
5 changes: 5 additions & 0 deletions tests/test_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,3 +536,8 @@ def test_load_decorated_function():
assert child.category == "function"
assert child.parent is child.root
assert child.parent.name == "decorated_function"

def test_load_final_annotations():
"""Load things annotated as final."""
loader = Loader(new_path_syntax=True)
obj = loader.get_object_documentation("tests.fixtures.final")