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

Personally, I'd really like to see an equivalent in Python to Haskell's `binop` , to turn an arbitrary two-argument function into a binary operator.


I think that you're not alone, but this is specifically considered and rejected (in the section on "Rejected alternatives …"):

> Add lots of new operators, or add a new generic syntax for defining infix operators: In addition to being generally un-Pythonic and repeatedly rejected by BDFL fiat, this would be using a sledgehammer to smash a fly.


Anyone have a reference for where that in particular was rejected by BDFL fiat?


PEP 225 was an attempt to add a load of new operators that was rejected (well, deferred 14 years ago). I don't know of a proposal to define arbitrary binary operators.




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

Search: