Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/simplejson/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyc

ó
ìUzMc@sXdZddlmZyeWnek
r:d„ZnXdeefd„ƒYZdS(ssDrop-in replacement for collections.OrderedDict by Raymond Hettinger

http://code.activestate.com/recipes/576693/

iÿÿÿÿ(t	DictMixincCsx|D]}|stSqWtS(N(tFalsetTrue(tseqtelem((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pytall
s
tOrderedDictcBsÚeZd„Zd„Zd„Zd„Zd„Zd„Zed„Z	d„Z
d„Zej
Z
ejZejZejZejZejZejZejZd	„Zd
„Zedd„ƒZd„Zd
„ZRS(cOsht|ƒdkr+tdt|ƒƒ‚ny|jWntk
rS|jƒnX|j||ŽdS(Nis$expected at most 1 arguments, got %d(tlent	TypeErrort_OrderedDict__endtAttributeErrortcleartupdate(tselftargstkwds((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyt__init__s
cCs:g|_}|d||g7}i|_tj|ƒdS(N(R	tNonet_OrderedDict__maptdictR(R
tend((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyRs
	cCs_||krH|j}|d}|||g|d<|d<|j|<ntj|||ƒdS(Nii(R	RRt__setitem__(R
tkeytvalueRtcurr((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyR$s
	
)cCsCtj||ƒ|jj|ƒ\}}}||d<||d<dS(Nii(Rt__delitem__Rtpop(R
Rtprevtnext((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyR+s
ccs=|j}|d}x#||k	r8|dV|d}qWdS(Nii(R	(R
RR((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyt__iter__1s
	
	ccs=|j}|d}x#||k	r8|dV|d}qWdS(Nii(R	(R
RR((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyt__reversed__8s
	
	cCs[|stdƒ‚n|r0t|ƒjƒ}nt|ƒjƒ}|j|ƒ}||fS(Nsdictionary is empty(tKeyErrortreversedRtiterR(R
tlastRR((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pytpopitem?scCsŽg|D]}|||g^q}|j|jf}|`|`t|ƒjƒ}|\|_|_|r~|j|f|fS|j|ffS(N(RR	tvarstcopyt	__class__(R
tktitemsttmpt	inst_dict((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyt
__reduce__Ks#cCs
t|ƒS(N(tlist(R
((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pytkeysUscCs1|sd|jjfSd|jj|jƒfS(Ns%s()s%s(%r)(R&t__name__R((R
((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyt__repr__ascCs
|j|ƒS(N(R&(R
((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyR%fscCs(|ƒ}x|D]}|||<qW|S(N((tclstiterableRtdR((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pytfromkeysis	
cCs`t|tƒrPt|ƒt|ƒkoOtd„t|jƒ|jƒƒDƒƒStj||ƒS(Ncss!|]\}}||kVqdS(N((t.0tptq((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pys	<genexpr>ss(t
isinstanceRRRtzipR(Rt__eq__(R
tother((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyR9ps)cCs||kS(N((R
R:((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyt__ne__vsN(R.t
__module__RRRRRRRR#R+R-Rt
setdefaultRRtvaluesR(titerkeyst
itervaluest	iteritemsR/R%tclassmethodRR3R9R;(((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyRs.								
												N(t__doc__tUserDictRRt	NameErrorRR(((s;/usr/lib/python2.7/dist-packages/simplejson/ordered_dict.pyt<module>s