[Tutor] The Whole Tree

Alan Gauld alan.gauld at btinternet.com
Sun Jun 16 19:51:48 CEST 2013


On 16/06/13 18:21, Jim Mooney wrote:
> My first impression of Python was that it had dynamic types but didn't
> mix them.

Umm yes, sort of. It depends on how you define some of those terms 
though. "mix them"???


> so if I was wrong on equality, is there a general rule of
> what different types can still be equal?

I'm not sure what was wrong with equality?
Whether two types can be compared depends on whether the
comparison operators for those types work.
Its hard to tell in advance, that's why you should use
try/except to catch the errors (better to ask forgiveness
principle...)

> Is it an inheritance thing?

That can play a part. But its not the only factor.

> Speaking of which, I put "Python class hierarchy" in Google but just
> got a bunch of specific wheeze. What I want is a
> list of the whole tree. Is there such,

Not that I'm aware. Not even for the standard library.

As far as I can recall Pythonwin IDE under Windows has
a class browser that will show the heirarchy for any
given object. But I haven't used it in a long time,
I may be mistaken. Your IDE (Wing?) may have a similar
feature...

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list