Skip to content

Commit

Permalink
SetConst new dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjinliu committed Sep 5, 2021
1 parent 37e65a0 commit 248a674
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion impy/_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ def __repr__(self):

class SetConst:
n_ongoing = 0
def __init__(self, name, value):
def __init__(self, name=None, value=None, **kwargs):
if name is None and value is None and len(kwargs) == 1:
name, value = list(kwargs.items())[0]
elif name in Const.keys() and value is not None:
pass
else:
raise TypeError("Invalid input for SetConst")
self.name = name
self.value = value

Expand Down

0 comments on commit 248a674

Please sign in to comment.