Created
February 28, 2016 23:29
-
-
Save Makman2/20167c5935f98cf39425 to your computer and use it in GitHub Desktop.
Prototype that shall replace get_metadata() more or less inside Bear
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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