Closed joshuadeng closed 1 year ago
Summary: The pattern
X.Y if hasattr(X, "Y") else Z
can be replaced with
getattr(X, "Y", Z)
The getattr function gives more succinct code than the hasattr function. Please use it when appropriate.
This diff is very low risk. Green tests indicate that you can safely Accept & Ship.
Differential Revision: D44886546
This pull request was exported from Phabricator. Differential Revision: D44886546
Summary: The pattern
can be replaced with
The getattr function gives more succinct code than the hasattr function. Please use it when appropriate.
This diff is very low risk. Green tests indicate that you can safely Accept & Ship.
Differential Revision: D44886546