Skip to content

Commit 410dcff

Browse files
committed
fix: add __future__ annotations to resolve 'function' object is not subscriptable
The CollectionStore class defines a method named `list` (line 123). In Python, class-body annotations are evaluated eagerly in the class namespace. After the `list` method is defined, any annotation using `list[...]` (lines 222, 255, 287, 299, 312, 327) resolves to the method object rather than the built-in list type, causing TypeError: 'function' object is not subscriptable at class definition time. Adding `from __future__ import annotations` defers all annotation evaluation to string form, avoiding the name-shadowing issue without changing any runtime logic. https://claude.ai/code/session_01U6Cp66NKhLL8k8VRifboXk
1 parent 1921a29 commit 410dcff

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tiklocal/services/collections.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import datetime
24
import json
35
import os

0 commit comments

Comments
 (0)