On Feb 03, 2010, at 01:07 PM, Antoine Pitrou wrote:
>Well, I don't think we need another transition... Just keep __file__ for the
>source file, and add a __cache__ or __compiled__ attribute for the compiled
>Since there might be several compiled files for a single source file (for
>example, a .pyc along with a JITted native .so), __cache__ should probably be
>a tuple rather than a string.
I'm going to call the attribute __cached__ and leave its contents
implementation defined. For CPython it will be the path to the pyc file if it
exists (or was written), or the path to where the pyc file /would/ exist if
the source lives on a read-only file system or -B/$PYTHONDONTWRITEBYTECODE is
For alternative implementations of Python that compose modules from multiple
sources, __cached__ can be a tuple.