[Web-SIG] WebOb
Ian Bicking
ianb at colorstudy.com
Mon Oct 22 23:39:54 CEST 2007
Adam Atlas wrote:
> On 22 Oct 2007, at 12:09, William Dode wrote:
>
>> So, don't you think web-sig should officialy support such library ?
>> Include it in the lib stantard or in a wsgiorg library ?
>>
>
> I don't really like the idea of having something like this be part of
> the standard library; it's sort of neither here nor there between low-
> level WSGI and framework territory. I don't see people using
> something like WebOb to write their applications directly (nor does
> that seem to be the intention); just like Paste, it seems more like
> something that full frameworks would incorporate and provide access to.
I am certainly not representative of a normal developer, but I have been
using it quite successfully without any framework. It also provides
most of the functionality of WebTest, a framework-neutral functional
testing tool, as another example.
> Given the principle of "there should be one, and preferably only one,
> obvious way to do it", it seems like putting this in the standard
> library would be an endorsement of it as the obvious/best way, and
> although I like the WebOb approach, I don't think there's enough of a
> consensus to bless it thus. For now, the multitude of web frameworks
> and their various philosophies is a good thing.
After actually reading the APIs of the different request objects and
summarizing the differences, I feel much less like this. All the major
frameworks (and almost all the minor frameworks) have request and
response objects with a subset of the same properties, and some slightly
different names. The only really substantial exceptions are Zope and
CherryPy that have a bunch of traversal-related properties and methods;
but even these have some parallels in WebOb.
I've also tried to avoid gratuitous incompatibilities with other
frameworks, and to allow backward compatibility through subclassing when
there are API differences. There's still some tricky details -- for
instance, Django uses a different multi-value dictionary API than WebOb
uses. Which is the kind of thing that makes me wish *some* multi-value
dictionary API existed in the standard library that could serve as a
reasonable model. But so it goes. Even there I switched around WebOb
some to be closer to Django (to prefer the last value over the first
value, when getting a single value when multiple values are available).
As for actual consensus, Pylons is committed to using it and TurboGears
by association. Jacob Kaplan-Moss and Simon Willison have expressed
specific interest in the idea for Django, though I don't think they've
had the time to analyze what that would mean specifically. Jacob
Smullyan is also using it as we've heard, and I've heard of some other
smaller/internal frameworks using it. That's not consensus, but I think
it points to the possibility of consensus.
As to the standard library, I don't know, there's a lot of issues with
its development model. WebOb, unlike a framework, actually *could*
match the kind of slow and steady progress that the standard library
has. But the stdlib might be a bad target even so.
--
Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org
: Write code, do good : http://topp.openplans.org/careers
More information about the Web-SIG
mailing list