I know that this could be dismissed as opinion-based, but googling isn't finding the resources I was hoping for, and I am looking for links to any established and agreed best practices in the Python community.
I am an intermediate Python programmer in an organization with a pretty terrible history of writing obfuscated code in every language ever invented. I would really like to set an example of good programming styles and practices. To that end, I am following PEP 8, running pylint on everything I write, and thinking deeply about each of its suggestions rather than simply dismissing them. I have broken up longer, complex methods into shorter ones, in part due to its advice. I also write detailed docstrings following this style: http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
One challenge for me is that, while I am not the only Python programmer in my organization, I seem to be the only one who takes any of this stuff seriously, and my colleagues don't seem to mind undocumented, repetitive code with naming that doesn't follow any particular schema, for example. So I don't think getting them to review my code or learning from them is my best option.
I just got my first "Too many lines in module" message from pylint. I am not done writing the module - I wanted to add at least one more class and several methods to the existing classes. I know that the idea is that a module should "do one thing" but that "thing" is not yet fully implemented.
Here are some statistics that pylint gives me:
+---------+-------+-----------+-----------+------------+---------+
|type |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module |1 |1 |= |100.00 |0.00 |
+---------+-------+-----------+-----------+------------+---------+
|class |3 |3 |= |100.00 |0.00 |
+---------+-------+-----------+-----------+------------+---------+
|method |27 |27 |= |100.00 |0.00 |
+---------+-------+-----------+-----------+------------+---------+
|function |2 |2 |= |100.00 |0.00 |
+---------+-------+-----------+-----------+------------+---------+
+----------+-------+------+---------+-----------+
|type |number |% |previous |difference |
+==========+=======+======+=========+===========+
|code |266 |24.98 |266 |= |
+----------+-------+------+---------+-----------+
|docstring |747 |70.14 |747 |= |
+----------+-------+------+---------+-----------+
|comment |41 |3.85 |41 |= |
+----------+-------+------+---------+-----------+
|empty |11 |1.03 |11 |= |
+----------+-------+------+---------+-----------+
I really don't think that 266 lines of code is too many for a module. My docstrings are 75% of the lines in the module - is this standard? My docstrings are pretty repetitive, since my methods are smallish operations on data. Each docstring will tend to state, for example, that one argument is a pandas dataframe and list the required and optional columns of the dataframe with their meanings, and that is repeated in each method or function that does anything to the dataframe.
Is there some sort of systematic error that it seems I might be making here? Are there guidelines for what to read in order to improve my code? Are my docstrings too long? Is there such a thing as a too-long docstring? Should I simply disable the pylint module-too-long message and get on with my life?