define class over 2 files

greg greg at
Wed Aug 19 08:11:43 CEST 2009

naveen wrote:
>>>Is it possible to split up a class definition over multiple files?
>>Not exactly, but you can do variations of this:
> ... [subclass a class]

Multiple inheritance can also be useful:


class A_Part1:


class A_Part2:


from A_Part1 import A_Part1
from A_Part2 import A_Part2

class A(A_Part1, A_Part2):


More information about the Python-list mailing list