Skip to content

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

Merged
cclauss merged 1 commit into
TheAlgorithms:masterfrom
JunaidIRF:improve-gray-code-sequence
Sep 6, 2026
Merged

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

Conversation

@JunaidIRF

Copy link
Copy Markdown
Contributor

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
@algorithms-keeper algorithms-keeper Bot removed the awaiting reviews This PR is ready to be reviewed label Sep 6, 2026
@cclauss
cclauss merged commit 9619ee1 into TheAlgorithms:master Sep 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants