RE: How to memoize functions?

Discussion in 'Python' started by sismex01@hebmex.com, Jun 27, 2003.

  1. Guest

    > From: Chris Reedy [mailto:]
    > Sent: Viernes, 27 de Junio de 2003 09:19 a.m.
    >
    > That's true. Unfortunately, that misses the other half of the
    > problem (which, admittedly, I didn't mention) which is that I
    > would also like to be able to collect the results of the function,
    > which could be complex data structures, as well as the arguments
    > (which could be other instances of the same complex structures).
    >
    > Chris
    >


    So how do you wish to memoize, if you wish for the
    results (which are gonna get cached) to be collected?

    Is this a long running process? If it's not, then
    I'd say to cache the results which take more than X
    seconds to calculate and forget about having the
    results collected.

    Or, use a shelf instead of a dictionary.

    -gustavo

    Advertencia:La informacion contenida en este mensaje es confidencial y
    restringida, por lo tanto esta destinada unicamente para el uso de la
    persona arriba indicada, se le notifica que esta prohibida la difusion de
    este mensaje. Si ha recibido este mensaje por error, o si hay problemas en
    la transmision, favor de comunicarse con el remitente. Gracias.
    , Jun 27, 2003
    #1
    1. Advertising

  2. Roy Smith Guest

    In article <>,
    wrote:

    > Or, use a shelf instead of a dictionary.


    What's a shelf?
    Roy Smith, Jun 27, 2003
    #2
    1. Advertising

  3. Aahz Guest

    In article <>,
    Roy Smith <> wrote:
    >In article <>,
    > wrote:
    >>
    >> Or, use a shelf instead of a dictionary.

    >
    >What's a shelf?


    It's a layer on top of a Berkeley database. See the shelve module docs.
    --
    Aahz () <*> http://www.pythoncraft.com/

    Usenet is not a democracy. It is a weird cross between an anarchy and a
    dictatorship.
    Aahz, Jun 27, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Reedy

    How to memoize functions?

    Chris Reedy, Jun 26, 2003, in forum: Python
    Replies:
    3
    Views:
    987
    Chris Reedy
    Jun 27, 2003
  2. Replies:
    0
    Views:
    649
  3. Michael Hohn
    Replies:
    3
    Views:
    1,099
    Dima Dorfman
    Oct 31, 2004
  4. Replies:
    11
    Views:
    621
    Gabriel Genellina
    Aug 19, 2006
  5. thebjorn
    Replies:
    4
    Views:
    310
    Michele Simionato
    Dec 20, 2007
Loading...

Share This Page