+2  A: 

I would solve this by using a function that encapsulates the choice of object:

class SpecialRule:
    """"""
    name="Special Rule"
    description="This is a Special Rule."
    @staticmethod
    def create(name=None):
        """"""
        print "SpecialCreate"
        if name!=None:
            SPECIAL_RULES={
                "Fly" : FlyRule,
                "Skirmish" : SkirmishRule
                } #dictionary coupling names to SpecialRuleclasses
            return SPECIAL_RULES[name]()
        else:
            return SpecialRule()

I have used the @staticmethod decorator to allow you to call the create() method without already having an instance of the object. You would call this like:

SpecialRule.create("Fly")
Greg Hewgill
This is known as the Factory Pattern, by the way.
Seamus Campbell
+2  A: 

Look up the __new__ method. It is the correct way to override how a class is created vs. initialized.

Here's a quick hack:

class Z(object):
    class A(object):
        def name(self):
            return "I'm A!"
    class B(object):
        def name(self):
            return "I'm B!"
    class C(object):
        def name(self):
            return "I'm C!"

    D = {'A':A,'B':B,'C':C}

    def __new__(cls,t):
        return cls.D[t]()
Mark Tolonen