MAINT: Apply 2to3 idioms fixer. #3281

Merged
merged 1 commit into from May 3, 2013

Projects

None yet

1 participant

@charris
Member
charris commented Apr 27, 2013

The idioms fixer makes the following replacements.

  1. int <- bool
  2. comparison or identity of types <- isinstance
  3. a.sort() <- sorted(a)

There were two problems that needed to be dealt with after the
application of the fixer. First, the replacement of comparison or
identity of types by isinstance was not always correct. The isinstance
function returns true for subtypes whereas many of the places where the
fixer made a substitution needed to check for exact type equality.
Second, the sorted function was applied to arrays, but because it treats
them as iterators and constructs a sorted list from the result, that is
the wrong thing to do.

Closes #3062.

@charris charris MAINT: Apply 2to3 idioms fixer.
The idioms fixer makes the following replacements.

1) int <- bool
2) comparison or identity of types <- isinstance
3) a.sort() <- sorted(a)

There were two problems that needed to be dealt with after the
application of the fixer. First, the replacement of comparison or
identity of types by isinstance was not always correct.  The isinstance
function returns true for subtypes whereas many of the places where the
fixer made a substitution needed to check for exact type equality.
Second, the sorted function was applied to arrays, but because it treats
them as iterators and constructs a sorted list from the result, that is
the wrong thing to do.

Closes #3062.
dec4f4b
@charris charris merged commit 962f429 into numpy:master May 3, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment