newbie question

Jeff Shannon jeff at ccvcorp.com
Fri Feb 11 15:07:34 EST 2005


Dennis Lee Bieber wrote:
> On Thu, 10 Feb 2005 09:36:42 -0800, Jeff Shannon <jeff at ccvcorp.com>
> declaimed the following in comp.lang.python:
> 
>>And as Peter Hansen points out, none of the Python versions leave n in 
>>the same state that the C loop does, so that's one more way in which 
>>an exact translation is not really possible -- and (IMO again) further 
>>evidence that trying to do an exact translation would be 
>>ill-conceived.  Much better to consider the context in which the loop 
>>is used and do a looser, idiomatic translation.
> 
> 	Yeah, though my background tends to be one which considers loop
> indices to be loop-local, value indeterminate after exit...

Well, even though I've programmed mostly in langauges where loop 
indices to retain a determinate value after exit, I almost always 
*treat* them as loop-local -- it just seems safer that way.  But not 
everyone does so, and especially with C while loops, often the point 
is to keep adjusting the control variable until it fits the 
requirements of the next section...

Jeff Shannon
Technician/Programmer
Credit International




More information about the Python-list mailing list