473,756 Members | 8,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Discovery of unpickleables in class heirarchies.

I've a need to pickle arbitrary class hierarchies, which, luckily, can
be made to conform to the pickle protocol. At the moment, however, I'm
having a rather hard time discovering which classes in a heirarchy
cannot be pickles. For instance, say class A has class B in it's
__dict__ and let class B have a file handler in its __dict__. When I
call cPickle.dumps(A ) UnpickleableErr or will be raised when B's file
handler is reached, but the error will only report being unable to
pickle the file handler, saying nothing of B or A. I wouldn't expect
cPickle to do that, but I do need to know somehow that class B has
failed to pickle properly.

To that end I've quickly hacked out a class that, ideally, will take
an object that I'm attempting to pickle and, if the pickling does not
succeed, recurse through the class heirarchy collecting information on
which objects were not pickled. It is here: http://deadbeefbabe.org/paste/5218
The output, for the above example would be:

<type 'A'>
<type 'B'>
<type 'file'>

However, it seems to be taking a rather long time. Perhaps my class
heirarchies are too deep, or my recursion is flawed. Can anyone see a
bug in my code, or have a better way of discovering this information
altogether?

Jun 22 '07 #1
0 930

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1468
by: Anurag | last post by:
Hi, I understand that the dbm cfg parameter "DISCOVER" controls whether Search or Known discovery is applicable. Additionally, Search discovery provides a superset of Known discovery. I completely understand the scenario where SEARCH is applicable and where KNOWN is applicable. My question is very basic: >From a server's perspective, what extra is being done at the server to support SEARCH discovery? Are some extra proceeses / threads...
0
2366
by: Joe Goeke | last post by:
The bluetooth stack that comes with XP SP2 has a couple of nice wizard interfaces for device discovery and pairing. I am looking to create my own wizards to do similar tasks and wanted to interface programmatically with the stack. I also found the Bluetooth API in the MSDN platform SDK. However, there isn't any example code, and my C/C++ skills are not that strong. I was hoping to create a C# class to interface with this stack in just...
6
1722
by: jason | last post by:
hello everyone, is there any way in C# to perform dynamic property discovery? i know such a thing was possible in C++ template code, but it was kind of an ugly mess. i'm just curious if there is a way to do such a thing in C#, not suggesting that C# should be able to do things that C++ did (no need to start any wars here) for example, if i have:
3
1119
by: Tim Mavers | last post by:
I am looking for a control (freeware or commercial) that operates like a standard ASP.NET dropdown list, but is able to display heirarchies in the actual dropdown list. This can be similar to a treecontrol, but I don't need to be able to expand/collapse nodes in the actual dropdown list--only have them appear indented. Thanks,
0
1311
by: serge calderara | last post by:
Dear all, Let say that I have developped a web service which is host on Server1. Then one of my customer will like to used that service in its own web site which is not based on .NET platform. As far as I have understand I need to proceed as follow : - Create a proxy class with WSDL.exe tool - I can then compile that class in an aseembly then my customer can add a reference to that assembly in its own page, or directly implemented the...
6
1538
by: razael1 | last post by:
Does anyone know of a good article dealing with organizing large class heirarchies? I've always had trouble with circular dependencies, global constants and variables, etc. Thanks.
4
1721
by: ddtl | last post by:
Hello everybody. Consider the following code: class A(object): def met(self): print 'A.met' class B(A): def met(self):
7
3821
by: Chris Mullins | last post by:
I'm in the process of building a number of (Web) Services using .NET 3.0 and WCF. These services are intended to be deployed within the Intranet of a very, very large orginization. I need to have a discovery process by which applications can discover these services. What I really would like to avoid is static URL's scattered throughout configuration files, and I'm willing to write a fair bit of code to achieve this goal. I had...
0
1231
by: news.microsoft.com | last post by:
Hey All, Sorry to post to several groups but wasn't sure which development group would be best for the question. I was wondering if there are any developers out there that have significant electronic discovery experience and are familiar with the OutIndex E-Discovery tool? If so, I was wondering if there are any good competing tools and,
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10040
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.