§ |<ˆjï ãóÄ—ddlmZddlmZddlmZddlmZddlmZddlmZddgZed ¦«Zed ¦«Z Gd „dee¦«Z Gd „d¦«Z d S)é)ÚAny)Úcast)ÚDict)ÚGeneric)ÚTypeVar)ÚUnionÚStashÚStashKeyÚTÚDcó—eZdZdZdZdS)r zÔ``StashKey`` is an object used as a key to a :class:`Stash`. A ``StashKey`` is associated with the type ``T`` of the value of the key. A ``StashKey`` is unique and cannot conflict with another key. ©N)Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú __slots__róú_/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/_pytest/stash.pyr r s€€€€€ððð€I€I€Ircóî—eZdZdZdZdd„Zdeededdfd„Zdeedefd „Z deed e de ee ffd „Z deed edefd „Z deeddfd „Zdeedefd„Zdefd„ZdS)r a/``Stash`` is a type-safe heterogeneous mutable mapping that allows keys and value types to be defined separately from where it (the ``Stash``) is created. Usually you will be given an object which has a ``Stash``, for example :class:`~pytest.Config` or a :class:`~_pytest.nodes.Node`: .. code-block:: python stash: Stash = some_object.stash If a module or plugin wants to store data in this ``Stash``, it creates :class:`StashKey`\s for its keys (at the module level): .. code-block:: python # At the top-level of the module some_str_key = StashKey[str]() some_bool_key = StashKey[bool]() To store information: .. code-block:: python # Value type must match the key. stash[some_str_key] = "value" stash[some_bool_key] = True To retrieve the information: .. code-block:: python # The static type of some_str is str. some_str = stash[some_str_key] # The static type of some_bool is bool. some_bool = stash[some_bool_key] ©Ú_storageÚreturnNcó—i|_dS)Nr©Úselfs rÚ__init__zStash.__init__Ds €Ø57ˆŒ ˆ ˆ rÚkeyÚvaluecó—||j|<dS)zSet a value for key.Nr)rrrs rÚ __setitem__zStash.__setitem__Gs€à"ˆŒ �cÑÐÐrcóB—tt|j|¦«S)zZGet the value for key. Raises ``KeyError`` if the key wasn't set before. )rr r©rrs rÚ __getitem__zStash.__getitem__Ks€õ •A�t”} SÔ)Ñ*Ô*Ð*rÚdefaultcó8— ||S#t$r|cYSwxYw)zNGet the value for key, or return default if the key wasn't set before.©ÚKeyError©rrr%s rÚgetz Stash.getRs5€ð ؘ”9Ð øÝð ð ð ØˆNˆNˆNð øøøs ‚ Š ˜cóB— ||S#t$r |||<|cYSwxYw)zmReturn the value of key if already set, otherwise set the value of key to default and return default.r'r)s rÚ setdefaultzStash.setdefaultZs>€ð ؘ”9Ð øÝð ð ð ØˆD�‰I؈NˆNˆNð øøøs ‚ Š�có—|j|=dS)z]Delete the value for key. Raises ``KeyError`` if the key wasn't set before. Nrr#s rÚ __delitem__zStash.__delitem__cs€ð ŒM˜#Ð Ð Ð rcó—||jvS)zReturn whether key was set.rr#s rÚ __contains__zStash.__contains__js€à�d”mÐ#Ð#rcó*—t|j¦«S)z)Return how many items exist in the stash.)Úlenrrs rÚ__len__z Stash.__len__ns€å�4”=Ñ!Ô!Ð!r)rN)rrrrrrr r r!r$r rr*r,r.Úboolr0Úintr3rrrr r sV€€€€€ð$ð$ðL€Ið8ð8ð8ð8ð#˜x¨œ{ð#°1ð#¸ð#ð#ð#ð#ð+˜x¨œ{ð+¨qð+ð+ð+ð+ð�x ”{ð¨Qð°5¸¸A¸´;ððððð˜h qœkð°Að¸!ððððð˜x¨œ{ð¨tððððð$ ¨¤ ð$°ð$ð$ð$ð$ð"˜ð"ð"ð"ð"ð"ð"rN) ÚtypingrrrrrrÚ__all__r r r r rrrúr8sðØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐð �JÐ €ð €GˆC�L„L€Ø €GˆC�L„L€ðððððˆw�qŒzñôððU"ðU"ðU"ðU"ðU"ñU"ôU"ðU"ðU"ðU"r