Skip to content

Instantly share code, notes, and snippets.

@Makman2
Created February 28, 2016 23:29
Show Gist options
  • Save Makman2/20167c5935f98cf39425 to your computer and use it in GitHub Desktop.
Save Makman2/20167c5935f98cf39425 to your computer and use it in GitHub Desktop.
Prototype that shall replace get_metadata() more or less inside Bear
# TODO Don't think I need this, but maybe we switch to a simpler system instead
# TODO of grabbing function metadata. So idea is grab metadata but parse them
# TODO into these BearSetting's for easier use.
class BearSetting:
@enforce_signature
def __init__(self, name: str, typ: type, default=None):
if default is not None and type(default) is not typ:
raise ValueError("Default is not of given type.")
self._name = name
self._type = typ
self._default = default
@property
def name(self):
return self._name
@property
def type(self):
return self._type
@property
def default(self):
return self._default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment