Tagged articles
1 articles
Page 1 of 1
AI Cyberspace
AI Cyberspace
Jun 30, 2016 · Fundamentals

Why Python’s list.sort() Returns None and What It Means for Your Code

The article explains why Python’s list.sort() method returns None instead of a sorted list, covering the command‑query separation principle, readability considerations from Guido van Rossum, and performance reasons that favor in‑place sorting to avoid unnecessary copies.

Command Query SeparationIn-Place SortingPython
0 likes · 4 min read
Why Python’s list.sort() Returns None and What It Means for Your Code