Skip to content

fix: raise TypeError for non-integer bucket_count in bucket_sort - #15041

Open
deepshekhardas wants to merge 2 commits into
TheAlgorithms:masterfrom
deepshekhardas:fix-14970-bucket-sort-float
Open

fix: raise TypeError for non-integer bucket_count in bucket_sort#15041
deepshekhardas wants to merge 2 commits into
TheAlgorithms:masterfrom
deepshekhardas:fix-14970-bucket-sort-float

Conversation

@deepshekhardas

Copy link
Copy Markdown
Contributor

Describe your change

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add, change, or clarify documentation?

What does this implement/fix?

Passing a float �ucket_count caused an unhandled TypeError: 'float' object cannot be interpreted as an integer. Raise a clear TypeError instead.

Additional comments?

None.

Fixes #14970

@cclauss

cclauss commented Sep 12, 2026

Copy link
Copy Markdown
Member

Please add a doctest where bucket_count = "A"

@cclauss cclauss added awaiting changes A maintainer has requested changes to this PR require tests Tests [doctest/unittest/pytest] are required labels Sep 12, 2026
@algorithms-keeper algorithms-keeper Bot added awaiting reviews This PR is ready to be reviewed and removed require tests Tests [doctest/unittest/pytest] are required awaiting changes A maintainer has requested changes to this PR labels Sep 12, 2026
@cclauss cclauss added awaiting changes A maintainer has requested changes to this PR and removed awaiting reviews This PR is ready to be reviewed labels Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes A maintainer has requested changes to this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bucket_sort has no dedicated error handling when the number of buckets in inputted as a float instead of an integer.

2 participants