Title: TypeError in bisect when called with key argument · Issue #117848 · python/cpython · GitHub
Open Graph Title: TypeError in bisect when called with key argument · Issue #117848 · python/cpython
X Title: TypeError in bisect when called with key argument · Issue #117848 · python/cpython
Description: Bug report Bug description: bisect functions raise TypeError when called with key argument. Here is a minimum code to reproduce the issue: import bisect import operator a = [('one', 1), ('two', 2)] print(bisect.bisect(a, ('one', 1), key=...
Open Graph Description: Bug report Bug description: bisect functions raise TypeError when called with key argument. Here is a minimum code to reproduce the issue: import bisect import operator a = [('one', 1), ('two', 2)]...
X Description: Bug report Bug description: bisect functions raise TypeError when called with key argument. Here is a minimum code to reproduce the issue: import bisect import operator a = [('one', 1), (...
Opengraph URL: https://github.com/python/cpython/issues/117848
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeError in bisect when called with key argument","articleBody":"# Bug report\n\n### Bug description:\n\nbisect functions raise TypeError when called with _key_ argument.\nHere is a minimum code to reproduce the issue:\n```python\nimport bisect\nimport operator\n\na = [('one', 1), ('two', 2)]\nprint(bisect.bisect(a, ('one', 1), key=operator.itemgetter(0)))\n```\nThis results in the following error:\n```shell\nTraceback (most recent call last):\n File \"/path/to/bisect_test.py\", line 5, in \u003cmodule\u003e\n print(bisect.bisect(a, ('one', 1), key=operator.itemgetter(0)))\n ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nTypeError: '\u003c' not supported between instances of 'tuple' and 'str'\n```\nIt seems that picking an item in a tuple has a problem.\n\n### CPython versions tested on:\n\n3.12\n\n### Operating systems tested on:\n\nmacOS","author":{"url":"https://github.com/c-m-m-kobayashi","@type":"Person","name":"c-m-m-kobayashi"},"datePublished":"2024-04-13T14:50:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/117848/cpython/issues/117848"}
| 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:f571eb16-9339-4f9f-8dea-e3c0224afb90 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BDDA:2016E2:740A14:9FB4E2:6969E547 |
| html-safe-nonce | 5e75672feeabc92d852f65925d8e3400fef149e2a33ff8ad32bacd3408a62c24 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRERBOjIwMTZFMjo3NDBBMTQ6OUZCNEUyOjY5NjlFNTQ3IiwidmlzaXRvcl9pZCI6Ijc3ODc2MjMyOTU0NDI2MDk0NzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 74d36f6cc876333483157b49b7dfe205509411cd49b2afd056d72115b2a1f9b3 |
| hovercard-subject-tag | issue:2241594036 |
| 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/cpython/117848/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b4d9375646edcbc015d14bde277e7525631a96d351c12f9a01da9712d3e5be57/python/cpython/issues/117848 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b4d9375646edcbc015d14bde277e7525631a96d351c12f9a01da9712d3e5be57/python/cpython/issues/117848 |
| og:image:alt | Bug report Bug description: bisect functions raise TypeError when called with key argument. Here is a minimum code to reproduce the issue: import bisect import operator a = [('one', 1), ('two', 2)]... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | c-m-m-kobayashi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width