On Tue, Mar 31, 2020 at 11:57 PM Philip Kahn <tigerhawk...@gmail.com> wrote:
>
> Yikes, this change is spitting out a lot of warnings on first run, and plenty 
> in stuff that's not my code to boot.
>
> A huge number of the cases, though, seem to be "is 0" and "is 1" comparisons. 
> Having read through the original issue I get where the SyntaxWarning is 
> coming from, but it seems it'd be a genuine end-user experience improvement 
> to not raise the warning on those two classic "truthy" comparisons.
>
> I understand it locks in that particular implementation detail, but it also 
> seems unlikely that that particular optimization (int 0 and int 1 as specific 
> memory objects) would ever make sense to NOT be including in a shipping 
> implementation (future proof by practicality).
>
> Mostly wanted to get that out there, but for now I'm rolling back my python 
> version rather than seeing a deluge of useless warnings. Right now, this is 
> just a great way to drown out real warnings in noisy unhelpful ones.
>

Your code is buggy. The warnings are telling you that your code is
buggy, even though *at the moment* it happens to work. And the fix is
simple - replace every "is 0" with "== 0", and your code will be
correct.

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

Reply via email to