Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
ed4b0e7b
Commit
ed4b0e7b
authored
Aug 16, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise compilation error on object[object] inplace operators (which are buggy)
parent
2f022483
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+3
-1
Cython/Includes/numpy.pxd
Cython/Includes/numpy.pxd
+19
-0
No files found.
Cython/Compiler/Nodes.py
View file @
ed4b0e7b
...
...
@@ -2532,7 +2532,10 @@ class InPlaceAssignmentNode(AssignmentNode):
extra
=
", Py_None"
else
:
extra
=
""
import
ExprNodes
if
self
.
lhs
.
type
.
is_pyobject
:
if
isinstance
(
self
.
lhs
,
ExprNodes
.
IndexNode
)
and
self
.
lhs
.
is_buffer_access
:
error
(
self
.
pos
,
"In-place operators not allowed on object buffers in this release."
)
self
.
dup
.
generate_result_code
(
code
)
code
.
putln
(
"%s = %s(%s, %s%s); %s"
%
(
...
...
@@ -2556,7 +2559,6 @@ class InPlaceAssignmentNode(AssignmentNode):
else
:
error
(
self
.
pos
,
"No C inplace power operator"
)
# have to do assignment directly to avoid side-effects
import
ExprNodes
if
isinstance
(
self
.
lhs
,
ExprNodes
.
IndexNode
)
and
self
.
lhs
.
is_buffer_access
:
self
.
lhs
.
generate_buffer_setitem_code
(
self
.
rhs
,
code
,
c_op
)
else
:
...
...
Cython/Includes/numpy.pxd
View file @
ed4b0e7b
...
...
@@ -102,3 +102,22 @@ cdef extern from "numpy/arrayobject.h":
ctypedef
float
npy_float96
ctypedef
float
npy_float128
ctypedef
npy_int8
int8_t
ctypedef
npy_int16
int16_t
ctypedef
npy_int32
int32_t
ctypedef
npy_int64
int64_t
ctypedef
npy_int96
int96_t
ctypedef
npy_int128
int128_t
ctypedef
npy_uint8
uint8_t
ctypedef
npy_uint16
uint16_t
ctypedef
npy_uint32
uint32_t
ctypedef
npy_uint64
uint64_t
ctypedef
npy_uint96
uint96_t
ctypedef
npy_uint128
uint128_t
ctypedef
npy_float32
float32_t
ctypedef
npy_float64
float64_t
ctypedef
npy_float80
float80_t
ctypedef
npy_float128
float128_t
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment