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
e46c93f1
Commit
e46c93f1
authored
Feb 18, 2011
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emulate del with set to None.
parent
2651a5d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+10
-8
No files found.
Cython/Compiler/ExprNodes.py
View file @
e46c93f1
...
...
@@ -1674,20 +1674,22 @@ class NameNode(AtomicExprNode):
def
generate_deletion_code
(
self
,
code
):
if
self
.
entry
is
None
:
return
# There was an error earlier
if
not
self
.
entry
.
is_pyglobal
:
error
(
self
.
pos
,
"Deletion of local or C global name not supported"
)
return
if
self
.
entry
.
is_pyclass_attr
:
elif
self
.
entry
.
is_pyglobal
:
code
.
put_error_if_neg
(
self
.
pos
,
'__Pyx_DelAttrString(%s, "%s")'
%
(
Naming
.
module_cname
,
self
.
entry
.
name
))
elif
self
.
entry
.
is_pyclass_attr
:
namespace
=
self
.
entry
.
scope
.
namespace_cname
code
.
put_error_if_neg
(
self
.
pos
,
'PyMapping_DelItemString(%s, "%s")'
%
(
namespace
,
self
.
entry
.
name
))
elif
self
.
entry
.
type
.
is_pyobject
:
# Fake it until we can do it for real...
self
.
generate_assignment_code
(
NoneNode
(
self
.
pos
),
code
)
else
:
code
.
put_error_if_neg
(
self
.
pos
,
'__Pyx_DelAttrString(%s, "%s")'
%
(
Naming
.
module_cname
,
self
.
entry
.
name
))
error
(
self
.
pos
,
"Deletion of C names not supported"
)
def
annotate
(
self
,
code
):
if
hasattr
(
self
,
'is_called'
)
and
self
.
is_called
:
...
...
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