updated for version 7.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)
diff --git a/src/testdir/test87.in b/src/testdir/test87.in
index 8f70fcf..210c055 100644
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -669,6 +669,24 @@
     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