Re: [Paste] Is there a get() in MultiDict?

Top Page
Author: Ian Bicking
Date:  
To: limodou
CC: paste-users
Subject: Re: [Paste] Is there a get() in MultiDict?
limodou wrote:
> I've used webob in my project uliweb, and I think it's wonderful.
>
> When I was using it, I found there is no get() of MultiDict, so if I
> missed it?
>
> I implemented one myself, the code is simple:
>
> def get(self, key, default=None):
> for k, v in self._items:
> if key == k:
> return v
> return default
>
> So I think it's handly when you don't want to process an excpetion if
> there is no key existed.


It works for me. It should inherit that method from DictMixin.

-- 
Ian Bicking : ianb@??? : http://blog.ianbicking.org

_______________________________________________
Paste-users mailing list
Paste-users@???
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users