Variable name has a typo, but code still works. Why?

2006-05-31 Thread mateus
print hello world I have a nested loop where the outer loop iterates over key value pairs of a dictionary and the inner loop iterates over a list each list of which is a mapped value from the dictionary def showReport(self): for dev, sessions in self.logger.items(): for

Re: Variable name has a typo, but code still works. Why?

2006-05-31 Thread mateus
mateus wrote: print hello world I have a nested loop where the outer loop iterates over key value pairs of a dictionary and the inner loop iterates over a list each list of which is a mapped value from the dictionary def showReport(self): for dev, sessions in

Re: Variable name has a typo, but code still works. Why?

2006-05-31 Thread hwiechers
mateus wrote: print hello world I have a nested loop where the outer loop iterates over key value pairs of a dictionary and the inner loop iterates over a list each list of which is a mapped value from the dictionary def showReport(self): for dev, sessions in

Re: Variable name has a typo, but code still works. Why?

2006-05-31 Thread Tim N. van der Leeuw
Hi Mateus, We'd need to see more code then just this snippet. It looks like the name 'session' is used elsewhere in the code, and is in scope for the showReport() method. But without seeing a bit more code of this class, and possibly global variables / code, it's not possible to say this.

Re: Variable name has a typo, but code still works. Why?

2006-05-31 Thread Max M
mateus wrote: print hello world I have a nested loop where the outer loop iterates over key value pairs of a dictionary and the inner loop iterates over a list each list of which is a mapped value from the dictionary def showReport(self): for dev, sessions in

Re: Variable name has a typo, but code still works. Why?

2006-05-31 Thread Max Erickson
mateus [EMAIL PROTECTED] wrote: print hello world I have a nested loop where the outer loop iterates over key value pairs of a dictionary and the inner loop iterates over a list each list of which is a mapped value from the dictionary def showReport(self): for dev, sessions

Re: Variable name has a typo, but code still works. Why?

2006-05-31 Thread mateus
Well, one by one I checked for the presence of both sessions and session in the globals dictionary (within showReport(), but outside of the loops). Neither one of them existed previously, thus and I received the exception about them not being found: File

Re: Variable name has a typo, but code still works. Why?

2006-05-31 Thread BartlebyScrivener
I can only assume that there was some type of cache problem. Could it have been in the .pyc? I thought that was recompiled every time a .py is run/set to be interpreted. If you are on Windows, check your PATHEXT environment variable and make sure that .py is listed ahead of .pyc and any