isA function?

Roy Smith roy at panix.com
Mon Jul 15 08:04:40 EDT 2002


"Delaney, Timothy" <tdelaney at avaya.com> wrote:
> Why would this be bad? Presumably you are testing that the returned objects
> have specified semantics. What does it matter if the returned objects are
> all of the same type or not - what is important is what happens when you use
> them.

If the API says "foo() returns an object of class bar", then "isinstance 
(foo(), bar) is true" is indeed part of the specified semantics.



More information about the Python-list mailing list