Message3205

Author leosoto
Recipients leosoto
Date 2008-05-25.21:07:56
SpamBayes Score 0.0988609
Marked as misclassified No
Message-id <1211749685.43.0.999852496524.issue1041@psf.upfronthosting.co.za>
In-reply-to
Content
As noted by Phillipe, the problem is on *Derived __findattr__:

    public PyObject __findattr__(String name) {
        PyType self_type=getType();
        PyObject getattribute=self_type.lookup("__getattribute__");
        PyString py_name=null;
        try {
            if (getattribute!=null) {
                return
getattribute.__get__(this,self_type).__call__(py_name=PyString.fromInterned(name));
            } else {
                return super.__findattr__(name);
            }
        } catch (PyException e) {
            if (Py.matchException(e,Py.AttributeError)) {
                PyObject getattr=self_type.lookup("__getattr__");
                if (getattr!=null)
                    try {
                        return
getattr.__get__(this,self_type).__call__(py_name!=null?py_name:PyString.fromInterned(name));
                    } catch (PyException e1) {
                        if (!Py.matchException(e1,Py.AttributeError))
                            throw e1;
                    }
                return null;
            }
            throw e;
        }
    }

The last "return null" is translating all the AttributeErrors into a
nulll return value, which is right from the perspective of the API
offered by PyObject#__findattr__, but causes this problem.

I would like to override PyObject#__getattr__ on *Derived (just as I
overrided __getitem__ on #1038), but it is marked final on PyObject. Why?
History
Date User Action Args
2008-05-25 21:08:05leosotosetspambayes_score: 0.0988609 -> 0.0988609
messageid: <1211749685.43.0.999852496524.issue1041@psf.upfronthosting.co.za>
2008-05-25 21:08:05leosotosetspambayes_score: 0.0988609 -> 0.0988609
recipients: + leosoto
2008-05-25 21:08:04leosotolinkissue1041 messages
2008-05-25 21:08:04leosotocreate