binary

Anonymous Coward 2018-03-06 20:17:11.766785 UTC

1class binary(int):
2 def __new__(self, bStr: str):
3 return int.__new__(binary, bStr, base=2)
4 def __str__(self):
5 return bin(self)
6 def __repr__(self):
7 return bin(self)