小编SUB*_*ERO的帖子

如果删除包含另一个对象的对象会发生什么?

如果我有

class MyClass:
    def __init__(self, object):
        self.object = object
some_other_object = SomeOtherObject()
myclass = MyClass(some_other_object)
del myclass
Run Code Online (Sandbox Code Playgroud)

会发生什么some_other_object?也会被删吗?

python

2
推荐指数
1
解决办法
54
查看次数

标签 统计

python ×1