This is concerning the following paragraph in the Chaitana’s Colossal Coaster exercise’s instructions:
A list can be re-ordered in place with the help of <list>.sort(). Internally, Python uses Timsort to arrange the list. Default order is ascending from the left. The Python docs offer additional tips and techniques for sorting lists effectively.
It seems that since version 3.11, the new sorting algorithm is used now instead of Timsort:
Or maybe it would make sense to just leave that paragraph out.
Cool. That was quick! Thanks for letting us know about the change.
One more slight nitpick I was going to mention, but forgot about it.
I guess the word ‘efficiently’ would be more appropriate than ‘effectively’, as any sorting would be effective provided it is correct, but not every algorithm and not in every case (a certain set of data to be sorted, the amount of memory, etc.) would be equally efficient, i. e. there are more efficient algorithms, there are less efficient algorithms (for a certain set of data).
- I might have to quibble here. The Sorting HOWTO goes over:
key functions,
using operator and partial evaluation in the course of a sort
how to control ordering (Ascending vs Descending)
sort stability
decorators
comparison functions
local-specific sorting, and more.
So I would argue that the article is about how to make sort more effective for your use case through different techniques, as opposed to making it more efficient.
But it could also convey that info without the use of the word “effective” … I’ll consider pushing a PR here in a bit.