Skip to content

Make gnome sort generic over comparable items - #15261

Open
bpiper02 wants to merge 1 commit into
TheAlgorithms:masterfrom
bpiper02:type-gnome-sort
Open

Make gnome sort generic over comparable items#15261
bpiper02 wants to merge 1 commit into
TheAlgorithms:masterfrom
bpiper02:type-gnome-sort

Conversation

@bpiper02

@bpiper02 bpiper02 commented Sep 9, 2026

Copy link
Copy Markdown

Part of #15234

Updates gnome_sort to use a bounded comparable type instead of an untyped list.

Also adds gnome_sort to the shared test covering rejection of non-comparable mixed items.

Validation:

  • python -m doctest -v sorts/gnome_sort.py
  • python -m pytest tests/test_sorts.py -k "gnome_sort or rejects_non_comparable"
  • python -m ruff check sorts/gnome_sort.py tests/test_sorts.py
  • python -m ruff format --check sorts/gnome_sort.py tests/test_sorts.py
  • python -m compileall sorts/gnome_sort.py

@cclauss

cclauss commented Sep 9, 2026

Copy link
Copy Markdown
Member

@priya-sundaram-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants