
    wg                        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y)z0Functions for iterating over items in a mapping.    )annotationsN)
itemgetter   )KT)VT)	ItemsIter)Maplike)
MapOrItemsc             +  v   K   t         t        j                        r j                         E d{    n<t         t              r" fd j                         D        E d{    n
 E d{    t        j                  t        t        t        f   |j                               E d{    y7 7 O7 F7 w)z7Yield the items from *arg* and *kw* in the order given.Nc              3  ,   K   | ]  }||   f  y w)N ).0kargs     Q/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/bidict/_iter.py	<genexpr>ziteritems.<locals>.<genexpr>   s     4AQAK4s   )

isinstancetMappingitemsr	   keyscastr   r   r   )r   kws   ` r   	iteritemsr      s}     #qyy!99;	C	!4444vviB'444 	44sE   .B9B11B9#B3$
B9.B5/<B9+B7,B93B95B97B9zt.Finalswapc                v    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#   $   s7     c>40G!(
tYs^$$    )r   )r   MapOrItems[KT, VT]r   r   returnzItemsIter[KT, VT])r   r%   r&   zItemsIter[VT, KT])__doc__
__future__r   typingr   operatorr   _typingr   r   r   r	   r
   r   r   __annotations__r#   r   r$   r   <module>r-      s?    7 "       5 1a g  %r$   