2018-07-21 | Paul Boddie | file changeset files shortlog | Invocations in parameter lists may require temporary storage for contexts and accessors, but the storage locations must be different. Otherwise, the code will generate a sequence-point warning. Here, distinct ranges for parameters in lists are introduced, and accessors are now also stored in arrays, permitting distinct storage. |
paul@2 | 1 | a = 4 |
paul@2 | 2 | |
paul@2 | 3 | def f(x): |
paul@2 | 4 | if not x: |
paul@2 | 5 | def g(y): |
paul@2 | 6 | return x, y, a |
paul@2 | 7 | return g # UnboundLocalError: not defined if x is true |
paul@2 | 8 | |
paul@2 | 9 | result = f(1)(2) |
paul@2 | 10 | assert result == (1, 2, 4) |