[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: Use cases for del
From:       Peter Hansen <peter () engcorp ! com>
Date:       2005-07-07 22:11:09
Message-ID: bNOdnT-8vI_CNVDfRVn-2Q () powergate ! ca
[Download RAW message or body]

Duncan Booth wrote:
> Peter Hansen wrote:
>>Tom Anderson wrote:
>>>How about just getting rid of del? 
>>
>>Arguing the case for del: how would I, in doing automated testing, 
>>ensure that I've returned everything to a "clean" starting point in all 
>>cases if I can't delete variables?  Sometimes a global is the simplest 
>>way to do something... how do I delete a global if not with "del".
> 
> I generally find that unit tests force me to structure the code in a 
> cleaner manner, e.g. to not use globals as much, but if you do need to 
> delete a global you do it in exactly the same way as you delete anything: 
> use the "del" statement:

Umm: huh?  Tom suggested getting rid of del, I suggested it was required 
for some cases in doing testing in the fact of globals (for cases where 
they are the simplest approach), then you suggest that the correct 
approach is to use "del".

Well, I agree (including your point on use of globals, which I attempted 
to anticipate with my comment starting "sometimes"), but I don't really 
see the point of your posting, Duncan...  it appears redundant on all 
counts.

-Peter
-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic