什么语法更适合python!=或不是?

ava*_*sin 1 python

例如:

match = re.search('...', str, re.IGNORECASE)
if match is not None:
    pass

# or
if match != None:
    pass
Run Code Online (Sandbox Code Playgroud)

什么是更好的?

Dav*_*nan 5

PEP 8:

与None这样的单例的比较应始终使用is或者is not从不使用相等运算符.