Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Old numeric, `sys.maxint`, `*.__nonzero` #3038

Closed
charris opened this Issue · 4 comments

2 participants

@charris
Owner

These only show up in oldnumeric when 2to3 with the 2to3 renames and nonzero fixers. The replacement for sys.maxint in python3 is sys.maxsize, but the two aren't the same, the latter the size of Py_ssize_t. Likewise the the replacement for __nonzero is __bool__, but anyone using old numeric is likely to have made the change.

Because oldnumeric will go away, I suggest we leave those attributes unchanged and advertize that oldnumeric isn't supported in python 3.

@njsmith
Owner
@charris
Owner

That sounds like a good idea to me.

@charris
Owner

Messes up the tests, though. The import fails for python3 and the tests end. Might be able to slip a warning through. I tried this a while ago, so I'm a bit hazy on the details of the result.

@charris
Owner

Given that no issues have been raised since Python 3 compatible Numpy 1.5, and that the oldnumeric package is reaching end of life, I made the sys.maxsize substitution for Python >= 3 and added a __bool__ method that duplicates the current __nonzero__ method. So closing this.

@charris charris closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.