Classes and Functions - General Questions

Sybren Stuvel sybrenUSE at YOURthirdtower.com.imagination
Thu Oct 19 16:45:46 CEST 2006


Setash enlightened us with:
>> class1.py:
>>
>>     class Class1(object):
>>         pass
>>
>> class2.py:
>>     import class1

This line imports class1.py and places its contents under the name
"class1".

> classes.py:
>
>   class Class1
>     pass
>
>   class Class2(Class1)
>     pass

That's correct.

> or would I still need to call it as:
>
>   class Class2(classes.Class1)
>     pass

Nope, since the name "classes" is unknown.

Sybren
-- 
Sybren Stüvel
Stüvel IT - http://www.stuvel.eu/



More information about the Python-list mailing list