§
    èÓáaÎ  ã                   ó   — d dl Z dd„ZdS )é    NÚ Ú	ImmutableFc                 óV  ‡ — t          ‰ t          ¦  «        r(‰                      dd¦  «                             ¦   «         Š ˆ fd„}d}t          j        dk     rd                     |¬¦  «        }d                     d	„ ‰ D ¦   «         ¦  «        }d
                     ||rd|z  nd |¦   «         ||¬¦  «        }|rt          |¦  «         ddl	m
} t          |d¬¦  «        }	 t          ||¦  «         n5# t          $ r(}	t          t          |	¦  «        dz   |z   ¦  «        |	‚d}	~	ww xY w||         S )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                  óv   •— d„ ‰D ¦   «         } | r)d                      d                     | ¦  «        ¬¦  «        S dS )Nc                 óB   — g | ]}|                      d ¦  «        ¯d|z  ‘ŒS )Ú_ú'%s')Úendswith)Ú.0Úfs     ú7/usr/lib/python3/dist-packages/pyrsistent/_immutable.pyú
<listcomp>z9immutable.<locals>.frozen_member_test.<locals>.<listcomp>5   s+   € ÐIÐIÐI¨¸¿ºÀC¹¼ÐI˜& 1™*ÐIÐIÐIó    zÆ
        frozen_fields = fields_to_modify & set([{frozen_members}])
        if frozen_fields:
            raise AttributeError('Cannot set frozen members %s' % ', '.join(frozen_fields))
            ú, )Úfrozen_membersr   )ÚformatÚjoin)r   Úmemberss    €r   Úfrozen_member_testz%immutable.<locals>.frozen_member_test4   sN   ø€ ØIÐI¨gÐIÑIÔIˆØð 	Að÷ ’ d§i¢i°Ñ&?Ô&?�Ñ@Ô@ð	Að ˆrr   r   )é   é   z, verbose={verbose})Úverboser   c              3   ó    K  — | ]	}d |z  V — Œ
dS )r   N© )r   Úms     r   ú	<genexpr>zimmutable.<locals>.<genexpr>D   s&   è è € Ð;Ð;¨a˜v¨™zÐ;Ð;Ð;Ð;Ð;Ð;r   a�  
class {class_name}(namedtuple('ImmutableBase', [{quoted_members}]{verbose_string})):
    __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   Úverbose_stringÚ
class_namer   )Ú
namedtupleÚpyrsistent_immutable)r#   Ú__name__z:
N)Ú
isinstanceÚstrÚreplaceÚsplitÚsysÚversion_infor   r   ÚprintÚcollectionsr#   ÚdictÚexecÚSyntaxError)
r   Únamer   r   r!   r   Útemplater#   Ú	namespaceÚes
   `         r   Ú	immutabler5      s}  ø€ õZ �'�3ÑÔð 4Ø—/’/ # sÑ+Ô+×1Ò1Ñ3Ô3ˆð	ð 	ð 	ð 	ð 	ð €NÝ
Ô˜&Ò Ð à.×5Ò5¸gÐ5ÑFÔFˆà—Y’YÐ;Ð;°7Ð;Ñ;Ô;Ñ;Ô;€Nð÷$ ‚F˜.Ø:HÐU˜+¨Ñ6Ð6ÈgØ"4Ð"4Ñ"6Ô"6Ø,Øð	 ñ  ô  ð% ð0 ð Ýˆh‰Œˆà&Ð&Ð&Ð&Ð&Ð&Ý 
Ð5KÐLÑLÔL€Ið<ÝˆX�yÑ!Ô!Ð!Ð!øÝð <ð <ð <Ý�#˜a™&œ& 5™.¨8Ñ3Ñ4Ô4¸!Ð;øøøøð<øøøð �TŒ?Ðs   ÃC. Ã.
D Ã8#DÄD )r   r   F)r*   r5   r   r   r   ú<module>r6      s2   ðØ 
€
€
€
ðcð cð cð cð cð cr   