On Jul 21, 5:20 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> On Jul 21, 12:08 pm, castironpi <[EMAIL PROTECTED]> wrote:
>
> > Some time ago, I was asking about the feasibility of a persistent
> > deque, a double-ended queue.
>
> > It runs into the typic
On Jul 21, 12:08 pm, castironpi <[EMAIL PROTECTED]> wrote:
> Some time ago, I was asking about the feasibility of a persistent
> deque, a double-ended queue.
>
> It runs into the typical space allocation problems.
Try starting with a dict-based implementation of a double-
On 2008-07-21 21:08, castironpi wrote:
Some time ago, I was asking about the feasibility of a persistent
deque, a double-ended queue.
You might want to have a look at mxBeeBase:
http://www.egenix.com/products/python/mxBase/mxBeeBase/
Using the integer index you could probably write an on
castironpi wrote:
Some time ago, I was asking about the feasibility of a persistent
deque, a double-ended queue.
It runs into the typical space allocation problems. If you're storing
a pickle, you have to allocate and fragment the file you've opened,
since pickles can be varia
Some time ago, I was asking about the feasibility of a persistent
deque, a double-ended queue.
It runs into the typical space allocation problems. If you're storing
a pickle, you have to allocate and fragment the file you've opened,
since pickles can be variable-length strings; i.e.
En Thu, 22 May 2008 12:20:56 -0300, inhahe <[EMAIL PROTECTED]> escribió:
> I thought about the fact that a decorator is merely syntactic sugar, so it
> shouldn't have any closure magic that I can't make myself, and I realized
> that I could have done it the following way:
>
> def makefunc(func):
>
"inhahe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> 4. can someone tell me if the way i'm using the decorator is sane? i've
> never used decorators before. it just seems ridiculous to a) define a
> lambda that just throws away the parameter, and b) define a meaningless
>
something randomly made me realize why my second solution didn't work, so i
fixed it. now you have a working persistent deque.
1. if you call somepdequeobject.load(filename) (as opposed to
pdeque.load(filename)), do you want it to return a new object that it loaded
from file, or do you
>
> i don't know how i would get around the problem, though, because i'd have
> to know how to access the deque object that my class stores when i do
> deque.__init__ in my constructor, so that i could pickle it and my class
> variables separately.
>
>
i decided i could just pickle deque(self),
oh yeah! thanks for pointing it out, i should have thought of that, i
*just* read about it today, or was it yesterday.
so what's the problem with pickle? i have a feeling, maybe i read it, that
when you pickle a derived class it pickles it as a member of the base class,
is that it?
i don't k
inhahe wrote:
def __init__(self, filename, initial):
should be
def __init__(self, filename, initial=[]):
(that was the whole reason i put the filename first.)
sorry.
Defaulting initial to empty list this way is asking for trouble. You should
default it to None and check for None and
def __init__(self, filename, initial):
should be
def __init__(self, filename, initial=[]):
(that was the whole reason i put the filename first.)
sorry.
--
http://mail.python.org/mailman/listinfo/python-list
"castironpi" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'd like a persistent deque, such that the instance operations all
> commit atomicly to file system.
ok, i made your persistent deque. but there are two important notes
regarding this module
I'd like a persistent deque, such that the instance operations all
commit atomicly to file system.
--
http://mail.python.org/mailman/listinfo/python-list
14 matches
Mail list logo