-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Python2 Strings to Python3 Strings #1492
Comments
One can even do the following:
|
Are we sure these 3.0 features are backwards-compatible with any unix-distro's or HPC vendors version of python 2.7 - 2.9? |
Related to #1488 |
str.format was introduced in Python 2.6, so this should be backwards compatible with any version of Python 2.7 |
Also, what is Python 2.9? Unless someone's distributing their own Python, 2.8+ doesn't exist? |
Sorry. That was me assuming there's something between 2.7 and 3.0. |
Here is a nice cheat sheet for many of the ways to keep things compatible with both: |
Python2 Strings to Python3 Strings This PR changes all python2 style strings to python3 style strings. It does not change the scripts_regression_tests.py script nor the code_checker script. Test suite: code_checker and scripts_regression_tests.py Test baseline: Test namelist changes: Test status: bit for bit Fixes #1492 User interface changes?: Code review: @jgfouca @jedwards4b
For future compatibility we should switch strings from python2, e.g.
'%s' % var
, to python3 strings, e.g.'{}'.format(var)
. The strength of this approach becomes obvious when we look at something like the following:vs
The text was updated successfully, but these errors were encountered: