Skip to content

Commit de4714c

Browse files
author
Doug Borg
committed
fix: use List instead of list for Python 3.9 compatibility
Replace lowercase 'list' type hints with uppercase 'List' from typing module to support Python 3.9. The lowercase generic types require either: - Python 3.9+ with 'from __future__ import annotations' - Python 3.10+ without future import Since the project supports Python 3.9, use the typing.List import instead. Fixes ty type checker errors in CI.
1 parent 633b26f commit de4714c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.claude/settings.local.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(poetry run pytest:*)"
5+
],
6+
"deny": [],
7+
"ask": []
8+
}
9+
}

src/openapi_python_generator/language_converters/python/model_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _wrap_optional(type_str: str, required: bool) -> str:
143143
return f"Optional[{type_str}]"
144144

145145

146-
def _collect_unique_imports(conversions: list[TypeConversion]) -> Optional[List[str]]:
146+
def _collect_unique_imports(conversions: List[TypeConversion]) -> Optional[List[str]]:
147147
"""
148148
Safely collect and deduplicate imports from conversions.
149149
@@ -246,7 +246,7 @@ def _convert_array_type(
246246

247247
def _convert_composite_schema(
248248
kind: str,
249-
sub_schemas: list[Union[Schema, Reference]],
249+
sub_schemas: List[Union[Schema, Reference]],
250250
required: bool,
251251
model_name: Optional[str],
252252
) -> TypeConversion:

0 commit comments

Comments
 (0)