Steven D'Aprano wrote: > Three times in the last week the devs where I work accidentally > introduced bugs into our code because of a mistake with case-insensitive > string comparisons. They managed to demonstrate three different failures: > > # 1 > a = something().upper() # normalise string > ... much later on > if a == b.lower(): ...
A quick and dirty fix would be a naming convention: upcase_a = something().upper() > ... much later on > if upcase_a == b.lower(): ... Wait, what... -- https://mail.python.org/mailman/listinfo/python-list