Skip to content

Python 3 compatibility #1

@DFEvans

Description

@DFEvans

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions