summaryrefslogtreecommitdiff
path: root/numpy/compat
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-02-27 13:26:58 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-03-01 11:22:47 -0700
commit6aa264c4bad9c89ccdd9ecd5a1cb5ef10643ec51 (patch)
tree15cad18dacf1ef03380c957ed9af4f39b94c5012 /numpy/compat
parent3c13c0a925276130d66be490eed4ae337712cce2 (diff)
downloadnumpy-6aa264c4bad9c89ccdd9ecd5a1cb5ef10643ec51.tar.gz
2to3: Put `from __future__ import division in every python file.
This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
Diffstat (limited to 'numpy/compat')
-rw-r--r--numpy/compat/__init__.py2
-rw-r--r--numpy/compat/_inspect.py2
-rw-r--r--numpy/compat/py3k.py1
-rw-r--r--numpy/compat/setup.py2
4 files changed, 7 insertions, 0 deletions
diff --git a/numpy/compat/__init__.py b/numpy/compat/__init__.py
index 9b4261616..930be5a90 100644
--- a/numpy/compat/__init__.py
+++ b/numpy/compat/__init__.py
@@ -8,6 +8,8 @@ extensions, which may be included for the following reasons:
* we may only need a small subset of the copied library/module
"""
+from __future__ import division
+
import _inspect
import py3k
from _inspect import getargspec, formatargspec
diff --git a/numpy/compat/_inspect.py b/numpy/compat/_inspect.py
index 4fee50814..5827db2b1 100644
--- a/numpy/compat/_inspect.py
+++ b/numpy/compat/_inspect.py
@@ -3,7 +3,9 @@
We use this instead of upstream because upstream inspect is slow to import, and
significanly contributes to numpy import times. Importing this copy has almost
no overhead.
+
"""
+from __future__ import division
import types
diff --git a/numpy/compat/py3k.py b/numpy/compat/py3k.py
index 0a03929be..594acc1e0 100644
--- a/numpy/compat/py3k.py
+++ b/numpy/compat/py3k.py
@@ -2,6 +2,7 @@
Python 3 compatibility tools.
"""
+from __future__ import division
__all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar',
'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested',
diff --git a/numpy/compat/setup.py b/numpy/compat/setup.py
index 4e0781085..3de064650 100644
--- a/numpy/compat/setup.py
+++ b/numpy/compat/setup.py
@@ -1,4 +1,6 @@
#!/usr/bin/env python
+from __future__ import division
+
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration