]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
refactor: drop use of typing.Set
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 30 May 2024 01:35:10 +0000 (03:35 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 4 Jun 2024 14:52:16 +0000 (16:52 +0200)
psycopg/psycopg/types/array.py
tests/fix_faker.py

index 7ff09d4f2851499333fe2e079a613cd3f71ec243..ea8dfd31616198f7cf0632ce48aab353bcb93ffc 100644 (file)
@@ -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")
 
index e09a59f9b41414a95ebc985a8d42a0c0b23d5e18..dc26d5edf4c6687d405b407a9626014bcc858c77 100644 (file)
@@ -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():