

Surely you wouldn’t argue that Rust or C++ would be a more appropriate alternative in that kind of role because they’re statically typed.
Not C++. Rust hopefully, when cargo script is stabilised!
Until then I strongly prefer Deno (which is also statically typed) for ad-hoc scripting. Python is surprisingly bad for that use case despite it being super popular for it because:
- There’s no way to use third party dependencies reliably from a single-file scripts. You’re limited to the standard library, or setting up a whole pyproject.toml, venv and so on.
- You can’t import files by relative file path like you can in Deno, Zig, and Rust (sort of; it’s slightly hacky). That leads to people doing hacks to PYTHONPATH or importlib which completely breaks all tooling.

I can assure you it is 100x more convenient. One command to install it that has worked every single time I’ve done it, vs the hell that is Python installation. It’s meme-level bad..
Granted that was written before uv existed, and UV makes things a lot better in general. One thing it still isn’t great at though is installing Python. E.g. the binary Python distributions it can install never look for SSL certificates in the right (read: different on every Linux distro) places, so HTTPS doesn’t work.
If you actually want to install the latest version of Python on Linux (so you can’t use distro packages), the official solution is to build it from source. Which mercifully is easy (very surprising given the rest of Python), but still!
Not uniformly (e.g. arbitrary precision integers are the right choice for ad-hoc scripting, and Python’s support for lists, dictionaries, and filter/map is arguably nicer). Overall though, absolutely.
Why not? It’s really good for shell scripting type stuff (executing commands, manipulating files, etc.).