That sounds extreme. I've never heard this before. Why?
That sounds extreme. I've never heard this before. Why?
def my_very_very_very_very_very_long_function_name(self,
param1,
param2): def my_very_very_very_very_very_long_function_name(
self, param1, param2):
... def my_very_very_very_very_very_long_function_name(
self, param1,
param2):
pass
Shrug. Seems okay to me, and preferable to what they say no to. def my_very_very_very_very_very_long_function_name(
self,
param1,
param2,
):
do_it() # function body here. func some_name(
arg: Type,
arg2: Type
) -> RetVal {
…
}The main ones that get me are the whitespace (4 characters) and restrictive line length (79 characters) rules. They don't work well together, and also don't work well with python's significant whitespace (can't easily break up a line), namespaces, generator expressions, and type hints. All for a subjective formatting decision.
I'll also often see people trying to cram as much as they can into 79 characters with one letter variable names and such while calling that elegant code because it's a "one-liner."
To be honest it says right at the beginning of PEP-8 that "A Foolish Consistency is the Hobgoblin of Little Minds" but it seems little minds are the norm (and usage of 'pep8' package to make developers do what a computer could do faster and better)
> This document gives coding conventions for the Python code comprising the standard library in the main Python distribution.
If you are not writing Python's stdlib, you are free to not to stick to it.
If in doubt, the next section of the document is helpfully titled "A Foolish Consistency is the Hobgoblin of Little Minds".