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/059765.html below:

[Python-Dev] basenumber redux

[Python-Dev] basenumber redux [Python-Dev] basenumber reduxAnthony Baxter anthony at interlink.com.au
Mon Jan 16 10:53:06 CET 2006
On Monday 16 January 2006 20:05, Nick Coghlan wrote:
> For example, what's wrong with "hasattr(x, __int__)"? That works
> for all the builtin types, and, IMO, anyone defining a direct
> conversion to an integer for a non-numeric type deserves whatever
> happens to them.

What about something that's got something like:

  def __int__(self):
      raise TypeError("This type is not a number!")

I don't see a problem with defining basenumber. For the use cases, 
pretty much the same set as basesstring.



-- 
Anthony Baxter     <anthony at interlink.com.au>
It's never too late to have a happy childhood.
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