[issue1023290] Conversion of longs to bytes and vice-versa.

Alexandre Vassalotti report at bugs.python.org
Sat Nov 14 21:38:12 CET 2009


Alexandre Vassalotti <alexandre at peadrop.com> added the comment:

Here's an updated patch.

- Renamed tobytes() to to_bytes() and frombytes() to from_bytes().
- Moved the changes to pickle to a different patch.
- Made the NULL-checks more consistent with the rest of long's code.
- Fixed the type check of the `length' parameter of to_bytes() to use
  PyIndex_Check() instead of PyLong_Check().

----------
dependencies: +Move the special-case for integer objects out of PyBytes_FromObject.
Added file: http://bugs.python.org/file15333/long_and_bytes_conversion-3.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1023290>
_______________________________________


More information about the Python-bugs-list mailing list