Commit f7f6dd3d authored by Robert Bradshaw's avatar Robert Bradshaw

Extend property tests.

parent fd68083c
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# ticket: 264 # ticket: 264
# tag: property, decorator # tag: property, decorator
my_property = property
cdef class Prop: cdef class Prop:
""" """
>>> p = Prop() >>> p = Prop()
...@@ -17,6 +19,9 @@ cdef class Prop: ...@@ -17,6 +19,9 @@ cdef class Prop:
>>> p.prop >>> p.prop
GETTING '2' GETTING '2'
2 2
>>> p.my_prop
GETTING '2' via my_prop
2
>>> del p.prop >>> del p.prop
DELETING '2' DELETING '2'
>>> p.prop >>> p.prop
...@@ -49,3 +54,8 @@ cdef class Prop: ...@@ -49,3 +54,8 @@ cdef class Prop:
def prop(self): def prop(self):
print("DELETING '%s'" % self._value) print("DELETING '%s'" % self._value)
self._value = None self._value = None
@my_property
def my_prop(self):
print("GETTING '%s' via my_prop" % self._value)
return self._value
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