class DummyObj: __config__ = [ DictConfigAB, DictConfigAC, ] a = byoc.param() b = byoc.param() c = byoc.param()
class DummyApp(byoc.App): __config__ = [DummyConfig] x = byoc.param() def __bareinit__(self): self.y = 0 def __init__(self, x): self.x = x
def find_param(obj, name=None): from more_itertools import only class_attrs = obj.__class__.__dict__ if name: return class_attrs[name] else: params = (x for x in class_attrs.values() if isinstance(x, byoc.param)) default = byoc.param() default.__set_name__(obj.__class__, '') return only(params, default)
class DummyObj: __config__ = [DummyConfig] def __init__(self): self.y = 0 def _update_y(self, x): self.y += 1 return x x = byoc.param(get=_update_y)
class DummyApp(byoc.App): __config__ = [DummyConfig] x = byoc.param()
class DummyObj: __config__ = [DummyConfig] x = byoc.param()
class DummyObj: __config__ = [byoc.EnvironmentConfig] x = byoc.param()
class DummyObj: __config__ = [byoc.YamlConfig] x = byoc.param()
class DummyObj: __config__ = [DictConfigAB] a = byoc.param()
class DummyObj: __config__ = [Foreground, Background] x = byoc.param()
class DummyObj: __config__ = [ForegroundConfig, BackgroundConfig] x = byoc.param(dynamic=dynamic)
class DummyObj: __config__ = [DummyConfig] x = byoc.param(dynamic=dynamic)
class ParentObj: x = byoc.param()