
    Edf                     J    d Z ddlmZ ddlmZ ddlmZ  G d de          ZdS )zA
Contains the base class for series
Made using sequences in mind
    )Expr)S)cacheitc                       e Zd ZdZed             Zed             Zed             Zed             Zed             Z	ed             Z
ed             Zd	 Zd
 Zd Zd ZdS )
SeriesBasezBase Class for seriesc                 &    t          d| z            )z+The interval on which the series is definedz(%s).intervalNotImplementedErrorselfs    9lib/python3.11/site-packages/sympy/series/series_class.pyintervalzSeriesBase.interval   s     "/D"8999    c                 &    t          d| z            )z8The starting point of the series. This point is includedz
(%s).startr	   r   s    r   startzSeriesBase.start   s     ","5666r   c                 &    t          d| z            )z6The ending point of the series. This point is includedz	(%s).stopr	   r   s    r   stopzSeriesBase.stop   s     "+"4555r   c                 &    t          d| z            )zLength of the series expansionz(%s).lengthr	   r   s    r   lengthzSeriesBase.length   s     "-$"6777r   c                     dS )z-Returns a tuple of variables that are bounded r   r   s    r   	variableszSeriesBase.variables"   s	     rr   c                 T    d | j         D                                 | j                  S )z
        This method returns the symbols in the object, excluding those
        that take on a specific value (i.e. the dummy symbols).
        c                 &    h | ]}|j         D ]}|S r   )free_symbols).0ijs      r   	<setcomp>z*SeriesBase.free_symbols.<locals>.<setcomp>-   s'    >>>qq~>>!>>>>r   )args
differencer   r   s    r   r   zSeriesBase.free_symbols'   s+     ?>DI>>>DN++	-r   c                     || j         k     s|| j        k    rt          d|d| j                  |                     |          S )zTerm at point pt of a serieszIndex z out of bounds )r   r   
IndexErrorr   
_eval_termr   pts     r   termzSeriesBase.term0   sP     
? 	Pb49n 	P*BBBNOOOr"""r   c                 0    t          d| j        z            )NzhThe _eval_term method should be added to%s to return series term so it is availablewhen 'term' calls it.)r
   funcr%   s     r   r$   zSeriesBase._eval_term7   s%    ! #: %)I#. / / 	/r   c                 ^    | j         t          j        u r
| j        }d}n	| j         }d}|||z  z   S )z
        Returns the i'th point of a series
        If start point is negative infinity, point is returned from the end.
        Assumes the first point to be indexed zero.

        Examples
        ========

        TODO
           )r   r   NegativeInfinityr   )r   r   initialsteps       r   
_ith_pointzSeriesBase._ith_point=   s?     :++ 	iGDDjGD4r   c              #      K   d}|| j         k     r>|                     |          }|                     |          V  |dz  }|| j         k     <d S d S )Nr   r,   )r   r0   r'   )r   r   r&   s      r   __iter__zSeriesBase.__iter__Q   sm      $+o 	##B))B--FA $+o 	 	 	 	 	r   c                 .    t          |t                    r*                     |          }                     |          S t          |t                    r?|j        |j        }}|d}| j        } fdt          |||j	        pd          D             S d S )Nr   c                 `    g | ]*}                                         |                    +S r   )r'   r0   )r   r   r   s     r   
<listcomp>z*SeriesBase.__getitem__.<locals>.<listcomp>b   s=     9 9 9aDIIdooa0011 9 9 9r   r,   )

isinstanceintr0   r'   slicer   r   r   ranger/   )r   indexr   r   s   `   r   __getitem__zSeriesBase.__getitem__X   s    eS!! 
	9OOE**E99U###u%% 	9+uz4E  #{9 9 9 9%uzQ779 9 9 9	9 	9r   N)__name__
__module____qualname____doc__propertyr   r   r   r   r   r   r   r'   r$   r0   r2   r;   r   r   r   r   r      s       : : X: 7 7 X7 6 6 X6 8 8 X8   X - - X- # # W#/ / /     (  9 9 9 9 9r   r   N)r?   sympy.core.exprr   sympy.core.singletonr   sympy.core.cacher   r   r   r   r   <module>rD      s    
 !           " " " " " " $ $ $ $ $ $X9 X9 X9 X9 X9 X9 X9 X9 X9 X9r   