tests/basics: Add test for getting name of func with closed over locals.
Tests correct decoding of the prelude to get the function name.
This commit is contained in:
parent
1d0423419b
commit
4102320e90
@ -22,3 +22,11 @@ try:
|
|||||||
str((1).to_bytes.__name__)
|
str((1).to_bytes.__name__)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# name of a function that has closed over variables
|
||||||
|
def outer():
|
||||||
|
x = 1
|
||||||
|
def inner():
|
||||||
|
return x
|
||||||
|
return inner
|
||||||
|
print(outer.__name__)
|
||||||
|
Loading…
Reference in New Issue
Block a user