"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "67c3518f68d9129a1c429fd45659c7896c44e08e"
Replace hasattr with getattr in mobile-vision/d2go/d2go/utils/abnormal_checker.py
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/533 The pattern ``` X.Y if hasattr(X, "Y") else Z ``` can be replaced with ``` getattr(X, "Y", Z) ``` The [getattr](https://www.w3schools.com/python/ref_func_getattr.asp) function gives more succinct code than the [hasattr](https://www.w3schools.com/python/ref_func_hasattr.asp) function. Please use it when appropriate. **This diff is very low risk. Green tests indicate that you can safely Accept & Ship.** Differential Revision: D44886687 fbshipit-source-id: f3f0265251bf8008ae927b767da5749bf6828c2c
Showing
Please register or sign in to comment