diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-03-27 21:49:08 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-03-28 08:43:26 -0600 |
commit | d4b88c1dbd6898fb6fcebc97f36b421999340f71 (patch) | |
tree | 61cc0282cf2509afe364c91e97b59dfb2ebcafd3 /numpy/doc | |
parent | 40742184df68fc01f3392c9865f35d5402e74b01 (diff) | |
download | numpy-d4b88c1dbd6898fb6fcebc97f36b421999340f71.tar.gz |
2to3: Use absolute imports.
The new import `absolute_import` is added the `from __future__ import`
statement and The 2to3 `import` fixer is run to make the imports
compatible. There are several things that need to be dealt with to make
this work.
1) Files meant to be run as scripts run in a different environment than
files imported as part of a package, and so changes to those files need
to be skipped. The affected script files are:
* all setup.py files
* numpy/core/code_generators/generate_umath.py
* numpy/core/code_generators/generate_numpy_api.py
* numpy/core/code_generators/generate_ufunc_api.py
2) Some imported modules are not available as they are created during
the build process and consequently 2to3 is unable to handle them
correctly. Files that import those modules need a bit of extra work.
The affected files are:
* core/__init__.py,
* core/numeric.py,
* core/_internal.py,
* core/arrayprint.py,
* core/fromnumeric.py,
* numpy/__init__.py,
* lib/npyio.py,
* lib/function_base.py,
* fft/fftpack.py,
* random/__init__.py
Closes #3172
Diffstat (limited to 'numpy/doc')
-rw-r--r-- | numpy/doc/__init__.py | 2 | ||||
-rw-r--r-- | numpy/doc/basics.py | 2 | ||||
-rw-r--r-- | numpy/doc/broadcasting.py | 2 | ||||
-rw-r--r-- | numpy/doc/byteswapping.py | 2 | ||||
-rw-r--r-- | numpy/doc/constants.py | 2 | ||||
-rw-r--r-- | numpy/doc/creation.py | 2 | ||||
-rw-r--r-- | numpy/doc/glossary.py | 2 | ||||
-rw-r--r-- | numpy/doc/howtofind.py | 2 | ||||
-rw-r--r-- | numpy/doc/indexing.py | 2 | ||||
-rw-r--r-- | numpy/doc/internals.py | 2 | ||||
-rw-r--r-- | numpy/doc/io.py | 2 | ||||
-rw-r--r-- | numpy/doc/jargon.py | 2 | ||||
-rw-r--r-- | numpy/doc/methods_vs_functions.py | 2 | ||||
-rw-r--r-- | numpy/doc/misc.py | 2 | ||||
-rw-r--r-- | numpy/doc/performance.py | 2 | ||||
-rw-r--r-- | numpy/doc/structured_arrays.py | 2 | ||||
-rw-r--r-- | numpy/doc/subclassing.py | 2 | ||||
-rw-r--r-- | numpy/doc/ufuncs.py | 2 |
18 files changed, 18 insertions, 18 deletions
diff --git a/numpy/doc/__init__.py b/numpy/doc/__init__.py index 19b3d87db..028d0c343 100644 --- a/numpy/doc/__init__.py +++ b/numpy/doc/__init__.py @@ -1,4 +1,4 @@ -from __future__ import division +from __future__ import division, absolute_import import os diff --git a/numpy/doc/basics.py b/numpy/doc/basics.py index d50388282..b56d61380 100644 --- a/numpy/doc/basics.py +++ b/numpy/doc/basics.py @@ -136,5 +136,5 @@ value is inside an array or not. NumPy scalars also have many of the same methods arrays do. """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/broadcasting.py b/numpy/doc/broadcasting.py index be6cde0bd..bbbd5bdcc 100644 --- a/numpy/doc/broadcasting.py +++ b/numpy/doc/broadcasting.py @@ -175,5 +175,5 @@ See `this article <http://www.scipy.org/EricsBroadcastingDoc>`_ for illustrations of broadcasting concepts. """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/byteswapping.py b/numpy/doc/byteswapping.py index 395c858ed..df767f1bc 100644 --- a/numpy/doc/byteswapping.py +++ b/numpy/doc/byteswapping.py @@ -135,5 +135,5 @@ the previous operations: False """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/constants.py b/numpy/doc/constants.py index 10f41a7ba..5fe93fa2b 100644 --- a/numpy/doc/constants.py +++ b/numpy/doc/constants.py @@ -10,7 +10,7 @@ Numpy includes several constants: # # Note: the docstring is autogenerated. # -from __future__ import division +from __future__ import division, absolute_import import textwrap, re diff --git a/numpy/doc/creation.py b/numpy/doc/creation.py index f14b163e6..045b476e3 100644 --- a/numpy/doc/creation.py +++ b/numpy/doc/creation.py @@ -141,5 +141,5 @@ random values, and some utility functions to generate special matrices (e.g. diagonal). """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/glossary.py b/numpy/doc/glossary.py index 35adfc820..02b291b64 100644 --- a/numpy/doc/glossary.py +++ b/numpy/doc/glossary.py @@ -415,5 +415,5 @@ Glossary and f2py (which wraps Fortran). """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/howtofind.py b/numpy/doc/howtofind.py index 8e6793c48..e456a7422 100644 --- a/numpy/doc/howtofind.py +++ b/numpy/doc/howtofind.py @@ -7,5 +7,5 @@ How to Find Stuff How to find things in NumPy. """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/indexing.py b/numpy/doc/indexing.py index 84f300dcd..821240efd 100644 --- a/numpy/doc/indexing.py +++ b/numpy/doc/indexing.py @@ -405,5 +405,5 @@ converted to an array as a list would be. As an example: :: 40 """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/internals.py b/numpy/doc/internals.py index d7b6d3c93..ed2991a32 100644 --- a/numpy/doc/internals.py +++ b/numpy/doc/internals.py @@ -160,5 +160,5 @@ when accessing elements of an array. Granted, it goes against the grain, but it is more in line with Python semantics and the natural order of the data. """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/io.py b/numpy/doc/io.py index 4ee4c7c2f..a212b9697 100644 --- a/numpy/doc/io.py +++ b/numpy/doc/io.py @@ -7,5 +7,5 @@ Array I/O Placeholder for array I/O documentation. """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/jargon.py b/numpy/doc/jargon.py index 3bf4d5070..684674816 100644 --- a/numpy/doc/jargon.py +++ b/numpy/doc/jargon.py @@ -7,5 +7,5 @@ Jargon Placeholder for computer science, engineering and other jargon. """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/methods_vs_functions.py b/numpy/doc/methods_vs_functions.py index 902ec54d0..7090190c0 100644 --- a/numpy/doc/methods_vs_functions.py +++ b/numpy/doc/methods_vs_functions.py @@ -7,5 +7,5 @@ Methods vs. Functions Placeholder for Methods vs. Functions documentation. """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/misc.py b/numpy/doc/misc.py index 9195ebb5a..a16698a20 100644 --- a/numpy/doc/misc.py +++ b/numpy/doc/misc.py @@ -226,5 +226,5 @@ Interfacing to C++: 5) SIP (used mainly in PyQT) """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/performance.py b/numpy/doc/performance.py index 711dd3153..e2ca2c53e 100644 --- a/numpy/doc/performance.py +++ b/numpy/doc/performance.py @@ -7,5 +7,5 @@ Performance Placeholder for Improving Performance documentation. """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/structured_arrays.py b/numpy/doc/structured_arrays.py index eeb8a949f..cd308c1cf 100644 --- a/numpy/doc/structured_arrays.py +++ b/numpy/doc/structured_arrays.py @@ -221,5 +221,5 @@ You can find some more information on recarrays and structured arrays <http://www.scipy.org/Cookbook/Recarray>`_. """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/subclassing.py b/numpy/doc/subclassing.py index 19bdd425f..8734a0567 100644 --- a/numpy/doc/subclassing.py +++ b/numpy/doc/subclassing.py @@ -557,5 +557,5 @@ how this can work, have a look at the ``memmap`` class in """ -from __future__ import division +from __future__ import division, absolute_import diff --git a/numpy/doc/ufuncs.py b/numpy/doc/ufuncs.py index d566ee98a..a1de5681f 100644 --- a/numpy/doc/ufuncs.py +++ b/numpy/doc/ufuncs.py @@ -135,5 +135,5 @@ results in an error. There are two alternatives: a convenient way to apply these operators. """ -from __future__ import division +from __future__ import division, absolute_import |