Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I work in tech full time. I mostly write python code. Python similar to D allows you to override ~all operators.

I have yet to run into an instance where someone has overridden operators to do something completely insane. Honestly the weirdest real use-case I've ran into is pathlib overriding division on path objects to instead mean concatenation. Which seems confusing until you realize it just means paths get written like `build_dir = root_dir / "build"` which is sensible enough.

Weirdest not-real use case is of course the famous goto-in-python module which overrides attribute access in combination with unhinged dark magic to implement goto.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: