Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/jedi/inference/__pycache__/recursion.cpython-39.pyc
Ðазад
a j�hD � @ sp d Z ddlmZ ddlmZ ddlmZ dZdZdZ dZ G d d � d �Zedd� �Zefd d�Z G dd� d�ZdS )a Recursions are the recipe of |jedi| to conquer Python code. However, someone must stop recursions going mad. Some settings are here to make |jedi| stop at the right time. You can read more about them :ref:`here <settings-recursion>`. Next to the internal ``jedi.inference.cache`` this module also makes |jedi| not thread-safe, because ``execution_recursion_decorator`` uses class variables to count the function calls. .. _settings-recursion: Settings ~~~~~~~~~~ Recursion settings are important if you don't want extremely recursive python code to go absolutely crazy. The default values are based on experiments while completing the |jedi| library itself (inception!). But I don't think there's any other Python library that uses recursion in a similarly extreme way. Completion should also be fast and therefore the quality might not always be maximal. .. autodata:: recursion_limit .. autodata:: total_function_execution_limit .. autodata:: per_function_execution_limit .. autodata:: per_function_recursion_limit � )�contextmanager)�debug)� NO_VALUES� �� � � c @ s e Zd Zdd� ZdS )�RecursionDetectorc C s g | _ d S �N)�pushed_nodes��self� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/jedi/inference/recursion.py�__init__6 s zRecursionDetector.__init__N)�__name__� __module__�__qualname__r r r r r r 5 s r c c sZ | j j}||v r.t�d|t|dd�� dV n(z|�|� dV W |�� n |�� 0 dS )z� A decorator to detect recursions in statements. In a recursion a statement at the same place, in the same module may not be executed two times. zcatched stmt recursion: %s @%s� start_posNFT)Zrecursion_detectorr r �warning�getattr�append�pop)�inference_state�noder r r r �execution_allowed: s � r c s � fdd�}|S )Nc s �� fdd�}|S )Nc sH | j j}|�| �}z&|r� }n�| fi |��}W |�� n |�� 0 |S r )r Zexecution_recursion_detector�push_execution� pop_execution)r �kwargsZdetectorZ limit_reached�result)�default�funcr r �wrapperP s zAexecution_recursion_decorator.<locals>.decorator.<locals>.wrapperr )r! r"