argo0n / NograBot

Discord.py bot written by Argon#0002
GNU General Public License v3.0
2 stars 1 forks source link

(PTC-W0068) Consider using identity comparison with singleton #81

Closed argo0n closed 3 years ago

argo0n commented 3 years ago

Description

Comparisons to the singleton objects, like True, False, and None, should be done with identity, not equality. Use is or is not. <!--more--> Identity checks are faster than equality checks. Also, the equality checks can result in unintended behaviour in some cases. ## Examples: ### Bad practice: ```python 1 is …

Occurrences

There are 3 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/argo0n/NograBot/issue/PTC-W0068/occurrences/

argo0n commented 3 years ago

Fixed in commit 97704e8239f3dda6c529eabecf5c1bc06c7e4a3d.