
    i                        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Z edd          Zde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             +     K   t           t          j                  r                                 E d{V  nDt           t                    r' fd                                 D             E d{V  n E d{V  t          j        t          t          t          f         |                                          E d{V  dS )z7Yield the items from *arg* and *kw* in the order given.Nc              3  ,   K   | ]}||         fV  d S )Nr   ).0kr   s     7/usr/local/lib/python3.11/dist-packages/bidict/_iter.py	<genexpr>ziteritems.<locals>.<genexpr>   s+      44AQAK444444    )

isinstancetMappingitemsr	   keyscastr   r   r   )r   r   s   ` r   	iteritemsr      s      #qy!! 99;;	C	!	! 444444444444444viB'44444444444r   zt.FinalswapItemsIter[VT, KT]c                    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__`
    __inverted__N)getattrcallablemapr   r   )r   invattrinvs      r   invertedr(   $   sK     c>400G !(
tYs^^$$$r   )r   )r   r   r   r   r   r   )r   r   r   r    )__doc__
__future__r   typingr   operatorr   _typingr   r   r   r	   r
   r   r   __annotations__r(   r   r   r   <module>r/      s    7 6 6 " " " " " "                                        5 5 5 5 5 
1a          % % % % % %r   