2to3 long will fail on python 2.7 #3035

Closed
charris opened this Issue Feb 28, 2013 · 4 comments

Projects

None yet

2 participants

@charris
Member
charris commented Feb 28, 2013

Python 3 only has int. That is a problem.

@charris
Member
charris commented Apr 13, 2013

Fixed.

@charris charris closed this Apr 13, 2013
@FrancescAlted
Contributor

I think I have a related problem with numexpr:

https://groups.google.com/forum/m/?fromgroups#!topic/numexpr/OQ0l6oxGoPw

Numexpr has been recently ported to python 3, and it uses numpy 2to3 machinery under the hood. So I'm interested in this issue. But I don't know exactly what you fixed. Could you elaborate more on this issue please? Thanks.

@charris
Member
charris commented Apr 13, 2013

Nothing fancy, I put a version dependent definition of long in numpy/compat/py3k.py where various other such things go. Basically

if sys.version_info[0] >= 3:
    long = int
else:
    long = long

And import long where it's needed.

@FrancescAlted
Contributor

Ah, okay. Yes, something similar has been done in numexpr. Thanks for the extra info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment