updated from Atlas
This commit is contained in:
23
19-dyn-attr-prop/doc_property.py
Normal file
23
19-dyn-attr-prop/doc_property.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Example of property documentation
|
||||
|
||||
>>> f = Foo()
|
||||
>>> f.bar = 77
|
||||
>>> f.bar
|
||||
77
|
||||
>>> Foo.bar.__doc__
|
||||
'The bar attribute'
|
||||
"""
|
||||
|
||||
# BEGIN DOC_PROPERTY
|
||||
class Foo:
|
||||
|
||||
@property
|
||||
def bar(self):
|
||||
'''The bar attribute'''
|
||||
return self.__dict__['bar']
|
||||
|
||||
@bar.setter
|
||||
def bar(self, value):
|
||||
self.__dict__['bar'] = value
|
||||
# END DOC_PROPERTY
|
||||
Reference in New Issue
Block a user