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
e3c9a786
Commit
e3c9a786
authored
Dec 21, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make __new__ -> __cinit__ into an error, fix compiler crash.
parent
1fb5c964
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-2
No files found.
Cython/Compiler/Nodes.py
View file @
e3c9a786
...
...
@@ -1988,7 +1988,7 @@ class DefNode(FuncDefNode):
# staticmethod() was overridden - not much we can do here ...
self
.
is_staticmethod
=
False
if
self
.
name
==
'__new__'
:
if
self
.
name
==
'__new__'
and
env
.
is_py_class_scope
:
self
.
is_staticmethod
=
1
self
.
analyse_argument_types
(
env
)
...
...
Cython/Compiler/Symtab.py
View file @
e3c9a786
...
...
@@ -1561,9 +1561,8 @@ class CClassScope(ClassScope):
if
name
in
(
'__eq__'
,
'__ne__'
,
'__lt__'
,
'__gt__'
,
'__le__'
,
'__ge__'
):
error
(
pos
,
"Special method %s must be implemented via __richcmp__"
%
name
)
if
name
==
"__new__"
:
warning
(
pos
,
"__new__ method of extension type will change semantics "
error
(
pos
,
"__new__ method of extension type will change semantics "
"in a future version of Pyrex and Cython. Use __cinit__ instead."
)
name
=
EncodedString
(
"__cinit__"
)
entry
=
self
.
declare_var
(
name
,
py_object_type
,
pos
,
visibility
=
'extern'
)
special_sig
=
get_special_method_signature
(
name
)
if
special_sig
:
...
...
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