code: def register(self, typ):
          
          # should be able to combine class/instance namespace, and inherit from either
          # would need to store meta or rely on copy ctor
          def _func(cls):
              if typ in self._class:
                  raise ValueError("duplicated type name '%s'" % typ)
              cls.plugin_type = typ
              self._class[typ] = cls
              return cls
          return _func
docs: register a plugin