468,136 Members | 1,438 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,136 developers. It's quick & easy.

Several __getstate__ methods

Hi!

I use ZODB3. I want to pickle parts
of my database and import it on a different system.

Since, as far as I know, ZODB uses the __getstate__ method
for pickling the objects.

For my export, I want to ignore some parts of my objects.

If I will change __getstate__ I am in trouble because Zope
uses it.

Using a global variable in __getstate__ to see if I am in
"zope-getstate" or "my-export getstate" mode is dangerous, since
the application is multithreaded.

I thought about using a dict which holds the variable for each thread.

What other solutions are possible?
Example:

class MyClass:
def __init__(self, root)
self.root=root

I want to ignore the reference to root, since I want to import the
object into a new root.
thomas

Jul 18 '05 #1
0 1764

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by D E | last post: by
reply views Thread by George Sakkis | last post: by
3 posts views Thread by Wiktor Zychla | last post: by
9 posts views Thread by eitan | last post: by
6 posts views Thread by =?ISO-8859-1?Q?Une_B=E9vue?= | last post: by
27 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.