I suspect when you say "unsafe by design" you may be referring to the dynamic type checking aspect of Python, although Python has supported for a while type annotations, that can be statically checked by linter-like tools like PyRight.
--
1: https://en.wikipedia.org/wiki/Type_safety
2: https://en.wikipedia.org/wiki/Memory_safety
But you can perform unsafe operations e.g.,
import ctypes
ctypes.string_at(0) # access 0 address in memory -> segfaultPython doesn't have an unsafe keyword like Rustlang.
In Python, you can dereference a null pointer and cause a Segmentation fault given a ctypes import.
lancedb/lance and/or pandas' dtype_backend="pyarrow" might work with pygame
eval((lambda:0).__code__.replace(co_consts=()))
cpython is not memory safe.Containers are considered nearly sufficient to sandbox Python, which cannot be effectively sandboxed using Python itself. Isn't that actually true for all languages though?
There's a RustPython, but it does support CFFI and __builtins__.eval, so
def f(): pass
f.__code__ = f.__code__.replace(co_consts=())
f()Have a look at the linked article to see what meaning of 'unsafe' the author has in mind.
Fun lang though, just not one that ever comes to mind when I hear 'safe'.
The generic snide about Python that has nothing to do with the article ain't all that informative.
You could make the same remark you just made about all Python being unsafe about Rust: 'Isn't all Rust, by design, unsafe?'. And compared to eg Agda or Idris that would be true, but it wouldn't be a very useful nor interesting comment when talking about specifically 'unsafe' Rust vs normal Rust.
So it doesn't really make sense to pretend there's some single meaning of 'safe' vs 'unsafe' that's appropriate in all contexts.
Fine and good to advocate rigor, whether or not it’s specifically relevant to this post, but maybe be careful with the interpretation and commentary lest people decide the misconception is on your part?
"Safety" is an overloaded term, but that happens a lot in software. You'll probably get best results if you try to understand what people are talking about, rather than just assuming everyone else is an idiot.