Skip to content

Commit 1b97620

Browse files
committed
FIX: fixed calling methods on CheckedSession subclasses
(thanks to Alix for finding the solution to this)
1 parent 6fef3db commit 1b97620

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

larray/core/checked.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,14 @@ def __new__(mcs, cls_name: str, bases: tuple[type[Any], ...], namespace: dict[st
116116
raw_annotations = namespace.get('__annotations__', {})
117117

118118
# tries to infer types for variables without type hints
119-
keys_to_infer_type = [key for key in namespace.keys() if key not in raw_annotations]
120-
keys_to_infer_type = [key for key in keys_to_infer_type if is_valid_field_name(key)]
121-
keys_to_infer_type = [key for key in keys_to_infer_type if key not in {'model_config', 'dict'}]
119+
keys_to_infer_type = [key for key in namespace.keys()
120+
if key not in raw_annotations]
121+
keys_to_infer_type = [key for key in keys_to_infer_type
122+
if is_valid_field_name(key)]
123+
keys_to_infer_type = [key for key in keys_to_infer_type
124+
if key not in {'model_config', 'dict', 'build'}]
125+
keys_to_infer_type = [key for key in keys_to_infer_type
126+
if not callable(namespace[key])]
122127
for key in keys_to_infer_type:
123128
value = namespace[key]
124129
raw_annotations[key] = type(value)

0 commit comments

Comments
 (0)