Brett Cannon wrote: > But what does "expected location" mean? If I am importing foo.bar > where foo.__path__ has multiple path entries, which one is supposed to > be used to set the hypothetical location of source for __file__? I > guess going with the first one would be somewhat reasonable, but it's > definitely a guess.
No, it wouldn't be a guess, it would be based on where the compiled bytecode was actually found (wherever in foo.__path__ that may have been). So __file__ would be the same regardless of whether or not the source code was actually physically present or not. __compiled__ would be set only if the code being executed was read from that file rather than from __file__. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia --------------------------------------------------------------- _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com