我一直无法让 python 生成(非预定)数量的类实例。基本上有类能够自我复制。
class foo:
def __init__(self, name):
self.name = name
while True:
newinstance(foo) #what would the code be for this?
#or maybe
foo.newinstance #just something that could update itself
基本上生成一个新实例任意次数。提前谢谢。