Format: application/x-python-code
⬇ Download File (3.9 KB)
   1  o
   2  
   3  �h�
   4  �@s�dZddlZddlZddlZejjZejjdureejj7Ze�d�	e�
   5  e���Z[dd�Zdd�Z
   6  dd	�ZGd
   7  d�de�Zdd
   8  �Zdd�ZGdd�d�ZdS)zC A universal module with functions / classes without dependencies. �Nz (?:\.[^{0}]+|[{0}]__init__\.py)$c��fdd�}|S)Nc�t�|i|���S�N)�list��args�kwargs��func��Jc:\Users\shubh\Videos\agent\nova\Lib\site-packages\jedi/inference/utils.py�wrapper�zto_list.<locals>.wrapperr�r
   9  r
  10  rr	r�to_list�rcr)Ncrr)�tuplerr	rrr
  11  rzto_tuple.<locals>.wrapperrrrr	r�to_tuplerrcCstdd�|D��S)z5Turns a two dimensional array into a one dimensional.css�|]
  12  }|D]}|VqqdSrr)�.0�types�typrrr�	<genexpr>s�zunite.<locals>.<genexpr>)�set)�iterablerrr�unitesrc@seZdZdZdS)�UncaughtAttributeErrora�
  13      Important, because `__getattr__` and `hasattr` catch AttributeErrors
  14      implicitly. This is really evil (mainly because of `__getattr__`).
  15      Therefore this class originally had to be derived from `BaseException`
  16      instead of `Exception`.  But because I removed relevant `hasattr` from
  17      the code base, we can now switch back to `Exception`.
  18  
  19      :param base: return values of sys.exc_info().
  20      N)�__name__�
  21  __module__�__qualname__�__doc__rrrrrsrcCstt|��Sr)�property�reraise_uncaughtr	rrr�
  22  safe_property+sr"cst����fdd��}|S)a*
  23      Re-throw uncaught `AttributeError`.
  24  
  25      Usage:  Put ``@rethrow_uncaught`` in front of the function
  26      which does **not** suppose to raise `AttributeError`.
  27  
  28      AttributeError is easily get caught by `hasattr` and another
  29      ``except AttributeError`` clause.  This becomes problem when you use
  30      a lot of "dynamic" attributes (e.g., using ``@property``) because you
  31      can't distinguish if the property does not exist for real or some code
  32      inside of the "dynamic" attribute through that error.  In a well
  33      written code, such error should not exist but getting there is very
  34      difficult.  This decorator is to help us getting there by changing
  35      `AttributeError` to `UncaughtAttributeError` to avoid unexpected catch.
  36      This helps us noticing bugs earlier and facilitates debugging.
  37      c
  38  s4z�|i|��WSty}zt|�|�d}~wwr)�AttributeErrorr)r�kwds�er	rrr
  39  @s
  40  ��z!reraise_uncaught.<locals>.wrapper)�	functools�wrapsrrr	rr!/sr!c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
  41  �PushBackIteratorcCsg|_||_d|_dSr)�pushes�iterator�current)�selfr*rrr�__init__Js
  42  zPushBackIterator.__init__cCs|j�|�dSr)r)�append)r,�valuerrr�	push_backOszPushBackIterator.push_backcCs|Srr�r,rrr�__iter__RszPushBackIterator.__iter__cCs*|jr|j��|_|jSt|j�|_|jSr)r)�popr+�nextr*r1rrr�__next__Us
  43  �zPushBackIterator.__next__N)rrrr-r0r2r5rrrrr(Is
  44  r()rr&�re�os�path�sepZ_sep�altsep�compile�format�escapeZ_path_rerrr�	Exceptionrr"r!r(rrrr�<module>s