Skip to content

Commit

Permalink
Merge 801c0c6 into c4bc112
Browse files Browse the repository at this point in the history
  • Loading branch information
cdonovick committed Jul 8, 2019
2 parents c4bc112 + 801c0c6 commit 79e3d0d
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions hwtypes/adt_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,6 @@ def _is_descriptor(obj):
return hasattr(obj, '__get__') or hasattr(obj, '__set__') or hasattr(obj, '__delete__')


class _key_map_dict(Mapping):
def __init__(self, f: Mapping, d: Mapping):
self._f = f
self._d = d

def __getitem__(self, key):
return self._d[self._f[key]]

def __iter__(self):
yield from self._f

def __len__(self):
return len(self._f)

def __repr__(self):
c = []
for k,v in self.items():
c.append('{}:{}'.format(k,v))
return f'{type(self).__name__}({",".join(c)})'


def is_adt_type(t):
return isinstance(t, BoundMeta)

Expand Down

0 comments on commit 79e3d0d

Please sign in to comment.