Edit: Since this question was asked a lot of improvement has happened in the standard Python scientific libraries (which was the targeted area). For example the numpy project has made a big effort to improve the docstrings. One can still argue if it would have been possible to address these issues continuously right from the start.
I have this somewhat heretic question: Why do so many Python libraries have messy code and don't follow standard best practices? Or do you think that this observation is absolutely not true? How does the situation compare to other languages? I am interested in your take on this.
Some reasons why I have the impression that quality is lacking:
The docstrings are often completely missing or incomplete, even for the public API. It is painful when a method takes
*args
and**kwargs
but does not document which values can be given.Bad Python coding practices, like adding new attributes outside of
__init__
. Things like this make the code hard to read (or to maintain).Hardly any libraries follow the PEP8 coding conventions. Sometimes the conventions are not even consistent in a single file.
The overall design is messy, with no clear API. It seems that not nearly enough refactoring is done.
Poor unittest coverage.
Don't get me wrong, I absolutely love Python and its ecosystem. And even though I struggled with these libraries they generally get the job done and I am grateful for that. But I also think that in the end tons of developer time are wasted because of these issues. Maybe that is because Python gives you so much freedom that it is very easy to write bad code.