confused with class inheritance

Rob Hall bloke at ii.net
Sun Sep 15 05:10:24 CEST 2002


In a sample app, I have the following:

>>> class a(sgmllib):
 pass

>>> a
<module '?' (built-in)>
>>> dir(a)
[]
>>> dir(sgmllib)
['SGMLParseError', 'SGMLParser', 'TestSGMLParser', '__all__',
'__builtins__', '__doc__', '__file__', '__name__', 'attrfind', 'charref',
'commentclose', 'endbracket', 'entityref', 'incomplete', 'interesting',
'markupbase', 'piclose', 're', 'shorttag', 'shorttagopen', 'starttagopen',
'tagfind', 'test']
>>> b=a
>>> dir(b)
[]
>>>

Why doesn't dir(b) show the same as dir(sgmllib) ?


Rob





More information about the Python-list mailing list