Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/sys/lib/python2.7/repr.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�`^c@s`dZddgZddlZddlmZddd��YZd�Ze�ZejZdS(	sGRedo the builtin repr() (representation) but with limits on most sizes.tReprtrepri�N(tislicecBs�eZd�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�ZRS(cCsgd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS(Niiiii(i(tmaxleveltmaxtupletmaxlisttmaxarraytmaxdicttmaxsettmaxfrozensettmaxdequet	maxstringtmaxlongtmaxother(tself((s/sys/lib/python2.7/repr.pyt__init__
s										cCs|j||j�S(N(trepr1R(Rtx((s/sys/lib/python2.7/repr.pyRscCs�t|�j}d|kr9|j�}dj|�}nt|d|�rft|d|�||�Stj|�}t|�|j	kr�
d|j	dd�}t
d|j	d|�}|| d|t|�|}n|SdS(Nt t_trepr_iiis...(ttypet__name__tsplittjointhasattrtgetattrt__builtin__RtlenR
tmax(RRtlevelttypenametpartststitj((s/sys/lib/python2.7/repr.pyRs#tc
Cs�t|�}|dkr'|r'd}n�|d}	|j}
gt||�D]}|
||	�^qJ}||kr�|jd�ndj|�}|dkr�|r�||}nd|||fS(Nis...is, s%s%s%s(RRRtappendR(
RRRtlefttrighttmaxiterttrailtnR!tnewlevelRtelemtpieces((s/sys/lib/python2.7/repr.pyt_repr_iterable)s	
	+
cCs|j||dd|jd�S(Nt(t)t,(R.R(RRR((s/sys/lib/python2.7/repr.pyt
repr_tuple6scCs|j||dd|j�S(Nt[t](R.R(RRR((s/sys/lib/python2.7/repr.pyt	repr_list9scCs)d|j}|j|||d|j�S(Ns
array('%s', [s])(ttypecodeR.R(RRRtheader((s/sys/lib/python2.7/repr.pyt
repr_array<s
cCs(t|�}|j||dd|j�S(Nsset([s])(t_possibly_sortedR.R(RRR((s/sys/lib/python2.7/repr.pytrepr_set@scCs(t|�}|j||dd|j�S(Nsfrozenset([s])(R9R.R	(RRR((s/sys/lib/python2.7/repr.pytrepr_frozensetDscCs|j||dd|j�S(Nsdeque([s])(R.R
(RRR((s/sys/lib/python2.7/repr.pyt
repr_dequeIscCs�t|�}|dkrdS|dkr,dS|d}|j}g}xYtt|�|j�D]?}|||�}||||�}	|jd||	f�q^W||jkr�|jd�ndj|�}
d|
fS(	Nis{}s{...}is%s: %ss...s, s{%s}(RRRR9RR%R(RRRR*R+RR-tkeytkeyreprtvalreprR!((s/sys/lib/python2.7/repr.pyt	repr_dictLs 
	cCs�tj||j �}t|�|jkr�td|jdd�}td|jd|�}tj|| |t|�|�}|| d|t|�|}n|S(Niiis...(RRRRR(RRRR!R"R#((s/sys/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/sys/lib/python2.7/repr.pyt	repr_longds#cCs�ytj|�}Wn(tk
r=d|jjt|�fSXt|�|jkr�td|jdd�}td|jd|�}|| d|t|�|}n|S(Ns<%s instance at %x>iiis...(	RRt	Exceptiont	__class__RtidRRR(RRRR!R"R#((s/sys/lib/python2.7/repr.pyt
repr_instancels
#(Rt
__module__RRRR.R2R5R8R:R;R<R@RARBRF(((s/sys/lib/python2.7/repr.pyRs	
		
										cCs-yt|�SWntk
r(t|�SXdS(N(tsortedRCtlist(R((s/sys/lib/python2.7/repr.pyR9zs
((	t__doc__t__all__Rt	itertoolsRRR9taReprR(((s/sys/lib/python2.7/repr.pyt<module>sr			

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].