Current File : //usr/lib/python3/dist-packages/pyrsistent/__pycache__/_pbag.cpython-312.pyc |
�
n�9e� � �0 � d dl mZmZmZmZ d dlmZ d dlmZm Z d dl
mZ e dd�� Zd� Z
G d � d
ee � Z ej e� ej e� ej e� ej e� d� Zd� Z e e� � Zy
)� )� Container�Iterable�Sized�Hashable)�reduce)�Generic�TypeVar)�pmap�T_coT)� covariantc �L � | j || j |d� dz � S )Nr � )�set�get)�counters�elements �2/usr/lib/python3/dist-packages/pyrsistent/_pbag.py�_add_to_countersr s# � ��<�<�����g�q�!9�A�!=�>�>� c � � e Zd ZdZdZd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
d� Zd
� ZeZeZeZd� Zd� Zd� Zd� Zd� Zy)�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 � � || _ y )N�r )�self�countss r �__init__z
PBag.__init__&