2 cents on file objects... WAS: RE: [Web-SIG] Bill's comments on WSGI draft 1.4

Michael C. Neel neel at mediapulse.com
Thu Sep 2 15:55:48 CEST 2004


On Thu, 2004-09-02 at 09:31, Phillip J. Eby wrote:

> Sorry, I've read through the above a few times and I haven't been able to 
> figure out exactly what it is that you're proposing, or if you're proposing 
> something at all.  :(

Sorry, I guess i'm not clear, but I was making a case for file objects
based upon my past use of them.

> These sentences seem diametrically opposed to me; choice and flexibility is 
> precisely what we *don't* want in WSGI, as it dramatically increases the 
> opportunity for breaking interoperability.  Right now, it's still possible 
> to write "dirt simple" implementations, because the requirements are 
> minimal even though there are some options for improved performance.

At the risk of angering a mob; what's on the table isn't perl level of
'there is more than one way to do it'; it's a object that supports two
interfaces.  Python's standard lib is full of objects that are
file-like, so I don't even see this as something that is a stretch from
the norm.

> There's a *big* difference between an option and a choice.  Choices double 
> the work for everybody, while options only affect people who want to use 
> them.  To the greatest extent possible, we should eliminate choices, and 
> keep the number of options reasonable.  (For example, a few revisions ago, 
> we dropped the "choice" of not returning an iterable.)

Again, I don't see how this is alot of work or enough work that it
prevents anyone from using it.  The WSGI can simple state that the
return can be used both as a file object and an iterable (which isn't
that a bit redundant, I'll have to check but file objects are iterable
correct?)

I think this is the only issue over the PEP, at least the only major one
from the amount of posts.  Allowing both interfaces would be acceptable
I think here, and solves the problem.  Also, this is just a pre-PEP on a
SIG atm; from PEPs I've followed in the past things are going to get
worse when it's before the python community, and you'll really want the
support of your SIG to help keep your sanity though the process, lol.

Mike



More information about the Web-SIG mailing list