o
    þ§Ýjd  ã                   @  s~   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	„ d	ej
ee	f ƒZG d
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                   @  s0   e Zd ZdZdZeeddd„ƒƒZd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                 C  s   t ‚)zÝThe 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©Úselfr   r   úF/var/www/html/chatgpt/venv/lib/python3.10/site-packages/bidict/_abc.pyÚinverse&   s   zBidirectionalMapping.inverseút.Iterator[tuple[VT, KT]]c                 C  s   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   r   r   r   Ú__inverted__5   s   z!BidirectionalMapping.__inverted__N)r	   r
   )r	   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__Úpropertyr   r   r   r   r   r   r   r      s    	r   c                   @  s   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    r   )r   Ú
__future__r   ÚtypingÚtÚabcr   Z_typingr   r   ÚMappingr   ÚMutableMappingr   r   r   r   r   Ú<module>   s   (,