Skip to content

Commit 8c70ce8

Browse files
Add preliminary arithmetic operator declarations to cpp/array.pxd.
1 parent cae0423 commit 8c70ce8

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

dynd/cpp/array.pxd

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,25 @@ cdef extern from 'dynd/array.hpp' namespace 'dynd::nd' nogil:
4040

4141
bool is_null()
4242

43-
array operator<(array &)
44-
array operator<=(array &)
45-
array operator==(array &)
46-
array operator!=(array &)
47-
array operator>=(array &)
48-
array operator>(array &)
49-
5043
void assign(array &) except +translate_exception
5144
array eval() except +translate_exception
5245
array cast(type) except +translate_exception
5346
array ucast(type, ssize_t) except +translate_exception
47+
48+
# These should only be used with versions of Cython later than 0.23.
49+
# Otherwise the exception handler isn't properly applied and the
50+
# resulting uncaught C++ exceptions can crash the Python interpreter.
51+
array operator<(array&) except +translate_exception
52+
array operator<=(array&) except +translate_exception
53+
array operator==(array&) except +translate_exception
54+
array operator!=(array&) except +translate_exception
55+
array operator>=(array&) except +translate_exception
56+
array operator>(array&) except +translate_exception
57+
array operator+(array&) except +translate_exception
58+
array operator-(array&) except +translate_exception
59+
array operator*(array&) except +translate_exception
60+
array operator/(array&) except +translate_exception
61+
array operator()(...) except +translate_exception
5462

5563
array empty(type &tp) except +translate_exception
5664

0 commit comments

Comments
 (0)