从类创建实例对象后,您是否可以使用对象的 init 方法将其变量设置为新的?
前:
class Object1(Object):
def __init__(self, name, ability):
self.name = name
self.ability = ability
example1 = Object1("example", "none")
#new object created with parameters set by the __init__ method
example1.__init__("changeExample", "Changed")
#called the __init__ method on the object and changed the parameters. Is this okay to do?