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 <[EMAIL PROTECTED]> It's never too late to have a happy childhood. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com