Closed jingw closed 4 years ago
I realize handling getattr is a slippery slope. I think this case makes sense and is a reasonable place to draw the line.
getattr
My rationale is that the following code does the same thing, counts as a reference to obj.constant_string, but is not what most people would write.
try: x = obj.constant_string except AttributeError: x = None
Haven't filed one. Happy to discuss this makes sense or not.
Thanks for the patch!
Description
I realize handling
getattr
is a slippery slope. I think this case makes sense and is a reasonable place to draw the line.My rationale is that the following code does the same thing, counts as a reference to obj.constant_string, but is not what most people would write.
Related Issue
Haven't filed one. Happy to discuss this makes sense or not.
Checklist: