
    2Bf                         d Z ddlZddlmZ ddlmZ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.    N)abstractmethod   )KTVTc                       e Zd ZdZdZeedd              Zdej                  ej                  eef      fdZdej                  e   fdZy)	BidirectionalMappingaK  Abstract base class (ABC) for bidirectional mapping types.

    Extends :class:`collections.abc.Mapping` primarily by adding the
    (abstract) :attr:`inverse` property,
    which implementors of :class:`BidirectionalMapping`
    should override to return a reference to the inverse
    :class:`BidirectionalMapping` instance.
     returnc                     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    K/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/bidict/_abc.pyinversezBidirectionalMapping.inverse1   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__A   s     DLL&&())r   c                 6    | j                   j                         S )a  A set-like object providing a view on the contained values.

        Override the implementation inherited from
        :class:`~collections.abc.Mapping`.
        Because the values of a :class:`~bidict.BidirectionalMapping`
        are the keys of its inverse,
        this returns a :class:`~collections.abc.KeysView`
        rather than a :class:`~collections.abc.ValuesView`,
        which has the advantages of constant-time containment checks
        and supporting set operations.
        )r   keysr   s    r   valueszBidirectionalMapping.valuesQ   s     ||  ""r   N)r
   zBidirectionalMapping[VT, KT])__name__
__module____qualname____doc__	__slots__propertyr   r   _tIteratorTupler   r   r   AbstractSetr   r	   r   r   r   r   %   s_     I"  "*bkk"((2r6*:; * #r* #r   r   c                       e Zd ZdZdZy)MutableBidirectionalMappingzBAbstract base class (ABC) for mutable bidirectional mapping types.r	   N)r   r   r   r   r   r	   r   r   r$   r$   `   s
    LIr   r$   )r   typingr   abcr   _typingr   r   Mappingr   MutableMappingr$   r	   r   r   <module>r*      sX   : E   8#2::b"f- 8#v"6r2v">@Q@QRTVXRX@Y r   