[Python-Dev] PEP 257 and __init__
Terry Reedy
tjreedy at udel.edu
Tue Dec 29 16:32:06 EST 2015
More information about the Python-Dev mailing list
Tue Dec 29 16:32:06 EST 2015
- Previous message (by thread): [Python-Dev] PEP 257 and __init__
- Next message (by thread): [Python-Dev] subprocess check_output
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12/29/2015 2:40 PM, Fred Drake wrote: > On Tue, Dec 29, 2015 at 1:27 PM, Facundo Batista > <facundobatista at gmail.com> wrote: >> I was reading PEP 257 and it says that all public methods from a class >> (including __init__) should have a docstring. >> >> Why __init__? >> >> It's behaviour is well defined (inits the instance), and the >> initialization parameters should be described in the class' docstring >> itself, right? > > __init__ is not always the only constructor for a class; each > constructor's arguments should be documented as part of the > constructor. I agree. >>> help(Someclass) first gives the class docstring, which should explain what the class is about, and then each method, with signature and docstring. The explanation of signatures for __new__, __init__, and any other constructor methods should follow the name and signature of the method. -- Terry Jan Reedy
- Previous message (by thread): [Python-Dev] PEP 257 and __init__
- Next message (by thread): [Python-Dev] subprocess check_output
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list