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
2895952e
Commit
2895952e
authored
May 16, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
class names are identifiers, too
parent
eaa1722e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+9
-6
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
2895952e
...
...
@@ -2423,11 +2423,10 @@ class ClassNode(ExprNode):
# doc ExprNode or None Doc string
# module_name string Name of defining module
subexprs
=
[
'
name'
,
'
bases'
,
'doc'
]
subexprs
=
[
'bases'
,
'doc'
]
def
analyse_types
(
self
,
env
):
self
.
name
.
analyse_types
(
env
)
self
.
name
=
self
.
name
.
coerce_to_pyobject
(
env
)
self
.
cname
=
env
.
intern_identifier
(
self
.
name
)
self
.
bases
.
analyse_types
(
env
)
if
self
.
doc
:
self
.
doc
.
analyse_types
(
env
)
...
...
@@ -2436,7 +2435,7 @@ class ClassNode(ExprNode):
self
.
type
=
py_object_type
self
.
is_temp
=
1
env
.
use_utility_code
(
create_class_utility_code
);
def
generate_result_code
(
self
,
code
):
if
self
.
doc
:
code
.
put_error_if_neg
(
self
.
pos
,
...
...
@@ -2448,7 +2447,7 @@ class ClassNode(ExprNode):
self
.
result_code
,
self
.
bases
.
py_result
(),
self
.
dict
.
py_result
(),
self
.
name
.
py_result
()
,
self
.
cname
,
self
.
module_name
,
code
.
error_goto_if_null
(
self
.
result_code
,
self
.
pos
)))
...
...
@@ -4022,7 +4021,11 @@ static PyObject *__Pyx_CreateClass(
PyObject *py_modname;
PyObject *result = 0;
#if PY_MAJOR_VERSION < 3
py_modname = PyString_FromString(modname);
#else
py_modname = PyUnicode_FromString(modname);
#endif
if (!py_modname)
goto bad;
if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
...
...
Cython/Compiler/Nodes.py
View file @
2895952e
...
...
@@ -1967,8 +1967,7 @@ class PyClassDefNode(StatNode, BlockNode):
doc_node
=
ExprNodes
.
StringNode
(
pos
,
value
=
doc
)
else
:
doc_node
=
None
self
.
classobj
=
ExprNodes
.
ClassNode
(
pos
,
name
=
ExprNodes
.
StringNode
(
pos
,
value
=
name
),
self
.
classobj
=
ExprNodes
.
ClassNode
(
pos
,
name
=
name
,
bases
=
bases
,
dict
=
self
.
dict
,
doc
=
doc_node
)
self
.
target
=
ExprNodes
.
NameNode
(
pos
,
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