How to use the immutables.map.Map._new function in immutables

To help you get started, we’ve selected a few immutables examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MagicStack / immutables / immutables / map.py View on Github external
def finish(self):
        self.__mutid = 0
        return Map._new(self.__count, self.__root)
github MagicStack / immutables / immutables / map.py View on Github external
def set(self, key, val):
        new_count = self.__count
        new_root, added = self.__root.assoc(0, map_hash(key), key, val, 0)

        if new_root is self.__root:
            assert not added
            return self

        if added:
            new_count += 1

        return Map._new(new_count, new_root)