At last found what I was trying to convey. A new class >>BinaryInt(n: Integer *, bits,signed=False)
It should accept float values.(now >> "bin(5.8)".. will raise an error). >>BinaryInt(-2,4) 0b1110 >>BinaryInt(5,4) 0b0101 >>BinaryInt(-2,4,True) -0b010 _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/XEDTIZS6COJ4IQG7G2VZEZUGE3FF3UL4/ Code of Conduct: http://python.org/psf/codeofconduct/