Commit 2b1548d8 authored by Craig Citro's avatar Craig Citro

Fix for autotestdict & property not playing well together.

parent 1c9b9fba
...@@ -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,6 +83,16 @@ class AutoTestDictTransform(ScopeTrackingTransform): ...@@ -82,6 +83,16 @@ 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)
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) name = "%s.%s" % (clsname, node.entry.name)
else: else:
assert False assert False
......
...@@ -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']
......
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment