Question: documentation convention for Python method/function

In Ruby, there is a well known convention to distinguish class/instance method.

  • Add a # before the method name when describing instance methods. (e.g. #foo)
  • Add a . before the method name when describing class methods. (e.g. Array.new)

Does Python have a similar convention?

2 comments · 50% upvoted · other discussions

comments

Diapolo10

Nothing like that, no. The method type should be clear from its parameters, and the docstring will simply describe what it does, what arguments it expects (and sometimes why), the return value, and possible exceptions.

There's really nothing fundamentally different between the three kinds of methods, only the first parameter changes.

[deleted]

Python pep257 talks about using docstrings.