patch 9.1.0844: if_python: no way to pass local vars to python

Problem:  if_python: no way to pass local vars to python
Solution: Add locals argument to py3eval(), pyeval() and pyxeval()
          (Ben Jackson)

fixes: #8573
closes: #10594

Signed-off-by: Ben Jackson <puremourning@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_vim9_python3.vim b/src/testdir/test_vim9_python3.vim
new file mode 100644
index 0000000..697b368
--- /dev/null
+++ b/src/testdir/test_vim9_python3.vim
@@ -0,0 +1,17 @@
+
+source check.vim
+import './vim9.vim' as v9
+CheckFeature python3
+
+def Test_python3_py3eval_locals()
+  var lines =<< trim EOF
+    var s = 'string'
+    var d = {'s': s}
+    assert_equal('string', py3eval('s', {'s': s}))
+    py3eval('d.update({"s": "new"})', {'d': d})
+    assert_equal('new', d['s'])
+  EOF
+  v9.CheckDefAndScriptSuccess(lines)
+enddef
+
+" vim: shiftwidth=2 sts=2 expandtab