Java Magazine, Nov/Dec 2015
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2015 50 jvm languages Once this is defined you can write a simple test script like Listing 10 Listing 10 finance_ wb XSSFWorkbook financials xlsx main_ sheet finance_ wb sheetAt 0 def test_ financials assert_ crosstab main_ sheet A5 G5 H1 H5 Then you can run Nose to discover and run your tests Nose follows a convention over configuration approach which means it is easy to get going The result is jython m nose Ran 1 test in 0033s OK Each dot on the second line corresponds to a test in all of the collected test files Simply add more tests Dont Look Back Predictably as time marches on technologies and language features evolve As such there have been some important deprecations in Jython 27 Perhaps the most notable is that Jython 27 requires a minimum of Java 7 Another important note is that the installer no longer supports the use of an alternative JRE when generating Jython launchers Use JAVA_ HOME instead Jython 35 The Python language undergoes continued active development along with its reference implementation By the time you read this article CPython 35 will be released At some future point a release of Jython 35 is planned paralleling the CPython 35 release It is worth pointing out that Jython 27 basically has the same internal runtime support and stdlib as Python 32 But substantial work will be required to get to Jython 35 One eagerly anticipated feature in Python 35 is optional static typing which will enable even better Java integration in Jython But not so fast Jython 27 x will be around for quite some time The Jython team plans to work on 27 x as long as Python 27 is in wide use The migration to and adoption of Python 3 has been fairly slow partly due to the significant changes between versions 27 and 30 Because Python 27 is still in wide use the Jython team plans to make time based releases of the Jython 27 x line The future releases of Jython 27 x will focus on performance integration and more The release of Java 9 will likely improve performance with more optimization for dynamic languages Although there is no rush to get to Jython 35 it is on the docket In fact there is a branch of development already devoted to Jython 35 although it is in the early stages Currently the target for a Jython 35 release is in the next two years Conclusion Jython 27 provides a wealth of tools enabling developers to combine two of the most popular ecosystems Python and Java in the same codebase In this article we took a look at some of the top new features of Jython 27 but there are plenty of other great features to explore Download it from jython org and watch for updates which are planned for every six months article This article is part of an ongoing series exploring JVM languages In the last issue we covered Kotlin In the next issue we examine Gosu a JVM language used in industry for both front ends and back end systems Ed
You must have JavaScript enabled to view digital editions.