[Python-3000] Fwd: Python bytes object

Josiah Carlson jcarlson at uci.edu
Sat Nov 18 00:20:27 CET 2006


"Guido van Rossum" <guido at python.org> wrote:
> Sounds good to me -- I don't have this need myself but it seems to fit
> well.  I'm looking forward to a patch. :-)

If I remember correctly, 2.5 was supposed to have binascii.long2b() and
binascii.b2long() which would have converted a long integer to a 2.x
string and vv, offering access to the underlying PyLong_AsString() and
PyLong_FromString() functions.  According to my Python 2.5 distribution
and the documentation, it didn't make it.

Note that there exists a patch against some 2.3 for the struct module
that implements a typecode for allowing the packing and unpacking of
arbitrarily lengthed integers, also offering access to the underlying
PyLong functions.  This would likely need to be updated for the post-2.5
struct module, if its functionality is desired.

 - Josiah


> On 11/17/06, Neil Schemenauer <nas at arctrix.com> wrote:
> > ----- Forwarded message from Antti Louko <alo at louko.com> -----
> >
> > Date: Fri, 17 Nov 2006 08:25:03 +0200
> > From: Antti Louko <alo at louko.com>
> > Subject: Python bytes object
> > To: nas at arctrix.com
> >
> > Python bytes object is useful.
> >
> > I would add bitwise logical operations. They would be most useful in
> > cryptographic and graphics operations.
> >
> > Also, encoding and decoding (long) integers in binary fromat to and from
> > bytes type would be useful. Currently, there is no way to efficiently
> > convert long integers to binary formats.
> >
> > Regards,
> >
> >         Antti Louko
> >
> > ----- End forwarded message -----
> > _______________________________________________
> > Python-3000 mailing list
> > Python-3000 at python.org
> > http://mail.python.org/mailman/listinfo/python-3000
> > Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
> >
> 
> 
> -- 
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/jcarlson%40uci.edu



More information about the Python-3000 mailing list