Steve Holden wrote:
> Paul Rubin wrote:
>> ....  I think it's a Python weakness that you can't declare a local var like
>> in other languages, to go out of scope at the end of the current block, e.g.:
>>
>>   if cond:
>>       my x = 7    # make a new scope for x, goes out of scope at end of if
>>
> If this genuinely troubles you then you can always isolate the scope 
> with a function, though of course you also no longer have the code 
> inline then.
Or, if you must:

def called(function):
     function()
     return called

then:

@called
def called():
     <whatever>

;-)

-- 
-Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to