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
f7f6dd3d
Commit
f7f6dd3d
authored
Apr 06, 2016
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend property tests.
parent
fd68083c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
tests/run/cdef_class_property_decorator_T264.pyx
tests/run/cdef_class_property_decorator_T264.pyx
+10
-0
No files found.
tests/run/cdef_class_property_decorator_T264.pyx
View file @
f7f6dd3d
...
@@ -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
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