【发布时间】:2019-08-03 02:02:30
【问题描述】:
假设我有以下课程:
class myClass():
def __init__(self, number):
self.myStr = "bla"
self.myInt = number * 3
如何获取属性类型?我的意思是我想得到以下列表:['str','int']?
我也希望它在派生类上工作。
非常感谢:)
【问题讨论】:
-
为什么不
['int', 'str']? -
Pythonic 方式是here :-)
标签: python python-2.7