forked from aniani/vim
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>
This commit is contained in:
committed by
Christian Brabandt
parent
fd1a838d36
commit
ea19e7856b
17
src/testdir/test_vim9_python3.vim
Normal file
17
src/testdir/test_vim9_python3.vim
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user