📄 testgenerateproperties2.py
字号:
class A(object):
def __init__(self, anAttribute):
self.anAttribute = anAttribute
print "Initializing A"
anAttribute = "hello"
def myMethod(self):
print self.anAttribute
a = A()
a.myMethod()
##c
'''
<config>
<classSelection>0</classSelection>
<attributeSelection>
<int>0</int>
</attributeSelection>
<methodOffsetStrategy>2</methodOffsetStrategy>
<propertyOffsetStrategy>4</propertyOffsetStrategy>
<methodSelection>
<int>1</int>
<int>2</int>
</methodSelection>
<accessModifier>1</accessModifier>
</config>
'''
##r
class A(object):
def setAnAttribute(self, value):
self.__anAttribute = value
def delAnAttribute(self):
del self.__anAttribute
def __init__(self, anAttribute):
self.anAttribute = anAttribute
print "Initializing A"
anAttribute = "hello"
def myMethod(self):
print self.anAttribute
anAttribute = property(None, setAnAttribute, delAnAttribute, None)
a = A()
a.myMethod()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -