How do I find out a name of class that created an instance of an object in Python if the function I am doing this from is the base class of which the class of the instance has been derived?
(如果我从中执行此操作的函数是实例的类派生的基类,如何找出在Python中创建对象实例的类的名称?)
Was thinking maybe the inspect module might have helped me out here, but it doesn't seem to give me what I want.
(想到也许检查模块可能在这里帮助了我,但它似乎没有给我我想要的东西。)
And short of parsing the __class__
member, I'm not sure how to get at this information. (如果没有解析__class__
成员,我不知道如何获取这些信息。)
ask by Dan translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…