mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
python: Clean up getattr, setattr, delattr calls with literal names.
These were useful as a transitional workaround to ignore type errors that only show up with django-stubs, while avoiding errors about unused type: ignore comments without django-stubs. Now that the django-stubs transition is complete, switch to type: ignore comments so that mypy will tell us if they become unnecessary. Many already have. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
5e1ebf2861
commit
1385a827c2
@@ -394,7 +394,7 @@ def instrument_url(f: UrlFuncT) -> UrlFuncT:
|
||||
info = "<bytes>"
|
||||
elif isinstance(info, dict):
|
||||
info = {
|
||||
k: "<file object>" if hasattr(v, "read") and callable(getattr(v, "read")) else v
|
||||
k: "<file object>" if hasattr(v, "read") and callable(v.read) else v
|
||||
for k, v in info.items()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user