| Server IP : 104.21.4.30 / Your IP : 104.23.243.108 Web Server : Apache System : Linux keen-cori.18-142-40-148.plesk.page 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64 User : simottodesign.com_2tntp341vs7 ( 10011) PHP Version : 8.3.31 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/pyrsistent/__pycache__/ |
Upload File : |
U
+�[b � @ s� d dl mZmZmZmZ ddlmZ ddlmZ dd� Z G dd� de
�Ze�e� e�e� e�e� e�e� d d
� Z
dd� Zee� �Zd
S )� )� Container�Iterable�Sized�Hashable� )�reduce)�pmapc C s | � || �|d�d �S )Nr r )�set�get)Zcounters�element� r �2/usr/lib/python3/dist-packages/pyrsistent/_pbag.py�_add_to_counters s r c @ s� e Zd ZdZdZdd� Zdd� Zdd� Zd d
� Zdd� Z d
d� Z
dd� Zdd� Zdd� Z
dd� Zdd� ZeZeZeZdd� Zdd� Zdd� Zdd � Zd!d"� Zd#S )$�PBaga�
A persistent bag/multiset type.
Requires elements to be hashable, and allows duplicates, but has no
ordering. Bags are hashable.
Do not instantiate directly, instead use the factory functions :py:func:`b`
or :py:func:`pbag` to create an instance.
Some examples:
>>> s = pbag([1, 2, 3, 1])
>>> s2 = s.add(4)
>>> s3 = s2.remove(1)
>>> s
pbag([1, 1, 2, 3])
>>> s2
pbag([1, 1, 2, 3, 4])
>>> s3
pbag([1, 2, 3, 4])
)�_counts�__weakref__c C s
|| _ d S )N�r )�selfZcountsr r r
�__init__# s z
PBag.__init__c C s t t| j|��S )z�
Add an element to the bag.
>>> s = pbag([1])
>>> s2 = s.add(1)
>>> s3 = s.add(2)
>>> s2
pbag([1, 1])
>>> s3
pbag([1, 2])
)r r r �r r r r r
�add&