Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
python bisect questions
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="John Machin, post: 3533230"] That's correct. You are passing a tuple of (sort_key, actual_data). Example use case: caseless sortorder but you want to retrieve the original data. f is lambda x: x.upper() or similar. Your data is 'foo', 'Bar', 'zOt'. Calls to your_queue.append will result in the following 2nd args for bisect.insort: ('FOO', 'foo') ('BAR', 'Bar') ('ZOT', 'zOt') Consider executing the code with a couple of print statements in it so that you can see what is happening. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
python bisect questions
Top