Class PyOverridableNew

All Implemented Interfaces:
Serializable, Cloneable, Traverseproc, org.python.expose.ExposeAsSuperclass

public abstract class PyOverridableNew extends PyNewWrapper
A __new__ function that tells its subclasses to just init if __new__ is being called on the type the function was defined on. Otherwise, it just leaves initting up to the subtype otherwise.
See Also:
  • Constructor Details

    • PyOverridableNew

      public PyOverridableNew()
  • Method Details

    • new_impl

      public PyObject new_impl(boolean init, PyType subtype, PyObject[] args, String[] keywords)
      Specified by:
      new_impl in class PyNewWrapper
    • createOfType

      public abstract PyObject createOfType(boolean init, PyObject[] args, String[] keywords)
      Called when new is invoked on the type the new was defined on.
      Parameters:
      init - - if the new object should be initted.
      args - - args passed to call
      keywords - - keywords passed to call
      Returns:
      - the new object.
    • createOfSubtype

      public abstract PyObject createOfSubtype(PyType subtype)
      Called when new is invoked on a subtype of for_type.