Skip to content

Commit

Permalink
inheritance from expr and __new__ needs to return something
Browse files Browse the repository at this point in the history
  • Loading branch information
tgbugs committed May 8, 2019
1 parent 119b26b commit b59e8bc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pysercomb/pyr/units.py
Expand Up @@ -347,11 +347,11 @@ class PlusOrMinus(Range):
op = _plus_or_minus


class Dilution(LoR):
class Dilution(Expr, LoR):
op = ':'


class Dimensions:
class Dimensions(Expr):
op = 'x'
def __init__(self, *dims, unit=None):
unit = set(d.unit for d in itertools.chain(dims, (unit,)) if d and d.unit is not None)
Expand Down Expand Up @@ -677,7 +677,8 @@ class UnitsParser(UnitsHelper, SExpr):

def __new__(cls, string_to_parse):
success, ast, rest = cls._parameter_expression(string_to_parse)
super().__new__(ast)
self = super().__new__(cls, ast)
return self


# pretty printing config
Expand Down

0 comments on commit b59e8bc

Please sign in to comment.