documentation

How to document fields and properties in Python?

How to document fields and properties in Python? Question: It’s easy to document a class or method in Python: class Something: “”” Description of the class. “”” def do_it(self): “”” Description of the method. “”” pass class_variable = 1 # How to comment? @property def give_me_some_special_dict(self): “”” doesn’t work! Doc of general dict will be …

Total answers: 4

Comprehensive tutorial on Pyinstaller?

Comprehensive tutorial on Pyinstaller? Question: I’m looking for a tutorial on PyInstaller that will explain things like how to create .pkg files how to include/exclude modules how to include data files inside the install directory. I cannot make much sense out of the standard PyInstaller documentation. Asked By: Brandon || Source Answers: Have you looked …

Total answers: 3

Using javadoc for Python documentation

Using javadoc for Python documentation Question: I am currently beginning with Python and I have a strong PHP background and in PHP I have took the habit of using javadoc as a documentation template. I was wondering if javadoc has its place as docstring documentation in Python. What are the established conventions and/or official guildelines …

Total answers: 4

What is the equivalent of a Python docstring in Ruby?

What is the equivalent of a Python docstring in Ruby? Question: In Python, you can access an object’s docstring by using obj.__doc__. What is the equivalent action in Ruby? Asked By: parzival || Source Answers: I don’t believe ruby supports this. Answered By: Olly Ruby does not have a Python __doc__ equivalent. They often use …

Total answers: 4

Source Code in Bullet Lists with reStructuredText

Source Code in Bullet Lists with reStructuredText Question: I am trying to include source code in bullet lists with reStructuredText; like this: – List item 1 :: code sample… code sample… – List item 2 :: code sample… code sample… However, I get the following warning: System Message: WARNING/2 Literal block expected; none found. The …

Total answers: 1

What are the most common Python docstring formats?

What are the most common Python docstring formats? Question: I have seen a few different styles of writing docstrings in Python, what are the most popular styles? Asked By: Noah McIlraith || Source Answers: Docstring conventions are in PEP-257 with much more detail than PEP-8. However, docstrings seem to be far more personal than other …

Total answers: 6

How to document class attributes in Python?

How to document class attributes in Python? Question: I’m writing a lightweight class whose attributes are intended to be publicly accessible, and only sometimes overridden in specific instantiations. There’s no provision in the Python language for creating docstrings for class attributes, or any sort of attributes, for that matter. What is the expected and supported …

Total answers: 4

What to put in a python module docstring?

What to put in a python module docstring? Question: Ok, so I’ve read both PEP 8 and PEP 257, and I’ve written lots of docstrings for functions and classes, but I’m a little unsure about what should go in a module docstring. I figured, at a minimum, it should document the functions and classes that …

Total answers: 2

What should people new to Python know about its community and ecosystem?

What should people new to Python know about its community and ecosystem? Question: I’m cobbling together some sort of an introduction to Python, but one that focuses on the community and the ecosystem around Python rather than just the language. With How to Think Like a Computer Scientist and other great tutorials, it’s easy to …

Total answers: 7

How should unit tests be documented?

How should unit tests be documented? Question: I’m trying to improve the number and quality of tests in my Python projects. One of the the difficulties I’ve encountered as the number of tests increase is knowing what each test does and how it’s supposed to help spot problems. I know that part of keeping track …

Total answers: 5