For example:
match = re.search('...', str, re.IGNORECASE)
if match is not None:
pass
# or
if match != None:
pass
What is better?
For example:
match = re.search('...', str, re.IGNORECASE)
if match is not None:
pass
# or
if match != None:
pass
What is better?
From PEP 8:
Comparisons to singletons like None should always be done with
is
oris not
, never the equality operators.