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 you really needed it. The long int representation should be absolutely opaque - even the fact that it is a sign+magnitude representation should be hidden. Looking at the PEP, I see that a class can implement __format__. Wouldn't it be appropriate if the long type implemented that? Implementation-wise, I would expect that long_format already does the bulk of what you need to do. OTOH, also look at _PyString_FormatLong. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4