Pickling Generators

Discussion in 'Python' started by Jenna, Oct 31, 2003.

  1. Jenna

    Jenna Guest

    Is there any work being done on pickling generators? I am just like
    every gal in the gaming community that wants to use generators as
    light weight AI threads. Are their any alternatives to generators? I
    looked at stackless python but it doesn't appear they have achieved
    serialization of their generator equivalent tasklets. (I could be
    wrong, the docs weren't clear on this issue, I'm not sure its being
    maintained anymore anyway) The promise held by serializing generators
    is so alluring that I would even consider modifying the interpreter to
    achieve it. If there is anyone working on this already I'd be happy to
    lend a hand. Any ideas/referals would be appreciated.

    Jenna
    Jenna, Oct 31, 2003
    #1
    1. Advertising

  2. Jenna:
    > I looked at stackless python but it doesn't appear they have achieved
    > serialization of their generator equivalent tasklets. (I could be
    > wrong, the docs weren't clear on this issue,


    This came up on the stackless list recently, and IIRC pickling of tasklets
    does work. There is a limitation if a uthread calls an external C library.

    > I'm not sure its being maintained anymore anyway)


    It is. If stackless looks like a good fit, it's probably worth another
    look.

    Emile van Sebille
    Emile van Sebille, Oct 31, 2003
    #2
    1. Advertising

  3. Jenna wrote:

    > Is there any work being done on pickling generators? I am just like


    Armin Rigo has a C-coded module for deep-copying generators (with
    lots of specific caveats) that may be of interest to you -- he
    posted its URL to python-dev recently, as a part of a discussion
    about _shallow-copying_ iterators (a much less ambitious issue) as
    covered in PEP 323. I think you can find his post easily in the
    python-dev archives for October 2003, he hasn't posted all that
    much recently.


    > achieve it. If there is anyone working on this already I'd be happy to
    > lend a hand. Any ideas/referals would be appreciated.


    Come over to python-dev, lobby for it (you DO have very real use
    cases, which is all Guido seems to want to hear about these days:),
    and particularly with your being willing to lend a hand you stand
    a chance. For Python 2.4, of course -- 2.3 is featurefrozenforever --
    but as you did mention that a modified interpreter is OK for you,
    you'll surely be able to snapshot 2.4 once this is done and/or turn
    whatever changes to it are needed into a patch for 2.3.

    Christian Tismer's "stackless" may prove easier to tweak this way --
    sorry, no real idea; you should ask about that on the stackless ML,
    as I don't think Christian is reading c.l.py these days.


    Alex
    Alex Martelli, Oct 31, 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. Jonathan Hayward

    Help pickling across sockets

    Jonathan Hayward, Aug 17, 2003, in forum: Python
    Replies:
    0
    Views:
    306
    Jonathan Hayward
    Aug 17, 2003
  2. Jonathan Hayward

    PS: Help pickling across sockets

    Jonathan Hayward, Aug 17, 2003, in forum: Python
    Replies:
    1
    Views:
    323
    Irmen de Jong
    Aug 17, 2003
  3. Bob
    Replies:
    1
    Views:
    338
    Martin v. =?iso-8859-15?q?L=F6wis?=
    Sep 11, 2003
  4. Thomas Guettler

    Pickling object inherited from dict

    Thomas Guettler, Oct 27, 2003, in forum: Python
    Replies:
    1
    Views:
    284
    Thomas Guettler
    Oct 28, 2003
  5. Thomas Guettler

    Pickling Objects inherited from dict (Bug?)

    Thomas Guettler, Nov 5, 2003, in forum: Python
    Replies:
    1
    Views:
    286
    Michael Hudson
    Nov 5, 2003
Loading...

Share This Page