CamelCase vs. all-lowercase package names

Terry Reedy tjreedy at udel.edu
Sat Feb 2 18:05:33 EST 2013


On 2/2/2013 3:03 AM, dieter wrote:
> Rhubarb Sin <rhubarbsin at gmail.com> writes:
>
>> PEP-8 calls for "short, all-lowercase names" for packages:
>>
>> http://www.python.org/dev/peps/pep-0008/#package-and-module-names
>
> This is mainly to support case insensitive file systems (and
> file systems with quite limited path length).

It also serves to differentiate a module from the main class it defines.
If file Module defines class Module, then the two possible imports
import Module
from Module import Module
make 'Module' later in the file ambiguous without referring to the top 
of the file for the import. But now, 'decimal' is the module and 
'Decimal' is the class (absent stupid renaming designed to confuse).

> With mixed case, some packages/modules may not conflict on
> a case sensitive file system but happen to conflict on a
> case insensitive file system.

-- 
Terry Jan Reedy




More information about the Python-list mailing list