On 2021-08-09 23:57:42, Chris Angelico wrote:
> On Mon, Aug 9, 2021 at 10:32 PM Samuel Freilich <sfreil...@google.com> wrote:
> > Even without it being used in as complicated a way as that it's still not 
> > backward compatible because of the trivial case, as foo.endswith("") is 
> > True.
> 
> I was talking specifically about the original, which can be depended
> upon to return True or False. Changing the return value would break
> anything that depends on that.
> 
> Not sure what you're referring to.

I think this is the problem:

> >>> "str".endswith("") is True
> True
> >>> "" is True
> <stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
> False

Even if you use the return value as a bool, it will flip the result.
_______________________________________________
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/YXWRXVDA6FI55POX5NYJJYVNQRATPYX7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to