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
69cd1c34
Commit
69cd1c34
authored
Apr 13, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #684: del in Python class scope
parent
38aca14c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
+6
-7
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+5
-5
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-1
tests/bugs.txt
tests/bugs.txt
+0
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
69cd1c34
...
...
@@ -1682,17 +1682,17 @@ class NameNode(AtomicExprNode):
def
generate_deletion_code
(
self
,
code
):
if
self
.
entry
is
None
:
return
# There was an error earlier
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
.
is_pyglobal
:
code
.
put_error_if_neg
(
self
.
pos
,
'__Pyx_DelAttrString(%s, "%s")'
%
(
Naming
.
module_cname
,
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
)
...
...
Cython/Compiler/Symtab.py
View file @
69cd1c34
...
...
@@ -1490,7 +1490,7 @@ class PyClassScope(ClassScope):
# Add an entry for a class attribute.
entry
=
Scope
.
declare_var
(
self
,
name
,
type
,
pos
,
cname
=
cname
,
visibility
=
visibility
,
api
=
api
,
is_cdef
=
is_cdef
)
entry
.
is_pyglobal
=
1
entry
.
is_pyglobal
=
1
# FIXME: WTF?
entry
.
is_pyclass_attr
=
1
return
entry
...
...
tests/bugs.txt
View file @
69cd1c34
...
...
@@ -19,7 +19,6 @@ for_from_pyvar_loop_T601
decorators_T593
temp_sideeffects_T654
class_scope_T671
class_scope_del_T684
# CPython regression tests that don't current work:
pyregr.test_threadsignals
...
...
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