[Web-SIG] Re: Pending modifications to PEP 333

Phillip J. Eby pje at telecommunity.com
Tue Aug 31 23:21:01 CEST 2004


At 07:38 PM 8/30/04 +0400, Denis S. Otkidach wrote:
>On Mon, 30 Aug 2004 09:33:14 -0400
>"Phillip J. Eby" <pje at telecommunity.com> wrote:
>
> > >Below is a class we use for headers in our framework for several years.
> > >I guess it's more comfortable than list of tuples or email.Message.
> > >Anyway, we have to fix only "must have" interface, but not all useful
> > >methods.
> >
> > Hi Denis; thanks for the input.  Unfortunately, WSGI needs to either use a
> > class/type that's available in the Python standard library, or else a
> > simple protocol like "sequence of name,value pairs".
>
>"sequence of name,value pairs" is OK - my class satisfies this interface if
>you mean just iterable object when saying "sequence", and not real list.

As it happens, the current spec is ambiguous: it says both "list" and 
"sequence" in different places.  I've standardized it to be "list", as in 
'type(headers) is ListType'.  This means your approach will require you to 
call 'list(myHeadersObject)', but it will allow middleware to manipulate 
the list in-place using boilerplate routines.



More information about the Web-SIG mailing list