Message8110
Confirming the print_function does not work at the Jython prompt (Mac OS X):
$ ~/jython2.7b1/jython
Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52)
[OpenJDK 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_24
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import print_function
>>> print(1,2,3,4)
(1, 2, 3, 4)
Notice this is being interpreted as a print statement and a tuple.
Furthermore it does not seem to be working via a script which invokes doctests extracted from a file, specifically https://github.com/biopython/biopython/blob/54c1dbe984ef69c129c40be885f66b68836865f2/Tests/test_Tutorial.py from Biopython has stopped working following changes in the test style to use print functions. e.g.
<pre>
$ ~/jython2.7b1/jython test_Tutorial.py
Skipping tests needing the following:
- numpy
Running Tutorial doctests...
**********************************************************************
File "test_Tutorial.py", line 150, in __main__.TutorialDocTestHolder.doctest_test_from_line_00601
Failed example:
for index, letter in enumerate(my_seq):
print(index, letter)
Expected:
0 G
1 A
2 T
3 C
4 G
Got:
(0, 'G')
(1, 'A')
(2, 'T')
(3, 'C')
(4, 'G')
**********************************************************************
...
</pre>
We have worked around this by modifying the print doctests:
https://github.com/biopython/biopython/commit/8bc8a9478be52b6a48741cd2406f8b210741fe71 |
|
Date |
User |
Action |
Args |
2013-09-09 13:55:35 | pjac | set | messageid: <1378734935.72.0.619494504732.issue2007@psf.upfronthosting.co.za> |
2013-09-09 13:55:35 | pjac | set | recipients:
+ pjac, fwierzbicki, irmen |
2013-09-09 13:55:35 | pjac | link | issue2007 messages |
2013-09-09 13:55:35 | pjac | create | |
|