Skip to content

Commit b40fca8

Browse files
committed
Use collections.abc instead of typing where possible
The typing.* variants have been deprecated in Python 3.10.
1 parent ca356bb commit b40fca8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sqlacodegen/generators.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
import sys
66
from abc import ABCMeta, abstractmethod
77
from collections import defaultdict
8+
from collections.abc import Collection, Iterable, Sequence
89
from dataclasses import dataclass
910
from importlib import import_module
1011
from inspect import Parameter
1112
from itertools import count
1213
from keyword import iskeyword
1314
from pprint import pformat
1415
from textwrap import indent
15-
from typing import Any, ClassVar, Collection, DefaultDict, Iterable, Sequence
16+
from typing import Any, ClassVar
1617

1718
import inflect
1819
import sqlalchemy
@@ -579,7 +580,7 @@ def generate_models(self) -> list[Model]:
579580
models_by_table_name: dict[str, Model] = {}
580581

581582
# Pick association tables from the metadata into their own set, don't process them normally
582-
links: DefaultDict[str, list[Model]] = defaultdict(lambda: [])
583+
links: defaultdict[str, list[Model]] = defaultdict(lambda: [])
583584
for table in self.metadata.sorted_tables:
584585
# Link tables have exactly two foreign key constraints and all columns are involved in
585586
# them

0 commit comments

Comments
 (0)