Re: [Python-ideas] new operators via backquoting
Chris Rebert wrote:
In Haskell, foo `baz` bar means (baz foo bar), which translates to baz(foo, bar) in Python. This allows Haskell programmers to use functions as infix operators. If I recall correctly, in Py3k, enclosing something in backticks will no longer cause it to be repr()-ed, leaving the backtick without a meaning in Python.
Perhaps you're not aware of the "best hack of 2005", which works in current Python and goes a step further by allowing you to even "override" the operator's delimiter: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/384122 George
George Sakkis wrote:
Perhaps you're not aware of the "best hack of 2005", which works in current Python and goes a step further by allowing you to even "override" the operator's delimiter:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/384122
George _______________________________________________
In light of this and Guido's pronouncement that the backtick will not have any meaning in Py3k, I withdraw my proposal. - Chris Rebert
participants (2)
-
Chris Rebert -
George Sakkis