Hacker News new | comments | show | ask | jobs | submit login

> people consider defining new infix operators to be on a whole new level compared to defining `ordinary' functions

It has nothing to do with the concept of defining new infix operators. It is to do with hacking the language in a way that is unexpected and (initially) confusing.

Hacks like this are clever and interesting, but not Pythonic. Doing this over using an "ordinary" function just makes Python harder to read because it is not conventional and not idiomatic. Any programmer competent in the language should be able to dive in without having to understand which set of hacks have been used. It doesn't matter whether it is mythical or not; it should not be used because it is a hack.

Yes, you should probably stay away from too clever hacks in production code. But pushing the language for fun is fine with me.

Perhaps somebody will even write up a PEP for properly defining your own operators?

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact