diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-04-21 19:46:02 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-04-21 19:46:02 -0700 |
commit | 56e806abb78ac03a5f45090a3b9bf7a6c9964026 (patch) | |
tree | 5c0106a65471d2c4bb85cd6b3dddf752d933fcf5 /numpy/core | |
parent | 1975606394d577421c4b4e21abb8fdadbdc572c0 (diff) | |
parent | c879ad8a39f2b74edcdaa05a2f2f854fb235537d (diff) | |
download | numpy-56e806abb78ac03a5f45090a3b9bf7a6c9964026.tar.gz |
Merge pull request #3242 from charris/2to3-apply-types-fixer
2to3: Apply types fixer.
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/fromnumeric.py | 21 | ||||
-rw-r--r-- | numpy/core/records.py | 14 |
2 files changed, 18 insertions, 17 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index a301bb7e9..84e45a6a5 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -3,7 +3,16 @@ """ from __future__ import division, absolute_import, print_function -__docformat__ = "restructuredtext en" +import types + +from . import multiarray as mu +from . import umath as um +from . import numerictypes as nt +from .numeric import asarray, array, asanyarray, concatenate +from . import _methods + +_dt_ = nt.sctype2char + # functions that are now methods __all__ = ['take', 'reshape', 'choose', 'repeat', 'put', @@ -16,19 +25,11 @@ __all__ = ['take', 'reshape', 'choose', 'repeat', 'put', 'amax', 'amin', ] -from . import multiarray as mu -from . import umath as um -from . import numerictypes as nt -from .numeric import asarray, array, asanyarray, concatenate -from . import _methods -_dt_ = nt.sctype2char - -import types try: _gentype = types.GeneratorType except AttributeError: - _gentype = types.NoneType + _gentype = type(None) # save away Python sum _sum_ = sum diff --git a/numpy/core/records.py b/numpy/core/records.py index 4f520ae66..4fe1f8444 100644 --- a/numpy/core/records.py +++ b/numpy/core/records.py @@ -36,18 +36,18 @@ Record arrays allow us to access fields as properties:: """ from __future__ import division, absolute_import, print_function -# All of the functions allow formats to be a dtype -__all__ = ['record', 'recarray', 'format_parser'] +import sys +import os from . import numeric as sb from .defchararray import chararray from . import numerictypes as nt -import types -import os -import sys - from numpy.compat import isfileobj, bytes, long +# All of the functions allow formats to be a dtype +__all__ = ['record', 'recarray', 'format_parser'] + + ndarray = sb.ndarray _byteorderconv = {'b':'>', @@ -171,7 +171,7 @@ class format_parser: attribute """ if (names): - if (type(names) in [types.ListType, types.TupleType]): + if (type(names) in [list, tuple]): pass elif (type(names) == str): names = names.split(',') |