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
490fc80e
Commit
490fc80e
authored
Feb 25, 2011
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ticket #562
parent
d153d859
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-0
Cython/Compiler/TypeSlots.py
Cython/Compiler/TypeSlots.py
+1
-1
tests/run/ipow_crash_T562.pyx
tests/run/ipow_crash_T562.pyx
+17
-2
No files found.
Cython/Compiler/Nodes.py
View file @
490fc80e
...
...
@@ -2278,6 +2278,8 @@ class DefNode(FuncDefNode):
arg
.
hdr_type
.
declaration_code
(
arg
.
hdr_cname
))
if
not
self
.
entry
.
is_special
and
sig
.
method_flags
()
==
[
TypeSlots
.
method_noargs
]:
arg_code_list
.
append
(
"CYTHON_UNUSED PyObject *unused"
)
if
(
self
.
entry
.
scope
.
is_c_class_scope
and
self
.
entry
.
name
==
"__ipow__"
):
arg_code_list
.
append
(
"CYTHON_UNUSED PyObject *unused"
)
if
sig
.
has_generic_args
:
arg_code_list
.
append
(
"PyObject *%s, PyObject *%s"
...
...
Cython/Compiler/TypeSlots.py
View file @
490fc80e
...
...
@@ -603,7 +603,7 @@ PyNumberMethods = (
MethodSlot
(
ibinaryfunc
,
"nb_inplace_multiply"
,
"__imul__"
),
MethodSlot
(
ibinaryfunc
,
"nb_inplace_divide"
,
"__idiv__"
,
py3
=
False
),
MethodSlot
(
ibinaryfunc
,
"nb_inplace_remainder"
,
"__imod__"
),
MethodSlot
(
ternaryfunc
,
"nb_inplace_power"
,
"__ipow__"
),
# NOT i
ternaryfunc!!!
MethodSlot
(
ibinaryfunc
,
"nb_inplace_power"
,
"__ipow__"
),
# actually
ternaryfunc!!!
MethodSlot
(
ibinaryfunc
,
"nb_inplace_lshift"
,
"__ilshift__"
),
MethodSlot
(
ibinaryfunc
,
"nb_inplace_rshift"
,
"__irshift__"
),
MethodSlot
(
ibinaryfunc
,
"nb_inplace_and"
,
"__iand__"
),
...
...
tests/run/ipow_crash_T562.pyx
View file @
490fc80e
class
IPOW
:
"""
>>> IPOW().__ipow__('a')
a
>>> x = IPOW()
>>> x **= 'z'
z
"""
def
__ipow__
(
self
,
other
):
print
(
"%s"
%
other
)
cdef
class
CrashIPOW
:
"""
>>> CrashIPOW().__ipow__('a')
a
>>> x = CrashIPOW()
>>> x **= 'z'
z
"""
def
__ipow__
(
self
,
other
,
mod
):
print
"%s, %s"
%
(
other
,
mod
)
def
__ipow__
(
self
,
other
):
print
(
"%s"
%
other
)
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