I’ve of course certainly heard of, seen, and used `assert`, but more often than not, outside of pytest, I see its use way more in potential footgun scenarios—I doubt that many people know that assertions can be silenced, and that they’d probably be better off raising exceptions in many cases where they’re using `assert`.
I would not be surprised in the least if that pattern existed in the wild. In fact, it's quite common to see this in C/C++ codebases too: people will use assert() to check a security-relevant property, and then disable those checks in their release builds "because it can't happen".
The most direct way to find out about `__debug__` is to read `python -h` (or the usage message, which is not all that easy to trigger) in full, and then head over to the documentation.
> Does it actually get used that often in real world code?
https://github.com/search?q=language%3APython+%2F%28%3F-i%29...