From: Daniele Varrazzo Date: Sun, 26 Sep 2021 19:47:06 +0000 (+0200) Subject: Fix BytesDumper return type annotation X-Git-Tag: 3.0~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ec940572c4980c4d056714d93a60827fe2a7b7a;p=thirdparty%2Fpsycopg.git Fix BytesDumper return type annotation --- diff --git a/psycopg/psycopg/types/string.py b/psycopg/psycopg/types/string.py index 3b9c355d4..9f8deb079 100644 --- a/psycopg/psycopg/types/string.py +++ b/psycopg/psycopg/types/string.py @@ -115,9 +115,7 @@ class BytesDumper(Dumper): self.connection.pgconn if self.connection else None ) - def dump(self, obj: bytes) -> memoryview: - # TODO: mypy doesn't complain, but this function has the wrong signature - # probably dump return value should be extended to Buffer + def dump(self, obj: bytes) -> Buffer: return self._esc.escape_bytea(obj) def quote(self, obj: bytes) -> bytes: