In particular, the community strongly discourages deleting or making non-trivial edits to posts. It makes conversation on the forums difficult.
Also, I would appreciate it if you took the time to read my post. I did my best to be constructive, to help you learn how to engage with these sorts of ideas carefully, in a way that is likely to be productive – to share what I have learned by experience and by observation of this community.
I feel like Python developers want to differentiate themselves from other languages all the time. You can see this in the “throw” vs “swich” example. can’t create anything good that way, it’s a very hostile environment.
C and its derivatives define the = operator as an expression, rather than a statement as is Python’s way. This allows assignments in more contexts, including contexts where comparisons are more common. The syntactic similarity between if (x == y) and if (x = y) belies their drastically different semantics. Thus this proposal uses := to clarify the distinction.
if a = b: can already be intended as an assignment or normal equation, it is a bad idea to make it do anything else.
Just for transparency, I flagged multiple of OPs posts for violating CoC. To OP: please actually read the CoC, other people messages and try to follow the instruction in the CoC about not overwhelming discussions by posting constantly. The only thing you achieve with that is making fewer people respond to you, and those that do respond are going to do so in the most combative and aggressive form, preventing the discussion from ever having a useful result.
The proposal would be slightly more plausible if a new binary operator such as ~, as in “approximate”, is suggested. It would call the __like__ method of the left operand or the __rlike__ method of the right operand to match the two in some way determined by the types of the two operands, e.g. "abc" ~ "ABC" returns True if we agree that ~ for two strings is to perform a case-insensitive match.
The real problem is that there’s no consensus on exactly what kind of approximation is expected given two types. For two strings, does approximation mean a case-insensitive match, a glob pattern match, a regex match, or a substring match? For a string and a number, does it mean to convert a string to a number, or a number to a string, before a match? Ultimately there’ll be too much guesswork for a ~ b to be readable, and we’re much better served with explicitly named calls.
>>> 'o' == 'ο' # Latin "o" vs. Greek omicron
False
As was noted above, Python’s == is not what you want when dealing with human language text. But it’s useful and appropriate for identifiers and programming languages.
The trouble with human-readable text is that “what humans would consider equal” is context-specific, and in most contexts, far from a solved problem. There’s no algorithm, library or function to “just do the right thing”.
The disadvantage of a.casefold() == b.casefold() is that it creates 2 new strings, so perhaps what’s needed is a function that compares 2 strings without doing that and can short-circuit on the first mismatch. It could let you specify the kind of comparison(s) to handle because there could be more than one kind as mentioned above.