Your IP : 216.73.216.196


Current Path : /opt/alt/python27/lib/python2.7/site-packages/hypothesis/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyc

�
�GHWc@`s�ddlmZmZmZddlZddlmZddlmZddl	m
Z
defd��YZdefd	��YZ
dS(
i(tdivisiontprint_functiontabsolute_importN(tRandom(tislice(tInvalidArgumenttRandomWithSeedcB`s2eZdZd�Zd�Zd�Zd�ZRS(s�A subclass of Random designed to expose the seed it was initially
    provided with.

    We consistently use this instead of Random objects because it makes
    examples much easier to recreate.

    cC`s#tt|�j|�||_dS(N(tsuperRt__init__tseed(tselfR	((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyR%scC`s&t|j�}|j|j��|S(N(RR	tsetstatetgetstate(R
tresult((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyt__copy__)scC`s
|j�S(N(R(R
ttable((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyt__deepcopy__.scC`sd|jfS(NuRandomWithSeed(%s)(R	(R
((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyt__repr__1s(t__name__t
__module__t__doc__RRRR(((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyRs
			tStreamcB`sbeZdZd
d�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�ZRS(s#A stream is a possibly infinite list. You can index into it, and you can
    iterate over it, but you can't ask its length and iterating over it will
    not necessarily terminate.

    Behind the scenes streams are backed by a generator, but they "remember"
    the values as they evaluate them so you can replay them later.

    Internally Hypothesis uses the fact that you can tell how much of a stream
    has been evaluated, but you shouldn't use that. The only public APIs of
    a Stream are that you can index, slice, and iterate it.

    cC`sO|dkrtd�}ntj|�s9t|�}n||_g|_dS(N((tNonetitertinspecttisgeneratort	generatortfetched(R
R((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyRDs	c`st�fd�|D��S(Nc3`s|]}�|�VqdS(N((t.0tv(tf(sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pys	<genexpr>Ms(R(R
R((RsA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pytmapLscc`sed}x/|t|j�kr7|j|V|d7}q	Wx&|jD]}|jj|�|VqBWdS(Nii(tlenRRtappend(R
tiR((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyt__iter__OscC`s�t|t�r7ttt|�|j|j|j��St|t�set	dt
|�jf��n|j|d�|j
|S(NuCannot index stream with %si(t
isinstancetsliceRRRtstarttstoptsteptintRttypeRt	_thunk_toR(R
tkey((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyt__getitem__Xs	cC`smt|�}y*x#t|j�|kr4t|�qWWn0tk
rhtd|t|j�f��nXdS(Nu5Index %d out of bounds for finite stream of length %d(RR Rtnextt
StopIterationt
IndexError(R
R"tit((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyR+es
cC`s
t|j�S(N(R R(R
((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyt_thunkedqscC`s*|js
dSddjtt|j��S(NuStream(...)uStream(%s, ...)u, (RtjoinRtrepr(R
((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyRts	cC`s|S(N((R
R((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyR|scC`s|S(N((R
((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyRsN(
RRRRRRR#R-R+R2RRR(((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyR5s
				
				(t
__future__RRRRtrandomRt	itertoolsRthypothesis.errorsRRtobjectR(((sA/opt/alt/python27/lib/python2.7/site-packages/hypothesis/types.pyt<module>s