main commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-16 16:30:25 +09:00
parent 91c7e04474
commit 537e7b363f
1146 changed files with 45926 additions and 77196 deletions

View File

@@ -1,5 +1,5 @@
# ext/mypy/apply.py
# Copyright (C) 2021-2025 the SQLAlchemy authors and contributors
# Copyright (C) 2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
@@ -161,9 +161,9 @@ def re_apply_declarative_assignments(
# update the SQLAlchemyAttribute with the better
# information
mapped_attr_lookup[stmt.lvalues[0].name].type = (
python_type_for_type
)
mapped_attr_lookup[
stmt.lvalues[0].name
].type = python_type_for_type
update_cls_metadata = True
@@ -199,15 +199,11 @@ def apply_type_to_mapped_statement(
To one that describes the final Python behavior to Mypy::
... format: off
class User(Base):
# ...
attrname : Mapped[Optional[int]] = <meaningless temp node>
... format: on
"""
left_node = lvalue.node
assert isinstance(left_node, Var)
@@ -227,11 +223,9 @@ def apply_type_to_mapped_statement(
lvalue.is_inferred_def = False
left_node.type = api.named_type(
NAMED_TYPE_SQLA_MAPPED,
(
[AnyType(TypeOfAny.special_form)]
if python_type_for_type is None
else [python_type_for_type]
),
[AnyType(TypeOfAny.special_form)]
if python_type_for_type is None
else [python_type_for_type],
)
# so to have it skip the right side totally, we can do this: