(self, name)
Returns a python representation of the named instance method,
        either by looking it up in the cached list of methods or by searching
        for and creating a new method object.
Returns a python representation of the named instance method,
        either by looking it up in the cached list of methods or by searching
        for and creating a new method object.
Returns a python representation of the named instance method either by looking it up in the cached list of methods or by searching for and creating a new method object .
def _cache_method(self, name):
        """Returns a python representation of the named instance method,
        either by looking it up in the cached list of methods or by searching
        for and creating a new method object."""

        supercls = self
        objc_method = None
        while supercls is not None:
            # Load the class's methods if we haven't done so yet.
            if supercls.methods_ptr is None:
                supercls._load_methods()

            try:
                objc_method = supercls.instance_methods[name]
                break
            except KeyError:
                pass

            try:
                objc_method = ObjCMethod(supercls.instance_method_ptrs[name])
                break
            except KeyError:
                pass

            supercls = supercls.superclass

        if objc_method is None:
            return None
        else:
            self.instance_methods[name] = objc_method
            return objc_method
def _cache_method ( self , name ) : supercls = self objc_method = None while supercls is not None : # Load the class's methods if we haven't done so yet. if supercls . methods_ptr is None : supercls . _load_methods ( ) try : objc_method = supercls . instance_methods [ name ] break except KeyError : pass try : objc_method = ObjCMethod ( supercls . instance_method_ptrs [ name ] ) break except KeyError : pass supercls = supercls . superclass if objc_method is None : return None else : self . instance_methods [ name ] = objc_method return objc_method