Title: bucket_sort has no dedicated error handling when the number of buckets in inputted as a float instead of an integer. · Issue #14970 · TheAlgorithms/Python · GitHub
Open Graph Title: bucket_sort has no dedicated error handling when the number of buckets in inputted as a float instead of an integer. · Issue #14970 · TheAlgorithms/Python
X Title: bucket_sort has no dedicated error handling when the number of buckets in inputted as a float instead of an integer. · Issue #14970 · TheAlgorithms/Python
Description: Feature description Issue: The bucket_sort function accepts an integer passed as an argument def bucket_sort(my_list: list, bucket_count: int = 10) When passing a float it causes an unhandled TypeError Test used: >>> data = [12, 7 , 22, ...
Open Graph Description: Feature description Issue: The bucket_sort function accepts an integer passed as an argument def bucket_sort(my_list: list, bucket_count: int = 10) When passing a float it causes an unhandled TypeE...
X Description: Feature description Issue: The bucket_sort function accepts an integer passed as an argument def bucket_sort(my_list: list, bucket_count: int = 10) When passing a float it causes an unhandled TypeE...
Opengraph URL: https://github.com/TheAlgorithms/Python/issues/14970
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bucket_sort has no dedicated error handling when the number of buckets in inputted as a float instead of an integer.","articleBody":"### Feature description\n\nIssue:\n\nThe bucket_sort function accepts an integer passed as an argument\n\ndef bucket_sort(my_list: list, bucket_count: int = 10)\n\nWhen passing a float it causes an unhandled TypeError\n\nTest used:\n\n >>> data = [12, 7 , 22, 11, 4]\n >>> bucket_sort(data, 2.5) == sorted(data)\n True\n\nTypeError: 'float' object cannot be interpreted as an integer\n\nProposed solution:\n\nEither return an empty list for consistency to match when a bucket count of less than 0 is used\n\nif len(my_list) == 0 or bucket_count \u003c= 0 or not isinstance(bucket_count, int):\n return [ ]\n\nOr raise a clearer TypeError\n\nif not isinstance(bucket_count, int):\n raise TypeError(\"bucket_count must be an integer\")\n\nI would like to implement either solution.\n","author":{"url":"https://github.com/ThayerMarvin","@type":"Person","name":"ThayerMarvin"},"datePublished":"2026-07-24T20:33:22Z","url":"https://github.com/TheAlgorithms/Python/issues/14970"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eafe7370-01c5-bdee-c991-6e3bf0db520c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BD88:2A59EB:48A934:609273:6AFBC06D |
| html-safe-nonce | 77ed7c1e20c9bdc91fbca5d4bf949238f5001fb23f19768143f59cd90ffa0ba5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDg4OjJBNTlFQjo0OEE5MzQ6NjA5MjczOjZBRkJDMDZEIiwidmlzaXRvcl9pZCI6IjE4MDExOTM1MDk1NzI5MzY3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9361e040ae0cf915b907cfdb254c13c7817df49f8fe8f4a977af71b3ae4771ac |
| hovercard-subject-tag | issue:4971819680 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TheAlgorithms/Python/14970/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2998d54c7618975081bf021198a72d48d09ffa4e4f569c02d1998555e9ee2726/TheAlgorithms/Python/issues/14970 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2998d54c7618975081bf021198a72d48d09ffa4e4f569c02d1998555e9ee2726/TheAlgorithms/Python/issues/14970 |
| og:image:alt | Feature description Issue: The bucket_sort function accepts an integer passed as an argument def bucket_sort(my_list: list, bucket_count: int = 10) When passing a float it causes an unhandled TypeE... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ThayerMarvin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c |
| turbo-cache-control | no-preview |
| go-import | github.com/TheAlgorithms/Python git https://github.com/TheAlgorithms/Python.git |
| octolytics-dimension-user_id | 20487725 |
| octolytics-dimension-user_login | TheAlgorithms |
| octolytics-dimension-repository_id | 63476337 |
| octolytics-dimension-repository_nwo | TheAlgorithms/Python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 63476337 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/Python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e4cce0e99cf61481a318ff12c2e8580153a6c7c6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width