Message8184
Running the test program using CPython (2.7.5 in this case) shows an object's __str__ method is called:
$ python issue2105.py
str
Running with Jython 2.5.3 or the trunk also shows the __str__ method being called:
$ jython issue2105.py
str
so out of the box, Jython is consistent with CPython.
But if stdout/stderr are changed to point to a Writer, so that Jython uses a PyFileWriter, for example by changing jython.java to:
InteractiveConsole interp = new InteractiveConsole();
interp.setOut(new PrintWriter(System.out));
interp.setErr(new PrintWriter(System.err));
then the __repr__ method is called instead:
$ jython issue2105.py
repr |
|
Date |
User |
Action |
Args |
2013-11-30 13:59:44 | richardfearn | set | messageid: <1385819984.66.0.257843138894.issue2105@psf.upfronthosting.co.za> |
2013-11-30 13:59:44 | richardfearn | set | recipients:
+ richardfearn |
2013-11-30 13:59:44 | richardfearn | link | issue2105 messages |
2013-11-30 13:59:44 | richardfearn | create | |
|