Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Shelve or pickle module
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Guillaume Bog  
View profile  
 More options May 17 2008, 11:14 pm
Newsgroups: comp.lang.python
From: "Guillaume Bog" <gui...@gmail.com>
Date: Sun, 18 May 2008 11:14:19 +0800
Local: Sat, May 17 2008 11:14 pm
Subject: Shelve or pickle module
Hello,

I read and re-read "Python in a Nutshell" written by Alex Martelli,
who knows what he is talking about. I'm a bit new to python and I'm
going to start doing persistence side on a project. Martelli's book
seems to tell me that I should use shelve module, but any code I
browsed is using pickle instead. Is there any reason to prefer pickle
over shelve?

Thanks,


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gabriel Genellina  
View profile  
 More options May 18 2008, 12:45 am
Newsgroups: comp.lang.python
From: "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
Date: Sun, 18 May 2008 01:45:57 -0300
Local: Sun, May 18 2008 12:45 am
Subject: Re: Shelve or pickle module
En Sun, 18 May 2008 00:14:19 -0300, Guillaume Bog <gui...@gmail.com> escribió:

> I read and re-read "Python in a Nutshell" written by Alex Martelli,
> who knows what he is talking about. I'm a bit new to python and I'm
> going to start doing persistence side on a project. Martelli's book
> seems to tell me that I should use shelve module, but any code I
> browsed is using pickle instead. Is there any reason to prefer pickle
> over shelve?

A shelve is just a persistent dictionary that uses pickle to store the objects.
If you want to store one or a few objects, using pickle directly may be easier.
Any problem you may have with pickle (nonpickleable objects, security risks) will happen with shelve too.

--
Gabriel Genellina


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ville M. Vainio  
View profile  
 More options May 18 2008, 11:54 am
Newsgroups: comp.lang.python
From: vivai...@gmail.com (Ville M. Vainio)
Date: Sun, 18 May 2008 15:54:38 GMT
Local: Sun, May 18 2008 11:54 am
Subject: Re: Shelve or pickle module

"Gabriel Genellina" <gagsl-...@yahoo.com.ar> writes:
> A shelve is just a persistent dictionary that uses pickle to store
> the objects.  If you want to store one or a few objects, using
> pickle directly may be easier.  Any problem you may have with pickle
> (nonpickleable objects, security risks) will happen with shelve too.

Shameless plug warning!

If you want to store pickles "directly" in a directory with
shelve-like dict API, you may also be interested in my "pickleshare"
module:

http://pypi.python.org/pypi/pickleshare/0.3


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google