is this faster than web.py's Storage?
On Tue, Sep 9, 2008 at 9:40 PM, Berwyn Hoyt <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> Just for your interest, I worked up a clever (if I may say so myself) but
> obscure alternative to web.py's storage facility:
>
> >>> class storage(dict):
> ... def __new__(cls, *args, **kwargs):
> ... self = dict.__new__(cls, *args, **kwargs)
> ... self.__dict__ = self
> ... return self
> ...
> >>> k=storage(a=3)
> >>> k
> {'a': 3}
> >>> k.b=4
> >>> k
> {'a': 3, 'b': 4}
> >>>
>
> --
>
> *Berwyn Hoyt,* *Senior Hardware Engineer:* [EMAIL PROTECTED]
> *Ph: *+64 3 359 2101; *Mobile:* +64 21 045 7830
> *Brush Technology: *www.brush.co.nz
>
> --
> Berwyn Hoyt, *Electronics & Engineering* -- Brush Technology
> *Ph:* +64 3 359 2101 *Mobile:* +64 21 045 7830
> *Web:* brush.co.nz *Email:* [EMAIL PROTECTED]
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---