2010/1/31 Nick Coghlan <ncogh...@gmail.com>:
> Vitor Bosshard wrote:
>> Why not:
>>
>> foo.py
>> foo.pyc # < 2.7 or < 3.2
>> foo.27.pyc
>> foo.32.pyc
>> etc.
>>
>>
>> This is simpler and more logical than the current subfolder proposal,
>> as it is clear which version each file corresponds to. Python can use
>> all the magic values it wants, but please don't spill them over into
>> the filesystem. Readability counts.
>
> There is no one-to-one correspondence between Python version and pyc
> magic numbers. Different runtime options may change the magic number and
> different versions may reuse a magic number

Good point. Runtime options would need to change the version (e.g.
foo.25U.py), and versions that reuse magic numbers would be
redundantly written to disk. However, the underlying issue as I see it
is that the magic value is an implementation detail that should not be
exposed.

>
>> Putting the files into a separate dir also makes it much harder to
>> work with external tools; e.g. VCSes already ignore .pyc and .pyo
>> files, but not unknown directories.
>>
>> I'd rather have a folder cluttered with files I know I can ignore (and
>> can easily run a selective rm over) than one that is cluttered with
>> subfolders.
>
> It won't be cluttered with subfolders - you will have at most one .pyr
> per source .py file. Even more conveniently, many file browsers already
> list subfolders and files separately, so if you never run a version of
> Python that uses the old .pyc format you won't even get that level of
> clutter.

Since those folders would start with arbitrary characters, they'd be
intermingled with "real" subfolders, which is a terrible mess. At
least the current .pyc files are always clustered nicely right next to
their source file.


>
> That is significantly better than accumulating an unbounded number of
> different .pyc files interspersed amongst the actual source files I care
> about.

I do see your point. How about creating a single pyr folder, in which
*all* compiled files of the parent folder go, e.g.
pyr/foo.0c4f0a0d.pyc


Vitor
_______________________________________________
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

Reply via email to