+
    n9e                         ^ RI t RR ltR# )    Nc                  a  \        S \        4      '       d!   S P                  RR4      P                  4       o V 3R lpRP	                  R S  4       4      pRP                  TV'       d
   RV,          MRV! 4       VR	7      pV'       d   \        V4       ^ R
IHp \        VRR7      p \        WW4       Wq,          #   \         d)   p\        \        T4      R,           T,           4      ThRp?ii ; i)a"  
Produces a class that either can be used standalone or as a base class for persistent classes.

This is a thin wrapper around a named tuple.

Constructing a type and using it to instantiate objects:

>>> Point = immutable('x, y', name='Point')
>>> p = Point(1, 2)
>>> p2 = p.set(x=3)
>>> p
Point(x=1, y=2)
>>> p2
Point(x=3, y=2)

Inheriting from a constructed type. In this case no type name needs to be supplied:

>>> class PositivePoint(immutable('x, y')):
...     __slots__ = tuple()
...     def __new__(cls, x, y):
...         if x > 0 and y > 0:
...             return super(PositivePoint, cls).__new__(cls, x, y)
...         raise Exception('Coordinates must be positive!')
...
>>> p = PositivePoint(1, 2)
>>> p.set(x=3)
PositivePoint(x=3, y=2)
>>> p.set(y=-3)
Traceback (most recent call last):
Exception: Coordinates must be positive!

The persistent class also supports the notion of frozen members. The value of a frozen member
cannot be updated. For example it could be used to implement an ID that should remain the same
over time. A frozen member is denoted by a trailing underscore.

>>> Point = immutable('x, y, id_', name='Point')
>>> p = Point(1, 2, id_=17)
>>> p.set(x=3)
Point(x=3, y=2, id_=17)
>>> p.set(id_=18)
Traceback (most recent call last):
AttributeError: Cannot set frozen members id_
, c                     < S U u. uF$  q P                  R 4      '       g   K  RV ,          NK&  	  pp V'       d"   RP                  RP                  V4      R7      # R# u up i )_'%s'z
        frozen_fields = fields_to_modify & set([{frozen_members}])
        if frozen_fields:
            raise AttributeError('Cannot set frozen members %s' % ', '.join(frozen_fields))
            , )frozen_members )endswithformatjoin)fr
   memberss     7/usr/lib/python3/dist-packages/pyrsistent/_immutable.pyfrozen_member_test%immutable.<locals>.frozen_member_test4   sW    .5IgC*&1**gI dii&?@	A  Js
   AAr	   c              3   4   "   T F  pR V,          x  K  	  R# 5i)r   N ).0ms   & r   	<genexpr>immutable.<locals>.<genexpr>?   s     ;7avzz7s   aq  
class {class_name}(namedtuple('ImmutableBase', [{quoted_members}])):
    __slots__ = tuple()

    def __repr__(self):
        return super({class_name}, self).__repr__().replace('ImmutableBase', self.__class__.__name__)

    def set(self, **kwargs):
        if not kwargs:
            return self

        fields_to_modify = set(kwargs.keys())
        if not fields_to_modify <= {member_set}:
            raise AttributeError("'%s' is not a member" % ', '.join(fields_to_modify - {member_set}))

        {frozen_member_test}

        return self.__class__.__new__(self.__class__, *map(kwargs.pop, [{quoted_members}], self))
z	set([%s])zset())quoted_members
member_setr   
class_name)
namedtuplepyrsistent_immutable)r   __name__z:
N)
isinstancestrreplacesplitr   r   printcollectionsr   dictexecSyntaxError)	r   nameverboser   r   templater   	namespacees	   f&&      r   	immutabler.      s    Z '3//#s+113	 YY;7;;N$ F.:H+6g"4"6   % . h&
5KLI<X! ?  <#a&5.834!;<s   (B; ;C.#C))C.)r   	ImmutableF)sysr.   r       r   <module>r2      s    
]r1   