Class PyBuiltinFunctionSet

All Implemented Interfaces:
Serializable, PyType.Newstyle
Direct Known Subclasses:
PyBuiltinMethodSet

public class PyBuiltinFunctionSet extends PyBuiltinFunction
A helper class for faster implementations of commonly called methods.

Subclasses of PyBuiltinFunctionSet will implement some or all of the __call__ method with a switch on the index number.

See Also:
  • Field Details

    • exposed_as

      public static final Class exposed_as
  • Constructor Details

    • PyBuiltinFunctionSet

      public PyBuiltinFunctionSet(String name, int index)
      Creates a PyBuiltinFunctionSet that expects 1 argument.
    • PyBuiltinFunctionSet

      public PyBuiltinFunctionSet(String name, int index, int numargs)
    • PyBuiltinFunctionSet

      public PyBuiltinFunctionSet(String name, int index, int minargs, int maxargs)
    • PyBuiltinFunctionSet

      public PyBuiltinFunctionSet(String name, int index, int minargs, int maxargs, String doc)
  • Method Details

    • fastGetDoc

      public PyObject fastGetDoc()
      Overrides:
      fastGetDoc in class PyBuiltinFunction
    • isMappingType

      public boolean isMappingType()
      Overrides:
      isMappingType in class PyObject
    • isNumberType

      public boolean isNumberType()
      Overrides:
      isNumberType in class PyObject
    • isSequenceType

      public boolean isSequenceType()
      Overrides:
      isSequenceType in class PyObject
    • fancyCall

      public PyObject fancyCall(PyObject[] args)
    • __call__

      public PyObject __call__(PyObject[] args)
      Description copied from class: PyObject
      A variant of the __call__ method when no keywords are passed. 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:
      args - all arguments to the function.
    • __call__

      public PyObject __call__(PyObject[] args, String[] kws)
      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).
      kws - 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 arg1)
      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:
      arg1 - the single argument to the function.
    • __call__

      public PyObject __call__(PyObject arg1, PyObject arg2)
      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:
      arg1 - the first argument to the function.
      arg2 - the second argument to the function.
    • __call__

      public PyObject __call__(PyObject arg1, PyObject arg2, PyObject arg3)
      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:
      arg1 - the first argument to the function.
      arg2 - the second argument to the function.
      arg3 - the third argument to the function.
    • __call__

      public PyObject __call__(PyObject arg1, PyObject arg2, PyObject arg3, PyObject arg4)
      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:
      arg1 - the first argument to the function.
      arg2 - the second argument to the function.
      arg3 - the third argument to the function.
      arg4 - the fourth argument to the function.
    • toString

      public String toString()
      Overrides:
      toString in class PyBuiltinFunction