9 Aug
2021
9 Aug
'21
2:03 p.m.
On 2021-08-09 23:57:42, Chris Angelico wrote:
On Mon, Aug 9, 2021 at 10:32 PM Samuel Freilich <sfreilich@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.