[Python-ideas] A Continuations Compromise in Python

Greg Ewing greg.ewing at canterbury.ac.nz
Tue May 5 03:11:20 CEST 2009


John Graham wrote:

> I believe it would be used for state that is not transferred via the
> URL, such as a user's session with the server should some sort of
> persistence take place.

In that case you have a stateful server rather
than a stateless one.

But I still don't see how the proposed "continue"
statement would help, because you don't want to
call the continuation *now*, you want to defer
it until later. So you still need to store it
somewhere or return it to a trampoline.

Seems to me a better structure for this would
be to represent the session by an instance of a
class, with methods corresponding to the various
queries that can be sent. Then you've got much
the same situation as with the stateless server,
except that the mapping from query string to
function goes through an intermediates step of
locating the appropriate session object, based
on a session id in the query. Still no need
for continuations anywhere.

-- 
Greg



More information about the Python-ideas mailing list