Alex Rivera | Logout

What is a partial class?

Asked 2008-11-17T14:24:32.683
10

What is and how can it be used in C#.
Can you use the same concept in Python/Perl?

Edit
Report

1 Answer

9

The c# partial class has been already explained here so I'll just cover the python part. You can use multiple inheritance to elegantly distribute the definition of a class.

class A_part1:
    def m1(self):
        print "m1"

class A_part2:
    def m2(self):
        print "m2"

class A(A_part1, A_part2):
    pass

a = A()
a.m1()
a.m2()
answered 2008-11-17T14:58:09.713

Your Answer