From 7a1f629052adb39bf55809effe45fc56fd689b4b Mon Sep 17 00:00:00 2001 From: Dantali0n <info@dantalion.nl> Date: Mon, 2 Oct 2023 08:41:14 +0200 Subject: [PATCH] Documentation example --- .../cool_module.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/cool_module.py b/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/cool_module.py index b71bcac..7486b94 100644 --- a/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/cool_module.py +++ b/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/cool_module.py @@ -1,6 +1,33 @@ """ Cool module containing functions, classes and other useful things """ +from typing import Union +from collections import OrderedDict + def greeter(): """Prints a nice message""" print("Hello World!, test line over 80 but not 88 characters on a single line") + + +class DocumentationExample: + """Class to demonstrate docstring documentation""" + + def __init__(self): + self.attribute: str = "Hello World" + + def operate(self, data: Union[str, int]) -> int: + """Perform operation + + :py:attr:`.self.attribute` + :py:func:`~.greeter` + :py:class:`collections.OrderedDict` + + ``OrderedDict(data)`` + + :param data: The data to peform the operation on + :raises RuntimeError: Raised if not enough memory to create Dict + :return: integer value representing success or failure + """ + + test = OrderedDict() + return 0 -- GitLab