code: def register_type(cls, propname, valcls, objcls=None):
          '''
              register type for class 
               
          :param cls:
          :param propname:
          :param valcls:
          :param objcls:
          '''
          # object class is not given
          if objcls is None:
              objcls = cls
          # get type map for objcls
          typemap = cls._types.get(objcls, None)
          # if type map doesn't exist then remove it
          if not typemap:
              typemap = {}
              cls._types[objcls] = typemap
          # register value class for property
          typemap[propname] = valclf register_type(cls, propname, valcls, objcls=None):
          '''
              register type for class 
               
          :param cls:
          :param propname:
          :param valcls:
          :param objcls:
          '''
          # object class is not given
          if objcls is None:
              objcls = cls
          # get type map for objcls
          typemap = cls._types.get(objcls, None)
          # if type map doesn't exist then remove it
          if not typemap:
              typemap = {}
              cls._types[objcls] = typemap
          # register value class for property
          typemap[propname] = valcls
docs: register type for class 
               
          :param cls:
          :param propname:
          :param valcls:
          :param objcls: