Format: application/x-python-code
1 o
2
3 �h� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddl
4 mZ ddlm
5 Z
6 dd lmZ dd
7 lmZ ddlmZmZ ddlmZ dd
8 lmZ dZdd� Zejedd� ��Zedd�edd� ��Zdd� Zdd� Zdd� Z dS )a�
9 One of the really important features of |jedi| is to have an option to
10 understand code like this::
11
12 def foo(bar):
13 bar. # completion here
14 foo(1)
15
16 There's no doubt wheter bar is an ``int`` or not, but if there's also a call
17 like ``foo('str')``, what would happen? Well, we'll just show both. Because
18 that's what a human would expect.
19
20 It works as follows:
21
22 - |Jedi| sees a param
23 - search for function calls named ``foo``
24 - execute these calls and check the input.
25 � )�settings)�debug)�get_parent_scope)�inference_state_method_cache)�
26 TreeArguments)�get_executed_param_names)�is_stdlib_path)�to_list)�instance)�ValueSet� NO_VALUES)�#get_module_contexts_containing_name)� recursion� c s � fdd�}|S )Nc
27 s� | j }t�|| j��0}|r1| jd7 _z� | |�W | jd8 _W d � S | jd8 _w tW d � S 1 s=w Y d S )N� )�inference_stater Zexecution_allowed� tree_node�dynamic_params_depthr )�function_value�param_index�inf�allowed��func� �Sc:\Users\shubh\Videos\agent\nova\Lib\site-packages\jedi/inference/dynamic_params.py�wrapper&