amuse icon indicating copy to clipboard operation
amuse copied to clipboard

Convert to python3 native behaviour

Open rieder opened this issue 6 years ago • 6 comments

In src/amuse/support/core.py, 2to3 changed

    def isnumber(self, x):
        return isinstance(x,types.IntType) or isinstance(x,types.FloatType)

to

    def isnumber(self, x):
        return isinstance(x,int) or isinstance(x,float) 

about which @ipelupessy wrote

this one is tricky because the py23 converter has tried to maintain effectively python 2 behaviour, while the class mimicks a dict, so probably should use python3 dict conventions...

in any case nowadays there is a build-in ordered dict, unfortunately it behaves not exactly the same

rieder avatar Sep 27 '19 11:09 rieder

Also in src/amuse/datamodel/base.py (line 627) 2to3 may have been overly careful.

rieder avatar Sep 27 '19 11:09 rieder

And src/amuse/datamodel/incode_storage.py, line 665

rieder avatar Sep 27 '19 11:09 rieder

And src/amuse/datamodel/particles.py line 284

rieder avatar Sep 27 '19 11:09 rieder

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 04 '22 18:03 stale[bot]

keep open and safe for some dedicated time for such issues

ipelupessy avatar Mar 12 '22 16:03 ipelupessy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 11 '22 17:05 stale[bot]