
    iW                         S r   SSKJr  Sr \   " S S\
\5      r " S	 S
\5      rg! \ a	    SSKJr   N+f = f! \ a    SSKJr  Sr N=f = f! \	 a    S r NIf = f)zvDrop-in replacement for collections.AttributedDict by Raymond Hettinger

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

    )MutableMapping   )	DictMixin   c                 (    U  H  nU(       a  M    g   g)NFT )seqelems     Y/home/james-whalen/.local/lib/python3.13/site-packages/dirtyjson/attributed_containers.pyallr      s    D4      c                     ^  \ rS rSrU 4S jrS rS rS rS rS r	S r
S	 rSS
 jrS rS r\R                   r\R"                  r\R$                  r\R&                  r\R(                  rS rS r\SS j5       rS rS rSrU =r$ )AttributedDict   c                 X   > [         [        U ]  5         0 U l        U R	                  5         g N)superr   __init___AttributedDict__attributesclearself	__class__s    r   r   AttributedDict.__init__    s!    nd,.

r   c                 \    / =U l         nUS X/-  n0 U l        [        R                  U 5        g r   )_AttributedDict__end_AttributedDict__mapdictr   )r   ends     r   r   AttributedDict.clear&   s0    
Sc


4r   c                 B    U R                  X5        X0R                  U'   g r   )__setitem__r   )r   keyvalue
attributess       r   add_with_attributes"AttributedDict.add_with_attributes,   s    $!+#r   c                 8    U R                   R                  U5      $ r   )r   get)r   r#   s     r   r%   AttributedDict.attributes0   s      $$S))r   c                     X;  a,  U R                   nUS   nXU/=US'   =US'   U R                  U'   [        R                  XU5        g )N   r   )r   r   r   r"   )r   r#   r$   r   currs        r   r"   AttributedDict.__setitem__3   sM    ?**Cq6D25S1AADGAc!ftzz#E*r   c                 z    [         R                  X5        U R                  R                  U5      u  pnX2S'   X#S'   g )Nr   r,   )r   __delitem__r   pop)r   r#   prev
next_entrys       r   r0   AttributedDict.__delitem__:   s5    # $

s 3:Q1r   c              #   \   #    U R                   nUS   nX!La  US   v   US   nX!La  M  g g 7f)Nr   r   r   r   r   r-   s      r   __iter__AttributedDict.__iter__@   5     jj1voq'M7D o   &,,c              #   \   #    U R                   nUS   nX!La  US   v   US   nX!La  M  g g 7f)Nr,   r   r6   r7   s      r   __reversed__AttributedDict.__reversed__G   r:   r;   c                 8   U (       d  [        S5      e[        S:X  a;  U(       a  [        U 5      R                  5       nOJ[	        U 5      R                  5       nO0U(       a  [        [        U 5      5      nO[        [	        U 5      5      nU R                  U5      nX#4$ )Nzdictionary is emptyr   )KeyErrorpy_levelreversednextiterr1   )r   lastr#   r$   s       r   popitemAttributedDict.popitemN   su    011 q=tn))+ 4joo'8D>*4:&zr   c                 
   U  Vs/ s H  oX   /PM
     nnU R                   U R                  4nU ? U ?[        U 5      R                  5       nUu  U l         U l        U(       a  U R                  U4U4$ U R                  U44$ s  snf r   )r   r   varscopyr   )r   kitemstmp	inst_dicts        r   
__reduce__AttributedDict.__reduce__b   s    '+,t!TWt,jj$**$J
JOO%	!$
DJ>>E8Y66~~x'' -s   B c                     [        U 5      $ r   )listr   s    r   keysAttributedDict.keysl   s    Dzr   c                     U (       d  U R                   R                  < S3$ U R                   R                  < S[        U R                  5       5      < S3$ )Nz()())r   __name__rR   rL   rS   s    r   __repr__AttributedDict.__repr__u   s8    !^^4466>>22D4FGGr   c                 $    U R                  U 5      $ r   r   rS   s    r   rJ   AttributedDict.copyz   s    ~~d##r   c                 .    U " 5       nU H  nX#U'   M	     U$ r   r   )clsiterabler$   dr#   s        r   fromkeysAttributedDict.fromkeys~   s    ECcF r   c           
      &   [        U[        5      (       ah  [        U 5      [        U5      :H  =(       aJ    [        S [	        [        U R                  5       5      [        UR                  5       5      5       5       5      $ [        R                  X5      $ )Nc              3   .   #    U  H  u  pX:H  v   M     g 7fr   r   ).0pqs      r   	<genexpr>(AttributedDict.__eq__.<locals>.<genexpr>   s      3U#S41#Ss   )	
isinstancer   lenr   zipsortedrL   r   __eq__r   others     r   rp   AttributedDict.__eq__   sn    e^,,t9E
* Us 3U#&vdjjl';VEKKM=R#S3U 0U U{{4''r   c                     X:X  + $ r   r   rq   s     r   __ne__AttributedDict.__ne__   s      r   )__attributes__end__map)Tr   )rY   
__module____qualname____firstlineno__r   r   r&   r%   r"   r0   r8   r=   rF   rO   rT   r   
setdefaultupdater1   valuesrL   rZ   rJ   classmethodrc   rp   ru   __static_attributes____classcell__r]   s   @r   r   r      s    ,*+(( %%JF
--CFOOEH
$  (! !r   r   c                   >   ^  \ rS rSrU 4S jrSU 4S jjrS rSrU =r$ )AttributedList   c                 8   > [         [        U ]  5         / U l        g r   )r   r   r   _AttributedList__attributesr   s    r   r   AttributedList.__init__   s    nd,.r   c                 b   > [         [        U ]  U5        U R                  R                  U5        g r   )r   r   appendr   )r   r$   r%   r   s      r   r   AttributedList.append   s&    nd*51  ,r   c                      U R                   U   $ r   )r   )r   indexs     r   r%   AttributedList.attributes   s      ''r   )rw   r   )	rY   rz   r{   r|   r   r   r%   r   r   r]   s   @r   r   r      s    -( (r   r   N)__doc__collections.abcr   r   ImportErrorcollectionsrA   UserDictr   	NameErrorr   r   rR   r   r   r   r   <module>r      s   
	<? H	m!T9 m!`
(T 
(M  <;<  "H  s4   ( : A 7: 7: A
A	AA