Added a singledispatch as a dependency on older python installs.

Needed by 'Paint data' widget.