o
    ºùŠeb	  ã                   @   sh   d Z ddgZddlZddlmZ e d¡ZG dd„ deƒZG d	d
„ d
eeejƒZ	G dd„ dee ƒZ
dS )zcMeson specific typing helpers.

Holds typing helper classes, such as the ImmutableProtocol classes
ÚProtocolÚImmutableListProtocolé    N)r   ÚTc                   @   s   e Zd Zdefdd„ZdS )ÚStringProtocolÚreturnc                 C   ó   d S ©N© ©Úselfr	   r	   ú7/usr/lib/python3.10/site-packages/mesonbuild/_typing.pyÚ__str__%   ó    zStringProtocol.__str__N)Ú__name__Ú
__module__Ú__qualname__Ústrr   r	   r	   r	   r   r   $   s    r   c                   @   s   e Zd ZdS )ÚSizedStringProtocolN)r   r   r   r	   r	   r	   r   r   '   s    r   c                   @   s\  e Zd ZdZdeje fdd„Zejde	defdd„ƒZ
ejdedeje fdd„ƒZ
d	edefd
d„Zdeje fdd„Zde	fdd„Zdeje deje fdd„Zdejdefdd„Zdejdefdd„Zdejdefdd„Zdejdefdd„Zdejdefdd„Zdejdefdd„Zd	ede	fdd „Zd	ede	fd!d"„Zdeje fd#d$„Zd%S )&r   ar  A protocol used in cases where a list is returned, but should not be
    mutated.

    This provides all of the methods of a Sequence, as well as copy(). copy()
    returns a list, which allows mutation as it's a copy and that's (hopefully)
    safe.

    One particular case this is important is for cached values, since python is
    a pass-by-reference language.
    r   c                 C   r   r   r	   r
   r	   r	   r   Ú__iter__7   r   zImmutableListProtocol.__iter__Úindexc                 C   r   r   r	   ©r   r   r	   r	   r   Ú__getitem__9   ó   z!ImmutableListProtocol.__getitem__c                 C   r   r   r	   r   r	   r	   r   r   ;   r   Úitemc                 C   r   r   r	   ©r   r   r	   r	   r   Ú__contains__>   r   z"ImmutableListProtocol.__contains__c                 C   r   r   r	   r
   r	   r	   r   Ú__reversed__@   r   z"ImmutableListProtocol.__reversed__c                 C   r   r   r	   r
   r	   r	   r   Ú__len__B   r   zImmutableListProtocol.__len__Úotherc                 C   r   r   r	   ©r   r   r	   r	   r   Ú__add__D   r   zImmutableListProtocol.__add__c                 C   r   r   r	   r   r	   r	   r   Ú__eq__F   r   zImmutableListProtocol.__eq__c                 C   r   r   r	   r   r	   r	   r   Ú__ne__G   r   zImmutableListProtocol.__ne__c                 C   r   r   r	   r   r	   r	   r   Ú__le__H   r   zImmutableListProtocol.__le__c                 C   r   r   r	   r   r	   r	   r   Ú__lt__I   r   zImmutableListProtocol.__lt__c                 C   r   r   r	   r   r	   r	   r   Ú__gt__J   r   zImmutableListProtocol.__gt__c                 C   r   r   r	   r   r	   r	   r   Ú__ge__K   r   zImmutableListProtocol.__ge__c                 C   r   r   r	   r   r	   r	   r   ÚcountM   r   zImmutableListProtocol.countc                 C   r   r   r	   r   r	   r	   r   r   O   r   zImmutableListProtocol.indexc                 C   r   r   r	   r
   r	   r	   r   ÚcopyQ   r   zImmutableListProtocol.copyN)r   r   r   Ú__doc__ÚtypingÚIteratorr   r   ÚoverloadÚintr   ÚsliceÚListÚboolr   r   r   r    ÚAnyr!   r"   r#   r$   r%   r&   r'   r   r(   r	   r	   r	   r   r   *   s(    )r)   Ú__all__r*   Útyping_extensionsr   ÚTypeVarr   r   ÚSizedr   r   r	   r	   r	   r   Ú<module>   s   þ
