summaryrefslogtreecommitdiffstats
path: root/src/testdir/test87.in
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-05-29 22:36:10 +0200
committerBram Moolenaar <Bram@vim.org>2013-05-29 22:36:10 +0200
commitdd8aca664d9768614d18cebec84badc3ecad3af5 (patch)
tree6002f0821e725f7829f73bc05336f4fc4ca376a3 /src/testdir/test87.in
parent432b09c84dc6daf0b7ca8dac986bc0b1faf899d7 (diff)
updated for version 7.3.1047v7.3.1047
Problem: Python: dir() does not work properly. Solution: Python patch 8. Add __dir__ method to all objects with custom tp_getattr supplemented by __members__ attribute for at least python-2* versions. __members__ is not mentioned in python-3* dir() output even if it is accessible. (ZyX)
Diffstat (limited to 'src/testdir/test87.in')
-rw-r--r--src/testdir/test87.in18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test87.in b/src/testdir/test87.in
index 8f70fcf907..210c055d75 100644
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -669,6 +669,24 @@ for expr, attr in (
cb.append(expr + ':' + attr + ':' + repr(type(eval(expr)) is getattr(vim, attr)))
EOF
:"
+:" Test __dir__() method
+py3 << EOF
+for name, o in (
+ ('current', vim.current),
+ ('buffer', vim.current.buffer),
+ ('window', vim.current.window),
+ ('tabpage', vim.current.tabpage),
+ ('range', vim.current.range),
+ ('dictionary', vim.bindeval('{}')),
+ ('list', vim.bindeval('[]')),
+ ('function', vim.bindeval('function("tr")')),
+ ('output', sys.stdout),
+ ):
+ cb.append(name + ':' + ','.join(dir(o)))
+del name
+del o
+EOF
+:"
:" Test exceptions
:fun Exe(e)
: execute a:e