Viewing File: /usr/lib/python2.7/site-packages/passlib/utils/compat/_ordered_dict.pyo
ó
ö
5Xc @ sX d Z y d d l m Z Wn! e k
r= d d l m Z n Xd e f d „ ƒ YZ d S( sð passlib.utils.compat._ordered_dict -- backport of collections.OrderedDict for py26
taken from stdlib-suggested recipe at http://code.activestate.com/recipes/576693/
this should be imported from passlib.utils.compat.OrderedDict, not here.
iÿÿÿÿ( t get_identt OrderedDictc B s e Z d Z d „ Z e j d „ Z e j d „ Z d „ Z d „ Z d „ Z e
d „ Z d „ Z d „ Z
d
„ Z d „ Z d „ Z d
„ Z d „ Z e Z e ƒ Z e d „ Z d d „ Z i d „ Z d „ Z d „ Z e d d „ ƒ Z d „ Z d „ Z RS( s) Dictionary that remembers insertion orderc O s„ t | ƒ d k r+ t d t | ƒ ƒ ‚ n y | j Wn7 t k
ro g | _ } | | d g | (i | _ n X| j | | Ž d S( sÅ Initialize an ordered dictionary. Signature is the same as for
regular dictionaries, but keyword arguments are not recommended
because their insertion order is arbitrary.
i s$ expected at most 1 arguments, got %dN( t lent TypeErrort _OrderedDict__roott AttributeErrort Nonet _OrderedDict__mapt _OrderedDict__update( t selft argst kwdst root( ( sF /usr/lib/python2.7/site-packages/passlib/utils/compat/_ordered_dict.pyt __init__ s
c C s\ | | k rH | j } | d } | | | g | d <| d <| j | <n | | | | ƒ d S( s! od.__setitem__(i, y) <==> od[i]=yi i N( R R ( R t keyt valuet dict_setitemR t last( ( sF /usr/lib/python2.7/site-packages/passlib/utils/compat/_ordered_dict.pyt __setitem__) s
)c C s@ | | | ƒ | j j | ƒ \ } } } | | d <| | d <d S( s od.__delitem__(y) <==> del od[y]i i N( R t pop( R R t dict_delitemt link_prevt link_next( ( sF /usr/lib/python2.7/site-packages/passlib/utils/compat/_ordered_dict.pyt __delitem__3 s
c c s= | j } | d } x# | | k r8 | d V| d } q Wd S( s od.__iter__() <==> iter(od)i i N( R ( R R t curr( ( sF /usr/lib/python2.7/site-packages/passlib/utils/compat/_ordered_dict.pyt __iter__<