TL i^dZddlZddlmZeZdZdZdZdZ dZ d Z d Z efd Z y) z A static version of getattr. This is a backport of the Python 3 code with a little bit of additional information returned to enable Jedi to make decisions. N)debugci} tj|d}tj ||t S#t$rY&wxYwN__dict__)object__getattribute__AttributeErrordictget _sentinel)objattr instance_dicts l/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/jedi/inference/compiled/getattr_static.py_check_instancersGM //Z@  88M4 33    s5 AAct|D].}tt|tus |j|cStS#t $rYBwxYwN)_static_getmro_shadowed_dicttyper rKeyError)klassrentrys r _check_classrsW& $u+ &) 3 ~~d++   sA AAc: t|y#t$rYywxYw)NFT)r TypeErrorr s r_is_typer!s(s  s  ctjd}t|D]S} |j|d}t|tj ur|j dk(r|j|urQ|cStS#t$rYgwxYwr) rrr__get__typesGetSetDescriptorType__name__ __objclass__rr )r dict_attrr class_dicts rrr)s j)I& " ""**51*=J$(B(BB"++z9"//58!! "    sA;; BBctjdj|}t|tt fst jd|d|dy|S)N__mro__zmro of z returned z, should be a tuple)rrr isinstancetuplelistrwarning)rmros rrr8sD -- " * *5 1C cE4= )  E3OP Jc8tt||tuSr)rrr )r names r _safe_hasattrr2Cs S 4 ( 99r/c6t|dxs t|dS)N__set__ __delete__)r2rs r_safe_is_data_descriptorr6Gs i ( LM#|,LLr/cHt}t|sFt|}t|}|tust|tj urt ||}n|}t||}|tur#|turt|drt|r|dfS|tur|dfS|tur|t|dfS||urGtt|D]0}tt|tus |j|dfcS|tur|dfSt|#t$rYUwxYw)aRetrieve attributes without triggering dynamic lookup via the descriptor protocol, __getattr__ or __getattribute__. Note: this function may not be able to retrieve all attributes that getattr can fetch (like dynamically created attributes) and may find attributes that getattr can't (like descriptors that raise AttributeError). It can also return descriptor objects instead of instance members in some cases. See the documentation for details. Returns a tuple `(attr, is_get_descriptor)`. is_get_descripter means that the attribute is a descriptor that has a `__get__` attribute. r TF)r rrrr!MemberDescriptorTyperrr2r6rrrr )r rdefaultinstance_resultrr% klass_resultrs rgetattr_staticr<Ks. O C=S "5)  "d9o9S9S&S-c48Ot,Li'L ,I y 1,\:% %i'%%9$]<CCC e|#DK0 Ed5k*i7 >>$/66  i~    s*D D! D!)__doc__r!jedirrr rrrrrr2r6r<r)r/rr?sG   H 4 :M'0.r/