Message7

Author bckfnn
Recipients
Date 2000-11-18.18:44:49
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The __str__() and __repr__() in a java class are never called.

----------- FILE: test024j.java ----------- 

import org.python.core.*;

public class test024j {
    public PyObject __getitem__(PyObject key) {
        return new PyString("A __getitem__ string");
    }
    public PyString __repr__() {
        return new PyString("A __repr__ string");
    }
    public PyString __str__() {
        return new PyString("A __str__ string");
    }
}

----------- END ----------- 

JPython 1.1alpha3 on java1.2.1
Copyright 1997-1999 Corporation for National Research Initiatives
>>> import test024j
>>> t = test024j()
>>> print t
test024j@d9929d72
>>> print str(t)
test024j@d9929d72
>>> print repr(t)
test024j@d9929d72
>>>
History
Date User Action Args
2008-02-20 17:16:37adminlinkissue222788 messages
2008-02-20 17:16:37admincreate