
    wgd                        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	  G d d	ej                  ee	f         Z G d
 deee	f   ej                  ee	f         Zy)z>Provide the :class:`BidirectionalMapping` abstract base class.    )annotationsN)abstractmethod   )KT)VTc                  8    e Zd ZdZdZeedd              ZddZy)BidirectionalMappingaE  Abstract base class for bidirectional mapping types.

    Extends :class:`collections.abc.Mapping` primarily by adding the
    (abstract) :attr:`inverse` property,
    which implementers of :class:`BidirectionalMapping`
    should override to return a reference to the inverse
    :class:`BidirectionalMapping` instance.
     c                    t         )zThe inverse of this bidirectional mapping instance.

        *See also* :attr:`bidict.BidictBase.inverse`, :attr:`bidict.BidictBase.inv`

        :raises NotImplementedError: Meant to be overridden in subclasses.
        )NotImplementedErrorselfs    P/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/bidict/_abc.pyinversezBidirectionalMapping.inverse&   s
     "!    c                H    t        | j                  j                               S )a  Get an iterator over the items in :attr:`inverse`.

        This is functionally equivalent to iterating over the items in the
        forward mapping and inverting each one on the fly, but this provides a
        more efficient implementation: Assuming the already-inverted items
        are stored in :attr:`inverse`, just return an iterator over them directly.

        Providing this default implementation enables external functions,
        particularly :func:`~bidict.inverted`, to use this optimized
        implementation when available, instead of having to invert on the fly.

        *See also* :func:`bidict.inverted`
        )iterr   itemsr   s    r   __inverted__z!BidirectionalMapping.__inverted__5   s     DLL&&())r   N)returnzBidirectionalMapping[VT, KT])r   zt.Iterator[tuple[VT, KT]])	__name__
__module____qualname____doc__	__slots__propertyr   r   r   r
   r   r   r	   r	      s-     I"  "*r   r	   c                      e Zd ZdZdZy)MutableBidirectionalMappingz<Abstract base class for mutable bidirectional mapping types.r
   N)r   r   r   r   r   r
   r   r   r   r   F   s
    FIr   r   )r   
__future__r   typingtabcr   _typingr   r   Mappingr	   MutableMappingr   r
   r   r   <module>r&      s^    E "    )*199RV, )*X"6r2v">@P@PQSUWQW@X r   