diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-05-28 12:04:37 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-05-28 12:04:37 +0200 |
commit | c69331e4d925658b2bf26dcb387981f6530d7b9e (patch) | |
tree | d19c7f9b0bf51f68c104057e013630e009835268 /lib/sly/ast.py | |
parent | 23927051ac3e64cabbaa6c30e8356dfe90ebfa6c (diff) |
use black(1) for uniform code formatting
Diffstat (limited to 'lib/sly/ast.py')
-rw-r--r-- | lib/sly/ast.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/sly/ast.py b/lib/sly/ast.py index 7b79ac5..05802bd 100644 --- a/lib/sly/ast.py +++ b/lib/sly/ast.py @@ -1,25 +1,24 @@ # sly/ast.py import sys + class AST(object): - @classmethod def __init_subclass__(cls, **kwargs): mod = sys.modules[cls.__module__] - if not hasattr(cls, '__annotations__'): + if not hasattr(cls, "__annotations__"): return hints = list(cls.__annotations__.items()) def __init__(self, *args, **kwargs): if len(hints) != len(args): - raise TypeError(f'Expected {len(hints)} arguments') + raise TypeError(f"Expected {len(hints)} arguments") for arg, (name, val) in zip(args, hints): if isinstance(val, str): val = getattr(mod, val) if not isinstance(arg, val): - raise TypeError(f'{name} argument must be {val}') + raise TypeError(f"{name} argument must be {val}") setattr(self, name, arg) cls.__init__ = __init__ - |