GitHub

Original file line numberDiff line numberDiff line change

@@ -463,13 +463,13 @@ Next `g` is called via `y = g(10)`, leading to the following sequence of actions

463463
464464

* The local namespace for the function is created.

465465

* Local names `x` and `a` are bound, so that the local namespace becomes `{'x': 10, 'a': 1}`.

466-

* Note that the global `a` was not affected by the local `a`.

466+
467+

Note that the global `a` was not affected by the local `a`.

467468
468469

```{figure} /_static/lecture_specific/oop_intro/local1.png

469470

```

470471
471472
472-
473473

* Statement `x = x + a` uses the local `a` and local `x` to compute `x + a`, and binds local name `x` to the result.

474474

* This value is returned, and `y` is bound to it in the global namespace.

475475

* Local `x` and `a` are discarded (and the local namespace is deallocated).

Read the original on github.com ↗