ó 9(Zc@`swddlmZmZmZddlZddlZddlZddlmZddl m Z ddl m Z m Z mZmZmZddlmZmZmZmZejZdZd Zd ZeiƒZd efd „ƒYZeƒZede e de didd „ Z!d„Z"e"dddgƒZ#d„Z$d„Z%d„Z&d„Z'defd„ƒYZ(ddde e de e)e)e)e)d„ Z*e*Z+e r®d„Z,n d„Z,d„Z-d„Z.d„Z/d„Z0dd„Z1d „Z2ddd!„Z3d"„Z4d#„Z5d$„Z6d%„Z7d&„Z8d'efd(„ƒYZ9ge9j:D]?Z;e9d)e;d*ed+dd,e d-e d.e;d/kd0e ƒ^qLZ<e/e1e3e9de<ƒde<ƒdge<D]Z=e=j>r¹e=^q¹ƒZ9d1efd2„ƒYZ?e1e3e?ƒƒZ?e*d3e d0e)d.e ƒd4efd5„ƒYƒZ@efd6„ZAe*d3e d.e ƒd7efd8„ƒYƒZBd9„ZCdS(:i(tabsolute_importtdivisiontprint_functionN(t itemgetteri(t_config(tPY2t iteritemstisclasstmetadata_proxytset_closure_cell(tDefaultAlreadySetErrortFrozenInstanceErrortNotAnAttrsClassErrortUnannotatedAttributeErrors__attr_convert_{}s__attr_factory_{}s/ {attr_name} = property(itemgetter({index}))t_NothingcB`sDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s€ Sentinel class to indicate the lack of a value when ``None`` is ambiguous. All instances of `_Nothing` are equal. cC`s|S(N((tself((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt__copy__'scC`s|S(N((Rt_((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt __deepcopy__*scC`s |jtkS(N(t __class__R(Rtother((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt__eq__-scC`s ||k S(N((RR((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt__ne__0scC`sdS(NtNOTHING((R((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt__repr__3scC`sdS(NIï¾­Þ((R((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt__hash__6s( t__name__t __module__t__doc__RRRRRR(((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR!s     c C`sp|d k r3|tk r3|tk r3tdƒ‚ntd|d|d|d|d|d|d|d |d |ƒ S( s9 Create a new attribute on a class. .. warning:: Does *not* do anything unless the class is also decorated with :func:`attr.s`! :param default: A value that is used if an ``attrs``-generated ``__init__`` is used and no value is passed while instantiating or the attribute is excluded using ``init=False``. If the value is an instance of :class:`Factory`, its callable will be used to construct a new value (useful for mutable data types like lists or dicts). If a default is not set (or set manually to ``attr.NOTHING``), a value *must* be supplied when instantiating; otherwise a :exc:`TypeError` will be raised. The default can also be set using decorator notation as shown below. :type default: Any value. :param validator: :func:`callable` that is called by ``attrs``-generated ``__init__`` methods after the instance has been initialized. They receive the initialized instance, the :class:`Attribute`, and the passed value. The return value is *not* inspected so the validator has to throw an exception itself. If a ``list`` is passed, its items are treated as validators and must all pass. Validators can be globally disabled and re-enabled using :func:`get_run_validators`. The validator can also be set using decorator notation as shown below. :type validator: ``callable`` or a ``list`` of ``callable``\ s. :param bool repr: Include this attribute in the generated ``__repr__`` method. :param bool cmp: Include this attribute in the generated comparison methods (``__eq__`` et al). :param hash: Include this attribute in the generated ``__hash__`` method. If ``None`` (default), mirror *cmp*'s value. This is the correct behavior according the Python spec. Setting this value to anything else than ``None`` is *discouraged*. :type hash: ``bool`` or ``None`` :param bool init: Include this attribute in the generated ``__init__`` method. It is possible to set this to ``False`` and set a default value. In that case this attributed is unconditionally initialized with the specified default value or factory. :param callable convert: :func:`callable` that is called by ``attrs``-generated ``__init__`` methods to convert attribute's value to the desired format. It is given the passed-in value, and the returned value will be used as the new value of the attribute. The value is converted before being passed to the validator, if any. :param metadata: An arbitrary mapping, to be used by third-party components. See :ref:`extending_metadata`. :param type: The type of the attribute. In Python 3.6 or greater, the preferred method to specify the type is using a variable annotation (see `PEP 526 `_). This argument is provided for backward compatibility. Regardless of the approach used, the type will be stored on ``Attribute.type``. .. versionchanged:: 17.1.0 *validator* can be a ``list`` now. .. versionchanged:: 17.1.0 *hash* is ``None`` and therefore mirrors *cmp* by default. .. versionadded:: 17.3.0 *type* s6Invalid value for hash. Must be True, False, or None.tdefaultt validatortreprtcmpthashtinittconverttmetadatattypeN(tNonetTruetFalset TypeErrort _CountingAttr( RRRR R!R"R#R$R%((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytattrib@sM$ cC`s­dj|ƒ}dj|ƒdg}|rixIt|ƒD]+\}}|jtjd|d|ƒƒq7Wn |jdƒitd6}ttdj|ƒd d ƒ|ƒ||S( sé Create a tuple subclass to hold `Attribute`s for an `attrs` class. The subclass is a bare tuple with properties for names. class MyClassAttributes(tuple): __slots__ = () x = property(itemgetter(0)) s {}Attributessclass {}(tuple):s __slots__ = ()tindext attr_names passRs ttexec(tformatt enumeratetappendt_tuple_property_patRtevaltcompiletjoin(tcls_namet attr_namestattr_class_nametattr_class_templatetiR-tglobs((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt_make_attr_tuple_classžs     "t _Attributestattrst super_attrscC`st|ƒjdƒS(s½ Check whether *annot* is a typing.ClassVar. The implementation is gross but importing `typing` is slow and there are discussions to remove it from the stdlib alltogether. styping.ClassVar(tstrt startswith(tannot((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt _is_class_varÂsc `s®|j‰t|diƒ}|dkr[|tkr[td„ˆjƒDƒdd„ƒ}nP|dkr†|tkr†d„ˆjƒDƒ}g}tƒ}x—|jƒD]‰\}}t|ƒrÃq¥n|j |ƒˆj |t ƒ} t | t ƒs| t kr tƒ} qtd| ƒ} n|j|| fƒq¥W||} t| ƒdkr«tdd jt| d‡fd †ƒƒd ƒ‚q«n%td „t|ƒDƒdd „ƒ}g|D]3\}} tjd|d| d|j |ƒƒ^q²} g} td„| Dƒƒ}x|jdd!D]m}t|ddƒ}|dk rxFt|ƒD]5} | j|krI| j| ƒ|j | jƒqIqIWqqW| jƒg| | D]} | j^qž}t|j|ƒ}|| g|D]3\}} tjd|d| d|j |ƒƒ^qÒƒ}t}x†|D]~} |tkrg| jt krg| jtkrgtdjd| ƒƒ‚q|tkr| jt k r| jtk rt}qqWt || fƒS(s® Transform all `_CountingAttr`s on a class into `Attribute`s. If *these* is passed, use that and don't look for them on the class. Return an `_Attributes`. t__annotations__cs`s0|]&\}}t|tƒr||fVqdS(N(t isinstanceR*(t.0tnametattr((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys Ùs tkeycS`s |djS(Ni(tcounter(te((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytÝscS`s+h|]!\}}t|tƒr|’qS((RFR*(RGRHRI((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys às  Ris1The following `attr.ib`s lack a type annotation: s, c`sˆj|ƒjS(N(tgetRK(tn(tcd(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyRMùst.cs`s!|]\}}||fVqdS(N((RGRHtca((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys þscS`s |djS(Ni(RK(RL((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyRMsRHRRR%cs`s|]}|jVqdS(N(RH(RGta((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys siiÿÿÿÿt__attrs_attrs__sqNo mandatory attributes allowed after an attribute with a default value or factory. Attribute in question: {a!r}RSN(!t__dict__tgetattrR&R(tsortedtitemsR'tsetRDtaddRNRRFR*R+R2tlenR R6Rt Attributetfrom_counting_attrt__mro__treversedRHtreverseR=RRR"t ValueErrorR0R>(tclsttheset auto_attribstannstca_listtca_namest annot_namesR-R%RSt unannotatedRRtnon_super_attrsR@ttaken_attr_namest super_clst sub_attrsR8t AttrsClassR?t had_default((RPs)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt_transform_attrsÌsv       5 =    A *   cC`s tƒ‚dS(s4 Attached to frozen classes as __setattr__. N(R (RRHtvalue((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt_frozen_setattrsAscC`s tƒ‚dS(s4 Attached to frozen classes as __delattr__. N(R (RRH((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt_frozen_delattrsHst _ClassBuildercB`sweZdZdZd „Zd „Zd „Zd „Zd „Zd„Z d„Z d„Z d„Z d„Z d„ZRS(s( Iteratively build *one* class. t_clst _cls_dictt_attrst _super_namest _attr_namest_slotst_frozent_has_post_initcC`sêt|||ƒ\}}||_|r6t|jƒni|_||_td„|Dƒƒ|_td„|Dƒƒ|_ ||_ |p’t |ƒ|_ t t|dtƒƒ|_|j|jd<|ræt|jd^scs`s|]}|jVqdS(N(RH(RGRS((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys _st__attrs_post_init__RTt __setattr__t __delattr__(RpRutdictRURvRwRYRxttupleRyRzt_has_frozen_superclassR{tboolRVR(R|RrRs(RRbRctslotstfrozenRdR?R@((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt__init__Xs    cC`sdjd|jjƒS(Ns<_ClassBuilder(cls={cls})>Rb(R0RuR(R((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyRjscC`s'|jtkr|jƒS|jƒSdS(s‹ Finalize class based on the accumulated configuration. Builder cannot be used anymore after calling this method. N(RzR't_create_slots_classt_patch_original_class(R((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt build_classms cC`sŽ|j}|j}xE|jD]:}||krt||dƒdk rt||ƒqqWx-|jjƒD]\}}t|||ƒqjW|S(sA Apply accumulated methods and return the class. N( RuRxRyRVR&tdelattrRvRXtsetattr(RRbt super_namesRHRq((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyRˆxs   c `s}ˆj‰‡fd†tˆjƒDƒ}t‡fd†ˆjDƒƒ|d‘s  c3`s!|]}|ˆkr|VqdS(N((RGRH(RŒ(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys ™st __slots__t __qualname__c`st‡fd†ˆDƒƒS(s9 Automatically created by attrs. c3`s|]}tˆ|ƒVqdS(N(RV(RGRH(R(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys ¨s(R(R(R8(Rs)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytslots_getstate¤sc`sCtj|tƒ}x*tˆ|ƒD]\}}|||ƒq"WdS(s9 Automatically created by attrs. N(t _obj_setattrt__get__R\tzip(Rtstatet_ClassBuilder__bound_setattrRHRq(R8(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytslots_setstateªst __getstate__t __setstate__t __closure__N(RxRRvRRyRVRuR&R%Rt __bases__RUtvaluesRFt classmethodt staticmethodt__func__t cell_contentsR ( RRPtqualnameR‘R—Rbtitemt closure_cellstcell((R8RRŒs)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR‡‹s8            cC`s t|jd|ƒ|jd<|S(NtnsR(t _make_reprRwRv(RR¥((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytadd_reprÓscC`s>|jjdƒ}|dkr-tdƒ‚n||jd<|S(NRs3__str__ can only be generated if a __repr__ exists.t__str__(RvRNR&Ra(Rtrepr_((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytadd_str×s    cC`sd|jd<|S(NR(R&Rv(R((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytmake_unhashableás cC`st|jƒ|jd<|S(NR(t _make_hashRwRv(R((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytadd_hashåscC`s&t|j|j|jƒ|jd<|S(NR†(t _make_initRwR|R{Rv(R((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytadd_inités cC`sF|j}t|jƒ\|d<|d<|d<|d<|d<|d<|S(NRRt__lt__t__le__t__gt__t__ge__(Rvt _make_cmpRw(RRP((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytadd_cmpñs 9(s_clss _cls_dicts_attrss _super_namess _attr_namess_slotss_frozens_has_post_init(RRRRR†RR‰RˆR‡R§RªR«R­R¯Rµ(((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyRtOs    H    c `sH‡‡‡‡‡‡‡‡‡‡ f d†} |dkr:| S| |ƒSdS(sU A class decorator that adds `dunder `_\ -methods according to the specified attributes using :func:`attr.ib` or the *these* argument. :param these: A dictionary of name to :func:`attr.ib` mappings. This is useful to avoid the definition of your attributes within the class body because you can't (e.g. if you want to add ``__repr__`` methods to Django models) or don't want to. If *these* is not ``None``, ``attrs`` will *not* search the class body for attributes. :type these: :class:`dict` of :class:`str` to :func:`attr.ib` :param str repr_ns: When using nested classes, there's no way in Python 2 to automatically detect that. Therefore it's possible to set the namespace explicitly for a more meaningful ``repr`` output. :param bool repr: Create a ``__repr__`` method with a human readable representation of ``attrs`` attributes.. :param bool str: Create a ``__str__`` method that is identical to ``__repr__``. This is usually not necessary except for :class:`Exception`\ s. :param bool cmp: Create ``__eq__``, ``__ne__``, ``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` methods that compare the class as if it were a tuple of its ``attrs`` attributes. But the attributes are *only* compared, if the type of both classes is *identical*! :param hash: If ``None`` (default), the ``__hash__`` method is generated according how *cmp* and *frozen* are set. 1. If *both* are True, ``attrs`` will generate a ``__hash__`` for you. 2. If *cmp* is True and *frozen* is False, ``__hash__`` will be set to None, marking it unhashable (which it is). 3. If *cmp* is False, ``__hash__`` will be left untouched meaning the ``__hash__`` method of the superclass will be used (if superclass is ``object``, this means it will fall back to id-based hashing.). Although not recommended, you can decide for yourself and force ``attrs`` to create one (e.g. if the class is immutable even though you didn't freeze it programmatically) by passing ``True`` or not. Both of these cases are rather special and should be used carefully. See the `Python documentation \ `_ and the `GitHub issue that led to the default behavior \ `_ for more details. :type hash: ``bool`` or ``None`` :param bool init: Create a ``__init__`` method that initializes the ``attrs`` attributes. Leading underscores are stripped for the argument name. If a ``__attrs_post_init__`` method exists on the class, it will be called after the class is fully initialized. :param bool slots: Create a slots_-style class that's more memory-efficient. See :ref:`slots` for further ramifications. :param bool frozen: Make instances immutable after initialization. If someone attempts to modify a frozen instance, :exc:`attr.exceptions.FrozenInstanceError` is raised. Please note: 1. This is achieved by installing a custom ``__setattr__`` method on your class so you can't implement an own one. 2. True immutability is impossible in Python. 3. This *does* have a minor a runtime performance :ref:`impact ` when initializing new instances. In other words: ``__init__`` is slightly slower with ``frozen=True``. 4. If a class is frozen, you cannot modify ``self`` in ``__attrs_post_init__`` or a self-written ``__init__``. You can circumvent that limitation by using ``object.__setattr__(self, "attribute_name", value)``. .. _slots: https://docs.python.org/3/reference/datamodel.html#slots :param bool auto_attribs: If True, collect `PEP 526`_-annotated attributes (Python 3.6 and later only) from the class body. In this case, you **must** annotate every field. If ``attrs`` encounters a field that is set to an :func:`attr.ib` but lacks a type annotation, an :exc:`attr.exceptions.UnannotatedAttributeError` is raised. Use ``field_name: typing.Any = attr.ib(...)`` if you don't want to set a type. If you assign a value to those attributes (e.g. ``x: int = 42``), that value becomes the default value like if it were passed using ``attr.ib(default=42)``. Passing an instance of :class:`Factory` also works as expected. Attributes annotated as :data:`typing.ClassVar` are **ignored**. .. _`PEP 526`: https://www.python.org/dev/peps/pep-0526/ .. versionadded:: 16.0.0 *slots* .. versionadded:: 16.1.0 *frozen* .. versionadded:: 16.3.0 *str*, and support for ``__attrs_post_init__``. .. versionchanged:: 17.1.0 *hash* supports ``None`` as value which is also the default now. .. versionadded:: 17.3.0 *auto_attribs* c`sQt|ddƒdkr'tdƒ‚nt|ˆ ˆˆˆƒ}ˆtkr[|jˆƒnˆtkrt|jƒnˆtkr|jƒnˆtk rÀˆtk rÀˆdk rÀtdƒ‚nnˆtks.ˆdkrçˆtkrçnGˆtksˆdkr$ˆtkr$ˆtkr$|j ƒn |j ƒˆtkrG|j ƒn|j ƒS(NRs(attrs only works with new-style classes.s6Invalid value for hash. Must be True, False, or None.( RVR&R)RtR'R§RªRµR(R­R«R¯R‰(Rbtbuilder( RdR R…R!R"Rtrepr_nsR„RARc(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytwrapas(     $ $0    N(R&( t maybe_clsRcR·RR R!R"R„R…RARdR¸(( RdR R…R!R"RR·R„RARcs)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR?úsg* cC`s1t|jddƒtjko0|jjtjkS(sb Check whether *cls* has a frozen ancestor by looking at its __setattr__. RN(RVR~R&RrRR(Rb((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR‚s cC`s |jtkS(sb Check whether *cls* has a frozen ancestor by looking at its __setattr__. (R~Rr(Rb((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR‚›sc`st‡fd†|DƒƒS(s: Create a tuple of all values of *obj*'s *attrs*. c3`s!|]}tˆ|jƒVqdS(N(RVRH(RGRS(tobj(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys §s(R(RºR?((Rºs)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt_attrs_to_tuple£sc`s)td„ˆDƒƒ‰‡fd†}|S(Ncs`sB|]8}|jtks6|jdkr|jtkr|VqdS(N(R!R'R&R (RGRS((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys ¬sc`stt|ˆƒƒS(s1 Automatically created by attrs. (R!R»(R(R?(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pythash_±s(R(R?R¼((R?s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR¬ªs  cC`st|ƒ|_|S(s% Add a hash method to *cls*. (R¬R(RbR?((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt _add_hashºsc`s¡gˆD]}|jr|^q‰‡fd†‰‡fd†‰‡fd†}‡fd†}‡fd†}‡fd†}‡fd†}ˆ|||||fS(Nc`s t|ˆƒS(s& Save us some typing. (R»(Rº(R?(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytattrs_to_tupleÅsc`s0|j|jkr(ˆ|ƒˆ|ƒkStSdS(s1 Automatically created by attrs. N(RtNotImplemented(RR(R¾(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyteqËsc`s(ˆ||ƒ}|tkrtS| SdS(s1 Automatically created by attrs. N(R¿(RRtresult(RÀ(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytneÔs c`s0t||jƒr(ˆ|ƒˆ|ƒkStSdS(s1 Automatically created by attrs. N(RFRR¿(RR(R¾(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytltÞsc`s0t||jƒr(ˆ|ƒˆ|ƒkStSdS(s1 Automatically created by attrs. N(RFRR¿(RR(R¾(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytleçsc`s0t||jƒr(ˆ|ƒˆ|ƒkStSdS(s1 Automatically created by attrs. N(RFRR¿(RR(R¾(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytgtðsc`s0t||jƒr(ˆ|ƒˆ|ƒkStSdS(s1 Automatically created by attrs. N(RFRR¿(RR(R¾(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytgeùs(R (R?RSRÂRÃRÄRÅRÆ((R?R¾RÀs)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR´Âs"      cC`sL|dkr|j}nt|ƒ\|_|_|_|_|_|_|S(s* Add comparison methods to *cls*. N( R&RTR´RRR°R±R²R³(RbR?((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt_add_cmps  0c`s,td„|Dƒƒ‰‡‡fd†}|S(sK Make a repr method for *attr_names* adding *ns* to the full name. cs`s!|]}|jr|jVqdS(N(RRH(RGRS((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys sc`s’ˆj}ˆd krXt|dd ƒ}|d k rL|jddƒd}qi|j}nˆd|j}dj|dj‡fd†ˆDƒƒƒS( s1 Automatically created by attrs. Rs>.iiÿÿÿÿRQs{0}({1})s, c3`s,|]"}|dttˆ|ƒƒVqdS(t=N(RRV(RGRH(R(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys -sN(RR&RVtrsplitRR0R6(Rtreal_clsR¡t class_name(R8R¥(Rs)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR©s     (R(R?R¥R©((R8R¥s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR¦s  cC`s4|dkr|j}nt||ƒ}||_|S(s% Add a repr method to *cls*. N(R&RTR¦R(RbR¥R?R©((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt _add_repr4s    c C`s.g|D]$}|js%|jtk r|^q}tjƒ}|jt|ƒjdƒƒdj|j ƒƒ}t |||ƒ\}}i}t ||dƒ} t d„|Dƒƒ} |jitd6| d6ƒ|t krèt|dR/cs`s|]}|j|fVqdS(N(RH(RGRS((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys UsRt attr_dictt_cached_setattrR†(R"RRthashlibtsha1tupdateRtencodeR0t hexdigestt_attrs_to_scriptR5R€R'R’R4R[R&t splitlinest linecachetcache( R?t post_initR…RSRÐtunique_filenametscriptR<tlocstbytecodeRÍR"((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR®@s4 $        cC`s(t|jt|dtƒ|ƒ|_|S(sR Add a __init__ method to *cls*. If *frozen* is True, make it immutable. R}(R®RTRVR(R†(RbR…((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt _add_initms  cC`sXt|ƒstdƒ‚nt|ddƒ}|dkrTtdjd|ƒƒ‚n|S(sö Returns the tuple of ``attrs`` attributes for a class. The tuple also allows accessing the fields by their names (see below for examples). :param type cls: Class to introspect. :raise TypeError: If *cls* is not a class. :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs`` class. :rtype: tuple (with name accessors) of :class:`attr.Attribute` .. versionchanged:: 16.2.0 Returned tuple allows accessing the fields by name. sPassed object must be a class.RTs({cls!r} is not an attrs-decorated class.RbN(RR)RVR&R R0(RbR?((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytfieldsys  cC`setjtkrdSxKt|jƒD]:}|j}|dk r#|||t||jƒƒq#q#WdS(s§ Validate all attributes on *inst* that have a validator. Leaves all exceptions through. :param inst: Instance of a class with ``attrs`` attributes. N( Rt_run_validatorsR(RÞRRR&RVRH(tinstRSRŽ((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytvalidate•s   cC`sëg}|tkr4|jdƒd„}d„}nd„}d„}g}g}i}xµ|D]­} | jr~|j| ƒn| j} | jjdƒ} t| jtƒ} | rÆ| jjrÆd} nd} | j t krõ| r}t j | jƒ}| j dk rG|j|| |d j | ƒƒƒtj | jƒ}| j ||ms RHRRR%(R&R%RaR\Rt _validatort_default(RbRHRRR%t inst_dict((RRs)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR]cs     c`st‡fd†ˆjDƒƒS(s( Play nice with pickle. c3`s9|]/}|dkr$tˆ|ƒn tˆjƒVqdS(R$N(RVR€R$(RGRH(R(s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys |s(RR(R((Rs)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR˜xscC`sttj|tƒ}x[t|j|ƒD]G\}}|dkrM|||ƒq%|||ret|ƒntƒq%WdS(s( Play nice with pickle. R$N(R’R“R\R”RRR÷(RR•RøRHRq((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR™€s  ( snamesdefaults validatorsreprscmpshashsinitsconvertsmetadatastypeN( RRRRR&R†R~RR]R˜R™(((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR\Bs  RHRRRR R!R$R"R*cB`seZdZdZed „dDƒƒed dd ddddedededeƒfZ dZ d„Z d„Z d„Z RS(s Intermediate representation of attributes that uses a counter to preserve the order in which the attributes have been defined. *Internal* data structure of the attrs library. Running into is most likely the result of a bug like a forgotten `@attr.s` decorator. RKRúRR R!R"R$RùR#R%cc`sB|]8}td|dtdddtdtdtdtƒVqdS(RHRRRR R!R"N(R\RR&R'(RGRH((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys ¢sRHRRic C`stjd7_tj|_||_|rQt|ttfƒrQt|Œ|_n ||_||_ ||_ ||_ ||_ ||_ ||_| |_dS(Ni(R*t cls_counterRKRúRFtlistRtand_RùRR R!R"R#R$R%( RRRRR R!R"R#R$R%((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR†¬s         cC`s4|jdkr||_nt|j|ƒ|_|S(sŒ Decorator that adds *meth* to the list of validators. Returns *meth* unchanged. .. versionadded:: 17.1.0 N(RùR&Rþ(Rtmeth((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR¾s cC`s4|jtk rtƒ‚nt|dtƒ|_|S(sÚ Decorator that allows to set the default for an attribute. Returns *meth* unchanged. :raises DefaultAlreadySetError: If default has been set before. .. versionadded:: 17.1.0 Rî(RúRR RíR'(RRÿ((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyRÌs  ( scounters_defaultsreprscmpshashsinitsmetadatas _validatorsconvertstype(scounters_defaultsreprscmpshashsinitN(RRRRRR\R&R'R(RTRüR†RR(((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR*—s   R„RícB`s,eZdZeƒZeƒZed„ZRS(sÉ Stores a factory callable. If passed as the default value to :func:`attr.ib`, the factory is used to generate a new value. :param callable factory: A callable that takes either none or exactly one mandatory positional argument depending on *takes_self*. :param bool takes_self: Pass the partially initialized instance that is being initialized as a positional argument. .. versionadded:: 17.1.0 *takes_self* cC`s||_||_dS(s‹ `Factory` is part of the default machinery so if we want a default value here, we have to implement it ourselves. N(RðRî(RRðRî((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR†ós (RRRR+RðRîR(R†(((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyRíás  cK`sät|tƒr|}n:t|ttfƒrFtd„|Dƒƒ}n tdƒ‚|jddƒ}t|||dkrin i|d6ƒ}y%tj dƒj j ddƒ|_ Wnt tfk rÍnXtd|||ƒS( s A quick way to create a new class called *name* with *attrs*. :param name: The name for the new class. :type name: str :param attrs: A list of names or a dictionary of mappings of names to attributes. :type attrs: :class:`list` or :class:`dict` :param tuple bases: Classes that the new class will subclass. :param attributes_arguments: Passed unmodified to :func:`attr.s`. :return: A new class with *attrs*. :rtype: type .. versionadded:: 17.1.0 *bases* cs`s|]}|tƒfVqdS(N(R+(RGRS((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pys ss(attrs argument must be a dict or a list.R}iRt__main__RcN(RFR€RýRR)tpopR&R%tsyst _getframet f_globalsRNRtAttributeErrorRaRw(RHR?tbasestattributes_argumentstcls_dictRØttype_((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt make_classüs   "t _AndValidatorcB`s eZdZeƒZd„ZRS(s2 Compose many validators to a single one. cC`s(x!|jD]}||||ƒq WdS(N(t _validators(RRàRIRqRŽ((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyt__call__6s(RRRR+R R (((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyR /s cG`sOg}x6|D].}|jt|tƒr1|jn|gƒq Wtt|ƒƒS(sô A validator that composes multiple validators into one. When called on a value, it runs all wrapped validators. :param validators: Arbitrary number of validators. :type validators: callables .. versionadded:: 17.1.0 (textendRFR R R(t validatorstvalsR((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pyRþ;s  (Dt __future__RRRRÏRÖRtoperatorRR.Rt_compatRRRRR t exceptionsR R R R tobjectR~R’RåRïR3R÷RRR&R'R+R=R>RDRpRrRsRtR(R?RwR‚R»R¬R½R´RÇR¦RÌR®RÝRÞRáRÔR\RRHt_aRSR!R*RíR R Rþ(((s)/tmp/pip-build-wDUJoH/attrs/attr/_make.pytsv   ("    \   u  «  ‹     C " -   œKL%G3