Title: `heapq.merge`, `heapq.nlargest` and `heapq.nsmallest` are typed inadequately · Issue #15668 · python/typeshed · GitHub
Open Graph Title: `heapq.merge`, `heapq.nlargest` and `heapq.nsmallest` are typed inadequately · Issue #15668 · python/typeshed
X Title: `heapq.merge`, `heapq.nlargest` and `heapq.nsmallest` are typed inadequately · Issue #15668 · python/typeshed
Description: The current annotations for the above functions mean that their key arguments can be omitted for iterables of objects that do not implement the rich comparison operators without triggering a type checker diagnostic, whereas that will lik...
Open Graph Description: The current annotations for the above functions mean that their key arguments can be omitted for iterables of objects that do not implement the rich comparison operators without triggering a type c...
X Description: The current annotations for the above functions mean that their key arguments can be omitted for iterables of objects that do not implement the rich comparison operators without triggering a type c...
Opengraph URL: https://github.com/python/typeshed/issues/15668
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`heapq.merge`, `heapq.nlargest` and `heapq.nsmallest` are typed inadequately","articleBody":"The current annotations for the above functions mean that their `key` arguments can be omitted for iterables of objects that do not implement the rich comparison operators without triggering a type checker diagnostic, whereas that will likely fail with `TypeError` at runtime. They should be overloaded accordingly.","author":{"url":"https://github.com/jonathandung","@type":"Person","name":"jonathandung"},"datePublished":"2026-04-23T02:56:48Z","url":"https://github.com/python/typeshed/issues/15668"}
| 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:068b22e9-d8ce-b392-e6aa-e4fe0856a76b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9012:115983:9BD7BD:D08024:6B00443F |
| html-safe-nonce | 9fd1180e63684ac5599f298bb9fdc4415eb0e6522f9aec25feeea76e899c78a5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDEyOjExNTk4Mzo5QkQ3QkQ6RDA4MDI0OjZCMDA0NDNGIiwidmlzaXRvcl9pZCI6IjcyMTk1MTczODQxMzI5MzY3NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0b6646efd424bca2495f865cdc4ec11a6118862b39a99f2a7128996da85ec5e0 |
| hovercard-subject-tag | issue:4313156691 |
| 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/python/typeshed/15668/issue_layout |
| twitter:image | https://opengraph.githubassets.com/35dfdbedb106383885c37ba46346d608f1a365ad4a29a2a4c60fb4c5a59a1cc5/python/typeshed/issues/15668 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/35dfdbedb106383885c37ba46346d608f1a365ad4a29a2a4c60fb4c5a59a1cc5/python/typeshed/issues/15668 |
| og:image:alt | The current annotations for the above functions mean that their key arguments can be omitted for iterables of objects that do not implement the rich comparison operators without triggering a type c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jonathandung |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width