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
51a31d88
Commit
51a31d88
authored
Nov 01, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make overridable a type-level property, now overriding functions must agree
parent
7f291b65
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
+7
-4
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+4
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
51a31d88
...
...
@@ -1550,7 +1550,7 @@ class SimpleCallNode(ExprNode):
result
=
"%s(%s)"
%
(
self
.
function
.
result_code
,
join
(
arg_list_code
,
","
))
if
self
.
wrapper_call
or
\
self
.
function
.
entry
.
is_unbound_cmethod
and
self
.
function
.
entry
.
is_overridable
:
self
.
function
.
entry
.
is_unbound_cmethod
and
self
.
function
.
entry
.
type
.
is_overridable
:
result
=
"(%s = 1, %s)"
%
(
Naming
.
skip_dispatch_cname
,
result
)
return
result
...
...
@@ -1770,7 +1770,6 @@ class AttributeNode(ExprNode):
ubcm_entry
.
is_cfunction
=
1
ubcm_entry
.
func_cname
=
entry
.
func_cname
ubcm_entry
.
is_unbound_cmethod
=
1
ubcm_entry
.
is_overridable
=
entry
.
is_overridable
self
.
mutate_into_name_node
(
env
,
ubcm_entry
,
None
)
return
1
return
0
...
...
Cython/Compiler/Nodes.py
View file @
51a31d88
...
...
@@ -761,6 +761,7 @@ class CFuncDefNode(FuncDefNode):
# may be different if we're overriding a C method inherited
# from the base type of an extension type.
self
.
type
=
type
type
.
is_overridable
=
self
.
overridable
name
=
name_declarator
.
name
cname
=
name_declarator
.
cname
self
.
entry
=
env
.
declare_cfunction
(
...
...
@@ -768,7 +769,6 @@ class CFuncDefNode(FuncDefNode):
cname
=
cname
,
visibility
=
self
.
visibility
,
defining
=
self
.
body
is
not
None
,
api
=
self
.
api
)
self
.
entry
.
is_overridable
=
self
.
overridable
self
.
return_type
=
type
.
return_type
if
self
.
overridable
:
...
...
Cython/Compiler/PyrexTypes.py
View file @
51a31d88
...
...
@@ -535,7 +535,7 @@ class CFuncType(CType):
def
__init__
(
self
,
return_type
,
args
,
has_varargs
=
0
,
exception_value
=
None
,
exception_check
=
0
,
calling_convention
=
""
,
nogil
=
0
,
with_gil
=
0
):
nogil
=
0
,
with_gil
=
0
,
is_overridable
=
0
):
self
.
return_type
=
return_type
self
.
args
=
args
self
.
has_varargs
=
has_varargs
...
...
@@ -544,6 +544,7 @@ class CFuncType(CType):
self
.
calling_convention
=
calling_convention
self
.
nogil
=
nogil
self
.
with_gil
=
with_gil
self
.
is_overridable
=
is_overridable
def
__repr__
(
self
):
arg_reprs
=
map
(
repr
,
self
.
args
)
...
...
@@ -572,6 +573,8 @@ class CFuncType(CType):
return
1
if
not
other_type
.
is_cfunction
:
return
0
if
self
.
is_overridable
!=
other_type
.
is_overridable
:
return
0
nargs
=
len
(
self
.
args
)
if
nargs
<>
len
(
other_type
.
args
):
return
0
...
...
Cython/Compiler/Symtab.py
View file @
51a31d88
...
...
@@ -109,6 +109,7 @@ class Entry:
defined_in_pxd
=
0
api
=
0
utility_code
=
None
is_overridable
=
0
def
__init__
(
self
,
name
,
cname
,
type
,
pos
=
None
,
init
=
None
):
self
.
name
=
name
...
...
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