Add a __repr__ method to Future

This commit is contained in:
Correl Roush 2019-01-22 23:44:02 -05:00 committed by Correl Roush
parent 7745f5ff6a
commit 6f9ce55404

View file

@ -60,6 +60,9 @@ class Future(Monad[T]):
def __await__(self):
return self.awaitable.__await__()
def __repr__(self):
return f"<Future {self.awaitable}>"
__rshift__ = bind
__and__ = lambda other, self: Future.apply(self, other)
__mul__ = __rmul__ = map