On 2021-10-12 13:36, Chris Angelico wrote:
On Tue, Oct 12, 2021 at 11:27 PM Jeremiah Vivian
<nohackingofkrow...@gmail.com> wrote:

> -1. It's unnecessary optimization for an uncommon case, abuse of syntax
Good point. But what else can the unary positive do? I'm just trying to add a 
use for it.
> illogical - why should +"a" be the integer 97?
Because `ord("a")` is `97`. Have you read the last question at the end of the 
post?

And eval("0xa") is 10. Why shouldn't +"a" be 10 instead?

Why are you using eval? int is safer: int("0xa", 0)

You haven't given any reason why unary plus should imply ord().

_______________________________________________
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/HXRX6LNHZB3H5QGDZR2GGSE23DV2ZCC7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to