B
    7r\                 @   s   d dl mZmZ d dlmZ G dd deZG dd deZG dd deZG d	d
 d
eZ	G dd deZ
dd ZG dd deZdS )    )
ContextSetNO_CONTEXTS)monkeypatchc               @   s$   e Zd Zdd Zdd Zdd ZdS )AbstractLazyContextc             C   s
   || _ d S )N)data)selfr    r   9lib/python3.7/site-packages/jedi/evaluate/lazy_context.py__init__   s    zAbstractLazyContext.__init__c             C   s   d| j j| jf S )Nz<%s: %s>)	__class____name__r   )r   r   r   r	   __repr__	   s    zAbstractLazyContext.__repr__c             C   s   t d S )N)NotImplementedError)r   r   r   r	   infer   s    zAbstractLazyContext.inferN)r   
__module____qualname__r
   r   r   r   r   r   r	   r      s   r   c               @   s   e Zd ZdZdd ZdS )LazyKnownContextzdata is a context.c             C   s
   t | jS )N)r   r   )r   r   r   r	   r      s    zLazyKnownContext.inferN)r   r   r   __doc__r   r   r   r   r	   r      s   r   c               @   s   e Zd ZdZdd ZdS )LazyKnownContextszdata is a ContextSet.c             C   s   | j S )N)r   )r   r   r   r	   r      s    zLazyKnownContexts.inferN)r   r   r   r   r   r   r   r   r	   r      s   r   c                   s$   e Zd Z fddZdd Z  ZS )LazyUnknownContextc                s   t t| d  d S )N)superr   r
   )r   )r   r   r	   r
      s    zLazyUnknownContext.__init__c             C   s   t S )N)r   )r   r   r   r	   r       s    zLazyUnknownContext.infer)r   r   r   r
   r   __classcell__r   r   )r   r	   r      s   r   c                   s$   e Zd Z fddZdd Z  ZS )LazyTreeContextc                s&   t t| | || _t|j| _d S )N)r   r   r
   _contextdictpredefined_names_predefined_names)r   contextZnode)r   r   r	   r
   %   s    zLazyTreeContext.__init__c          	   C   s*   t | jd| j | j| jS Q R X d S )Nr   )r   r   r   Z	eval_noder   )r   r   r   r	   r   ,   s    zLazyTreeContext.infer)r   r   r   r
   r   r   r   r   )r   r	   r   $   s   r   c             C   s    t | dkrt| S | d S d S )N   r   )lenMergedLazyContexts)Zlazy_contextsr   r   r	   get_merged_lazy_context1   s    r!   c               @   s   e Zd ZdZdd ZdS )r    z data is a list of lazy contexts.c             C   s   t dd | jD S )Nc             s   s   | ]}|  V  qd S )N)r   ).0lr   r   r	   	<genexpr>;   s    z+MergedLazyContexts.infer.<locals>.<genexpr>)r   Z	from_setsr   )r   r   r   r	   r   :   s    zMergedLazyContexts.inferN)r   r   r   r   r   r   r   r   r	   r    8   s   r    N)Zjedi.evaluate.base_contextr   r   Zjedi.common.utilsr   objectr   r   r   r   r   r!   r    r   r   r   r	   <module>   s   