私は何が良い/最高なのだろうか:
>>> def command():
... return False
...
>>> assert command() == False
>>> assert command() is False
>>> assert not command()
乾杯、マーカス
私は何が良い/最高なのだろうか:
>>> def command():
... return False
...
>>> assert command() == False
>>> assert command() is False
>>> assert not command()
乾杯、マーカス
コーディング規約はここで学ぶことができます: PEP 8 Style Guide for Python Code
そこには次のものがあります。
== を使用してブール値を True または False と比較しないでください
Yes: if greeting:
No: if greeting == True:
Worse: if greeting is True:
最もpythonicは3番目です。これは以下と同等です:
assert bool(command()) != False