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/2006-January/059776.html below:

[Python-Dev] basenumber redux

[Python-Dev] basenumber redux [Python-Dev] basenumber reduxGuido van Rossum guido at python.org
Mon Jan 16 16:53:20 CET 2006
On 1/15/06, Alex Martelli <aleaxit at gmail.com> wrote:
> Now, today, I have _again_ been bit by the lack of basenumber (by a
> bug of mine, fixed by adding decimal.Decimal to a long tuple of
> classes to be passed to an isinstance call -- I hadn't run that
> particular numeric code of mine since the time of Python 2.3,
> apparently), so I'm back to pining for it.

As you already suspected, I think a PEP is needed. The intent of
basestring was to *only* be used as the base class for *built-in*
string types. Clearly what you're proposing is different (Decimal is
not built-in -- not yet anyway).

Like other posters, I suspect that the best way of detecting numbers
might be some other kind of test, not necessarily a call to
isinstance().

It would also help to explain the user case more. ("I've been bitten"
doesn't convey a lot of information. :-)

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

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