On 07-03-11 17:38, Rogerio Luz wrote:
import sys
import pickle
class MyClass:
teste = 0
nome = None
lista = ["default"]
def __init__(self):
for reg in range(1,10):
self.lista.append(reg)
^^
This probably doesn't do w
Chris
2011/3/7 Rogério Luz
> Chris, Thanks a lot for your explanation, I got it
>
> class MyClass:
> #class variables
>
> teste = 0
> nome = None
> lista = ["default"]
>
> def __init__(self):
> #instance variables
> self.lista = MyClass.lista # if I still wa
On Mon, Mar 7, 2011 at 8:38 AM, Rogerio Luz wrote:
> Hi All
>
> I'd like to pickle an object instance with all values. So I
> instanciate myClass and set some values including a list with more
> values (in the __init__), then dump to file. I realized that the
> pickled object don't saved my new li
Hi All
I'd like to pickle an object instance with all values. So I
instanciate myClass and set some values including a list with more
values (in the __init__), then dump to file. I realized that the
pickled object don't saved my new list values (saved only the
"default" value) but saved a String a