σ
ίΘ[c           @   s    d  Z  d e f d     YZ d S(   s5   
A module containing specialized collection classes.
t   HomogeneousListc           B   sP   e  Z d  Z g  d  Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   s·   
    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         C   s   | |  _  t j |  |  d S(   s½   
        Parameters
        ----------
        types : sequence of types
            The types to accept.

        values : sequence, optional
            An initial set of values.
        N(   t   _typest   listt   __init__(   t   selft   typest   values(    (    s8   lib/python2.7/site-packages/astropy/utils/collections.pyR      s    
	c         C   s1   t  | |  j  s- t d j |  j    n  d  S(   Ns7   homogeneous list must contain only objects of type '{}'(   t
   isinstanceR   t	   TypeErrort   format(   R   t   x(    (    s8   lib/python2.7/site-packages/astropy/utils/collections.pyt   _assert   s    c         C   s.   x | D] } |  j  |  q Wt j |  |  S(   N(   R   R   t   __iadd__(   R   t   otherR
   (    (    s8   lib/python2.7/site-packages/astropy/utils/collections.pyR       s    c         C   s   |  j  |  t j |  |  S(   N(   R   R   t   __setitem__(   R   R
   (    (    s8   lib/python2.7/site-packages/astropy/utils/collections.pyR   %   s    c         C   s   |  j  |  t j |  |  S(   N(   R   R   t   append(   R   R
   (    (    s8   lib/python2.7/site-packages/astropy/utils/collections.pyR   )   s    c         C   s    |  j  |  t j |  | |  S(   N(   R   R   t   insert(   R   t   iR
   (    (    s8   lib/python2.7/site-packages/astropy/utils/collections.pyR   -   s    c         C   s.   x | D] } |  j  |  q Wt j |  |  S(   N(   R   R   t   extend(   R   R
   t   item(    (    s8   lib/python2.7/site-packages/astropy/utils/collections.pyR   1   s    (
   t   __name__t
   __module__t   __doc__R   R   R   R   R   R   R   (    (    (    s8   lib/python2.7/site-packages/astropy/utils/collections.pyR       s   					N(   R   R   R    (    (    (    s8   lib/python2.7/site-packages/astropy/utils/collections.pyt   <module>   s   