[EMAIL PROTECTED] writes: > @infix > def interval(x, y): return range(x, y+1) # 2 parameters needed > > This may allow: > assert 5 interval 9 == interval(5,9)
I don't like the idea of turning words into operators. I'd much rather see something like: @infix('..') def interval(x, y): return range(x, y + 1) assert 5 .. 9 == interval(5, 10) This would also allow us to start working on doing away with the magic method names for current operators, which I think would be an improvement. As others have pointed out, you do need to do something about operator precedence. For existing operators, that's easy - they keep their precedence. For new operators, it's harder. You also need to worry about binding order. At the very least, you can specify that all new operators bind left to right. But that might not be what you want. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list