Skip to content

Commit a1657db

Browse files
author
James Souter
committed
fix type checking logic for hinted Attributes
1 parent 7ccd579 commit a1657db

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
@@ -60,8 +60,10 @@ def validate_hinted_attributes(controller: BaseController):
6060
f"Controller `{controller.__class__.__name__}` failed to introspect "
6161
f"hinted attribute `{name}` during initialisation"
6262
)
63-
if attr_class not in [type(attr), Attribute]:
63+
if attr_class is not type(attr):
6464
# skip validation if access mode not specified
65+
if attr_class is Attribute and isinstance(attr, Attribute):
66+
continue
6567
raise RuntimeError(
6668
f"Controller '{controller.__class__.__name__}' introspection of hinted "
6769
f"attribute '{name}' does not match defined access mode. "

0 commit comments

Comments
 (0)