8000 Update _AsSqlType to allow tuple[str, tuple] (#2673) · typeddjango/django-stubs@10f75b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 10f75b6

Browse files
Update _AsSqlType to allow tuple[str, tuple] (#2673)
See https://code.djangoproject.com/ticket/35972 for a proposal to eventually narrow this type to tuple[str, tuple]. Until then, allow both tuple[str, tuple] and tuple[str, list].
1 parent 828ead6 commit 10f75b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

django-stubs/db/models/sql/compiler.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ from django.db.models.base import Model
1010
from django.db.models.expressions import BaseExpression, Expression, Ref
1111
from django.db.models.sql.query import Query
1212
from django.db.models.sql.subqueries import AggregateQuery, DeleteQuery, InsertQuery, UpdateQuery
13+
from django.utils.datastructures import _ListOrTuple
1314
from django.utils.functional import cached_property
1415

1516
_ParamT: TypeAlias = str | int
1617

17-
_ParamsT: TypeAlias = list[_ParamT]
18+
_ParamsT: TypeAlias = _ListOrTuple[_ParamT]
1819
_AsSqlType: TypeAlias = tuple[str, _ParamsT]
1920

2021
class PositionRef(Ref):

0 commit comments

Comments
 (0)
0