14.04.21 13:22, Stefano Borini пише:
> This was just posted on SO
> 
> https://stackoverflow.com/questions/67083039/why-does-python-return-15-for-0xfor-x-in-1-2-3
> 
> I can reproduce it with a simpler example
> 
>>>> 0xfor 3
> 15
> 
> Is it a bug in the parser, or working as intended? It's not only for
> hex. This works to
> 
>>>> 3or 50
> 3
> 
> 
> 

It is already discussed in thread >
https://mail.python.org/archives/list/python-dev@python.org/thread/D2WPCITHG2LBQAP7DBTC6CY26WQUBAKP/

It does not contradict specification, but looks pretty confusing, so we
will likely change specification and implementation to prevent confusion.

_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/QODMSOOHZFGL7HL4VDAKZMZ23RPYTIQO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to