[Python-ideas] My objections to implicit package directories

Chris Rebert pyideas at rebertia.com
Wed Mar 21 04:13:07 CET 2012


On Tue, Mar 20, 2012 at 10:42 AM, Terry Reedy <tjreedy at udel.edu> wrote:
> On 3/20/2012 11:49 AM, Ronald Oussoren wrote:
>> On 13 Mar, 2012, at 9:15, Guido van Rossum wrote:
>>> I think it comes down to this: I really, really, really hate
>>> directories with a suffix. I'd like to point out that the suffix
>>> is also introducing a backwards incompatibility: everybody will
>>> have to teach their tools, IDEs, and brains about .pyp
>>> directories,
>>
>> Directories with a suffix have the advantage that you could teach
>> GUIs to treat them differently, filemanagers could for example show a
>> ".pyp" directory as a folder with a python logo just like ".py"
>> files are shown as documents with a python logo.
>>
>> With the implicit approach it is much harder to recognize python
>> packages as such without detailed knowledge about the import
>> algorithm and python search path.
>
> Package directories are files and can be imported to make modules. I think
> it would have been nice to use .pyp from the beginning. It would make Python
> easier to learn. Also, 'import x' would mean simply mean "Search sys.path
> directories for a file named 'x.py*', with no need for either the importer
> (or human reader) to look within directories for the magic __init__.py file.
> Sorting a directory listing by extension would sort all packages together.

Your file manager views directories as having filename extensions?
Mine sure doesn't.

Cheers,
Chris



More information about the Python-ideas mailing list