A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-November/030535.html below:

[Python-Dev] Re: PyNumber_Check()

[Python-Dev] Re: PyNumber_Check()Guido van Rossum guido@python.org
Thu, 28 Nov 2002 08:57:04 -0500
> > Maybe, as long as we all agree that that's *exactly* what they check
> > for, and as long as we agree that there may be overlapping areas
> > (where two or more of these will return True).
> > 
> > PyMapping_Check() returns true for a variety of non-mappings like
> > strings, lists, and all classic instances.
> 
> Perhaps we should simply keep the existing semantics for
> those two APIs, that is, ensure that they return the same
> results for the standard builtin types as they did in Python 2.2
> and below ?!

That's a new way of defining their semantics, but I can agree with it!

> This would mean that a special case would have to be added
> to PyNumber_Check() to have it return False for strings
> and Unicode.

Somebody (MWH?) proposed to test for one or nb_int/nb_long/nb_float.
That makes sense to me, and should do what you ask for.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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