summaryrefslogtreecommitdiff
path: root/numpy/doc
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-26 21:31:12 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-05-02 21:13:17 -0600
commitdec4f4b76ae9b2b953bcc093275aa59f93adf6fd (patch)
tree13a9a50d087f6c55a6afb942437afc99110cd6f5 /numpy/doc
parent63a9f197d040b5479b772fd3925274fc984ffd24 (diff)
downloadnumpy-dec4f4b76ae9b2b953bcc093275aa59f93adf6fd.tar.gz
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.
Diffstat (limited to 'numpy/doc')
-rw-r--r--numpy/doc/__init__.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/numpy/doc/__init__.py b/numpy/doc/__init__.py
index 86d45f618..b6f1fa71c 100644
--- a/numpy/doc/__init__.py
+++ b/numpy/doc/__init__.py
@@ -4,9 +4,8 @@ import os
ref_dir = os.path.join(os.path.dirname(__file__))
-__all__ = [f[:-3] for f in os.listdir(ref_dir) if f.endswith('.py') and
- not f.startswith('__')]
-__all__.sort()
+__all__ = sorted(f[:-3] for f in os.listdir(ref_dir) if f.endswith('.py') and
+ not f.startswith('__'))
for f in __all__:
__import__(__name__ + '.' + f)