Package org.python.core

Examples of org.python.core.PyType.lookup()


        dict = subtype.instDict();
    }

    public PyString __str__() {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__str__");
        if (impl != null) {
            PyObject res = impl.__get__(this, self_type).__call__();
            if (res instanceof PyString)
                return (PyString) res;
            throw Py.TypeError("__str__" + " should return a " + "string");
View Full Code Here


        return super.__str__();
    }

    public PyString __repr__() {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__repr__");
        if (impl != null) {
            PyObject res = impl.__get__(this, self_type).__call__();
            if (res instanceof PyString)
                return (PyString) res;
            throw Py.TypeError("__repr__" + " should return a " + "string");
View Full Code Here

        return super.__repr__();
    }

    public PyString __hex__() {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__hex__");
        if (impl != null) {
            PyObject res = impl.__get__(this, self_type).__call__();
            if (res instanceof PyString)
                return (PyString) res;
            throw Py.TypeError("__hex__" + " should return a " + "string");
View Full Code Here

        return super.__hex__();
    }

    public PyString __oct__() {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__oct__");
        if (impl != null) {
            PyObject res = impl.__get__(this, self_type).__call__();
            if (res instanceof PyString)
                return (PyString) res;
            throw Py.TypeError("__oct__" + " should return a " + "string");
View Full Code Here

        return super.__oct__();
    }

    public PyFloat __float__() {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__float__");
        if (impl != null) {
            PyObject res = impl.__get__(this, self_type).__call__();
            if (res instanceof PyFloat)
                return (PyFloat) res;
            throw Py.TypeError("__float__" + " should return a " + "float");
View Full Code Here

        return super.__float__();
    }

    public PyLong __long__() {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__long__");
        if (impl != null) {
            PyObject res = impl.__get__(this, self_type).__call__();
            if (res instanceof PyLong)
                return (PyLong) res;
            throw Py.TypeError("__long__" + " should return a " + "long");
View Full Code Here

        return super.__long__();
    }

    public PyComplex __complex__() {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__complex__");
        if (impl != null) {
            PyObject res = impl.__get__(this, self_type).__call__();
            if (res instanceof PyComplex)
                return (PyComplex) res;
            throw Py.TypeError("__complex__" + " should return a " + "complex");
View Full Code Here

        return super.__complex__();
    }

    public PyObject __pos__() {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__pos__");
        if (impl != null)
            return impl.__get__(this, self_type).__call__();
        return super.__pos__();
    }
View Full Code Here

        return super.__pos__();
    }

    public PyObject __neg__() {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__neg__");
        if (impl != null)
            return impl.__get__(this, self_type).__call__();
        return super.__neg__();
    }
View Full Code Here

        return super.__neg__();
    }

    public PyObject __abs__() {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__abs__");
        if (impl != null)
            return impl.__get__(this, self_type).__call__();
        return super.__abs__();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.