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
Boxiang Sun
cython
Commits
5c5ab3ad
Commit
5c5ab3ad
authored
Oct 11, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow inheritance from Python numeric types.
parent
becd5ce7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+5
-1
No files found.
Cython/Compiler/Nodes.py
View file @
5c5ab3ad
...
@@ -4591,13 +4591,17 @@ class CClassDefNode(ClassDefNode):
...
@@ -4591,13 +4591,17 @@ class CClassDefNode(ClassDefNode):
if
self
.
bases
.
args
:
if
self
.
bases
.
args
:
base
=
self
.
bases
.
args
[
0
]
base
=
self
.
bases
.
args
[
0
]
base_type
=
base
.
analyse_as_type
(
env
)
base_type
=
base
.
analyse_as_type
(
env
)
if
base_type
in
(
PyrexTypes
.
c_int_type
,
PyrexTypes
.
c_long_type
,
PyrexTypes
.
c_float_type
):
# Use the Python rather than C variant of these types.
base_type
=
env
.
lookup
(
str
(
base_type
)).
type
if
base_type
is
None
:
if
base_type
is
None
:
error
(
base
.
pos
,
"First base of '%s' is not an extension type"
%
self
.
class_name
)
error
(
base
.
pos
,
"First base of '%s' is not an extension type"
%
self
.
class_name
)
elif
base_type
==
PyrexTypes
.
py_object_type
:
elif
base_type
==
PyrexTypes
.
py_object_type
:
base_class_scope
=
None
base_class_scope
=
None
elif
not
base_type
.
is_extension_type
and
\
elif
not
base_type
.
is_extension_type
and
\
not
(
base_type
.
is_builtin_type
and
base_type
.
objstruct_cname
):
not
(
base_type
.
is_builtin_type
and
base_type
.
objstruct_cname
):
error
(
base
.
pos
,
"'%s' is not an extension type"
%
base_type
.
name
)
print
(
base_type
,
base_type
.
is_builtin_type
)
error
(
base
.
pos
,
"'%s' is not an extension type"
%
base_type
)
elif
not
base_type
.
is_complete
():
elif
not
base_type
.
is_complete
():
error
(
base
.
pos
,
"Base class '%s' of type '%s' is incomplete"
%
(
error
(
base
.
pos
,
"Base class '%s' of type '%s' is incomplete"
%
(
base_type
.
name
,
self
.
class_name
))
base_type
.
name
,
self
.
class_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