0x1949 Team - FAZEMRX - MANAGER
Edit File: _pmap.cpython-310.pyc
o ���an9 � @ s� d dl mZmZ d dlmZ d dlmZ d dlmZ G dd� de �Z e�e � e�e � dd� Zei d �Z i d fd d �Zdd� Zd S )� )�Mapping�Hashable)�chain)�pvector�� transformc sD e Zd ZdZdZ� fdd�Zedd� �Zedd� �Zd d � Z edd� �Z d d� Zej Z dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� ZejZd%d&� ZeZeZeZd'd(� Zd)d*� Zd+d,� Z d-d.� Z!d/d0� Z"d1d2� Z#d3d4� Z$d5d6� Z%e%Z&d7d8� Z'd9d:� Z(d;d<� Z)G d=d>� d>e*�Z+d?d@� Z,� Z-S )A�PMapa� Persistent map/dict. Tries to follow the same naming conventions as the built in dict where feasible. Do not instantiate directly, instead use the factory functions :py:func:`m` or :py:func:`pmap` to create an instance. Was originally written as a very close copy of the Clojure equivalent but was later rewritten to closer re-assemble the python dict. This means that a sparse vector (a PVector) of buckets is used. The keys are hashed and the elements inserted at position hash % len(bucket_vector). Whenever the map size exceeds 2/3 of the containing vectors size the map is reallocated to a vector of double the size. This is done to avoid excessive hash collisions. This structure corresponds most closely to the built in dict type and is intended as a replacement. Where the semantics are the same (more or less) the same function names have been used but for some cases it is not possible, for example assignments and deletion of values. PMap implements the Mapping protocol and is Hashable. It also supports dot-notation for element access. Random access and insert is log32(n) where n is the size of the map. The following are examples of some common operations on persistent maps >>> m1 = m(a=1, b=3) >>> m2 = m1.set('c', 3) >>> m3 = m2.remove('a') >>> m1 == {'a': 1, 'b': 3} True >>> m2 == {'a': 1, 'b': 3, 'c': 3} True >>> m3 == {'b': 3, 'c': 3} True >>> m3['c'] 3 >>> m3.c 3 )�_size�_buckets�__weakref__�_cached_hashc s t t| ��| �}||_||_|S �N)�superr �__new__r r )�cls�size�buckets�self�� __class__� �2/usr/lib/python3/dist-packages/pyrsistent/_pmap.pyr / s zPMap.__new__c C s t |�t| � }| | }||fS r )�hash�len)r �key�index�bucketr r r �_get_bucket5 s zPMap._get_bucketc C s: t �| |�\}}|r|D ]\}}||kr| S qt|��r )r r �KeyError)r r �_r �k�vr r r �_getitem; s �z PMap._getitemc C � t �| j|�S r )r r"