z`M X d dl mZ d dlmZmZ d dlmZmZ d dlm Z m
Z
d
dZd
dZd Z
d S ) wraps)PMappmap)PSetpset)PVectorpvectorTc t | }|t u srBt | t r-t fd| D S |t u sr7t | t r"fd}t t || S |t u r"fd}t t || S |t u rt | S | S )a}
Recursively convert simple Python containers into pyrsistent versions
of those containers.
- list is converted to pvector, recursively
- dict is converted to pmap, recursively on values (but not keys)
- set is converted to pset, but not recursively
- tuple is converted to tuple, recursively.
If strict == True (default):
- freeze is called on elements of pvectors
- freeze is called on values of pmaps
Sets and dict keys are not recursively frozen because they do not contain
mutable data by convention. The main exception to this rule is that
dict keys and set elements are often instances of mutable objects that
support hash-by-id, which this function can't convert anyway.
>>> freeze(set([1, 2]))
pset([1, 2])
>>> freeze([1, {'a': 3}])
pvector([1, pmap({'a': 3})])
>>> freeze((1, []))
(1, pvector([]))
c 8 i | ]\ }}|t | S freeze.0kvstricts s/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/pyrsistent/_helpers.py