MCPcopy
hub / github.com/redis/redis-py / __repr__

Method __repr__

redis/maint_notifications.py:156–171  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

154 self.new_node_port = new_node_port
155
156 def __repr__(self) -> str:
157 expiry_time = self.expire_at
158 remaining = max(0, expiry_time - time.monotonic())
159
160 return (
161 f"{self.__class__.__name__}("
162 f"id={self.id}, "
163 f"new_node_host='{self.new_node_host}', "
164 f"new_node_port={self.new_node_port}, "
165 f"ttl={self.ttl}, "
166 f"creation_time={self.creation_time}, "
167 f"expires_at={expiry_time}, "
168 f"remaining={remaining:.1f}s, "
169 f"expired={self.is_expired()}"
170 f")"
171 )
172
173 def __eq__(self, other) -> bool:
174 """

Callers

nothing calls this directly

Calls 3

maxClass · 0.85
monotonicMethod · 0.80
is_expiredMethod · 0.45

Tested by

no test coverage detected