§
    ŒŸj_  ã                   ó”   — d Z ddlmZ ddlmZ  e¦   «         Z e¦   «         Zeddfd„Zefd„Z	efd„Z
d„ Z G d	„ d
e¦  «        Zd„ ZdS )z³
- the popular ``_memoize_default`` works like a typical memoize and returns the
  default otherwise.
- ``CachedMetaClass`` uses ``_memoize_default`` to do the same with classes.
é    ©Úwraps)ÚdebugFc                 ó   ‡ ‡‡— ˆ ˆˆfd„}|S )aO   This is a typical memoization decorator, BUT there is one difference:
    To prevent recursion it sets defaults.

    Preventing recursion is in this case the much bigger use than speed. I
    don't think, that there is a big speed difference, but there are many cases
    where recursion could happen (think about a = b; b = a).
    c                 ó   •‡ — ˆˆ ˆˆfd„}|S )Nc                 ó4  •— ‰	r| j         }n‰
r|d         j         }n| j        j         }	 |‰         }n# t          $ r
 i x|‰<   }Y nw xY w| |t          |                     ¦   «         ¦  «        f}||v r||         S ‰t
          ur‰||<    ‰| g|¢R i |¤Ž}|||<   |S )Nr   )Úmemoize_cacheÚinference_stateÚKeyErrorÚ	frozensetÚitemsÚ_NO_DEFAULT)ÚobjÚargsÚkwargsÚcacheÚmemoÚkeyÚrvÚdefaultÚfunctionÚinference_state_is_first_argÚsecond_arg_is_inference_states          €€€€úa/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/jedi/inference/cache.pyÚwrapperz/_memoize_default.<locals>.func.<locals>.wrapper   så   ø€ à+ð :ØÔ)��Ø.ð :Ø˜QœÔ-��àÔ+Ô9�ð,Ø˜X”��øÝð ,ð ,ð ,Ø)+Ð+��h‘ $ $ $ð,øøøð ˜�i¨¯ª©¬Ñ7Ô7Ð8ˆCØ�dˆ{ˆ{Ø˜C”yÐ à¥+Ð-Ð-Ø '�D˜‘IØ�X˜cÐ3 DÐ3Ð3Ð3¨FÐ3Ð3�Ø��S‘	Ø�	s   ©2 ²AÁA© )r   r   r   r   r   s   ` €€€r   Úfuncz_memoize_default.<locals>.func   s3   øø€ ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð. ˆó    r   )r   r   r   r   s   ``` r   Ú_memoize_defaultr      s/   øøø€ ðð ð ð ð ð ð ð4 €Kr   c                 ó   ‡ — ˆ fd„}|S )Nc                 ó8   •—  t          ‰d¬¦  «        | ¦  «        S )NT)r   r   ©r   ©r   r   s    €r   Ú	decoratorz1inference_state_function_cache.<locals>.decorator5   s"   ø€ ØSÕ¨ÈdÐSÑSÔSÐTXÑYÔYÐYr   r   ©r   r$   s   ` r   Úinference_state_function_cacher&   4   s)   ø€ ðZð Zð Zð Zð Zð Ðr   c                 ó   ‡ — ˆ fd„}|S )Nc                 ó6   •—  t          ‰¬¦  «        | ¦  «        S )N)r   r"   r#   s    €r   r$   z/inference_state_method_cache.<locals>.decorator<   s   ø€ Ø0Õ¨Ð0Ñ0Ô0°Ñ6Ô6Ð6r   r   r%   s   ` r   Úinference_state_method_cacher)   ;   s$   ø€ ð7ð 7ð 7ð 7ð 7ð Ðr   c                  ó   — d„ } | S )Nc                 ó4   —  t          d¬¦  «        | ¦  «        S )NT)r   r"   )Úcalls    r   r$   z8inference_state_as_method_param_cache.<locals>.decoratorC   s   € ØCÕ¸dÐCÑCÔCÀDÑIÔIÐIr   r   )r$   s    r   Ú%inference_state_as_method_param_cacher-   B   s   € ðJð Jð Jð Ðr   c                   óB   ‡ — e Zd ZdZ e¦   «         ˆ fd„¦   «         Zˆ xZS )ÚCachedMetaClasszÞ
    This is basically almost the same than the decorator above, it just caches
    class initializations. Either you do it this way or with decorators, but
    with decorators you lose class access (isinstance, etc).
    c                 ó6   •—  t          ¦   «         j        |i |¤ŽS )N)ÚsuperÚ__call__)Úselfr   r   Ú	__class__s      €r   r2   zCachedMetaClass.__call__O   s   ø€ à�u‰wŒwÔ Ð0¨Ð0Ð0Ð0r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r-   r2   Ú__classcell__)r4   s   @r   r/   r/   I   sX   ø€ € € € € ðð ð
 +Ð*Ñ,Ô,ð1ð 1ð 1ð 1ñ -Ô,ð1ð 1ð 1ð 1ð 1r   r/   c                  ó   — d„ } | S )zœ
    This is a special memoizer. It memoizes generators and also checks for
    recursion errors and returns no further iterator elemends in that case.
    c                 ó<   ‡ — t          ‰ ¦  «        ˆ fd„¦   «         }|S )Nc              ?   ó  •K  — | j         j        }	 |‰
         }n# t          $ r
 i x|‰
