Am 31.01.2010 07:18, schrieb Nick Coghlan: > Ben Finney wrote: >> Could we instead have a single subdirectory for each tree of module >> packages, keeping them tidily out of the way of the source files, while >> making them located just as deterministically:: > > Not easily. With the scheme currently proposed in the PEP, setting a > value for __file__ which is both reasonably accurate and backwards > compatible with existing file manipulation techniques is > straightforward: just use the name of the cache directory.
Not really -- much of the code I've seen that tries to guess the source file name from a __file__ value just does something like this: if fname.lower().endswith(('.pyc', '.pyo')): fname = fname[:-1] That's not compatible with using .pyr, either. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. _______________________________________________ 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