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
2b1548d8
Commit
2b1548d8
authored
Mar 09, 2010
by
Craig Citro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for autotestdict & property not playing well together.
parent
1c9b9fba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
Cython/Compiler/AnalysedTreeTransforms.py
Cython/Compiler/AnalysedTreeTransforms.py
+12
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
tests/run/extpropertyref.pyx
tests/run/extpropertyref.pyx
+5
-0
No files found.
Cython/Compiler/AnalysedTreeTransforms.py
View file @
2b1548d8
...
@@ -6,6 +6,7 @@ from PyrexTypes import py_object_type
...
@@ -6,6 +6,7 @@ from PyrexTypes import py_object_type
from
Builtin
import
dict_type
from
Builtin
import
dict_type
from
StringEncoding
import
EncodedString
from
StringEncoding
import
EncodedString
import
Naming
import
Naming
import
Symtab
class
AutoTestDictTransform
(
ScopeTrackingTransform
):
class
AutoTestDictTransform
(
ScopeTrackingTransform
):
# Handles autotestdict directive
# Handles autotestdict directive
...
@@ -82,7 +83,17 @@ class AutoTestDictTransform(ScopeTrackingTransform):
...
@@ -82,7 +83,17 @@ class AutoTestDictTransform(ScopeTrackingTransform):
type
=
py_object_type
,
type
=
py_object_type
,
is_py_attr
=
True
,
is_py_attr
=
True
,
is_temp
=
True
)
is_temp
=
True
)
name
=
"%s.%s"
%
(
clsname
,
node
.
entry
.
name
)
if
isinstance
(
node
.
entry
.
scope
,
Symtab
.
PropertyScope
):
new_node
=
AttributeNode
(
pos
,
obj
=
parent
,
attribute
=
node
.
entry
.
scope
.
name
,
type
=
py_object_type
,
is_py_attr
=
True
,
is_temp
=
True
)
parent
=
new_node
name
=
"%s.%s.%s"
%
(
clsname
,
node
.
entry
.
scope
.
name
,
node
.
entry
.
name
)
else
:
name
=
"%s.%s"
%
(
clsname
,
node
.
entry
.
name
)
else
:
else
:
assert
False
assert
False
getfunc
=
AttributeNode
(
pos
,
obj
=
parent
,
getfunc
=
AttributeNode
(
pos
,
obj
=
parent
,
...
...
Cython/Compiler/Nodes.py
View file @
2b1548d8
...
@@ -1726,7 +1726,7 @@ class PyArgDeclNode(Node):
...
@@ -1726,7 +1726,7 @@ class PyArgDeclNode(Node):
class
DecoratorNode
(
Node
):
class
DecoratorNode
(
Node
):
# A decorator
# A decorator
#
#
# decorator NameNode or CallNode
# decorator NameNode or CallNode
or AttributeNode
child_attrs
=
[
'decorator'
]
child_attrs
=
[
'decorator'
]
...
...
tests/run/extpropertyref.pyx
View file @
2b1548d8
...
@@ -3,12 +3,17 @@ cdef class Spam:
...
@@ -3,12 +3,17 @@ cdef class Spam:
property
eggs
:
property
eggs
:
def
__get__
(
self
):
def
__get__
(
self
):
"""
This is the docstring for Spam.eggs.__get__
"""
return
42
return
42
def
tomato
():
def
tomato
():
"""
"""
>>> tomato()
>>> tomato()
42
42
>>> sorted(__test__.keys())
[u'Spam.eggs.__get__ (line 5)', u'tomato (line 11)']
"""
"""
cdef
Spam
spam
cdef
Spam
spam
cdef
object
lettuce
cdef
object
lettuce
...
...
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