diff options
Diffstat (limited to 'tests/basics/builtin_property.py')
-rw-r--r-- | tests/basics/builtin_property.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/basics/builtin_property.py b/tests/basics/builtin_property.py index 4df9842a3..3b3b32d16 100644 --- a/tests/basics/builtin_property.py +++ b/tests/basics/builtin_property.py @@ -76,3 +76,20 @@ print(c.x) c.x = 6 print(c.x) del c.x + +# a property that has no get, set or del +class D: + prop = property() +d = D() +try: + d.prop +except AttributeError: + print('AttributeError') +try: + d.prop = 1 +except AttributeError: + print('AttributeError') +try: + del d.prop +except AttributeError: + print('AttributeError') |