Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/
Upload File :
Current File : //usr/lib/python2.7/repr.pyc


|_c@s`dZddgZddlZddlmZdddYZdZeZejZdS(	sGRedo the builtin repr() (representation) but with limits on most sizes.tReprtrepriN(tislicecBseZdZdZdZddZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZRS(cCsgd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS(Niiiii(i(tmaxleveltmaxtupletmaxlisttmaxarraytmaxdicttmaxsettmaxfrozensettmaxdequet	maxstringtmaxlongtmaxother(tself((s/usr/lib/python2.7/repr.pyt__init__
s										cCs|j||jS(N(trepr1R(Rtx((s/usr/lib/python2.7/repr.pyRscCst|j}d|kr9|j}dj|}nt|d|rft|d|||Stj|}t||j	krt
d|j	dd}t
d|j	d|}|| d|t||}n|SdS(Nt t_trepr_iiis...(ttypet__name__tsplittjointhasattrtgetattrt__builtin__RtlenR
tmax(RRtlevelttypenametpartststitj((s/usr/lib/python2.7/repr.pyRs#tc
Cst|}|dkr'|r'd}n|d}	|j}
gt||D]}|
||	^qJ}||kr|jdndj|}|dkr|r||}nd|||fS(Nis...is, s%s%s%s(RRRtappendR(
RRRtlefttrighttmaxiterttrailtnR!tnewlevelRtelemtpieces((s/usr/lib/python2.7/repr.pyt_repr_iterable)s	
	+
cCs|j||dd|jdS(Nt(t)t,(R.R(RRR((s/usr/lib/python2.7/repr.pyt
repr_tuple6scCs|j||dd|jS(Nt[t](R.R(RRR((s/usr/lib/python2.7/repr.pyt	repr_list9scCs)d|j}|j|||d|jS(Ns
array('%s', [s])(ttypecodeR.R(RRRtheader((s/usr/lib/python2.7/repr.pyt
repr_array<s
cCs(t|}|j||dd|jS(Nsset([s])(t_possibly_sortedR.R(RRR((s/usr/lib/python2.7/repr.pytrepr_set@scCs(t|}|j||dd|jS(Nsfrozenset([s])(R9R.R	(RRR((s/usr/lib/python2.7/repr.pytrepr_frozensetDscCs|j||dd|jS(Nsdeque([s])(R.R
(RRR((s/usr/lib/python2.7/repr.pyt
repr_dequeIscCst|}|dkrdS|dkr,dS|d}|j}g}xYtt||jD]?}|||}||||}	|jd||	fq^W||jkr|jdndj|}
d|
fS(	Nis{}s{...}is%s: %ss...s, s{%s}(RRRR9RR%R(RRRR*R+RR-tkeytkeyreprtvalreprR!((s/usr/lib/python2.7/repr.pyt	repr_dictLs 
	cCstj||j }t||jkrtd|jdd}td|jd|}tj|| |t||}|| d|t||}n|S(Niiis...(RRRRR(RRRR!R"R#((s/usr/lib/python2.7/repr.pytrepr_str[s%#cCstj|}t||jkr{td|jdd}td|jd|}|| d|t||}n|S(Niiis...(RRRRR(RRRR!R"R#((s/usr/lib/python2.7/repr.pyt	repr_longds#cCsytj|}Wn(tk
r=d|jjt|fSXt||jkrtd|jdd}td|jd|}|| d|t||}n|S(Ns<%s instance at %x>iiis...(	RRt	Exceptiont	__class__RtidRRR(RRRR!R"R#((s/usr/lib/python2.7/repr.pyt
repr_instancels
#(Rt
__module__RRRR.R2R5R8R:R;R<R@RARBRF(((s/usr/lib/python2.7/repr.pyRs	
		
										cCs-yt|SWntk
r(t|SXdS(N(tsortedRCtlist(R((s/usr/lib/python2.7/repr.pyR9zs
((	t__doc__t__all__Rt	itertoolsRRR9taReprR(((s/usr/lib/python2.7/repr.pyt<module>sr