Pickling Generators

J

Jenna

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
 
E

Emile van Sebille

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
(e-mail address removed)
 
A

Alex Martelli

Jenna said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top