From: Daniele Varrazzo Date: Thu, 30 May 2024 01:35:10 +0000 (+0200) Subject: refactor: drop use of typing.Set X-Git-Tag: 3.2.0~19^2~3 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2724fc65839232b9b43ae5f11b559f909c6a525c;p=thirdparty%2Fpsycopg.git refactor: drop use of typing.Set --- diff --git a/psycopg/psycopg/types/array.py b/psycopg/psycopg/types/array.py index 7ff09d4f2..ea8dfd316 100644 --- a/psycopg/psycopg/types/array.py +++ b/psycopg/psycopg/types/array.py @@ -9,7 +9,7 @@ from __future__ import annotations import re import struct from math import prod -from typing import Any, cast, Callable, Pattern, Set +from typing import Any, cast, Callable, Pattern from .. import pq from .. import errors as e @@ -84,7 +84,7 @@ class BaseListDumper(RecursiveDumper): else: return max(imax, -imin - 1) - def _flatiter(self, L: list[Any], seen: Set[int]) -> Any: + def _flatiter(self, L: list[Any], seen: set[int]) -> Any: if id(L) in seen: raise e.DataError("cannot dump a recursive list") diff --git a/tests/fix_faker.py b/tests/fix_faker.py index e09a59f9b..dc26d5edf 100644 --- a/tests/fix_faker.py +++ b/tests/fix_faker.py @@ -6,7 +6,7 @@ import ipaddress from math import isnan from uuid import UUID from random import choice, random, randrange -from typing import Any, Set +from typing import Any from decimal import Decimal from contextlib import contextmanager, asynccontextmanager @@ -225,7 +225,7 @@ class Faker: m = self.get_matcher(spec) m(spec, g, w) - def get_supported_types(self) -> Set[type]: + def get_supported_types(self) -> set[type]: dumpers = self.conn.adapters._dumpers[self.format] rv = set() for cls in dumpers.keys():