isinstance is broken
exarkun at intarweb.us
Sat Jan 18 18:15:52 CET 2003
On Sat, Jan 18, 2003 at 08:50:25AM -0800, Michele Simionato wrote:
> There are inconsistencies in "isinstance".
> Example 1:
> >>> isinstance(int,object)
> gives no error message. I don't like it, an error should be
> raised. There is issubclass for that job:
> >>> issubclass(int,object)
This isn't an inconsistency.
If it returned 0, it would be inconsistent.
For the rest of your examples, I'm not sure I like the behavior, but it
does seem intentional. I'd be interested to here from a Python developer
just why this behavior was decided upon.
A sad spectacle. If they be inhabited, what a scope for misery
and folly. If they be not inhabited, what a waste of space.
-- Thomas Carlyle, looking at the stars
12:00am up 33 days, 9:48, 4 users, load average: 0.08, 0.17, 0.17
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
More information about the Python-list