GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — TypeError in bisect when called with key argument · Issue #117848 · python/cpython Closed Labels type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:bisect functions raise TypeError when called with key argument. import bisect import operator a = [('one', 1), ('two', 2)] print(bisect.bisect(a, ('one', 1), key=operator.itemgetter(0))) This results in the following error: Traceback (most recent call last): File "/path/to/bisect_test.py", line 5, in <module> print(bisect.bisect(a, ('one', 1), key=operator.itemgetter(0))) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: '<' not supported between instances of 'tuple' and 'str' It seems that picking an item in a tuple has a problem. CPython versions tested on:3.12 Operating systems tested on:macOS Activity
MetadataMetadataAssigneesLabelstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |