+
    n9e%                         ^ RI HtHtHtHt ^ RIHtHtHtH	t	H
t
Ht ^ RIHt R t ! R R]4      t]! 4       tR t ! R R	]]R
7      t ! R R]4      tR# )    )InvariantExceptionCheckedType_restore_picklestore_invariants)
set_fields
check_typeis_field_ignore_extra_complaintPFIELD_NO_INITIAL	serializecheck_global_invariants	transformc                 N    \        V 4      ^8H  ;'       d    V ^ ,          \        8H  # )   )lenr   )basess   &4/usr/lib/python3/dist-packages/pyrsistent/_pclass.py
_is_pclassr      s!    u:?66uQx;66    c                   2   a a ] tR t^t oV 3R ltRtVtV ;t# )
PClassMetac                4  < \        W2R R7       \        W2RR4       R\        ;QJ d    . R VR ,           4       F  NK  	  5M! R VR ,           4       4      ,           VR&   \        V4      '       d   VR;;,          R,          uu&   \        \
        V `  WW#4      # )_pclass_fields)name_pclass_invariants__invariant__c              3   $   "   T F  qx  K  	  R # 5iN ).0keys   & r   	<genexpr>%PClassMeta.__new__.<locals>.<genexpr>   s     6\F[ssF[s   	__slots__)_pclass_frozen)__weakref__)r   r   tupler   superr   __new__)mcsr   r   dct	__class__s   &&&&r   r)   PClassMeta.__new__   s    3$45%9?K.6\cJZF[6\6\cJZF[6\1\\K e 00Z-cDDr   r   )__name__
__module____qualname____firstlineno__r)   __static_attributes____classdictcell____classcell__r,   __classdict__s   @@r   r   r      s     
E 
Er   r   c                     \        WW#4       VP                  V4      w  rgV'       g   VP                  V4       R # \        WBV4       R # r   )r   	invariantappendsetattr)clsfieldr   valueresultinvariant_errorsis_ok
error_codes   &&&&&&  r   _check_and_set_attrrB      s8    s4'.E
+e$r   c                      a a ] tR t^%t oRtV 3R ltR t]RR l4       tRR lt	R t
R tR tR	 tV 3R
 ltR tR tR tR tR tR tRtVtV ;t# )PClassa  
A PClass is a python class with a fixed set of specified fields. PClasses are declared as python classes inheriting
from PClass. It is defined the same way that PRecords are and behaves like a PRecord in all aspects except that it
is not a PMap and hence not a collection but rather a plain Python object.


