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

Method __repr__

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

Source from the content-addressed store, hash-verified

322 super().__init__(id, ttl)
323
324 def __repr__(self) -> str:
325 expiry_time = self.creation_time + self.ttl
326 remaining = max(0, expiry_time - time.monotonic())
327 return (
328 f"{self.__class__.__name__}("
329 f"id={self.id}, "
330 f"ttl={self.ttl}, "
331 f"creation_time={self.creation_time}, "
332 f"expires_at={expiry_time}, "
333 f"remaining={remaining:.1f}s, "
334 f"expired={self.is_expired()}"
335 f")"
336 )
337
338 def __eq__(self, other) -> bool:
339 """

Callers

nothing calls this directly

Calls 3

maxClass · 0.85
monotonicMethod · 0.80
is_expiredMethod · 0.45

Tested by

no test coverage detected