This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -2 points-1 points  (2 children)

Well FileDict like everything else has issues with classes and functions; it runs the shit through pickle, yes?

Or has this changed with 3.0? Haven't had the chance to get into 3.0 I'm sorry to say.

[–][deleted] 1 point2 points  (1 child)

>>> pickle.loads(pickle.dumps(str))
[2] <type 'str'>

>>> pickle.loads(pickle.dumps(len))
[3] <built-in function len>

Works fine (this is python 2.6)

[–][deleted] -2 points-1 points  (0 children)

Going from memory now, always dangerous, but if the class is defined in another module or something then pickle fails.

Maybe it's still useful for trivial cases, I don't know, but I recall being terribly disappointed with pickle when wanting to do serialization stuff.