<   }Y nw xY w| |t          |                     ¦   «         ¦  «        f}||v r||         \  }}n ‰
| g|¢R i |¤Ž}g }||f||<   d}	 	 ||         }	|	t
          u rt          j        d| z  ¦  «         d S nX# t          $ rK | 	                    t
          ¦  «         t          |d ¦  «        }	|	€|                     ¦   «          Y d S |	|d<   Y nw xY w|	V — |dz  }ŒŽ)Nr   Tz"Found a generator recursion for %séÿÿÿÿé   )r
   r	   r   r   r   Ú_RECURSION_SENTINELr   ÚwarningÚ
IndexErrorÚappendÚnextÚpop)r   r   r   r   r   r   Úactual_generatorÚ
cached_lstÚiÚnext_elementr   s             €r   r   zEinference_state_method_generator_cache.<locals>.func.<locals>.wrapperZ   s†  øè è € àÔ'Ô5ˆEð,Ø˜X”��øÝð ,ð ,ð ,Ø)+Ð+��h‘ $ $ $ð,øøøð ˜�i¨¯ª©¬Ñ7Ô7Ð8ˆCà�dˆ{ˆ{Ø/3°C¬yÑ,Ð  * *à#+ 8¨CÐ#A°$Ð#AÐ#AÐ#A¸&Ð#AÐ#AÐ Ø�
Ø,¨jÐ8��S‘	àˆAðð2Ø#-¨a¤=�LØ#Õ':Ð:Ð:ÝœÐ&JÈSÑ&PÑQÔQÐQà˜ð ;øõ "ð 2ð 2ð 2Ø×%Ò%Õ&9Ñ:Ô:Ð:Ý#'Ð(8¸$Ñ#?Ô#?�LØ#Ð+Ø"ŸšÑ(Ô(Ð(Ø˜˜Ø%1�J˜r‘N�N�Nð2øøøð #Ð"Ð"Ð"Ø�Q‘�ðs%   ‘ š.­.Á>(B) Â)A
C>Ã6C>Ã=C>r   )r   r   s   ` r   r   z4inference_state_method_generator_cache.<locals>.funcY   s4   ø€ Ý	ˆx‰Œð 	ð  	ð  	ð  	ñ 
Œð 	ðB ˆr   r   )r   s    r   Ú&inference_state_method_generator_cacherI   T   s   € ð
#ð #ð #ðJ €Kr   N)r8   Ú	functoolsr   Újedir   Úobjectr   r?   r   r&   r)   r-   Útyper/   rI   r   r   r   ú<module>rN      sï   ððð ð
 Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð àˆf‰hŒh€Ø�f‘h”hÐ ð )ÀuØ38ð#ð #ð #ð #ðL ,7ð ð ð ð ð *5ð ð ð ð ðð ð ð1ð 1ð 1ð 1ð 1�dñ 1ô 1ð 1ð*ð *ð *ð *ð *r   