> On Feb 2, 2020, at 07:18, Karl Ramm <[email protected]> wrote:
> 
> 
> I propose adding ! and $ as (normally unimplemented) binary operators and ?
> as a unary operator so as to explicitly to give people the rope they want
> but clearly tagged "here there be shenanigans".

Why should ? be a prefix operator and the other two infix? Especially given 
that those aren’t their syntax in other common languages (! is usually prefix, 
? is usually suffix or infix or part of a ternary infix…):

What precedence do they have? What associativity? Do the infix ones follow 
__rop__ protocols like arithmetic operators, different rules like comparisons, 
or no reverse overloading?

Why these three and not backticks or tildes or Unicode symbols?

I think in order to actually be useful for people who want this flexibility all 
of that may need to be configurable. At which point you might as well go full 
Haskell and allow people to define any string of symbol characters as a new 
operator. Of course that’s hard to do in Python, both because of the question 
of where to define things early enough and globally enough, and because Python 
doesn’t require spaces around operators so there’s nothing stopping someone 
from creating ambiguous operators… But I think the fact that code written with 
custom operators wouldn’t feel much like Python is a better argument against it 
than the practical difficulties.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/VPEWWGUU4OQJDBPW2ZLYFZBZPGW4IU32/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to