New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
longobject: documentation improvements #57174
Comments
I think the integer objects documentation could be clearer on a
Additionally, the patch fixes comments in longobject.c that |
New changeset d4839fea4a5a by Mark Dickinson in branch 'default': |
I've fixed some of the inaccurate comments in Objects/longobject.c, for the default branch; I'm still looking at the Doc update. This really is a bit of a mess, especially for cases like PyLong_AsVoidPtr, which can either end up calling PyLong_As(Long)Long (which allows conversion via __int__), or PyLong_AsUnsigned(Long)Long (which doesn't). Ultimately, I think it would make sense to remove all __int__ conversions from Objects/longobject.c; this would affect:
and the 'LongLong' variants of these. The ramifications of such a change might be quite long-reaching; in particular, I seem to recall that this would affect the 'getargs' machinery. It could be fun to remove these conversions and see how much of the test-suite fails. :-) |
... On my machine, just test_ctypes and test_getargs2, as it turns out. |
+1 I think this API cleanup is worth some (probably very limited) |
New changeset 5ca9a51f3d85 by Mark Dickinson in branch '3.2': New changeset 63fc1552cd36 by Mark Dickinson in branch 'default': |
New changeset 3ace8e17074a by Mark Dickinson in branch '3.2': New changeset 85683f005fc8 by Mark Dickinson in branch 'default': |
New changeset e1416a4d728a by Mark Dickinson in branch '3.2': New changeset 349bc58e8c66 by Mark Dickinson in branch 'default': |
Docs mostly fixed now for Python 3.2 and Python 3.3. That leaves 2.7, where there are some additional complications (e.g., __long__ in addition to __int__, when / whether short ints are accepted, etc.). While it would be good to fix the 2.7 docs as well, I don't see myself having time for this in the near future, so I'm unassigning for now; Stefan, I think should feel free to take this issue and check in clarifications for 2.7, if you want to. |
OK, I'll see if I find some time for the 2.7 docs. |
This seems like too much trouble for 2.7. Closing, since I was the |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: