[Web-SIG] WebOb API

Ian Bicking ianb at colorstudy.com
Thu Oct 29 21:22:54 CET 2009

Hi all.

So, it's about time that WebOb came to 1.0.  For 1.0 I'd like to
settle the API as much as possible.  But I'd also like to move further
to getting WebOb used for more frameworks.  I don't expect that to
happen before 1.0, but if there are API changes that will make that
easier later, then maybe we can get those in.

While I haven't tracked ongoing changes to frameworks, I did put
together the differences I am aware of in APIs here:


Some of them are fairly trivial, and could be managed through
subclassing (e.g., req.raw_post_data vs. req.body -- semantically
identical, just different names).

Are there API changes that would help people consider WebOb for other
frameworks?  The main ones I can think of is req.FILES, separating out
file uploads from other POST fields.  Also then there's the issue of
what kind of object represents files.  The finer details of individual
objects are also important, things like the API of req.GET/req.POST
(which are views on ordered dictionaries, and are represented somewhat
differently in different frameworks).

Also I'm planning on introducing a BaseRequest (and *maybe*
BaseResponse) class, that removes some functionality.  Specifically
for Repoze they'd like to remove __getattr__ and __setattr__ (which
has some performance implications), and maybe other things are
possible (though removing writers is infeasible, IMHO, as read and
write access are not easily separated, and it would require too much
code duplication).

(Incidentally WebOb is now on bitbucket: http://bitbucket.org/ianb/webob/)

Ian Bicking  |  http://blog.ianbicking.org  |  http://topplabs.org/civichacker

More information about the Web-SIG mailing list