Re: [Python-Dev] Access to bits for a PyLongObject

2007-03-07 Thread Eric V. Smith
Martin v. Löwis wrote: > Ah, I had missed the point that it's just binary formatting that > you are concerned with (and then I missed that binary is "base 2", > rather than "sequence of bits") Apologies for not being clear. It's easy to forget that others don't share the context of something you

Re: [Python-Dev] Access to bits for a PyLongObject

2007-03-06 Thread Martin v. Löwis
Eric V. Smith schrieb: > Also, it would either mean duplicating lots of code from the int > formatter, or having a formatter library that both can call. This is > because __format__ must implement all formats, including padding, > parenthesis for negatives, etc., not just the "missing" binary form

Re: [Python-Dev] Access to bits for a PyLongObject

2007-03-06 Thread Eric V. Smith
Martin v. Löwis wrote: > Eric V. Smith schrieb: >> I'm working on PEP 3101, Advanced String Formatting. About the only >> built-in numeric formatting I have left to do is for converting a >> PyLongOjbect to binary. >> >> I need to know how to access the bits in a PyLong. > > I think it would

Re: [Python-Dev] Access to bits for a PyLongObject

2007-03-06 Thread Nick Maclaren
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: > Eric V. Smith schrieb: > > I'm working on PEP 3101, Advanced String Formatting. About the only > > built-in numeric formatting I have left to do is for converting a > > PyLongOjbect to binary. > > > > I need to know how to a

Re: [Python-Dev] Access to bits for a PyLongObject

2007-03-05 Thread Martin v. Löwis
Eric V. Smith schrieb: > I'm working on PEP 3101, Advanced String Formatting. About the only > built-in numeric formatting I have left to do is for converting a > PyLongOjbect to binary. > > I need to know how to access the bits in a PyLong. I think it would be a major flaw in PEP 3101 if yo

[Python-Dev] Access to bits for a PyLongObject

2007-03-05 Thread Eric V. Smith
I'm working on PEP 3101, Advanced String Formatting. About the only built-in numeric formatting I have left to do is for converting a PyLongOjbect to binary. I need to know how to access the bits in a PyLong. After reading longobject.c, I can figure it out. But I'm looking for something that