Skip to content

Commit d00e78a

Browse files
committed
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.
1 parent fcf7fa9 commit d00e78a

11 files changed

+17
-1
lines changed

numpydoc/comment_eater.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import division
2+
13
import sys
24
if sys.version_info[0] >= 3:
35
from io import StringIO

numpydoc/compiler_unparse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
fixme: We may want to move to using _ast trees because the compiler for
1111
them is about 6 times faster than compiler.compile.
1212
"""
13+
from __future__ import division
1314

1415
import sys
1516
from compiler.ast import Const, Name, Tuple, Div, Mul, Sub, Add

numpydoc/docscrape.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Extract reference documentation from the NumPy source tree.
22
33
"""
4+
from __future__ import division
45

56
import sys
67
import inspect

numpydoc/docscrape_sphinx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import division
2+
13
import re, inspect, textwrap, pydoc
24
import sphinx
35
import collections

numpydoc/linkcode.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
88
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
99
:license: BSD, see LICENSE for details.
10+
1011
"""
12+
from __future__ import division
1113

1214
import warnings
1315
import collections

numpydoc/numpydoc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
.. [1] https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
1616
1717
"""
18+
from __future__ import division
1819

1920
import sphinx
2021
import collections

numpydoc/phantom_import.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
.. [1] http://code.google.com/p/pydocweb
1515
1616
"""
17+
from __future__ import division
18+
1719
import imp, sys, compiler, types, os, inspect, re
1820

1921
def setup(app):

numpydoc/plot_directive.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
to make them appear side-by-side, or in floats.
7575
7676
"""
77+
from __future__ import division
7778

7879
import sys, os, glob, shutil, imp, warnings, re, textwrap, traceback
7980
import sphinx
@@ -99,7 +100,7 @@ def setup(app):
99100
setup.app = app
100101
setup.config = app.config
101102
setup.confdir = app.confdir
102-
103+
103104
app.add_config_value('plot_pre_code', '', True)
104105
app.add_config_value('plot_include_source', False, True)
105106
app.add_config_value('plot_formats', ['png', 'hires.png', 'pdf'], True)

numpydoc/tests/test_docscrape.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- encoding:utf-8 -*-
2+
from __future__ import division
23

34
import sys, textwrap
45

numpydoc/traitsdoc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
.. [2] http://code.enthought.com/projects/traits/
1414
1515
"""
16+
from __future__ import division
1617

1718
import inspect
1819
import os

0 commit comments

Comments
 (0)