homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author phr
Recipients
Date 2004年03月27日.06:57:57
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=72053
How about just punting signed conversion. I don't think
two's complement makes much sense for arbitrary precision
longs. Have some separate representation for negative longs
if needed. If you call hex() on a large negative number,
you get a hex string with a leading minus sign. For base
256, you can't reserve a char like that, so I guess you have
to just throw an error if someone tries to convert a
negative long to a string. If you want a representation for
signed longs, ASN1 DER is probably an ok choice. I agree
with Guido that the binascii module is a good place to put
such a function. Twos complement can work if you specify a
fixed precision, but that sure complicates what this started
out as.
History
Date User Action Args
2007年08月23日 15:36:54adminlinkissue923643 messages
2007年08月23日 15:36:54admincreate

AltStyle によって変換されたページ (->オリジナル) /