We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
assoc
1 parent 4137875 commit ff00223Copy full SHA for ff00223
unification/core.py
@@ -1,6 +1,5 @@
1
from collections import OrderedDict, deque
2
from collections.abc import Generator, Iterator, Mapping, Set
3
-from copy import copy
4
from functools import partial
5
from operator import length_hint
6
@@ -16,10 +15,7 @@
16
15
@dispatch(Mapping, object, object)
17
def assoc(s, u, v):
18
"""Add an entry to a `Mapping` and return it."""
19
- if hasattr(s, "copy"):
20
- s = s.copy()
21
- else:
22
- s = copy(s) # pragma: no cover
+ s = dict(s)
23
s[u] = v
24
return s
25
0 commit comments