0x1949 Team - FAZEMRX - MANAGER
Edit File: _pdeque.cpython-310.pyc
o ���a�/ � @ sr d dl mZmZ d dlmZmZ d dlmZ d dlm Z G dd� de �Ze�e� e�e� d d d �Z dd� ZdS )� )�Sequence�Hashable)�islice�chain)�Integral)�plistc s( e Zd ZdZdZd=� fdd� Zedd� �Zedd � �Ze d d� �Z dd � Zdd� ZeZ edd� �Zd>dd�Zd>dd�Ze dd� �Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Ze d)d*� �Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd3d4� Zd5d6� Z e Z!d7d8� Z"d9d:� Z#d;d<� Z$e%j&Z&� Z'S )?�PDequea� Persistent double ended queue (deque). Allows quick appends and pops in both ends. Implemented using two persistent lists. A maximum length can be specified to create a bounded queue. Fully supports the Sequence and Hashable protocols including indexing and slicing but if you need fast random access go for the PVector instead. Do not instantiate directly, instead use the factory functions :py:func:`dq` or :py:func:`pdeque` to create an instance. Some examples: >>> x = pdeque([1, 2, 3]) >>> x.left 1 >>> x.right 3 >>> x[0] == x.left True >>> x[-1] == x.right True >>> x.pop() pdeque([1, 2]) >>> x.pop() == x[:-1] True >>> x.popleft() pdeque([2, 3]) >>> x.append(4) pdeque([1, 2, 3, 4]) >>> x.appendleft(4) pdeque([4, 1, 2, 3]) >>> y = pdeque([1, 2, 3], maxlen=3) >>> y.append(4) pdeque([2, 3, 4], maxlen=3) >>> y.appendleft(4) pdeque([4, 1, 2], maxlen=3) )� _left_list�_right_list�_length�_maxlen�__weakref__Nc sV t t| ��| �}||_||_||_|d ur&t|t�std��|dk r&t d��||_ |S )Nz An integer is required as maxlenr zmaxlen must be non-negative)�superr �__new__r r r � isinstancer � TypeError� ValueErrorr )�cls� left_list� right_list�length�maxlen�instance�� __class__� �4/usr/lib/python3/dist-packages/pyrsistent/_pdeque.pyr 2 s zPDeque.__new__c C � t �| j| j�S )z. Rightmost element in dqueue. )r �_tip_from_listsr r ��selfr r r �rightB � zPDeque.rightc C r )z- Leftmost element in dqueue. )r r r r r r r r �leftI r"