1
Python's splitlines does more than just newlines
I always assumed that Python's str.splitlines() split strings by " universal newlines ", i.e., \n , \r , and \r\n .
The personal website of william woodruff
Visit yossarian.net → On Hacker News Nov 2024 – Oct 2026
Software Engineering 4Programming Languages 2Tools & Productivity 1Security & Privacy 1
I always assumed that Python's str.splitlines() split strings by " universal newlines ", i.e., \n , \r , and \r\n .
In Rust, one of the most common ways to implement core traits (like Debug , Display , and Clone ) is to #[derive(...)] them, e.g.: