U
vâ’i ã @ s† d dl mZ d dlmZmZmZmZmZ d dlm Z d dlm
Z edƒZd
ee
ee
ee
ee e ge e f dœdd „Zd gZdS )é )Úmaxsize)ÚAnyÚCallableÚListÚOptionalÚTypeVar)Ú
Observable)Ú operatorsÚ_TN)ÚstartÚstopÚstepÚreturnc sZ | d krdn| ‰ |d krt n|‰|d kr,dn|‰g ‰tt tt dœ‡ ‡‡‡fdd„}|S )Nr é )Úsourcer c s¢ ˆdkrˆ t ˆ¡¡ ˆ dkr2ˆ t ˆ ¡¡ nˆ dk rLˆ t ˆ ¡¡ ˆdk rfˆ t ˆ ¡¡ ˆdkrˆˆ t ‡fdd„¡¡ nˆdk r˜tdƒ‚| jˆŽ S )a# The partially applied slice operator.
Slices the given observable. It is basically a wrapper around the operators
:func:`skip `,
:func:`skip_last `,
:func:`take `,
:func:`take_last ` and
:func:`filter `.
The following diagram helps you remember how slices works with streams.
Positive numbers are relative to the start of the events, while negative
numbers are relative to the end (close) of the stream.
.. code::
r---e---a---c---t---i---v---e---!
0 1 2 3 4 5 6 7 8
-8 -7 -6 -5 -4 -3 -2 -1 0
Examples:
>>> result = source.slice(1, 10)
>>> result = source.slice(1, -2)
>>> result = source.slice(1, -1, 2)
Args:
source: Observable to slice
Returns:
A sliced observable sequence.
r r c s |ˆ dkS )Nr © )ÚxÚi)Ú_stepr úK/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_slice.pyÚA ó z'slice_..slice..zNegative step not supported.) ÚappendÚopsZtakeÚskipZ take_lastZ skip_lastZfilter_indexedÚ TypeErrorÚpipe)r ©Ú_startr Ú_stopZpipeliner r Úslice s !zslice_..slice)r r r
)r r r
r r r r Úslice_ s "4r! )NNN)Úsysr Útypingr r r r r Z reactivexr r r r
Úintr! Ú__all__r r r r Ú s ÿ þ@