Velocity Reviews

Velocity Reviews (
-   Python (
-   -   Several __getstate__ methods (

Thomas =?ISO-8859-15?Q?G=FCttler?= 07-07-2003 01:06 PM

Several __getstate__ methods

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?


class MyClass:
def __init__(self, root)

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


All times are GMT. The time now is 12:47 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.