Repository: dask/dask

Issue:
dask.core.quote does not quote dicts
It seems that dask now recurses into dicts stored within a graph to find keys (I'm not quite sure when that came in: #1748 proposed it but was never merged). However, `quote` doesn't take that into account.

```python3
from dask import core
core.get({"x": quote({"a": "x"})}, "x")
```

Produces
```
RuntimeError: Cycle detected in Dask: x->x
```

I'll make a PR to fix it.

Discussion:

Patch:
diff --git a/dask/core.py b/dask/core.py
index 59d9fd921..153c39a4d 100644
--- a/dask/core.py
+++ b/dask/core.py
@@ -463,6 +463,6 @@ def quote(x):
     >>> quote((add, 1, 2))  # doctest: +SKIP
     (literal<type=tuple>,)
     """
-    if istask(x) or type(x) is list:
+    if istask(x) or type(x) is list or type(x) is dict:
         return (literal(x),)
     return x


Test patch:
diff --git a/dask/tests/test_core.py b/dask/tests/test_core.py
index 8ebe0acd3..1f8eacb88 100644
--- a/dask/tests/test_core.py
+++ b/dask/tests/test_core.py
@@ -250,7 +250,7 @@ def test_subs_unexpected_hashable_key():
 
 
 def test_quote():
-    literals = [[1, 2, 3], (add, 1, 2), [1, [2, 3]], (add, 1, (add, 2, 3))]
+    literals = [[1, 2, 3], (add, 1, 2), [1, [2, 3]], (add, 1, (add, 2, 3)), {"x": "x"}]
 
     for l in literals:
         assert core.get({"x": quote(l)}, "x") == l