vt-vl-lab / 3d-photo-inpainting

[CVPR 2020] 3D Photography using Context-aware Layered Depth Inpainting
https://shihmengli.github.io/3D-Photo-Inpainting/
Other
6.9k stars 1.11k forks source link

removed a literal caomparison pitfall from the code #139

Open NaelsonDouglas opened 2 years ago

NaelsonDouglas commented 2 years ago

The problem In Python when comparing to non-singleton values, it advised to use the operator '==' instead of 'is'. By doing otherwise, we may fall into the a code pitfall which can be detected by pylint under the identification of R0123 literal-comparison https://vald-phoenix.github.io/pylint-errors/plerr/errors/basic/R0123.html

The solution Refactored the comparison on literals