Class PyReflectedFunction

java.lang.Object
org.python.core.PyObject
org.python.core.PyReflectedFunction
All Implemented Interfaces:
Serializable, Traverseproc
Direct Known Subclasses:
PyReflectedConstructor

public class PyReflectedFunction extends PyObject implements Traverseproc
See Also:
  • Field Details

    • __name__

      public String __name__
    • __doc__

      public PyObject __doc__
    • __module__

      public PyObject __module__
    • argslist

      public ReflectedArgs[] argslist
    • nargs

      public int nargs
  • Constructor Details

    • PyReflectedFunction

      public PyReflectedFunction(Method... methods)
  • Method Details

    • _doget

      public PyObject _doget(PyObject container)
      Overrides:
      _doget in class PyObject
    • _doget

      public PyObject _doget(PyObject container, PyObject wherefound)
      Overrides:
      _doget in class PyObject
    • copy

      public PyReflectedFunction copy()
    • handles

      public boolean handles(Method method)
    • addMethod

      public void addMethod(Method m)
    • isPackagedProtected

      public static boolean isPackagedProtected(Class<?> c)
    • __call__

      public PyObject __call__(PyObject self, PyObject[] args, String[] keywords)
      Description copied from class: PyObject
      A variant of the __call__ method with one extra initial argument. This variant is used to allow method invocations to be performed efficiently. The default behavior is to invoke __call__(args, keywords) with the appropriate arguments. The only reason to override this function would be for improved performance.
      Overrides:
      __call__ in class PyObject
      Parameters:
      self - the first argument to the function.
      args - the last arguments to the function (including keyword arguments).
      keywords - the keywords used for all keyword arguments.
    • __call__

      public PyObject __call__(PyObject[] args, String[] keywords)
      Description copied from class: PyObject
      The basic method to override when implementing a callable object. The first len(args)-len(keywords) members of args[] are plain arguments. The last len(keywords) arguments are the values of the keyword arguments.
      Overrides:
      __call__ in class PyObject
      Parameters:
      args - all arguments to the function (including keyword arguments).
      keywords - the keywords used for all keyword arguments.
    • printArgs

      public void printArgs()
    • toString

      public String toString()
      Overrides:
      toString in class PyObject
    • traverse

      public int traverse(Visitproc visit, Object arg)
      Description copied from interface: Traverseproc
      Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc.visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc.visit(PyObject, Object) must not be called with a null PyObject-argument.
      Specified by:
      traverse in interface Traverseproc
    • refersDirectlyTo

      public boolean refersDirectlyTo(PyObject ob)
      Description copied from interface: Traverseproc
      Optional operation. Should only be implemented if it is more efficient than calling Traverseproc.traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.
      Specified by:
      refersDirectlyTo in interface Traverseproc