From 4102320e908dfa6e2fc320d73f118670ad5b1501 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 26 Sep 2019 11:48:39 +1000 Subject: [PATCH] tests/basics: Add test for getting name of func with closed over locals. Tests correct decoding of the prelude to get the function name. --- tests/basics/fun_name.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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__)