On Wed, Oct 13, 2021 at 10:53 AM Jeremiah Vivian <nohackingofkrow...@gmail.com> wrote: > > I posted a previous thread about overloading the unary `+` operator in > strings with `ord`, and that expanded to more than just the unary `+` > operator. So I'm saying now, there should be these implementations: > > +string - `int(string, 10)` (or just `int(string)`) > > -string - `int(string, 8)` > > ~string - `int(string, 16)` > > Or: > > +string - `string.lstrip()` > > -string - `string.rstrip()` > > ~string - `string.strip()` > > If anyone has better ideas, they can post it here.
Better idea: Just don't. These are incredibly arbitrary and have very little association with their symbols. They don't even have the "cute" value of constructing a path by dividing a path by a string, or constructing an email address using matrix multiplication. Don't search for a meaning for some combination of symbols. Start with meaning, and then think about the best way to spell it. In each of these cases, the existing spelling is FAR better than anything involving an operator. ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/43Y5WQIYJTSCI4ULJFZPB35MDPSHXLOA/ Code of Conduct: http://python.org/psf/codeofconduct/