2to3: Apply types fixer. #3242

Merged
merged 1 commit into from Apr 22, 2013

Projects

None yet

1 participant

@charris
Member
charris commented Apr 13, 2013

Python 3 removes the builtin types from the types module. The types
fixer replaces such references with the builtin types where possible
and also takes care of some special cases:

types.TypeNone           <- type(None)
types.NotImplementedType <- type(NotImplemented)
types.EllipsisType       <- type(Ellipsis)

The only two tricky substitutions are

types.StringType         <- bytes
types.LongType           <- int

These are fixed up to support both Python 3 and Python 2 code by
importing the long and bytes types from numpy.compat.

Closes #3240.

@charris
Member
charris commented Apr 13, 2013

This should probably go in last of the current fixers, but even so I expect merge conflicts to develop somewhere along the line..

@charris charris 2to3: Apply types fixer.
Python 3 removes the builtin types from the types module. The types
fixer replaces such references with the builtin types where possible
and also takes care of some special cases:

    types.TypeNone           <- type(None)
    types.NotImplementedType <- type(NotImplemented)
    types.EllipsisType       <- type(Ellipsis)

The only two tricky substitutions are

    types.StringType         <- bytes
    types.LongType           <- int

These are fixed up to support both Python 3 and Python 2 code by
importing the long and bytes types from numpy.compat.

Closes #3240.
c879ad8
@charris charris merged commit 56e806a into numpy:master Apr 22, 2013

1 check passed

default The Travis build passed
Details
@charris charris deleted the charris:2to3-apply-types-fixer branch Apr 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment