[3.8] Doc: Use walrus operator in example. (GH-15934) (GH-15936)

(cherry picked from commit e1d455f3a3b82c2e08d5e133bcbab5a181b66cfb)

Co-authored-by: Julien Palard <julien@palard.fr>
1 file changed