You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/docs/tutorial/extra-models.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,9 +70,9 @@ we would get a Python `dict` with:
70
70
}
71
71
```
72
72
73
-
#### Unwrapping a `dict`
73
+
#### Unpacking a `dict`
74
74
75
-
If we take a `dict` like `user_dict` and pass it to a function (or class) with `**user_dict`, Python will "unwrap" it. It will pass the keys and values of the `user_dict` directly as key-value arguments.
75
+
If we take a `dict` like `user_dict` and pass it to a function (or class) with `**user_dict`, Python will "unpack" it. It will pass the keys and values of the `user_dict` directly as key-value arguments.
76
76
77
77
So, continuing with the `user_dict` from above, writing:
78
78
@@ -117,11 +117,11 @@ would be equivalent to:
117
117
UserInDB(**user_in.dict())
118
118
```
119
119
120
-
...because `user_in.dict()` is a `dict`, and then we make Python "unwrap" it by passing it to `UserInDB` prefixed with `**`.
120
+
...because `user_in.dict()` is a `dict`, and then we make Python "unpack" it by passing it to `UserInDB` prefixed with `**`.
121
121
122
122
So, we get a Pydantic model from the data in another Pydantic model.
123
123
124
-
#### Unwrapping a `dict` and extra keywords
124
+
#### Unpacking a `dict` and extra keywords
125
125
126
126
And then adding the extra keyword argument `hashed_password=hashed_password`, like in:
0 commit comments