About 199,000 results
Open links in new tab
  1. What are the most common Python docstring formats?

    Docstring conventions are in PEP-257 with much more detail than PEP-8. However, docstrings seem to be far more personal than other areas of code. Different projects will have their own standard. I tend …

  2. How to document a method with parameter (s)? - Stack Overflow

    How to document methods with parameters using Python's documentation strings? PEP 257 gives this example: def complex (real=0.0, imag=0.0): """Form a complex number. Keyword

  3. How to print Docstring of python function from inside the function ...

    Jan 12, 2012 · 87 I want to print the docstring of a python function from inside the function itself. for eg.

  4. python - Getting the docstring from a function - Stack Overflow

    Aug 24, 2024 · I have the following function: def my_func(): """My docstring is both funny and informative""" pass How do I get access to the docstring?

  5. How do I document a module in Python? - Stack Overflow

    Here is an Example Google Style Python Docstrings on how module can be documented. Basically there is an information about a module, how to execute it and information about module level …

  6. What is the proper way to comment functions in Python?

    Mar 2, 2010 · A docstring isn't a comment, and people often want to include things in function-level comments that shouldn't be part of documentation. It's also commonly considered that documenting …

  7. python - Dynamic function docstring - Stack Overflow

    Apr 22, 2010 · The context here is to write a python package wrapping a large number of command line tools in an existing analysis package. Each tool becomes a similarly named module function (created …

  8. python - How to write meaningful docstrings? - Stack Overflow

    Mar 2, 2009 · It might also mean to explain what a method/function returns. You might also want to use Sphinx (and reStructuredText syntax) for documentation purposes inside your docstrings. That way …

  9. python - Templated docstrings - Stack Overflow

    A proper docstring is not executed, it is simply taken from the parsed sourcecode and attached to the function object, no code is ever executed for this. Python stores the docstring as the first constant …

  10. python - How do I disable "missing docstring" warnings at a file-level ...

    I try and add docstrings to each class, method and function, but it seems that Pylint also checks that files should have a docstring at the beginning of them. Can I disable this somehow? I would like to be …