More documentation and examples of PClass usage is available at https://github.com/tobgu/pyrsistent
c           	       < \         \        V `  V 4      pVP                  R R4      pVP                  RR4      p. p. pV P                  P                  4        EF  w  rxWq9   dl   Ve   Ws9   dI   \        \        W4      '       d   VP                  W,          VR7      p	M VP                  W,          4      p	MW,          p	\        WWyW&4       W Kw  VP                  \        JdG   \        VP                  4      '       d   VP                  4       MVP                  p
\        WWzW&4       K  VP                  '       g   K  VP                  RP                  V P                  V4      4       EK  	  V'       g	   V'       d    \!        \#        V4      \#        V4      R4      hV'       d5   \%        RP                  RP'                  V4      V P                  4      4      h\)        W P*                  4       RVn        V# )	_factory_fieldsNignore_extra)rG   z{0}.{1}zField invariant failedz0'{0}' are not among the specified fields for {1}, T)r(   rD   r)   popr   itemsr	   factoryrB   initialr
   callable	mandatoryr9   formatr.   r   r'   AttributeErrorjoinr   r   r%   )r;   kwargsr>   factory_fieldsrG   missing_fieldsr?   r   r<   r=   rL   r,   s   &,         r   r)   PClass.__new__.   s   vs+C0$5t<zz.$7--335KD~!)T-C6vuSS %fl V %fl ;"LE#CVVL&77-5emm-D-D%--/%--#vI%%i&6&6s||T&JK! 6$ ~$U+;%<eN>SUmnn !S!Z!Z		&!3<<"1 2 2 	 (>(>? $r   c                    V'       d   V^,          W!^ ,          &   \        V4      pV P                   F+  pWB9  g   K  \        W\        4      pV\        Jg   K'  WRV&   K-  	  V P                  ! RRV/VB # )a  
Set a field in the instance. Returns a new instance with the updated value. The original instance remains
unmodified. Accepts key-value pairs or single string representing the field name and a value.

>>> from pyrsistent import PClass, field
>>> class AClass(PClass):
...     x = field()
...
>>> a = AClass(x=1)
>>> a2 = a.set(x=2)
>>> a3 = a.set('x', 3)
>>> a
AClass(x=1)
>>> a2
AClass(x=2)
>>> a3
AClass(x=3)
rF   r   )setr   getattr_MISSING_VALUEr,   )selfargsrR   rS   r!   r=   s   &*,   r   rW   
PClass.setR   si    & "1gF7OV&&C >:."'3K	 ' ~~GnGGGr   c                    \        W4      '       d   V# V'       d+   V P                   Uu/ uF  qDV9   g   K  WAV,          bK  	  ppV ! RRVRV/VB # u upi )a  
Factory method. Will create a new PClass of the current type and assign the values
specified in kwargs.

:param ignore_extra: A boolean which when set to True will ignore any keys which appear in kwargs that are not
                     in the set of fields on the PClass.
rF   rG   r   )
isinstancer   )r;   rR   rF   rG   ks   &&&& r   createPClass.creater   s^     f""M,/,>,>N,>qv+lal,>FNX?XXQWXX Os
   AAc                    / pV P                    FH  p\        W\        4      pV\        Jg   K  \        V P                   V,          P                  W4      W#&   KJ  	  V# )zj
Serialize the current PClass using custom serializer functions for fields where
such have been supplied.
)r   rX   rY   r   
serializer)rZ   rO   r>   r   r=   s   &&   r   r   PClass.serialize   sS    
 ''DD7EN*()<)<T)B)M)Mv] (
 r   c                    \        W4      # )a,  
Apply transformations to the currency PClass. For more details on transformations see
the documentation for PMap. Transformations on PClasses do not support key matching
since the PClass is not a collection. Apart from that the transformations available
for other persistent types work as expected.
r   )rZ   transformationss   &*r   r   PClass.transform   s     //r   c                    \        WP                  4      '       d<   V P                   F)  p\        W\        4      \        W\        4      8w  g   K(   R # 	  R# \
        # )FT)r^   r,   r   rX   rY   NotImplemented)rZ   otherr   s   && r   __eq__PClass.__eq__   sE    e^^,,++4~6'%~:^^  , r   c                    W8X  * # r   r   )rZ   rj   s   &&r   __ne__PClass.__ne__   s      r   c                   a  \        \        ;QJ d%    . V 3R  lS P                   4       F  NK  	  54      # ! V 3R  lS P                   4       4      4      # )c              3   H   <"   T F  q\        SV\        4      3x  K  	  R # 5ir   )rX   rY   r    r!   rZ   s   & r   r"   "PClass.__hash__.<locals>.<genexpr>   s     cObc> BCObs   ")hashr'   r   rZ   s   fr   __hash__PClass.__hash__   s9    EEctObObcEddEctObObccddr   c                   < \        V R R4      '       d   \        RP                  W4      4      h\        \        V `  W4       R# )r%   Fz'Can't set attribute, key={0}, value={1}N)rX   rP   rO   r(   rD   __setattr__rZ   r!   r=   r,   s   &&&r   ry   PClass.__setattr__   s:    4)511 !J!Q!QRU!]^^fd'3r   c                6    \        R P                  V4      4      h)z-Can't delete attribute, key={0}, use remove())rP   rO   )rZ   r!   s   &&r   __delattr__PClass.__delattr__   s     !P!W!WX[!\]]r   c                p    / pV P                    F#  p\        W\        4      pV\        Jg   K  W1V&   K%  	  V# r   )r   rX   rY   )rZ   r>   r!   r=   s   &   r   _to_dictPClass._to_dict   s9    &&CD~6EN*#s '
 r   c                    R P                  V P                  P                  RP                  R V P	                  4       P                  4        4       4      4      # )z{0}({1})rH   c              3   \   "   T F"  w  rR P                  V\        V4      4      x  K$  	  R# 5i)z{0}={1}N)rO   repr)r    r_   vs   &  r   r"   "PClass.__repr__.<locals>.<genexpr>   s(     *lTkDA9+;+;AtAw+G+GTks   *,)rO   r,   r.   rQ   r   rJ   ru   s   &r   __repr__PClass.__repr__   sH      !8!8!%*lTXTaTaTcTiTiTk*l!ln 	nr   c                j   a  \        V 3R  lS P                   4       4      p\        S P                  V33# )c              3   h   <"   T F'  p\        SV4      '       g   K  V\        SV4      3x  K)  	  R # 5ir   )hasattrrX   rr   s   & r   r"   $PClass.__reduce__.<locals>.<genexpr>   s.     c9L#PWX\^aPb-S'$,-9Ls   22)dictr   r   r,   )rZ   datas   f r   
__reduce__PClass.__reduce__   s-    c9L9Lcc 777r   c                4    \        W P                  4       4      # )z%
Returns an evolver for this object.
)_PClassEvolverr   ru   s   &r   evolverPClass.evolver   s     dMMO44r   c                F    V P                  4       pW! VP                  4       # )zq
Remove attribute given by name from the current instance. Raises AttributeError if the
attribute doesn't exist.
)r   
persistent)rZ   r   r   s   && r   removePClass.remove   s#    
 ,,.M!!##r   r   )NFr   )r.   r/   r0   r1   __doc__r)   rW   classmethodr`   r   r   rk   rn   rv   ry   r}   r   r   r   r   r   r2   r3   r4   r5   s   @@r   rD   rD   %   sq     "HH@ Y Y 0!e4^n8
5$ $r   rD   )	metaclassc                   f   a a ] tR t^t oRtR tR tR tR tR t	R t
R tV 3R ltR	 tR
tVtV ;t# )r   c                J    Wn         W n        R V n        \        4       V n        R# )FN)_pclass_evolver_original_pclass_evolver_data_pclass_evolver_data_is_dirtyrW   rF   )rZ   originalinitial_dicts   &&&r   __init___PClassEvolver.__init__   s     (0%$0!-2*"ur   c                (    V P                   V,          # r   )r   rZ   items   &&r   __getitem___PClassEvolver.__getitem__   s    ((..r   c                    V P                   P                  V\        4      VJd1   W P                   V&   V P                  P	                  V4       R V n        V # T)r   getrY   rF   addr   rZ   r!   r=   s   &&&r   rW   _PClassEvolver.set   sL    $$((n=UJ-2%%c*  $$S)15D.r   c                (    V P                  W4       R # r   )rW   r   s   &&&r   __setitem___PClassEvolver.__setitem__   s    r   c                    WP                   9   d2   V P                   V V P                  P                  V4       R V n        V # \	        V4      hr   )r   rF   discardr   rP   r   s   &&r   r   _PClassEvolver.remove   sH    ,,,))$/  ((.15D.KT""r   c                (    V P                  V4       R # r   )r   r   s   &&r   __delitem___PClassEvolver.__delitem__   s    Dr   c                    V P                   '       d3   V P                  P                  ! RR V P                  /V P                  B # V P                  # )rF   r   )r   r   r,   rF   r   ru   s   &r   r   _PClassEvolver.persistent   sT    ---00:: X4K_K_ X=A=V=VX X ,,,r   c                t   < WP                   9  d   V P                  W4       R # \        \        V `  W4       R # r   )r$   rW   r(   r   ry   rz   s   &&&r   ry   _PClassEvolver.__setattr__   s(    nn$HHS .$3C?r   c                    W,          # r   r   r   s   &&r   __getattr___PClassEvolver.__getattr__  s
    zr   )rF   r   r   r   )r   r   r   rF   )r.   r/   r0   r1   r$   r   r   rW   r   r   r   r   ry   r   r2   r3   r4   r5   s   @@r   r   r      s=     xI%/#-@ r   r   N)pyrsistent._checked_typesr   r   r   r   pyrsistent._field_commonr   r   r	   r
   r   r   pyrsistent._transformationsr   r   typer   objectrY   rB   rD   r   r   r   r   <module>r      sX    j j  27E E %m$[J m$`1V 1r   