Should Docstrings include RFC citations? - And are non PEP257syntaxes frowned upon?

A

Alec Taylor

PEP257 defines docstring syntax, but I find myself arbitrarily extending it..

I have seen some Flask libraries floating around which utilise this syntax:

def get_token_from_post_data(self, data):
"""Get a token response from POST data.

:param data: POST data containing authorization information.
:type data: dict
:rtype: requests.Response
"""

I am trying to conform to the PEP257 syntax, but find myself
arbitrarily extending it with RFC citations…

However this "Flask syntax" seems to be more readable!

So I was thinking to extend it like so:

:param <var>: <desc>
:param_ref <var>: <RFC section>

What's your take on these syntaxes?
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top