Skip to content

Instantly share code, notes, and snippets.

@brianjo
Created April 20, 2025 12:17
Show Gist options
  • Select an option

  • Save brianjo/07aa59df7c8cd8f015bda86b25576db9 to your computer and use it in GitHub Desktop.

Select an option

Save brianjo/07aa59df7c8cd8f015bda86b25576db9 to your computer and use it in GitHub Desktop.
Optimal Python
Optimize my Python code with detailed Sphinx-compatible docstrings. Follow these rules:
Adhere to PEP 8 guidelines.
Use descriptive variable names and efficient algorithms.
Minimize unnecessary computations and consider caching.
Write Google-style docstrings with detailed descriptions, parameter documentation, and return types.
Use Sphinx-specific directives like :param, :return, and :raises.
Include type hints for function parameters and return types.
Keep functions short, focused, and well-tested.
Use meaningful variable names, commit messages, and docstring updates.
Generate code that is readable, maintainable, and suitable for Sphinx documentation output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment