How important is it to use short names for Python packages and modules?

PEP 8 says that the names of Python packages and modules should be short, as some file systems truncate long names. And I'm trying to follow Python conventions in a new project. But I really like the long, descriptive names. So I wonder how short the names should correspond to PEP 8. And does anyone really care more about this? I tend to ignore this recommendation and use longer names, thinking that this is not so important. Does anyone think this recommendation is still worth it? If so, why? And how short is short enough?

edit: Thanks for all the helpful answers. I will not worry about my names being short, since I do not think that someone will run my system on a really old computer. And if that happened, I could sometimes shorten some of the names later. But I will limit them to 32 characters. And now I understand that PEP 8 is specifically designed for the standard library, in which case the length of the name makes sense. But I think longer names will be better for the application I'm working on. I don't think there is one better answer here, so I'm going to flip a coin to help me decide.

+4
source share
4 answers

Common Python platforms support directory and file names of 32 characters or more, but I personally think that if you find yourself breaking 11 characters often, you need to rethink things.

+1
source

If you need to make sure your code works in DOS, use 8 characters .: P

Otherwise, it is a free world. But no one likes to print insanely long lines. (See Powershell = fail). Therefore, use your best judgment and be reasonable.

+2
source

The problem is with older file systems (used before Windows 95 and fat16) that do not support names larger than, for example, 32 characters (this depends on the file system). This is only a problem if your scripts should run on older computers.

+1
source

Long names simplify stupid typing errors. Any modern computer should not have problems with long file names, but choosing short descriptive names is a good practice. Abbreviations are your friend, especially if you like to know what the function does right off the bat, etc.

0
source

Source: https://habr.com/ru/post/1332993/


All Articles