what's wrong with "lambda x : print x/60,x%60"

Steven D'Aprano steve at REMOVETHIScyber.com.au
Wed Dec 7 04:42:26 EST 2005


On Tue, 06 Dec 2005 00:33:17 +0100, Fredrik Lundh wrote:

> Sybren Stuvel wrote:
> 
>> def somefunc(x): return x*5
>>
>> How is that a multi-line function definition?
> 
> but that's namespace pollution! if you do this, nobody will never ever be
> able to use the name somefunc again! won't somebody please think about
> the children!

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?



-- 
Steven.




More information about the Python-list mailing list