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
Gwenaël Samain
cython
Commits
221ef93e
Commit
221ef93e
authored
Oct 15, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Incomplete hack for autotestdict, see #387
parent
5e933a2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
Cython/Compiler/AnalysedTreeTransforms.py
Cython/Compiler/AnalysedTreeTransforms.py
+4
-0
tests/run/autotestdict.pyx
tests/run/autotestdict.pyx
+19
-1
No files found.
Cython/Compiler/AnalysedTreeTransforms.py
View file @
221ef93e
...
...
@@ -10,6 +10,8 @@ import Naming
class
AutoTestDictTransform
(
ScopeTrackingTransform
):
# Handles autotestdict directive
blacklist
=
[
'__cinit__'
,
'__dealloc__'
]
def
visit_ModuleNode
(
self
,
node
):
self
.
scope_type
=
'module'
self
.
scope_node
=
node
...
...
@@ -62,6 +64,8 @@ class AutoTestDictTransform(ScopeTrackingTransform):
parent
=
ModuleRefNode
(
pos
)
name
=
node
.
entry
.
name
elif
self
.
scope_type
in
(
'pyclass'
,
'cclass'
):
if
self
.
scope_type
==
'cclass'
and
node
.
name
in
self
.
blacklist
:
return
node
mod
=
ModuleRefNode
(
pos
)
if
self
.
scope_type
==
'pyclass'
:
clsname
=
self
.
scope_node
.
name
...
...
tests/run/autotestdict.pyx
View file @
221ef93e
...
...
@@ -61,7 +61,7 @@ class MyClass:
>>> True
True
"""
def
method
(
self
):
""">>> add_log("class method")"""
...
...
@@ -75,3 +75,21 @@ cdef class MyCdefClass:
def
method
(
self
):
""">>> add_log("cdef class method")"""
def
__cinit__
(
self
):
"""
Should not be included, as it can't be looked up with getattr
>>> True
False
"""
def
__dealloc__
(
self
):
"""
Should not be included, as it can't be looked up with getattr
>>> True
False
"""
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