
    id                        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dS )z>Provide the :class:`BidirectionalMapping` abstract base class.    )annotationsN)abstractmethod   )KT)VTc                  F    e Zd ZdZdZeed	d                        Zd
dZdS )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.
     returnBidirectionalMapping[VT, KT]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    6/usr/local/lib/python3.11/dist-packages/bidict/_abc.pyinversezBidirectionalMapping.inverse&   s
     "!    t.Iterator[tuple[VT, KT]]c                N    t          | 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      DL&&(()))r   N)r   r   )r   r   )	__name__
__module____qualname____doc__	__slots__propertyr   r   r   r
   r   r   r	   r	      sa          I" " " ^ X"* * * * * *r   r	   c                      e Zd ZdZdZdS )MutableBidirectionalMappingz<Abstract base class for mutable bidirectional mapping types.r
   N)r   r   r   r   r   r
   r   r   r    r    F   s        FFIIIr   r    )r   
__future__r   typingtabcr   _typingr   r   Mappingr	   MutableMappingr    r
   r   r   <module>r(      s    E D " " " " " "                      )* )* )* )* )*19RV, )* )* )*X    "6r2v">@PQSUWQW@X     r   