Revision e9d57bc0-dcb0-4512-9e8b-6f5b9adfc53b - Stack Overflow

It shouldn't be necessary to recreate the SimpleClass object each time, as some are suggesting, if you're simply using it to output data based on its attributes. However, you're not actually creating an instance of the class; you're simply creating a reference to the class object itself. Therefore, you're adding a reference to the same class attribute to the list (instead of instance attribute), over and over.

Instead of:

 x = SimpleClass

you need:

 x = SimpleClass()

AltStyle によって変換されたページ (->オリジナル) /