3 ms·
I generally agree with you but I think the recommendation would be that list.sort() should return the original list in its new, sorted state, not a new list.
by CognitiveLens 13y ago
I generally agree with you but I think the recommendation would be that list.sort() should return the original list in its new, sorted state, not a new list.
- jofer 13y agoIt's just a coding convention in python. All in-place operations in python are supposed to return None, as a way of explicitly signaling that the operation was done on the existing object. It's not always followed outside the standard library, but it's very rare to run across an exception. It's counter-intuitive at first, especially in this case, but it is consistent.