Peter Hansen wrote:

> I thought of that one, of course, but it can't cause exactly the trouble 
> you describe above.  If there's a .py in the same folder as the .pyc, it 
> will not use the .pyc unless the timestamp encoded in it matches the one 
> on the .py file (which, unless you go to extraordinary lengths, will 
> never screw you up that way).
> 
> On the other hand, if there was a .pyc in the current directory when you 
> run it with "python cbfindfiles.py", but no cbfindfiles.py in the same 
> folder, it will run the local one and not the .py which might be 
> elsewhere, in your PATH.  Any chance there are cbfindfiles.py* files in 
> other folders or have you been doing this all from the same folder?

You missed the other option: if PATHEXT has .pyc in front of .py then you 
get exactly the described behaviour.

Of course that leaves open the question why anyone would want to put .pyc 
into PATHEXT.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to