edualgo / eduAlgo

A simple python package having modules of different algorithms to use in educational purposes.
https://edualgo.github.io/documentation/
MIT License
99 stars 54 forks source link

Comparison to singleton `True` should be `expr is True` #191

Closed VenkatsQuest closed 2 years ago

VenkatsQuest commented 2 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Consider using identity comparison with singleton

Describe the solution you'd like A clear and concise description of what you want to happen.

32 if (hint == True): should be replaced with if (hint is True):

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Comparisons to the singleton objects, like True, False, and None, should be done with identity, not equality. Use is or is not.

Identity checks are faster than equality checks.