From: Daniele Varrazzo Date: Mon, 19 Jul 2021 18:16:55 +0000 (+0200) Subject: Display the Dumper oid in its repr X-Git-Tag: 3.0.dev2~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=794c8e8bbfe04f4cb6facfc77c733ce5197570e5;p=thirdparty%2Fpsycopg.git Display the Dumper oid in its repr --- diff --git a/psycopg/psycopg/adapt.py b/psycopg/psycopg/adapt.py index 06d38d51c..29c59f396 100644 --- a/psycopg/psycopg/adapt.py +++ b/psycopg/psycopg/adapt.py @@ -39,6 +39,12 @@ class Dumper(abc.Dumper, ABC): self.oid = self._oid + def __repr__(self) -> str: + return ( + f"<{type(self).__module__}.{type(self).__qualname__}" + f" (oid={self.oid}) at 0x{id(self):x}>" + ) + @abstractmethod def dump(self, obj: Any) -> Buffer: ...