Message45680
| Author |
trevp |
| Recipients |
| Date |
2004年09月15日.09:27:58 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Logged In: YES
user_id=973611
Uploading a new patch (base256.diff). This implements only
the string-> long (or int) conversion. It adds support for
radix 256 (unsigned) or -256 (2's-complement signed) to the
int() and long() built-ins:
int("\xFF\xFF\xFF", 256) -> 0xFFFFFF
int("\xFF\xFF\xFF", -256) -> -1
long(os.urandom(128), 256) -> 1024-bit integer
I left out the long -> string conversion. If python adds a
bytes() type, then that conversion could be done as
bytes(long). This patch has docs and tests. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 15:36:55 | admin | link | issue923643 messages |
| 2007年08月23日 15:36:55 | admin | create |
|