xcfem / xc

finite element analysis package for civil engineering structures.
http://www.xcengineering.xyz/html_files/software.html
GNU General Public License v3.0
266 stars 54 forks source link

Fix 'testing eqality to None' python issues #111

Closed luzpaz closed 2 years ago

luzpaz commented 2 years ago

"When you compare an object to None, use is rather than ==. None is a singleton object, comparing using == invokes the eq method on the object in question, which may be slower than identity comparison. Comparing to None using the is operator is also easier for other programmers to read."

lcpt commented 2 years ago

I didn't know. Thank you!

luzpaz commented 2 years ago

I learned it via LGTM https://lgtm.com/logs/a5377a114ddd54680fb05f702236df1a10f5d5d6/lang:python

lcpt commented 2 years ago

Curious. I didn't know this "compiling robot". Thanks!

luzpaz commented 2 years ago

https://lgtm.com/projects/g/xcfem/xc/?mode=tree

lcpt commented 2 years ago

Wow. Impressive! Thanks a lot. I didn't know we have so many little bugs everywhere.