@staticmethod
def _add_func(functype, obj, funcname, func):
    """
        Adds `func` to `obj` as `funcname` using `setattr()`, but adds
        `funcname` to set given by `obj._extrattrs[functype]` for tracking
        purposes.
        """
    if funcname not in obj._extra_attrs[functype]:
        obj._extra_attrs[functype].append(funcname)
    setattr(obj, funcname, func)
