-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Remove uses of nb_long slot, and rename to nb_reserved. #49160
Comments
In Python 3.x: >>> int.__long__.__doc__
'x.__long__() <==> long(x)' But the long builtin no longer exists. I'm actually not sure why the nb_long slot still exists in 3.x at all. |
long(x) replaced by int(x) in r68508. I'm still wondering about the nb_long slot, though. |
Here's a patch against the py3k branch that gets rid of the two existing
With this patch, all tests pass on my (OS X 10.5/Intel) machine. If someone can review this quickly I'll move on to the next patch towards I think it would be good if nb_long could be altered before 3.0.1. Benjamin, do you have time to take a look? |
That was a pretty poor patch. Here's a better one:
|
The first installment looks good! |
Thanks, Benjamin! Checked in in r68553, backported to 3.0 in r68556. Here's the second patch, which fixes almost all remaining uses of nb_long Notes: (1) I haven't tested the change to PC/winreg.c (2) The Modules/_struct.c change does introduce a change in behaviour: struct.pack('q', decimal.Decimal(1)) raises struct.error. After the patch, the packing succeeds. I *think* |
On Thu, Jan 15, 2009 at 10:48 AM, Mark Dickinson <report@bugs.python.org> wrote:
This looks correct. In fact, I don't really see the point of having
Since Decimal implements __int__ and that's what the struct module is Overall, the patch looks fine. I wonder if we should mark |
It would be nice to standardize on one of (PyNumber_Long, PyNumber_Int) Maybe it would make more sense to stick with PyNumber_Long and deprecate |
Second patch applied in r68619 (py3k) and r68620 (3.0 maintenance branch). Here's the third and final patch: rename the nb_long slot to nb_reserved, |
+1 for applying the last patch. |
Thanks again for reviewing, Benjamin. nb_long renamed in r68651, merged There seems to be a consensus on deprecating PyNumber_Int. I'll leave |
Here's a patch that deprecates PyNumber_Int in favour of PyNumber_Long:
I suppose that in theory this goes too far: we should really deprecate in N.B. We should remember to actually remove intobject.h for 3.1. :) |
PyNumber_Int deprecated in r69517, r69518. |
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: