[Python-Dev] PEP 257 and __init__
Andrew Barnert
abarnert at yahoo.com
Tue Dec 29 18:41:58 EST 2015
On Dec 29, 2015, at 13:03, Facundo Batista <facundobatista at gmail.com> wrote:
>
>> On Tue, Dec 29, 2015 at 4:38 PM, Andrew Barnert <abarnert at yahoo.com> wrote:
>> I usually just don't bother. You can violate PEP 257 when it makes sense, just like PEP 8. They're just guidelines, not iron-clad rules.
>
> Yeap, but pep257 (the tool [0]) complains for __init__, and wanted to
> know how serious was it.
Of course. It's telling you that you're not following the standard, which is correct. It's also expected in this case, and if you think you have a good reason for breaking from the standard, that's perfectly fine. You probably want to configure the tool to meet your own standards. (I've worked on multiple projects that used custom pep8 configurations. I haven't used pep257 as much, but I believe I've seen configurations for the slightly different conventions of scientific/numerical programming and Django programming, so presumably coming up with your own configuration shouldn't be too hard--don't require docstrings on __init__, or on all special methods, or only when there no __new__, or whatever.)
More information about the Python-Dev
mailing list