Why use "locals()"

Chris Colbert sccolbert at gmail.com
Mon Sep 14 02:58:04 EDT 2009


Given that python is devoid of types: "Is the variable 'a' an int or a
float at runtime?", explicit can only be taken so far.

Personally, I use locals() when I work with Django.


On Mon, Sep 14, 2009 at 7:42 AM, Sean DiZazzo <half.italian at gmail.com> wrote:
>> If you are willing to open your mind to the possibility that some
>> Pythonic things don't adhere to every Zen, then I would suggest that
>> Gabrielle's examples are perfectly Pythonic shortcuts.  But if you
>> don't want to use them, you don't have to, nobody is forcing you.
>
> It's a pretty small domain, but I see the use (and the Pythonicity).
>
> Thanks all for your advice.
>
> ~Sean
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list