Skip to content

Commit 6a666e1

Browse files
committed
fix type checking logic for hinted Attributes
1 parent 8072db8 commit 6a666e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/fastcs/util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ def validate_hinted_attributes(controller: BaseController):
5757
f"Controller `{controller.__class__.__name__}` failed to introspect "
5858
f"hinted attribute `{name}` during initialisation"
5959
)
60-
if attr_class not in [type(attr), Attribute]:
60+
if attr_class is not type(attr):
6161
# skip validation if access mode not specified
62+
if attr_class is Attribute and isinstance(attr, Attribute):
63+
continue
6264
raise RuntimeError(
6365
f"Controller '{controller.__class__.__name__}' introspection of hinted "
6466
f"attribute '{name}' does not match defined access mode. "

0 commit comments

Comments
 (0)