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

Top Page
Author: limodou
Date:  
To: Ian Bicking
CC: paste-users
Subject: Re: [Paste] Is there a get() in MultiDict?
On Mon, Jun 23, 2008 at 9:09 AM, Ian Bicking <ianb@???> wrote:

> 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.
>
> Oh, I see, thank you.


-- 
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
UliSpot <<UliPad Snippets>>: http://ulipad.appspot.com
UliWeb <<simple web framework>>: http://uliwebproject.appspot.com
My Blog: (new)http://http://hi.baidu.com/limodou (old)
http://www.donews.net/limodou
_______________________________________________
Paste-users mailing list
Paste-users@???
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users