目录解决方案1. 使用 locals() 函数2. 使用 globals() 函数3. 使用 nonlocal 关键字代码例子在 python 中,函数内部无法直接获取函数外部的局部变量。这可能会导致一些问题,例如:
In ArrayBlockingQueue, all the methods that require the lock copy it to a local final variable before calling lock().