Skip to content
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

Python 3 compatibility #1

Open
DFEvans opened this issue Jan 16, 2018 · 0 comments
Open

Python 3 compatibility #1

DFEvans opened this issue Jan 16, 2018 · 0 comments

Comments

@DFEvans
Copy link

DFEvans commented Jan 16, 2018

Given that Python 2 will no longer be maintained from 2020, and most astronomical packages are already heavily advocating the use of Python 3, it would be useful if this package could also be made compatible.

In a quick test, the "futurize" tool (http://python-future.org/automatic_conversion.html) seems to do a good job with the package, most of the changes being print, xrange->range, and changes where e.g. keys() returns iterators instead of lists. It should also retain Python 2 compatibility

The only unfixed item I've encountered so far is the definition of AISampler in Sampler.py, due to it inheriting from both object and FileHandler. I believe it's no longer necessary to inherit from object in Python 3, and removing this fixes the issue. The code also still appears to work in Python 2, but I've not done a comprehensive test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant