<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>RE: [Web-SIG] Proposal: Avoiding Serialization When Stacking Middleware</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Ian Bicking wrote:<BR>
&gt; This proposal gives a strategy for avoiding unnecessary<BR>
&gt; serialization and deserialization of request and response<BR>
&gt; bodies.&nbsp; It does so by attaching attributes to ``wsgi.input``<BR>
&gt; and the ``app_iter``, as well as a new environment key<BR>
&gt; ``x-wsgiorg.want_parsed_response``.<BR>
&gt;<BR>
&gt; [snip]<BR>
&gt;<BR>
&gt; for item in app_iter:<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; written_output.append(item)<BR>
<BR>
This bit of the example, at least, is not compliant with PEP 333:<BR>
<A HREF="http://www.python.org/dev/peps/pep-0333/#middleware-handling-of-block-boundaries">http://www.python.org/dev/peps/pep-0333/#middleware-handling-of-block-boundaries</A><BR>
<BR>
&quot;To put this requirement another way, a middleware component<BR>
must yield at least one value each time its underlying<BR>
application yields a value. If the middleware cannot yield<BR>
any other value, it must yield an empty string.&quot;<BR>
<BR>
I suspect rewriting the example to conform to PEP 333 will make this proposal much more complex?<BR>
<BR>
<BR>
Robert Brewer<BR>
System Architect<BR>
Amor Ministries<BR>
fumanchu@amor.org</FONT>
</P>

</BODY>
</HTML>