patch 7.4.1559
Problem:    Passing cookie to a callback is clumsy.
Solution:   Change function() to take arguments and return a partial.
diff --git a/src/if_py_both.h b/src/if_py_both.h
index e916e6a..8070bd6 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -2944,7 +2944,7 @@
     Python_Lock_Vim();
 
     VimTryStart();
-    error = func_call(name, &args, selfdict, &rettv);
+    error = func_call(name, &args, NULL, selfdict, &rettv);
 
     Python_Release_Vim();
     Py_END_ALLOW_THREADS