Message328319
Ok, that’s fair. But then the inspect module currently doesn’t provide tools to the user to construct the recursive identification without duplicating code already in stdlib. For that, one would need to refactor getclosurevars() to two parts: getcode() and getclosurevars_from_code(). Then one could do:
clvars = ClosureVars({}, {}, {}, set())
codes = [getcode(func)]
while codes:
code = codes.pop()
for const in code.co_consts:
if iscode(const):
codes.append(const)
lclvars = getclosurevars_from_code(code)
for v, lv in zip(clvars, lclvars):
v.update(lv) |
|
Date |
User |
Action |
Args |
2018-10-23 14:56:22 | jhrmnn | set | recipients:
+ jhrmnn, josh.r |
2018-10-23 14:56:22 | jhrmnn | set | messageid: <1540306582.07.0.788709270274.issue34947@psf.upfronthosting.co.za> |
2018-10-23 14:56:22 | jhrmnn | link | issue34947 messages |
2018-10-23 14:56:22 | jhrmnn | create | |
|