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
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):
...
@@ -1674,20 +1674,22 @@ class NameNode(AtomicExprNode):
def
generate_deletion_code
(
self
,
code
):
def
generate_deletion_code
(
self
,
code
):
if
self
.
entry
is
None
:
if
self
.
entry
is
None
:
return
# There was an error earlier
return
# There was an error earlier
if
not
self
.
entry
.
is_pyglobal
:
elif
self
.
entry
.
is_pyglobal
:
error
(
self
.
pos
,
"Deletion of local or C global name not supported"
)
code
.
put_error_if_neg
(
self
.
pos
,
return
'__Pyx_DelAttrString(%s, "%s")'
%
(
if
self
.
entry
.
is_pyclass_attr
:
Naming
.
module_cname
,
self
.
entry
.
name
))
elif
self
.
entry
.
is_pyclass_attr
:
namespace
=
self
.
entry
.
scope
.
namespace_cname
namespace
=
self
.
entry
.
scope
.
namespace_cname
code
.
put_error_if_neg
(
self
.
pos
,
code
.
put_error_if_neg
(
self
.
pos
,
'PyMapping_DelItemString(%s, "%s")'
%
(
'PyMapping_DelItemString(%s, "%s")'
%
(
namespace
,
namespace
,
self
.
entry
.
name
))
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
:
else
:
code
.
put_error_if_neg
(
self
.
pos
,
error
(
self
.
pos
,
"Deletion of C names not supported"
)
'__Pyx_DelAttrString(%s, "%s")'
%
(
Naming
.
module_cname
,
self
.
entry
.
name
))
def
annotate
(
self
,
code
):
def
annotate
(
self
,
code
):
if
hasattr
(
self
,
'is_called'
)
and
self
.
is_called
:
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