On Fri, Oct 30, 2009 at 12:32 PM, Jonathan Vanasco
<[email protected]> wrote:
>> Are there API changes that would help people consider WebOb for other
> frameworks?
>
> Personally, I don't like the default behavior of how
> request.params.get/post handles the multidict -- in that it returns
> ONE by default.  that drove me crazy trying to figure out how posted
> arrays were supported, and I nearly dropped using pylons because the
> getall behavior was completely hidden in the documentation at that
> point.
>
> i'd honestly like to see get() listed for deprecation, and just have
> getone and getall.

It's based on the dictionary API.  get basically means:

def get(self, key, default=None):
    if key in self:
        return self[key]
    else:
        return default

So it makes sense based on that.  In some other frameworks I worked
with places where you would get a single value or a list depending on
how many values were passed in, and I found it generally less
productive, so multidict acts like a flat single-value dictionary
unless you use something specific (like getall).

There's no standard API I really know of for a dict-view over a list.
There's an ordered dict in Python now, but it's single-value, so it
has no real API over a normal dictionary.

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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to