diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2014-03-22 18:33:41 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2014-03-22 18:33:41 +0100 |
commit | ad356fd1dd08cd4b1dbde9442403a8086d836d9a (patch) | |
tree | cb45ff8d991d3951d6a3a88003c5447bc4675108 /Cython/Compiler/MemoryView.py | |
parent | 076fac37ec57a3e7812c279bc8ec90cd6aa92808 (diff) | |
download | cython-ad356fd1dd08cd4b1dbde9442403a8086d836d9a.tar.gz |
remove some legacy Py2.[45] code
Diffstat (limited to 'Cython/Compiler/MemoryView.py')
-rw-r--r-- | Cython/Compiler/MemoryView.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Cython/Compiler/MemoryView.py b/Cython/Compiler/MemoryView.py index 9adb194d3..50a948e3c 100644 --- a/Cython/Compiler/MemoryView.py +++ b/Cython/Compiler/MemoryView.py @@ -728,6 +728,7 @@ def get_axes_specs(env, axes): return axes_specs + def validate_axes(pos, axes): if len(axes) >= Options.buffer_max_dims: error(pos, "More dimensions than the maximum number" @@ -736,31 +737,27 @@ def validate_axes(pos, axes): return True -def all(it): - for item in it: - if not item: - return False - return True def is_cf_contig(specs): is_c_contig = is_f_contig = False - if (len(specs) == 1 and specs == [('direct', 'contig')]): + if len(specs) == 1 and specs == [('direct', 'contig')]: is_c_contig = True elif (specs[-1] == ('direct','contig') and - all([axis == ('direct','follow') for axis in specs[:-1]])): + all(axis == ('direct','follow') for axis in specs[:-1])): # c_contiguous: 'follow', 'follow', ..., 'follow', 'contig' is_c_contig = True elif (len(specs) > 1 and specs[0] == ('direct','contig') and - all([axis == ('direct','follow') for axis in specs[1:]])): + all(axis == ('direct','follow') for axis in specs[1:])): # f_contiguous: 'contig', 'follow', 'follow', ..., 'follow' is_f_contig = True return is_c_contig, is_f_contig + def get_mode(specs): is_c_contig, is_f_contig = is_cf_contig(specs) |