what's wrong with "lambda x : print x/60,x%60"
Steve Holden
steve at holdenweb.com
Wed Dec 7 05:12:35 EST 2005
Steven D'Aprano wrote:
[...]
> All joking aside, when I have names (temporary variables or scaffolding
> functions) that I need to initialise a module or data structure, but then
> outlive their usefulness, I del the name afterwards. Am I the only one? I
> can't say I've seen anyone else doing that, and it feels icky to me (for
> no reason I can put my finger on) -- what do others think?
>
I don't generally speaking see the point: unless the name is referencing
something potentially large (like the results of a database query) and
won't be going out of scope soon (which typically happens at the end of
the current method or function) I just leave it to happen automatically.
If it doesn't happen (because the name exists at module scope) thwn what
the heck.
You must be some kind of Python neatnik! If I need the external
appearance of a module to be tidy I just use __all__.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
More information about the Python-list
mailing list