From f61b94e9f7befcce87ab0848fdafb833338aec50 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 24 Dec 2020 05:00:27 +0100 Subject: [PATCH] PostgresQuery const initialisation moved to the class --- psycopg3/psycopg3/_queries.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/psycopg3/psycopg3/_queries.py b/psycopg3/psycopg3/_queries.py index cdf4c1883..5df9237be 100644 --- a/psycopg3/psycopg3/_queries.py +++ b/psycopg3/psycopg3/_queries.py @@ -30,18 +30,18 @@ class PostgresQuery: Helper to convert a Python query and parameters into Postgres format. """ + _unknown_oid = INVALID_OID + _parts: List[QueryPart] _query = b"" - _unknown_oid = INVALID_OID + params: Optional[List[Optional[bytes]]] = None + # these are tuples so they can be used as keys e.g. in prepared stmts + types: Tuple[int, ...] = () + formats: Optional[List[Format]] = None + _order: Optional[List[str]] = None def __init__(self, transformer: "Transformer"): self._tx = transformer - self.params: Optional[List[Optional[bytes]]] = None - # these are tuples so they can be used as keys e.g. in prepared stmts - self.types: Tuple[int, ...] = () - self.formats: Optional[List[Format]] = None - - self._order: Optional[List[str]] = None if ( self._tx.connection and self._tx.connection.pgconn.server_version < 100000 -- 2.47.2