An empty object with dynamic attributes (expando)

dmtr dchichkov at gmail.com
Thu Jun 10 21:25:13 EDT 2010


On Jun 9, 7:31 pm, a... at pythoncraft.com (Aahz) wrote:
> dmtr  <dchich... at gmail.com> wrote:
>
> >>>> m = lambda:expando
> >>>> m.myattr = 1
> >>>> print m.myattr
> >1
>
> That's a *great* technique if your goal is to confuse people.
> --

Yeah. But it is kinda cute. Let's hope it won't get adapted
(adopted ;).

-- Dmitry



More information about the Python-list mailing list