Repository navigation
Commit c33ea8d
committed
fix(sorts): remove shadowed type parameter from bogo_sort is_sorted helper
In PEP 695 syntax, T is already bound by the outer function bogo_sort[T: Comparable]. Re-declaring [T: Comparable] on the nested is_sorted helper shadows T and causes ty check to emit error[shadowed-type-variable].
Remove [T: Comparable] from is_sorted so it uses the enclosing type variable T, matching other sorting algorithms in sorts/ (e.g. circle_sort, merge_sort).
Validation:
- uvx ty check sorts/bogo_sort.py -> All checks passed
- uvx pytest sorts/bogo_sort.py --doctest-modules -> 1 passed
- uvx pytest tests/test_sorts.py -k test_bogo_sort -> 1 passed
- uvx ruff check / format -> clean1 parent 25c712f commit c33ea8d
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
0 commit comments