[Tutor] Defining "bit" type
Vicent
vginer at gmail.com
Sat Jan 24 15:25:58 CET 2009
Hello.
As fas as I know, there is a "bytes" type in Python 3, which is a sequence
of bytes.
Anyway, I am working with Python 2.5.4, and I am interested in defining a
new type called "bit" (if possible), which represents a number that can only
take values 0 or 1 —that's what we would call a "binary variable", in a
Mathematical Programming context.
I want to define that new data type within my code, so that I can use it in
the same way I would use "int", "long" and "float" data types, for instance.
How can I do that? If you can give me some hint or any web reference, I
would appreciate it.
Thank you in advance.
--
Vicent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090124/19e143ad/attachment.htm>
More information about the Tutor
mailing list