Class Function

All Implemented Interfaces:
Serializable, Traverseproc, Pointer

public class Function extends BasePointer implements Traverseproc
See Also:
  • Field Details

    • TYPE

      public static final PyType TYPE
    • errcheck

      public PyObject errcheck
    • name

      public final String name
  • Method Details

    • Function_new

      public static PyObject Function_new(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)
    • getMemory

      public DirectMemory getMemory()
      Specified by:
      getMemory in interface Pointer
    • fastGetDict

      public PyObject fastGetDict()
      Description copied from class: PyObject
      xxx implements where meaningful
      Overrides:
      fastGetDict in class PyObject
      Returns:
      internal object per instance dict or null
    • getDict

      public PyObject getDict()
      Description copied from class: PyObject
      xxx implements where meaningful
      Overrides:
      getDict in class PyObject
      Returns:
      internal object __dict__ or null
    • __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.
    • __call__

      public PyObject __call__()
      Description copied from class: PyObject
      A variant of the __call__ method with no arguments. 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
    • __call__

      public PyObject __call__(PyObject arg0)
      Description copied from class: PyObject
      A variant of the __call__ method with one argument. 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:
      arg0 - the single argument to the function.
    • __call__

      public PyObject __call__(PyObject arg0, PyObject arg1)
      Description copied from class: PyObject
      A variant of the __call__ method with two arguments. 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:
      arg0 - the first argument to the function.
      arg1 - the second argument to the function.
    • __call__

      public PyObject __call__(PyObject arg0, PyObject arg1, PyObject arg2)
      Description copied from class: PyObject
      A variant of the __call__ method with three arguments. 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:
      arg0 - the first argument to the function.
      arg1 - the second argument to the function.
      arg2 - the third argument to the function.
    • __call__

      public PyObject __call__(PyObject arg0, PyObject arg1, PyObject arg2, PyObject arg3)
      Description copied from class: PyObject
      A variant of the __call__ method with four arguments. 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:
      arg0 - the first argument to the function.
      arg1 - the second argument to the function.
      arg2 - the third argument to the function.
      arg3 - the fourth argument to the function.
    • getResultType

      public PyObject getResultType()
    • setResultType

      public void setResultType(PyObject restype)
    • getArgTypes

      public PyObject getArgTypes()
    • setArgTypes

      public void setArgTypes(PyObject parameterTypes)
    • errcheck

      public void errcheck(PyObject errcheck)
    • __nonzero__

      public boolean __nonzero__()
      Description copied from class: PyObject
      Equivalent to the standard Python __nonzero__ method. Returns whether of not a given PyObject is considered true.
      Overrides:
      __nonzero__ in class BasePointer
    • 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) throws UnsupportedOperationException
      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
      Throws:
      UnsupportedOperationException