ezmsg-org / ezmsg

Pure-Python DAG-based high-performance SHM-backed pub-sub and multi-processing pattern
https://ezmsg.readthedocs.io/en/latest/
MIT License
9 stars 4 forks source link

Issue Warning when a child of ez.Settings has a field named .settings #88

Open cboulay opened 5 months ago

cboulay commented 5 months ago

With a recent change it is possible to shortcut using a settings constructor directly and instead provide settings' field values directly to the Component constructor, which then get passed on to the Component's SETTINGS object. However, this only works if there is no settings kwarg passed to the Component constructor. In effect, a Settings class with a .settings field can never have that field set by the above shortcut. Moreover, this would be a difficult error to detect and explain.

Thus, we should detect it pre-emptively and warn a user against their custom ez.Settings-derived class having a field named .settings.