summary refs log tree commit diff
path: root/synapse/notifier.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-09-14 12:50:06 -0400
committerGitHub <noreply@github.com>2020-09-14 12:50:06 -0400
commitaec294ee0d0f2fa4ccef57085d670b8939de3669 (patch)
treebe1bf0f3786c88287ef814b8434ae720058be1f9 /synapse/notifier.py
parentFix typos in comments. (diff)
downloadsynapse-aec294ee0d0f2fa4ccef57085d670b8939de3669.tar.xz
Use slots in attrs classes where possible (#8296)
slots use less memory (and attribute access is faster) while slightly
limiting the flexibility of the class attributes. This focuses on objects
which are instantiated "often" and for short periods of time.
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r--synapse/notifier.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index 12cd84b27b..a8fd3ef886 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -164,11 +164,9 @@ class _NotifierUserStream:
 
 
 class EventStreamResult(namedtuple("EventStreamResult", ("events", "tokens"))):
-    def __nonzero__(self):
+    def __bool__(self):
         return bool(self.events)
 
-    __bool__ = __nonzero__  # python3
-
 
 class Notifier:
     """ This class is responsible for notifying any listeners when there are