ó 9(Zc@`s­ddlmZmZmZddlZddlmZddlmZm Z m Z ddl m Z e deed„Ze deed„Zd „Zd „Zd „ZdS( i(tabsolute_importtdivisiontprint_functionNi(t iteritems(tNOTHINGtfieldst _obj_setattr(tAttrsAttributeNotFoundErrorc `s‹t|jƒ}|ƒ}xl|D]d}t||jƒ}|dk rY|||ƒ rYqn|tkrvt|jƒrœt|dtd|d|ƒ||j;sN(RR tgetattrtnametNonetTrueR R t isinstancettupletlisttsettdictR( tinstRR R tretain_collection_typestattrstrvtatvtcfti((Rs*/tmp/pip-build-wDUJoH/attrs/attr/_funcs.pyR s,   Pc `sÈt|jƒ}g}|‰x|D]ˆ}t||jƒ}|dk r\|||ƒ r\q"n|tkrt|jƒr¥|jt|dtd|dˆdˆƒƒqªt |t t t fƒr4ˆtkrÒ|jnt } |j| g|D]?} t| jƒr!t| dtd|dˆdˆƒn| ^q胃qªt |t ƒrˆtkrX|jnt } |j| ‡‡fd†t|ƒDƒƒƒqª|j|ƒq"|j|ƒq"Wˆt kr¾|Sˆ|ƒS(s8 Return the ``attrs`` attribute values of *inst* as a tuple. Optionally recurse into other ``attrs``-decorated classes. :param inst: Instance of an ``attrs``-decorated class. :param bool recurse: Recurse into classes that are also ``attrs``-decorated. :param callable filter: A callable whose return code determines whether an attribute or element is included (``True``) or dropped (``False``). Is called with the :class:`attr.Attribute` as the first argument and the value as the second argument. :param callable tuple_factory: A callable to produce tuples from. For example, to produce lists instead of tuples. :param bool retain_collection_types: Do not convert to ``list`` or ``dict`` when encountering an attribute which type is ``tuple``, ``dict`` or ``set``. Only meaningful if ``recurse`` is ``True``. :rtype: return type of *tuple_factory* :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs`` class. .. versionadded:: 16.2.0 RR t tuple_factoryRc3`so|]e\}}t|jƒr6t|dˆdˆƒn|t|jƒr`t|dˆdˆƒn|fVqdS(R#RN(R R tastuple(RRR(tretainR#(s*/tmp/pip-build-wDUJoH/attrs/attr/_funcs.pys zs N(RR RRRRR tappendR$RRRRRR( RRR R#RRRRR R!tjR((R%R#s*/tmp/pip-build-wDUJoH/attrs/attr/_funcs.pyR$Fs2    P  cC`st|ddƒdk S(s¸ Check whether *cls* is a class with ``attrs`` attributes. :param type cls: Class to introspect. :raise TypeError: If *cls* is not a class. :rtype: :class:`bool` t__attrs_attrs__N(RR(tcls((s*/tmp/pip-build-wDUJoH/attrs/attr/_funcs.pyR Žs cK`s³ddl}|jdtddƒtj|ƒ}t|jƒ}xlt|ƒD]^\}}t||tƒ}|tkr›t dj d|d|jƒƒ‚nt |||ƒqMW|S( sä Copy *inst* and apply *changes*. :param inst: Instance of a class with ``attrs`` attributes. :param changes: Keyword changes in the new copy. :return: A copy of inst with *changes* incorporated. :raise attr.exceptions.AttrsAttributeNotFoundError: If *attr_name* couldn't be found on *cls*. :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs`` class. .. deprecated:: 17.1.0 Use :func:`evolve` instead. iNs6assoc is deprecated and will be removed after 2018/01.t stacklevelis&{k} is not an attrs attribute on {cl}.tktcl( twarningstwarntDeprecationWarningtcopyRR RRRRtformatR(RtchangesR-tnewRR+R R((s*/tmp/pip-build-wDUJoH/attrs/attr/_funcs.pytassocšs     cK`sŠ|j}t|ƒ}xh|D]`}|js1qn|j}|ddkrP|n|d}||krt||ƒ||s   ;  G !