Browse Source

📝 Change the word "unwrap" to "unpack" in `docs/en/docs/tutorial/extra-models.md` (#13061)

Co-authored-by: timothy <[email protected]>
Co-authored-by: Sofie Van Landeghem <[email protected]>
pull/13285/head
timothy 2 months ago
committed by GitHub
parent
commit
83ab6ac957
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      docs/en/docs/tutorial/extra-models.md

8
docs/en/docs/tutorial/extra-models.md

@ -70,9 +70,9 @@ we would get a Python `dict` with:
} }
``` ```
#### Unwrapping a `dict` #### Unpacking a `dict`
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. 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.
So, continuing with the `user_dict` from above, writing: So, continuing with the `user_dict` from above, writing:
@ -117,11 +117,11 @@ would be equivalent to:
UserInDB(**user_in.dict()) UserInDB(**user_in.dict())
``` ```
...because `user_in.dict()` is a `dict`, and then we make Python "unwrap" it by passing it to `UserInDB` prefixed with `**`. ...because `user_in.dict()` is a `dict`, and then we make Python "unpack" it by passing it to `UserInDB` prefixed with `**`.
So, we get a Pydantic model from the data in another Pydantic model. So, we get a Pydantic model from the data in another Pydantic model.
#### Unwrapping a `dict` and extra keywords #### Unpacking a `dict` and extra keywords
And then adding the extra keyword argument `hashed_password=hashed_password`, like in: And then adding the extra keyword argument `hashed_password=hashed_password`, like in:

Loading…
Cancel
Save