[Python-Dev] Re: PyNumber_Check()
M.-A. Lemburg
mal@lemburg.com
Mon, 18 Nov 2002 18:01:59 +0100
gvanrossum@projects.sourceforge.net wrote:
> *** NEWS 18 Nov 2002 16:19:39 -0000 1.526
> --- NEWS 18 Nov 2002 16:27:16 -0000 1.527
> ***************
> *** 694,698 ****
> - PyNumber_Check() now returns true for string and unicode objects.
> This is a result of these types having a partially defined
> ! tp_as_number slot.
>
> - The string object's layout has changed: the pointer member
> --- 694,700 ----
> - PyNumber_Check() now returns true for string and unicode objects.
> This is a result of these types having a partially defined
> ! tp_as_number slot. (This is not a feature, but an indication that
> ! PyNumber_check() is not very useful to determine numeric behavior.
> ! It may be deprecated.)
Perhaps PyNumber_Check() should check that at least
one of nb_int, nb_long, nb_float is available (in addition to the
tp_as_number slot) ?!
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting: http://www.egenix.com/
Python Software: http://www.egenix.com/files/python/