diff options
author | Mark Florisson <markflorisson88@gmail.com> | 2011-12-07 23:06:13 +0000 |
---|---|---|
committer | Mark Florisson <markflorisson88@gmail.com> | 2011-12-08 16:13:10 +0000 |
commit | cf9598f3707e46497b033a59437c2588bf52fe1c (patch) | |
tree | 5e6e133677bc3d08e633e1a705af76ac47bf39b4 /Cython/Compiler/MemoryView.py | |
parent | a8d81e52e649b4013cefab18d27e90a9c491b363 (diff) | |
download | cython-cf9598f3707e46497b033a59437c2588bf52fe1c.tar.gz |
Support arrays in structs and implicit struct padding in buffer format strings
Diffstat (limited to 'Cython/Compiler/MemoryView.py')
-rw-r--r-- | Cython/Compiler/MemoryView.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Cython/Compiler/MemoryView.py b/Cython/Compiler/MemoryView.py index 249195707..c6888b8e9 100644 --- a/Cython/Compiler/MemoryView.py +++ b/Cython/Compiler/MemoryView.py @@ -157,7 +157,7 @@ def src_conforms_to_dst(src, dst): return True -def valid_memslice_dtype(dtype): +def valid_memslice_dtype(dtype, i=0): """ Return whether type dtype can be used as the base type of a memoryview slice. @@ -178,6 +178,8 @@ def valid_memslice_dtype(dtype): dtype.is_error or # Pointers are not valid (yet) # (dtype.is_ptr and valid_memslice_dtype(dtype.base_type)) or + (dtype.is_array and i < 8 and + valid_memslice_dtype(dtype.base_type, i + 1)) or dtype.is_numeric or dtype.is_pyobject or dtype.is_fused or # accept this as it will be replaced by specializations later |