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 | ncoghlan at gmail.com | Brisbane, Australia ---------------------------------------------------------------
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4