Source code for attune._setable

__all__ = ["Setable"]

from typing import Union, Optional

[docs]class Setable(object):
[docs] def __init__(self, name: str, default: Optional[Union[str, float]] = None, **kwargs): """Setable object representation. Parameters ---------- name: str The key for this setable """ = name self.default = default
def __repr__(self): return f"Setable({repr(}, {repr(self.default)})" def __eq__(self, other): return == and self.default == other.default
[docs] def as_dict(self): """Representation as a JSON encodable dictionary.""" out = {} out["name"] = out["default"] = self.default return out