Class PyModule

    • Field Detail

      • __dict__

        public PyObject __dict__
        The module's mutable dictionary
    • Constructor Detail

      • PyModule

        public PyModule()
      • PyModule

        public PyModule​(PyType subType)
      • PyModule

        public PyModule​(PyType subType,
                        java.lang.String name)
      • PyModule

        public PyModule​(java.lang.String name)
      • PyModule

        public PyModule​(java.lang.String name,
                        PyObject dict)
    • Method Detail

      • 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
      • __findattr_ex__

        public PyObject __findattr_ex__​(java.lang.String name)
        Description copied from class: PyObject
        Attribute lookup hook. If the attribute is not found, null may be returned or a Py.AttributeError can be thrown, whatever is more correct, efficient and/or convenient for the implementing class. Client code should use PyObject.__getattr__(String) or PyObject.__findattr__(String). Both methods have a clear policy for failed lookups.
        Overrides:
        __findattr_ex__ in class PyObject
        Returns:
        The looked up value. May return null if the attribute is not found
      • __setattr__

        public void __setattr__​(java.lang.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:
        PyObject.__setattr__(PyString, PyObject)
      • __delattr__

        public void __delattr__​(java.lang.String name)
        Description copied from class: PyObject
        A variant of the __delattr__ method which accepts a String as the key. This String must be interned. By default, this will call __delattr__(PyString name) with the appropriate args. The only reason to override this method is for performance.
        Overrides:
        __delattr__ in class PyObject
        Parameters:
        name - the name which will be removed - must be an interned string .
        See Also:
        PyObject.__delattr__(PyString)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class PyObject
      • __dir__

        public PyObject __dir__()
        Description copied from class: PyObject
        Equivalent to the standard Python __dir__ method.
        Overrides:
        __dir__ in class PyObject
        Returns:
        a list of names defined by this object.
      • newJ

        public <T> T newJ​(java.lang.Class<T> jcls,
                          java.lang.Object... args)
        Delegates to #newJ(PyModule, Class, Object...), .
        For keywords-support use newJ(Class, String[], Object...). {@see #newJ(Class, String[], Object...)} {@see org.python.core.Py#newJ(PyModule, Class, Object...)} {@see org.python.core.Py#newJ(PyModule, Class, String[], Object...)} {@see org.python.core.Py#newJ(PyObject, Class, PyObject[], String[])} {@see org.python.core.Py#newJ(PyObject, Class, Object...)} {@see org.python.core.Py#newJ(PyObject, Class, String[], Object...)}
        Parameters:
        module - the module containing the desired class
        jcls - Java-type of the desired clas, must have the same name
        args - constructor-arguments
        Returns:
        a new instance of the desired class
      • newJ

        public <T> T newJ​(java.lang.Class<T> jcls,
                          java.lang.String[] keywords,
                          java.lang.Object... args)
        Delgates to Py.newJ(PyModule, Class, String[], Object...).
        keywordss are applied to the last args in the list. {@see #newJ(Class, Object...)} {@see org.python.core.Py#newJ(PyModule, Class, Object...)} {@see org.python.core.Py#newJ(PyModule, Class, String[], Object...)} {@see org.python.core.Py#newJ(PyObject, Class, PyObject[], String[])} {@see org.python.core.Py#newJ(PyObject, Class, Object...)} {@see org.python.core.Py#newJ(PyObject, Class, String[], Object...)}
        Parameters:
        jcls - Java-type of the desired class, must have the same name
        keywords - are applied to the last args in the list
        args - constructor-arguments
        Returns:
        a new instance of the desired class