This changes the calling convention for calling a Javascript function from Python so that any proxied arguments are automatically destroyed at the end of the function call. This is a breaking change. It should make it much more convenient to use the foreign function interface. 

The docs need to be updated to explain the new calling convention before this can be merged. We should put a link to the appropriate section in the docs into the error message emitted when a borrowed proxy is used after it is free so that people have an easy time learning the model by trial and error.
ENH Destroy proxies created in JsProxy.__call__ when done with call. This changes the calling convention for calling a Javascript function from Python so that any proxied arguments are automatically destroyed at the end of the function call. This is a breaking change. It should make it much more convenient to use the foreign function interface. 

The docs need to be updated to explain the new calling convention before this can be merged. We should put a link to the appropriate section in the docs into the error message emitted when a borrowed proxy is used after it is free so that people have an easy time learning the model by trial and error.
commit d6740caa7400105a578ace74f8c25bbb3434178c
Author: Roman Yurchak <rth.yurchak@pm.me>
Date:   Wed Oct 10 14:47:12 2018 +0200

    Disable scipy.stats.mvn

diff --git a/scipy/stats/kde.py b/scipy/stats/kde.py
index 7c702a038..8b0ab0254 100644
--- a/scipy/stats/kde.py
+++ b/scipy/stats/kde.py
@@ -32,7 +32,10 @@ import numpy as np
 from numpy.random import randint, multivariate_normal
 
 # Local imports.
-from . import mvn
+try:
+    from . import mvn
+except ImportError:
+    mvn = None
 
 
 __all__ = ['gaussian_kde']
diff --git a/scipy/stats/setup.py b/scipy/stats/setup.py
index f1a02df4e..7366ec12d 100755
--- a/scipy/stats/setup.py
+++ b/scipy/stats/setup.py
@@ -32,9 +32,9 @@ def configuration(parent_package='',top_path=None):
     )
 
     # add mvn module
-    config.add_extension('mvn',
-        sources=['mvn.pyf','mvndst.f'],
-    )
+    #config.add_extension('mvn',
+    #    sources=['mvn.pyf','mvndst.f'],
+    #)
 
     return config
 

commit d6740caa7400105a578ace74f8c25bbb3434178c
Author: Roman Yurchak <rth.yurchak@pm.me>
Date:   Wed Oct 10 14:47:12 2018 +0200

    Disable scipy.stats.mvn

diff --git a/scipy/stats/kde.py b/scipy/stats/kde.py
index 7c702a038..8b0ab0254 100644
--- a/scipy/stats/kde.py
+++ b/scipy/stats/kde.py
@@ -32,7 +32,10 @@ import numpy as np
 from numpy.random import randint, multivariate_normal
 
 # Local imports.
-from . import mvn
+try:
+    from . import mvn
+except ImportError:
+    mvn = None
 
 
 __all__ = ['gaussian_kde']
diff --git a/scipy/stats/setup.py b/scipy/stats/setup.py
index f1a02df4e..7366ec12d 100755
--- a/scipy/stats/setup.py
+++ b/scipy/stats/setup.py
@@ -32,9 +32,9 @@ def configuration(parent_package='',top_path=None):
     )
 
     # add mvn module
-    config.add_extension('mvn',
-        sources=['mvn.pyf','mvndst.f'],
-    )
+    #config.add_extension('mvn',
+    #    sources=['mvn.pyf','mvndst.f'],
+    #)
 
     return config
 
