You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think discard should ever add anything to a PMap
This caused serious headache for me as we were using a transformation with discard to remove an empty map with a specific key if it existed, but when we bumped the version of pyrsistent we were using, that transformation started adding new empty maps one level up from the potential location of the empty map.
For example:
versions <0.15.2
>>> freeze({'baz':{'foo':{'bar':1}},'boo':{'far':2}}).transform([ny,'foo','bar'],discard)
pmap({'boo': pmap({'far': 2}), 'baz': pmap({'foo': pmap({})})}) # this is what I expect
30f1381 changed the way transforms work so that they add intervening nodes from the matcher which didn't previously exist.
This addressed the case in #154 and made
Have the intuitive result:
Rather than
But I think this added an unintuitive side-effect to discard where it will add nodes.
in versions >=0.15.2:
in versions <0.15.2:
I don't think discard should ever add anything to a PMap
This caused serious headache for me as we were using a transformation with discard to remove an empty map with a specific key if it existed, but when we bumped the version of pyrsistent we were using, that transformation started adding new empty maps one level up from the potential location of the empty map.
For example:
versions <0.15.2
versions >=0.15.2
The text was updated successfully, but these errors were encountered: