scikit-learn/scikit-learn — pull request #3892 by mrshu (2014-11-26 22:29:44+00:00)
Title: DOC: COSMIT: Naive Bayes long url + PEP8 cleanup

* Put long link to IR-book on its own line to make sure it renders as a
correct link in the docs.

* Put long ValueError messages that were breaking PEP8 compliance of
the file `naive_bayes.py` into temporary variables.

Signed-off-by: mr.Shu

-------------

This pull request might not be necessary at all, but at least the change on line 572 is pretty important to me. It took me a while to realize what the URL should be by looking in here (http://scikit-learn.org/dev/modules/generated/sklearn.naive_bayes.MultinomialNB.html#sklearn.naive_bayes.MultinomialNB) and I also think this is just not right and shouldn't be left like that.

I understand that this breaks PEP8 (especially the line length rule) and there are ways how to get around that (http://stackoverflow.com/questions/14414878/how-do-i-break-a-link-in-a-rst-docstring-to-satisfy-pep8) but I believe this is precisely the case in which the following from the original PEP8 document applies:

> But most importantly: know when to be inconsistent -- sometimes the style guide just doesn't apply. When in doubt, use your best judgment. Look at other examples and decide what looks best. And don't hesitate to ask!
> Two good reasons to break a particular rule:
> - When applying the rule would make the code less readable, even for someone who is used to reading code that follows the rules.