Usability problem: Cannot access .shape member of numpy.ndarray as tuple
|Reported by:||NNemec||Owned by:||somebody|
On typed variable of type numpy.ndarray, the .shape member does not work
cdef numpy.ndarray var = numpy.zeros((3,))
gives the cython compiler error "Cannot convert 'numpy.npy_intp *' to Python object"
Comment by dagss (mailing list):
This is mostly a question of semantics. shape is defined to be a C integer array for speed of var.shape. How can we define a generic rule in Cython which makes both possible?
Should the behaviour of "var.shape" e.g. depend on the requested return value? This means overloading on return value which is a non-trivial language change, though perhaps appropriate here.
Change History (4)
comment:1 Changed 6 years ago by NNemec
- Component changed from Build System to Invalid
- Owner somebody deleted
comment:3 Changed 6 years ago by dagss
- Component changed from Invalid to Parsing
- Milestone set to wishlist
- Owner set to somebody
- Summary changed from .shape member of numpy.ndarray broken to Usability problem: Cannot access .shape member of numpy.ndarray as tuple