Improve typing, doctests, and docstrings in gray_code_sequence by JunaidIRF · Pull Request #15205 · TheAlgorithms/Python · GitHub
Skip to content

Improve typing, doctests, and docstrings in gray_code_sequence - #15205

Open
JunaidIRF wants to merge 1 commit into
TheAlgorithms:masterfrom
JunaidIRF:improve-gray-code-sequence
Open

Improve typing, doctests, and docstrings in gray_code_sequence#15205
JunaidIRF wants to merge 1 commit into
TheAlgorithms:masterfrom
JunaidIRF:improve-gray-code-sequence

Conversation

@JunaidIRF

Copy link
Copy Markdown

Describe your change:

  • Parameterized return types with modern Python type hints (list[int] and list[str] instead of raw list).
  • Added doctest coverage for the base case gray_code(0).
  • Corrected minor typographical errors in docstrings ("one times" -> "one time", "grey" -> "Gray code").

Checklist:

  • I have read the CONTRIBUTING.md guide.
  • This pull request adheres to the project guidelines.
  • All doctests pass (pytest --doctest-modules bit_manipulation/gray_code_sequence.py).
  • Ruff linter passes (uvx ruff check bit_manipulation/gray_code_sequence.py).

@algorithms-keeper algorithms-keeper Bot added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files labels Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant