diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-04-06 13:25:26 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-04-06 13:25:26 -0600 |
commit | bb726ca19f434f5055c0efceefe48d89469fcbbe (patch) | |
tree | 889782afaf67fd5acb5f222969251871c0c46e5a /numpy/testing/print_coercion_tables.py | |
parent | 7441fa50523f5b4a16c854bf004d675e5bd86ab8 (diff) | |
download | numpy-bb726ca19f434f5055c0efceefe48d89469fcbbe.tar.gz |
2to3: Apply `print` fixer.
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.
Closes #3078.
Diffstat (limited to 'numpy/testing/print_coercion_tables.py')
-rwxr-xr-x | numpy/testing/print_coercion_tables.py | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/numpy/testing/print_coercion_tables.py b/numpy/testing/print_coercion_tables.py index 829ba0a16..06c968cf4 100755 --- a/numpy/testing/print_coercion_tables.py +++ b/numpy/testing/print_coercion_tables.py @@ -2,7 +2,7 @@ """Prints type-coercion tables for the built-in NumPy types """ -from __future__ import division, absolute_import +from __future__ import division, absolute_import, print_function import numpy as np @@ -20,26 +20,26 @@ class GenericObject(object): dtype = np.dtype('O') def print_cancast_table(ntypes): - print 'X', - for char in ntypes: print char, - print + print('X', end=' ') + for char in ntypes: print(char, end=' ') + print() for row in ntypes: - print row, + print(row, end=' ') for col in ntypes: - print int(np.can_cast(row, col)), - print + print(int(np.can_cast(row, col)), end=' ') + print() def print_coercion_table(ntypes, inputfirstvalue, inputsecondvalue, firstarray, use_promote_types=False): - print '+', - for char in ntypes: print char, - print + print('+', end=' ') + for char in ntypes: print(char, end=' ') + print() for row in ntypes: if row == 'O': rowtype = GenericObject else: rowtype = np.obj2sctype(row) - print row, + print(row, end=' ') for col in ntypes: if col == 'O': coltype = GenericObject @@ -65,25 +65,25 @@ def print_coercion_table(ntypes, inputfirstvalue, inputsecondvalue, firstarray, char = '@' except TypeError: char = '#' - print char, - print + print(char, end=' ') + print() -print "can cast" +print("can cast") print_cancast_table(np.typecodes['All']) -print -print "In these tables, ValueError is '!', OverflowError is '@', TypeError is '#'" -print -print "scalar + scalar" +print() +print("In these tables, ValueError is '!', OverflowError is '@', TypeError is '#'") +print() +print("scalar + scalar") print_coercion_table(np.typecodes['All'], 0, 0, False) -print -print "scalar + neg scalar" +print() +print("scalar + neg scalar") print_coercion_table(np.typecodes['All'], 0, -1, False) -print -print "array + scalar" +print() +print("array + scalar") print_coercion_table(np.typecodes['All'], 0, 0, True) -print -print "array + neg scalar" +print() +print("array + neg scalar") print_coercion_table(np.typecodes['All'], 0, -1, True) -print -print "promote_types" +print() +print("promote_types") print_coercion_table(np.typecodes['All'], 0, 0, False, True) |