Search code examples
jython

Does Jython have a ternary operator?


Does Jython have a ternary operator? I was unable to find it in the guide. edit: I am using weblogic's jython 2.2.1


Solution

  • The a if condition else b syntax was added to the language in version 2.5. It is available in both CPython and Jython.

    Jython 2.2.1 is too old and does not support this syntax.