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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
a503f162
Commit
a503f162
authored
Dec 31, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
673e8007
01d8cb4f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
+48
-0
CHANGES.rst
CHANGES.rst
+3
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+22
-0
tests/run/ooo_base_classes.pyx
tests/run/ooo_base_classes.pyx
+23
-0
No files found.
CHANGES.rst
View file @
a503f162
...
@@ -84,6 +84,9 @@ Bugs fixed
...
@@ -84,6 +84,9 @@ Bugs fixed
generates a 'default' clause to avoid C compiler warnings about
generates a 'default' clause to avoid C compiler warnings about
unmatched enum values.
unmatched enum values.
* Fixed a bug where class hierarchies declared out-of-order could result
in broken generated code.
* Fixed a bug which prevented overriding const methods of C++ classes.
* Fixed a bug which prevented overriding const methods of C++ classes.
Other changes
Other changes
...
...
Cython/Compiler/Nodes.py
View file @
a503f162
...
@@ -25,6 +25,7 @@ from Code import UtilityCode
...
@@ -25,6 +25,7 @@ from Code import UtilityCode
from
StringEncoding
import
EncodedString
,
escape_byte_string
,
split_string_literal
from
StringEncoding
import
EncodedString
,
escape_byte_string
,
split_string_literal
import
Options
import
Options
import
DebugFlags
import
DebugFlags
from
Cython.Utils
import
cached_function
absolute_path_length
=
0
absolute_path_length
=
0
...
@@ -378,7 +379,25 @@ class StatListNode(Node):
...
@@ -378,7 +379,25 @@ class StatListNode(Node):
def
analyse_declarations
(
self
,
env
):
def
analyse_declarations
(
self
,
env
):
#print "StatListNode.analyse_declarations" ###
#print "StatListNode.analyse_declarations" ###
base_classes
=
{}
for
stat
in
self
.
stats
:
for
stat
in
self
.
stats
:
if
isinstance
(
stat
,
CClassDefNode
)
and
not
stat
.
base_class_module
:
base_classes
[
stat
.
class_name
]
=
stat
.
base_class_name
@
cached_function
def
depth
(
class_name
):
base_class
=
base_classes
.
get
(
class_name
)
if
class_name
is
None
:
return
0
else
:
return
depth
(
base_class
)
+
1
keyed_stats
=
[]
for
ix
,
stat
in
enumerate
(
self
.
stats
):
if
isinstance
(
stat
,
CClassDefNode
):
key
=
20
,
depth
(
stat
.
class_name
),
ix
else
:
key
=
10
,
ix
keyed_stats
.
append
((
key
,
stat
))
for
key
,
stat
in
sorted
(
keyed_stats
):
stat
.
analyse_declarations
(
env
)
stat
.
analyse_declarations
(
env
)
def
analyse_expressions
(
self
,
env
):
def
analyse_expressions
(
self
,
env
):
...
@@ -2955,6 +2974,9 @@ class DefNodeWrapper(FuncDefNode):
...
@@ -2955,6 +2974,9 @@ class DefNodeWrapper(FuncDefNode):
if
not
arg
.
type
.
is_pyobject
:
if
not
arg
.
type
.
is_pyobject
:
if
not
arg
.
type
.
create_from_py_utility_code
(
env
):
if
not
arg
.
type
.
create_from_py_utility_code
(
env
):
pass
# will fail later
pass
# will fail later
elif
arg
.
hdr_type
and
not
arg
.
hdr_type
.
is_pyobject
:
if
not
arg
.
hdr_type
.
create_to_py_utility_code
(
env
):
pass
# will fail later
def
signature_has_nongeneric_args
(
self
):
def
signature_has_nongeneric_args
(
self
):
argcount
=
len
(
self
.
args
)
argcount
=
len
(
self
.
args
)
...
...
tests/run/ooo_base_classes.pyx
0 → 100644
View file @
a503f162
cdef
class
B
(
A
):
cpdef
foo
(
self
):
"""
>>> B().foo()
B
"""
print
"B"
cdef
class
A
(
object
):
cpdef
foo
(
self
):
"""
>>> A().foo()
A
"""
print
"A"
cdef
class
C
(
A
):
cpdef
foo
(
self
):
"""
>>> C().foo()
C
"""
print
"C"
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