Class PyOverridableNew

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    Serialized Form
    • Constructor Detail

      • PyOverridableNew

        public PyOverridableNew()
    • Method Detail

      • createOfType

        public abstract PyObject createOfType​(boolean init,
                                              PyObject[] args,
                                              java.lang.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.