Skip to content

Commit

Permalink
add corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Xronophobe committed Dec 30, 2024
1 parent 2ca9e9f commit 8859ab7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions chapter_22_fixtures_and_wait_decorator.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ as a way of temporarily keeping track of some state.
This works for non–logged-in users too.
Just use `request.session` inside any view, and it works as a dict.
There's more information in the
https://docs.djangoproject.com/en/5.0/topics/http/sessions/[Django docs on sessions].
https://docs.djangoproject.com/en/5.1/topics/http/sessions/[Django docs on sessions].
**********************************************************************

Expand Down Expand Up @@ -514,14 +514,16 @@ that have [keep-together]#arguments#:

`wait_to_be_logged_in` takes `self` and `email` as positional arguments.
But when it's decorated, it's replaced with `modified_fn`,
which current takes no arguments.
which currently takes no arguments.
How do we magically make it so our `modified_fn` can handle the same arguments
as whatever `fn` the decorator gets given has?

The answer is a bit of Python magic,
`*args` and `**kwargs`, more formally known as
https://docs.python.org/3/tutorial/controlflow.html#keyword-arguments["variadic arguments"],
apparently (I only just learned that):
// CSANAD: the way I read it, I think they only call `*args` "variadic arguments":
// https://docs.python.org/3/tutorial/controlflow.html#arbitrary-argument-lists



Expand Down

0 comments on commit 8859ab7

Please sign in to comment.