Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 02:20 AM
Philippe C. Martin
Guest
 
Posts: n/a
Default Extracting pickle from Python

Hi,

How would one go about extracting the pickle module from Python (ex: to make
a .a or a .dll) ?

Thanks

Philippe


  #2  
Old July 19th, 2005, 02:20 AM
Martin v. Löwis
Guest
 
Posts: n/a
Default Re: Extracting pickle from Python

Philippe C. Martin wrote:[color=blue]
> How would one go about extracting the pickle module from Python (ex: to make
> a .a or a .dll) ?[/color]

Pickle relies heavily on Python, so you most likely have to take the
rest of Python as well when trying to integrate pickle elsewhere?

Are you looking for pickle or cPickle? pickle.py is written in Python,
so you need a full Python interpreter to run it. cPickle is written
in C, so you could go away with less than a full interpreter, but
it still calls a lot of Python interpreter functions.

To integrate a Python interpreter, see the "Embedding and Extending"
manual, in particular the "embedding" part. Essentially, you need to
link with pythonxy.dll/libpythonxy.a.

If you want a Python-free implementation of pickle, you best rewrite
it yourself. The core of pickle is fairly easy. The tricky part is
the extensibility: During unpickling, arbitrary Python functions can
be invoked to reconstruct objects, and arbitrary classes can be
instantiated, so you need to emulate constructors for all types
that may be present in your pickle files.

Regards,
Martin
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles