mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +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
@@ -15,6 +15,6 @@ class Command(BaseCommand):
|
||||
def handle(self, *args: Any, **options: Any) -> None:
|
||||
assert settings.DEVELOPMENT
|
||||
UserMessage.objects.all().update(flags=F("flags").bitand(~UserMessage.flags.read))
|
||||
_cache = getattr(cache, "_cache")
|
||||
_cache = cache._cache # type: ignore[attr-defined] # not in stubs
|
||||
assert isinstance(_cache, bmemcached.Client)
|
||||
_cache.flush_all()
|
||||
|
||||
Reference in New Issue
Block a user