comparison src/testdir/test87.in @ 4496:ebd94eabfd80 v7.3.996

updated for version 7.3.996 Problem: Python: Can't check types of what is returned by bindeval(). Solution: Add vim.List, vim.Dictionary and vim.Function types. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Tue, 21 May 2013 19:50:34 +0200
parents 0a94ac379769
children ef02f32d8e53
comparison
equal deleted inserted replaced
4495:fe5605ef4d72 4496:ebd94eabfd80
620 if b is not cb: 620 if b is not cb:
621 vim.command('bwipeout! ' + str(b.number)) 621 vim.command('bwipeout! ' + str(b.number))
622 EOF 622 EOF
623 :tabonly! 623 :tabonly!
624 :only! 624 :only!
625 :"
626 :" Test types
627 py3 << EOF
628 for expr, attr in (
629 ('vim.vars', 'Dictionary'),
630 ('vim.options', 'Options'),
631 ('vim.bindeval("{}")', 'Dictionary'),
632 ('vim.bindeval("[]")', 'List'),
633 ('vim.bindeval("function(\'tr\')")', 'Function'),
634 ('vim.current.buffer', 'Buffer'),
635 ('vim.current.range', 'Range'),
636 ('vim.current.window', 'Window'),
637 ('vim.current.tabpage', 'TabPage'),
638 ):
639 cb.append(expr + ':' + attr + ':' + repr(type(eval(expr)) is getattr(vim, attr)))
640 EOF
625 :endfun 641 :endfun
626 :" 642 :"
627 :call Test() 643 :call Test()
628 :" 644 :"
629 :delfunc Test 645 :delfunc Test