`__getattribute__` can incorrectly call `build()` on factory instances
AdamHillier opened this issue · 0 comments
AdamHillier commented
Implicit calling of build()
is desired behaviour when accessing a field, but the current behaviour is for this to happen always, including e.g. when accessing instance.__component_parent__
, as is frequently done internally. This is incorrect behaviour, and causes failures with confusing error messages (and sometimes infinite recursion). The behaviour in question comes from here:
zookeeper/zookeeper/core/component.py
Lines 215 to 220 in c8eaab4
We need to check that name
is a valid field name before calling build()
implicitly.
Apologies to @timdebruin for this bug....