code: def _unpickle_method(func_name, obj, cls):
    
  
    if obj is None:
      return cls.__dict__[func_name].__get__(obj, cls)
    for cls in cls.__mro__:
      try:
        func = cls.__dict__[func_name]
      except KeyError:
        pass
      else:
        break
    return func.__get__(obj, cls)
docs: Unpickle methods properly, including class methods.