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.
This patch can be removed once scipy is updated to >= 0.18
AttributeError is raised by the absence of next_fast_len
--- PyWavelets-1.1.1/pywt/_cwt.py.old	2020-12-16 08:19:13.000000000 +0100
+++ PyWavelets-1.1.1/pywt/_cwt.py	2020-12-16 08:20:23.000000000 +0100
@@ -20,7 +20,7 @@
         import scipy.fftpack
         fftmodule = scipy.fftpack
         next_fast_len = fftmodule.next_fast_len
-    except ImportError:
+    except (AttributeError, ImportError):
         fftmodule = np.fft
 
         # provide a fallback so scipy is an optional requirement

This patch can be removed once scipy is updated to >= 0.18
AttributeError is raised by the absence of next_fast_len
--- PyWavelets-1.1.1/pywt/_cwt.py.old	2020-12-16 08:19:13.000000000 +0100
+++ PyWavelets-1.1.1/pywt/_cwt.py	2020-12-16 08:20:23.000000000 +0100
@@ -20,7 +20,7 @@
         import scipy.fftpack
         fftmodule = scipy.fftpack
         next_fast_len = fftmodule.next_fast_len
-    except ImportError:
+    except (AttributeError, ImportError):
         fftmodule = np.fft
 
         # provide a fallback so scipy is an optional requirement
