Python Documentation Standards

C

Colin J. Williams

Doc strings provide us with a great opportunity to illuminate our code.

In the example below, __init__ refers us to the class's documentation,
but the class doc doesn't help much.

Are there any guideline which cover such things?

PEP 8 <http://www.python.org/doc/peps/pep-0008/> has general advice.
PEP 257 <http://www.python.org/doc/peps/pep-0257/> provides more
detailed advice.

list provides a trivial example because it is very well documented
elsewhere but it does provide a template for others.

Colin W.

Colin W.
 
S

Steven Bethard

Colin said:
Doc strings provide us with a great opportunity to illuminate our code.

In the example below, __init__ refers us to the class's documentation,
but the class doc doesn't help much.

It doesn't?
list() -> new list
list(sequence) -> new list initialized from sequence's items

What is it you were hoping to see in constructor documentation?

STeVe
 
C

Colin J. Williams

Steven said:
It doesn't?

list() -> new list
list(sequence) -> new list initialized from sequence's items

What is it you were hoping to see in constructor documentation?

STeVe
You are right, I didn't dig far enough.

Colin W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,619
Members
45,310
Latest member
FaustoMont

Latest Threads

Top