3 ms·
Python has a `sorted` function which will return a new sorted list. I agree with you about the general inconsistency though.
by elbear 2y ago
Python has a `sorted` function which will return a new sorted list. I agree with you about the general inconsistency though.
- MatthiasPortzel 2y agoPython’s weird mix of OOP but also global methods like `sorted` and `filter` is very weird to me. (Not to mention list comprehensions.) In Ruby, control flow pretty much always moves from left to right as you add successive method calls.
- elbear 2y agoI agree. Python is not consistent, probably because features kept being added. Ruby is a little younger though, so its creator could use lessons learned from its predecessors.