News for hackers. Stuff that matters.
Re:Writing Python like it's Rust by cies on Sunday May 21, 2023 @05:06AM (#36019126)
See how much discipline is needed to "write Python as Rust"? This is the real problem: you can have great code in dynamic/liberal/forgiving languages, but it will be due to programmer's discipline.

Using a tool like Rust (or other strict/strongly-typed languages) forces some quality constraints on all code that compiles. This is, to me, a great benefit of these languages.

Re:Writing Python like it's Rust by ouija on Sunday May 21, 2023 @05:58AM (#36019388)
Yes, you can write Python code that runs with missing or wrong type hints. Not ideal, but you can add a static type checker (mypy) as a step in your CI pipeline and reject commits that fail this step. Not much discipline required.
Re:Writing Python like it's Rust by Too on Sunday May 21, 2023 @06:19AM (#36019503)
You need even more discipline to write code without the type hints. So a move in the right direction.