private boolean setMethod(Object obj, Method method) {
		String methodName = method.getName();

		// First, check to make sure we're not shadowing any internal Python keywords/functions/etc
		if (builtinModule.__findattr__(methodName) != null) {
			return false;
		}

		// OK, we're safe to set it
		PyObject pyObj = get(methodName);
		if ((null == pyObj) || (pyObj instanceof PyNone)) {
			// This is the first method of this name that we are adding. Create a new bound PyMethod
			// to bind the Java method to the Java object in the Python world.
			set(methodName, new PyMethod(new PyReflectedFunction(method), Py.java2py(obj),
				Py.java2py(obj.getClass())));
		}
		else if (pyObj instanceof PyMethod) {
			// Another method of this name has already been added. Add it to the list of possibilities
			// (different arguments to methods on the same Object). But first, we must do some sanity
			// checks.
			PyMethod pyMethod = (PyMethod) pyObj;
			if ((pyMethod.__self__._is(Py.java2py(obj))) != Py.True) {
				Msg.error(this,
					"Method " + methodName + " of " + obj + " attempting to shadow method " +
						pyMethod.__func__ + " of " + pyMethod.__self__);
				return false;
			}
			if (!(pyMethod.__func__ instanceof PyReflectedFunction)) {
				Msg.error(this, "For addition of method " + methodName + " of " + obj +
					", cannot mix with non Java function " + pyMethod.__func__);
				return false;
			}
			((PyReflectedFunction) pyMethod.__func__).addMethod(method);
		}

		return true;
	}
Sets a bound (callback/function pointer) method as a local variable in the interpreter.

@param obj A Java object that contains the method to bind.
@param method The method from the object to bind.
@return True if the method was set; false if it already existed and wasn't set.
Ghidra/Features/Jython/src/main/java/ghidra/jython/GhidraJythonInterpreter.java