o
    þ§Ýjú  ã                   @  sŽ   U d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ dd
lmZ dddd„ZeddƒZded< ddd„ZdS )z0Functions for iterating over items in a mapping.é    )ÚannotationsN)Ú
itemgetteré   )ÚKT)ÚVT)Ú	ItemsIter)ÚMaplike)Ú
MapOrItems© ÚargúMapOrItems[KT, VT]Úkwr   ÚreturnúItemsIter[KT, VT]c                +  sr   � t ˆ tjƒrˆ  ¡ E dH  nt ˆ tƒr#‡ fdd„ˆ  ¡ D ƒE dH  nˆ E dH  t ttt	f | ¡ ¡E dH  dS )z7Yield the items from *arg* and *kw* in the order given.Nc                 3  s   � | ]	}|ˆ | fV  qd S )Nr
   )Ú.0Úk©r   r
   úG/var/www/html/chatgpt/venv/lib/python3.10/site-packages/bidict/_iter.pyÚ	<genexpr>   s   € ziteritems.<locals>.<genexpr>)
Ú
isinstanceÚtÚMappingÚitemsr   ÚkeysÚcastr   r   r   )r   r   r
   r   r   Ú	iteritems   s   €

"r   zt.FinalÚswapúItemsIter[VT, KT]c                 C  s,   t | ddƒ}t|ƒr|ƒ }|S ttt| ƒƒS )a;  Yield the inverse items of the provided object.

    If *arg* has a :func:`callable` ``__inverted__`` attribute,
    return the result of calling it.

    Otherwise, return an iterator over the items in `arg`,
    inverting each item on the fly.

    *See also* :attr:`bidict.BidirectionalMapping.__inverted__`
    Z__inverted__N)ÚgetattrÚcallableÚmapr   r   )r   ZinvattrÚinvr
   r
   r   Úinverted$   s
   r"   )r
   )r   r   r   r   r   r   )r   r   r   r   )Ú__doc__Ú
__future__r   Útypingr   Úoperatorr   Z_typingr   r   r   r   r	   r   r   Ú__annotations__r"   r
   r
   r
   r   Ú<module>   s   