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
60a1e44a
Commit
60a1e44a
authored
Apr 26, 2020
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove an unused method argument and avoid shadowing the 'type' builtin.
parent
1f8044c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+10
-10
No files found.
Cython/Compiler/ModuleNode.py
View file @
60a1e44a
...
@@ -1322,7 +1322,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1322,7 +1322,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self
.
generate_method_table
(
scope
,
code
)
self
.
generate_method_table
(
scope
,
code
)
self
.
generate_getset_table
(
scope
,
code
)
self
.
generate_getset_table
(
scope
,
code
)
code
.
putln
(
"#if CYTHON_COMPILING_IN_LIMITED_API"
)
code
.
putln
(
"#if CYTHON_COMPILING_IN_LIMITED_API"
)
self
.
generate_typeobj_spec
(
full_module_name
,
entry
,
code
)
self
.
generate_typeobj_spec
(
entry
,
code
)
code
.
putln
(
"#else"
)
code
.
putln
(
"#else"
)
self
.
generate_typeobj_definition
(
full_module_name
,
entry
,
code
)
self
.
generate_typeobj_definition
(
full_module_name
,
entry
,
code
)
code
.
putln
(
"#endif"
)
code
.
putln
(
"#endif"
)
...
@@ -2228,26 +2228,26 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -2228,26 +2228,26 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
code
.
putln
(
"}"
)
"}"
)
def
generate_typeobj_spec
(
self
,
modname
,
entry
,
code
):
def
generate_typeobj_spec
(
self
,
entry
,
code
):
type
=
entry
.
type
ext_
type
=
entry
.
type
scope
=
type
.
scope
scope
=
ext_
type
.
scope
code
.
putln
(
"static PyType_Slot %s_slots[] = {"
%
type
.
typeobj_cname
)
code
.
putln
(
"static PyType_Slot %s_slots[] = {"
%
ext_
type
.
typeobj_cname
)
for
slot
in
TypeSlots
.
slot_table
:
for
slot
in
TypeSlots
.
slot_table
:
slot
.
generate_spec
(
scope
,
code
)
slot
.
generate_spec
(
scope
,
code
)
code
.
putln
(
"{0, 0},"
)
code
.
putln
(
"{0, 0},"
)
code
.
putln
(
"};"
)
code
.
putln
(
"};"
)
if
type
.
typedef_flag
:
if
ext_
type
.
typedef_flag
:
objstruct
=
type
.
objstruct_cname
objstruct
=
ext_
type
.
objstruct_cname
else
:
else
:
objstruct
=
"struct %s"
%
type
.
objstruct_cname
objstruct
=
"struct %s"
%
ext_
type
.
objstruct_cname
classname
=
scope
.
class_name
.
as_c_string_literal
()
classname
=
scope
.
class_name
.
as_c_string_literal
()
code
.
putln
(
"static PyType_Spec %s_spec = {"
%
type
.
typeobj_cname
)
code
.
putln
(
"static PyType_Spec %s_spec = {"
%
ext_
type
.
typeobj_cname
)
code
.
putln
(
'"%s.%s",'
%
(
self
.
full_module_name
,
classname
.
replace
(
'"'
,
''
)))
code
.
putln
(
'"%s.%s",'
%
(
self
.
full_module_name
,
classname
.
replace
(
'"'
,
''
)))
code
.
putln
(
"sizeof(%s),"
%
objstruct
)
code
.
putln
(
"sizeof(%s),"
%
objstruct
)
code
.
putln
(
"0,"
)
code
.
putln
(
"0,"
)
code
.
putln
(
"%s,"
%
TypeSlots
.
get_slot_by_name
(
"tp_flags"
).
slot_code
(
scope
))
code
.
putln
(
"%s,"
%
TypeSlots
.
get_slot_by_name
(
"tp_flags"
).
slot_code
(
scope
))
code
.
putln
(
"%s_slots,"
%
type
.
typeobj_cname
)
code
.
putln
(
"%s_slots,"
%
ext_
type
.
typeobj_cname
)
code
.
putln
(
"};"
)
code
.
putln
(
"};"
)
def
generate_typeobj_definition
(
self
,
modname
,
entry
,
code
):
def
generate_typeobj_definition
(
self
,
modname
,
entry
,
code
):
...
...
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