This may work better as a <code>@staticmethod</code> with <code>__type2class_dict__</code> defined as a local variable.  Also it doesn't need to have a special name (i.e. double-underscore) that way.