Class PyPartial

java.lang.Object
org.python.core.PyObject
org.python.modules._functools.PyPartial
All Implemented Interfaces:
Serializable, Traverseproc
Direct Known Subclasses:
PyPartialDerived

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

    • TYPE

      public static final PyType TYPE
    • func

      public PyObject func
      The wrapped callable.
    • args

      public PyObject[] args
      Callable's args.
  • Constructor Details

    • PyPartial

      public PyPartial()
    • PyPartial

      public PyPartial(PyType subType)
  • Method Details

    • partial___new__

      public static PyObject partial___new__(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)
    • __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.
    • partial___call__

      public PyObject partial___call__(PyObject[] args, String[] keywords)
    • getArgs

      public PyObject getArgs()
    • getKeywords

      public PyObject getKeywords()
    • __setattr__

      public void __setattr__(String name, PyObject value)
      Description copied from class: PyObject
      A variant of the __setattr__ method which accepts a String as the key. This String must be interned.
      Overrides:
      __setattr__ in class PyObject
      Parameters:
      name - the name whose value will be set - must be an interned string .
      value - the value to set this name to
      See Also:
    • 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
    • setDict

      public void setDict(PyObject val)
      Overrides:
      setDict 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