Details
-
Type:
RFC
-
Status: Implemented
-
Resolution: Done
-
Component/s: DM
-
Labels:None
Description
Ending Python module files with .py is sufficiently established in the broader Python community that it's just noise to repeat it in our own developer guide (unlike C++, there are not multiple competing extensions).
Ending Python script files with .py is not as well-established, but I believe it's actually a minor anti-pattern, as it exposes an implementation detail (the language the script is written in) to a caller who shouldn't care. And while it's unlikely that most of our scripts will ever be in a language other than Python, we should not make that more difficult for no reason.
At the same time, we already have many scripts that already end in .py, and establishing a rule that says they shouldn't have a suffix could result in exactly the sort of churn we want to avoid: DM has a well-established history of not being able to avoid churning existing code to meet new standards when the standards change.
I therefore propose that we drop mention of suffixes for Python files from the developer guide entirely. The new butler and pipetask commands do not have a .py suffix (will will continue to if this RFC is accepted), and are already slated to replace all of the .py-ending CmdLineTasks; I think that will make the future consistent enough.
I will rather vote to mention that while ending scripts in .py is not prohibited, it's discouraged. To make clear what's our preference. And rather keep MUST have .py ending for modules.