U e5d@s^dZdddgZddlZddlmZddlmZd d dZGd ddZd d Z eZ e j Z dS)zGRedo the builtin repr() (representation) but with limits on most sizes.Reprreprrecursive_reprN)islice) get_ident...csfdd}|S)zGDecorator to make a repr function return fillvalue for a recursive callcsXtfdd}td|_td|_td|_td|_tdi|_|S)Nc sBt|tf}|krS|z |}W5|X|SN)idradddiscard)selfkeyresult) fillvalue repr_running user_function/usr/lib64/python3.8/reprlib.pywrappers   z.decorating_function..wrapper __module____doc____name__ __qualname____annotations__)setgetattrrrrrr)rrr)rrrdecorating_function s    z+recursive_repr..decorating_functionr)rrrrrr s c@s~eZdZddZddZddZddd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZdS) rcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ dS)N() maxlevelmaxtuplemaxlistmaxarraymaxdictmaxset maxfrozensetmaxdeque maxstringmaxlongmaxother)r rrr__init__&sz Repr.__init__cCs|||jSr)repr1r#)r xrrrr3sz Repr.reprcCsVt|j}d|kr$|}d|}t|d|rFt|d|||S|||SdS)N _repr_)typersplitjoinhasattrr repr_instance)r r0leveltypenamepartsrrrr/6s  z Repr.repr1c st|}|dkr|rd}nX|d|jfddt||D} ||krT| dd| }|dkrr|rr||}d|||fS)Nrrcsg|]}|qSrr).0elemnewlevelr/rr Gsz'Repr._repr_iterable.., z%s%s%s)lenr/rappendr6) r r0r9leftrightmaxitertrailnspiecesrr@r_repr_iterable@s    zRepr._repr_iterablecCs|||dd|jdS)N(),)rMr$r r0r9rrr repr_tupleMszRepr.repr_tuplecCs|||dd|jS)N[])rMr%rQrrr repr_listPszRepr.repr_listcCs,|sd|jSd|j}||||d|jS)Nz array('%s')z array('%s', []))typecoderMr&)r r0r9headerrrr repr_arraySs  zRepr.repr_arraycCs$|sdSt|}|||dd|jS)Nzset(){})_possibly_sortedrMr(rQrrrrepr_setYsz Repr.repr_setcCs$|sdSt|}|||dd|jS)Nz frozenset()z frozenset({z}))r\rMr)rQrrrrepr_frozenset_s  zRepr.repr_frozensetcCs|||dd|jS)Nzdeque([rV)rMr*rQrrr repr_dequefszRepr.repr_dequec Cst|}|dkrdS|dkr dS|d}|j}g}tt||jD].}|||}||||} |d|| fqB||jkr|dd|} d| fS) Nrz{}z{...}r=z%s: %srrCz{%s})rDr/rr\r'rEr6) r r0r9rJrAr/rLr keyreprvalreprrKrrr repr_dictis    zRepr.repr_dictcCst|d|j}t||jkrtd|jdd}td|jd|}t|d||t||d}|d|d|t||d}|SNrr)builtinsrr+rDmaxr r0r9rKijrrrrepr_strxs&$z Repr.repr_strcCsht|}t||jkrdtd|jdd}td|jd|}|d|d|t||d}|Src)rfrrDr,rgrhrrrrepr_ints  $z Repr.repr_intcCszt|}Wn(tk r6d|jjt|fYSXt||jkrtd|jdd}td|jd|}|d|d|t||d}|S)Nz<%s instance at %#x>rrdrer) rfr Exception __class__rr rDr-rgrhrrrr8s$zRepr.repr_instanceN)r<)rrrr.rr/rMrRrUrYr]r^r_rbrkrlr8rrrrr$s   cCs,z t|WStk r&t|YSXdSr)sortedrmlist)r0rrrr\s r\)r) r__all__rf itertoolsr_threadrrrr\aReprrrrrrs    s