Pickling Generators

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jenna

    Pickling Generators

    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
  • Emile van Sebille

    #2
    Re: Pickling Generators

    Jenna:[color=blue]
    > 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,[/color]

    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.
    [color=blue]
    > I'm not sure its being maintained anymore anyway)[/color]

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

    Emile van Sebille
    emile@fenx.com


    Comment

    • Alex Martelli

      #3
      Re: Pickling Generators

      Jenna wrote:
      [color=blue]
      > Is there any work being done on pickling generators? I am just like[/color]

      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.

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

      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 featurefrozenfo rever --
      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

      Comment

      Working...