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/)
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