It's a sample code for use __subclasses__ to validate the type. I write a config factory utility #!/bin/env python import os, sys if './' not in sys.path: sys.path.append('./') if './lib' not in sys.path: sys.path.append('./lib') if '../lib' not in sys.path: sys.path.append('../lib') if os.getcwd()+'/lib' not in sys.path: sys.path.append(os.getcwd()+'/lib') import yaml, json from libproperty import * from StringIO import StringIO from abc import * ## Property Abstract Class ## Subclass naming rule: xxxProperty. (e.g. JavaProperty, YamlProperty) class CommonProperty(object): __metaclass__ = ABCMeta def __init__(self, FILE=None): self._prop_file_output = self._prop_file = FILE self._prop = None pass @staticmethod def isValidType(type): return '%sProperty' % type in [ c.__name__ for c in CommonProperty.__subclasses__() ] @abstractmethod def save(self, FI...