fix BaseModel.model_copy() seems to lose intersection data #3113#3547
fix BaseModel.model_copy() seems to lose intersection data #3113#3547asukaminato0721 wants to merge 1 commit into
Conversation
|
Diff from mypy_primer, showing the effect of this PR on open source code: steam.py (https://github.com/Gobot1234/steam.py)
+ ERROR steam/ext/commands/commands.py:782:44-46: Argument `Command[CogT] & GroupMixin` is not assignable to parameter `self` with type `Command & GroupMixin` in function `GroupMixin.remove_all_commands` [bad-argument-type]
strawberry (https://github.com/strawberry-graphql/strawberry)
- ERROR strawberry/relay/types.py:239:27-33: Argument `(self: LazyType[Unknown, Unknown]) -> type[Any] | type[Any]` is not assignable to parameter `cls` with type `type` in function `issubclass` [bad-argument-type]
+ ERROR strawberry/relay/types.py:239:27-33: Argument `(self: LazyType[Unknown, Unknown] & type[Any]) -> type[Any] | type[Any]` is not assignable to parameter `cls` with type `type` in function `issubclass` [bad-argument-type]
- ERROR strawberry/relay/types.py:244:16-22: Returned type `(self: LazyType[Unknown, Unknown]) -> type[Any] | type[Any]` is not assignable to declared return type `type[Node]` [bad-return]
+ ERROR strawberry/relay/types.py:244:16-22: Returned type `(self: LazyType[Unknown, Unknown] & type[Any]) -> type[Any] | type[Any]` is not assignable to declared return type `type[Node]` [bad-return]
static-frame (https://github.com/static-frame/static-frame)
+ ERROR static_frame/core/frame.py:9340:35-41: Argument `Frame & Self@Frame` is not assignable to parameter `self` with type `Frame & Self@Frame` in function `Frame.rename` [bad-argument-type]
mypy (https://github.com/python/mypy)
- ERROR mypy/checkmember.py:1523:12-1528:6: Returned type `CallableType` is not assignable to declared return type `F` [bad-return]
discord.py (https://github.com/Rapptz/discord.py)
+ ERROR discord/ext/commands/core.py:1355:56-58: Argument `Command[CogT, Ellipsis, Any] & GroupMixin[Unknown]` is not assignable to parameter `self` with type `Command[Unknown, Ellipsis, Any] & GroupMixin[Unknown]` in function `GroupMixin.recursively_remove_all_commands` [bad-argument-type]
+ ERROR discord/ext/commands/core.py:1455:49-51: Argument `Command[CogT, Ellipsis, Any] & GroupMixin[Unknown]` is not assignable to parameter `self` with type `Command[Unknown, Ellipsis, Any] & GroupMixin[Unknown]` in function `GroupMixin.walk_commands` [bad-argument-type]
artigraph (https://github.com/artigraph/artigraph)
- ERROR src/arti/types/pydantic.py:27:16-23: Returned type `Type | _NamedMixin` is not assignable to declared return type `Type` [bad-return]
|
Primer Diff Classification❌ 3 regression(s) | ✅ 2 improvement(s) | ➖ 1 neutral | 6 project(s) total | +6, -4 errors 3 regression(s) across steam.py, static-frame, discord.py. error kinds:
Detailed analysis❌ Regression (3)steam.py (+1)
static-frame (+1)
discord.py (+2)
✅ Improvement (2)mypy (-1)
artigraph (-1)
➖ Neutral (1)strawberry (+2, -2)
Suggested fixesSummary: The PR's new intersection self-type propagation via 1. In
Was this helpful? React with 👍 or 👎 Classification by primer-classifier (1 heuristic, 5 LLM) |
Summary
Fixes #3113
Test Plan