diff options
author | Damien George <damien.p.george@gmail.com> | 2019-09-26 11:48:39 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-10-01 12:26:22 +1000 |
commit | 4102320e908dfa6e2fc320d73f118670ad5b1501 (patch) | |
tree | 59863e2f5eb50f5df800a40009890764f78b1900 | |
parent | 1d0423419b6da1f865ad73e1a95f26e724770ab7 (diff) |
tests/basics: Add test for getting name of func with closed over locals.
Tests correct decoding of the prelude to get the function name.
-rw-r--r-- | tests/basics/fun_name.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/basics/fun_name.py b/tests/basics/fun_name.py index 53ca93561..bb1f14992 100644 --- a/tests/basics/fun_name.py +++ b/tests/basics/fun_name.py @@ -22,3 +22,11 @@ try: str((1).to_bytes.__name__) except AttributeError: pass + +# name of a function that has closed over variables +def outer(): + x = 1 + def inner(): + return x + return inner +print(outer.__name__) |