Ich habe versucht, 2 Instanzen für s1 und s2 zu erstellen, aber der Speicher wird zweimal geschrieben. ich:Speicher in 1 Instanz überschreiben statt 2
Out of the World
Book: Decision Procedure
=========================================
Out of the World
Book: Decision Procedure
instead of
Out of the World
=========================================
Book: Decision Procedure
How is this so?
ich eine Klasse wie folgt erstellt:
class domain_monitor:
name = '';
tasks = [];
Ich begann im Anschluss an die Instanzen als bevölkern:
s1 = domain_monitor();
s1.name = "s1";
s1.tasks.append("Out of the World");
s2 = domain_monitor();
s2.name = "s2";
s2.tasks.append("Book: Decision Procedure");
ich die Ausgabe wie folgt drucken:
for v in s1.tasks: #
print v
print " ========================================= "
for v in s2.tasks: #
print v