Rename `v` to `wrapped_func` in `metawrapper.__newindex()`

This commit is contained in:
Gnome Ann 2021-12-12 12:20:01 -05:00
parent d76dd35791
commit e06861bb0b
1 changed files with 4 additions and 4 deletions

View File

@ -110,8 +110,8 @@ return function(_python, _bridged)
---@generic T : table
---@param t T
---@return T
function metawrapper.__newindex(t, k, v)
if type(v) == "function" then
function metawrapper.__newindex(t, k, wrapped_func)
if type(wrapped_func) == "function" then
return rawset(t, k, function(...)
local _needs_unwrap = false
if not wrapped then
@ -120,7 +120,7 @@ return function(_python, _bridged)
_needs_unwrap = true
wrapped = true
end
local r = {v(...)}
local r = {wrapped_func(...)}
if _needs_unwrap then
metatables:restore()
wrapped = false
@ -128,7 +128,7 @@ return function(_python, _bridged)
return table.unpack(r)
end)
else
return rawset(t, k, v)
return rawset(t, k, wrapped_func)
end
end