I have the following class which is being subclassed:
class ConnectionManager(object):
    def __init__(self, type=None):
        self.type = None
        self.host = None
        self.username = None
        self.password = None
        self.database = None
        self.port = None
    def _setup_connection(self, type):
        pass
I then have a specific manager for various database. And I can call those like this:
c = MySQLConnectionManager()
c._setup_connection(...)
However, is there a way to do the following instead?
c = ConnectionManager("MySQL")
c._setup_connection(x,y,z) # this would call the MySQLConnectionManager, 
                           # not the ConnectionManager
Basically, I want to be able to call things in reverse order, is that possible?



__new__()- that lets you create and return an instance of an appropriate subclass, based on the parameters that were passed.__init__()is too late to do any such thing, the object has already been created.__new__method? Would it bereturn MySQLConnectionManager()?