[Python-Dev] __long__ method still exists in Python 3.x

2009-01-11 Thread Mark Dickinson
I noticed that the builtin numeric types (int, float, complex) all still
have a __long__ method in 3.x.  Shouldn't this have disappeared as
part of the int/long unification?  Is there any reason not to remove this
(by setting the nb_long entry to 0 in all three cases)?

Mark
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] __long__ method still exists in Python 3.x

2009-01-11 Thread Martin v. Löwis
> I noticed that the builtin numeric types (int, float, complex) all still
> have a __long__ method in 3.x.  Shouldn't this have disappeared as
> part of the int/long unification?  Is there any reason not to remove this
> (by setting the nb_long entry to 0 in all three cases)?

There are, apparently, still callers of the nb_long slot, so I would be
cautious.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] __long__ method still exists in Python 3.x

2009-01-11 Thread Benjamin Peterson
On Sun, Jan 11, 2009 at 12:40 PM, "Martin v. Löwis"  wrote:
>> I noticed that the builtin numeric types (int, float, complex) all still
>> have a __long__ method in 3.x.  Shouldn't this have disappeared as
>> part of the int/long unification?  Is there any reason not to remove this
>> (by setting the nb_long entry to 0 in all three cases)?
>
> There are, apparently, still callers of the nb_long slot, so I would be
> cautious.

We should remove all usage of it and rename it to nb_reserved.



-- 
Regards,
Benjamin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] __long__ method still exists in Python 3.x

2009-01-12 Thread Mark Dickinson
On Sun, Jan 11, 2009 at 7:43 PM, Benjamin Peterson  wrote:
> On Sun, Jan 11, 2009 at 12:40 PM, "Martin v. Löwis"  
> wrote:
>> There are, apparently, still callers of the nb_long slot, so I would be
>> cautious.
>
> We should remove all usage of it and rename it to nb_reserved.

I see uses of nb_long in Object/abstract.c and Modules/_struct.c, but
no others in the core.   I think the first can be removed, and the
second changed
to nb_int.

Patch at

http://bugs.python.org/issue4910

Thanks,

Mark
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com