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

Method __repr__

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

Source from the content-addressed store, hash-verified

223 super().__init__(id, ttl)
224
225 def __repr__(self) -> str:
226 expiry_time = self.creation_time + self.ttl
227 remaining = max(0, expiry_time - time.monotonic())
228 return (
229 f"{self.__class__.__name__}("
230 f"id={self.id}, "
231 f"ttl={self.ttl}, "
232 f"creation_time={self.creation_time}, "
233 f"expires_at={expiry_time}, "
234 f"remaining={remaining:.1f}s, "
235 f"expired={self.is_expired()}"
236 f")"
237 )
238
239 def __eq__(self, other) -> bool:
240 """

Callers

nothing calls this directly

Calls 3

maxClass · 0.85
monotonicMethod · 0.80
is_expiredMethod · 0.45

Tested by

no test coverage detected