
    IR-e                     &    d Z  G d de          ZdS )z5
A module containing specialized collection classes.
c                   Z     e Zd ZdZg f fd	Zd Zd Z fdZ fdZ fdZ	 fdZ
 xZS )	HomogeneousListz
    A subclass of list that contains only elements of a given type or
    types.  If an item that is not of the specified type is added to
    the list, a `TypeError` is raised.
    c                     || _         t                                                       |                     |           dS )z
        Parameters
        ----------
        types : sequence of types
            The types to accept.

        values : sequence, optional
            An initial set of values.
        N)_typessuper__init__extend)selftypesvalues	__class__s      9lib/python3.11/site-packages/astropy/utils/collections.pyr   zHomogeneousList.__init__   s:     F    c                 `    t          || j                  st          d| j         d          d S )Nz4homogeneous list must contain only objects of type '')
isinstancer   	TypeError)r	   xs     r   _assertzHomogeneousList._assert   sB    !T[)) 	Ut{UUU  	 	r   c                 0    |                      |           | S N)r   )r	   others     r   __iadd__zHomogeneousList.__iadd__"   s    Er   c                     t          |t                    r*t          |          }|D ]}|                     |           n|                     |           t	                                          ||          S r   )r   slicelistr   r   __setitem__)r	   idxvalueitemr   s       r   r   zHomogeneousList.__setitem__&   sw    c5!! 	 KKE # #T""""# LLww""3...r   c                 p    |                      |           t                                          |          S r   r   r   append)r	   r   r   s     r   r"   zHomogeneousList.append/   s(    Qww~~a   r   c                 r    |                      |           t                                          ||          S r   )r   r   insert)r	   ir   r   s      r   r$   zHomogeneousList.insert3   s*    Qww~~a###r   c                 ~    |D ]8}|                      |           t                                          |           9d S r   r!   )r	   r   r   r   s      r   r   zHomogeneousList.extend7   sG     	! 	!DLLGGNN4    	! 	!r   )__name__
__module____qualname____doc__r   r   r   r   r"   r$   r   __classcell__)r   s   @r   r   r      s          &(          / / / / /! ! ! ! !$ $ $ $ $! ! ! ! ! ! ! ! !r   r   N)r*   r   r    r   r   <module>r-      sC    
3! 3! 3! 3! 3!d 3! 3! 3! 3! 3!r   