Ë
    n€9e×  ã                   ó   — d dl Z dd„Zy)é    Nc                 óœ  ‡ — t        ‰ t        «      r ‰ j                  dd«      j                  «       Š ˆ fd„}dj	                  d„ ‰ D «       «      }dj                  ||rd|z  nd |«       |¬	«      }|rt        |«       d
dlm} t        |d¬«      }	 t        ||«       ||   S # t        $ r }t        t        |«      dz   |z   «      |‚d}~ww xY w)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                  óž   •— ‰D � cg c]  } | j                  d«      sŒd| z  ‘Œ }} |r!dj                  dj                  |«      ¬«      S yc c} w )NÚ_ú'%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_testz%immutable.<locals>.frozen_member_test4   sT   ø€ Ø.5ÖI¨¸¿¹ÀC½˜& 1›*ÐIˆÐIÙð÷ ‘ d§i¡i°Ó&?�Ó@ð	Að ùò Js
   †A
�A
r	   c              3   ó&   K  — | ]	  }d |z  –— Œ y­w)r   N© )Ú.0Úms     r   ú	<genexpr>zimmutable.<locals>.<genexpr>?   s   è ø€ Ò;¨a˜v¨�zÑ;ùs   ‚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_namer   )Ú
namedtupleÚpyrsistent_immutable)r   Ú__name__z:
N)Ú
isinstanceÚstrÚreplaceÚsplitr   r   ÚprintÚcollectionsr   ÚdictÚexecÚSyntaxError)	r   ÚnameÚverboser   r   Útemplater   Ú	namespaceÚes	   `        r   Ú	immutabler,      sÙ   ø€ ôZ �'œ3ÔØ—/‘/ # sÓ+×1Ñ1Ó3ˆô	ð —Y‘YÑ;°7Ô;Ó;€Nð÷$ �F˜.Ù:H˜+¨Ò6ÈgÙ"4Ó"6Øð ó  ð% ñ. ÜˆhŒå&Ü 
Ð5KÔL€Ið<ÜˆX�yÔ!ð �T‰?Ðøô ò <Üœ#˜a›& 5™.¨8Ñ3Ó4¸!Ð;ûð<ús   ÂB" Â"	CÂ+CÃC)r   Ú	ImmutableF)Úsysr,   r   ó    r   ú<module>r0      s   ðÛ 
ô]r/   