Skip to content

Commit

Permalink
Use classmethod syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed Jun 10, 2019
1 parent e019932 commit b0d19fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions magma/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,9 @@ def const(self):
def flatten(self):
return sum([t.flatten() for t in self.ts], [])

def concat(self, *args):
return concat(self, *args)
@classmethod
def concat(cls, *args):
return concat(*args)


# def Array(N, T):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_type/test_bits.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class TestCircuit(m.Circuit):
@classmethod
def definition(io):
a = io.I
b = a[0:-1].concat(m.bits(0, 1))
b = m.BFloat.concat(a[0:-1], m.bits(0, 1))
io.O <= b
print(repr(TestCircuit))
assert repr(TestCircuit) == """\
Expand Down

0 comments on commit b0d19fe

Please sign in to comment.