403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/jedi/inference/value/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/jedi/inference/value/__pycache__/klass.cpython-311.pyc
�

p�{cD>��B�dZddlmZddlmZmZmZddlmZm	Z	m
Z
ddlmZddl
mZmZddlmZddlmZmZdd	lmZmZdd
lmZmZmZddlmZddlmZdd
l m!Z!m"Z"ddl#m$Z$Gd�de��Z%Gd�de��Z&Gd�d��Z'Gd�de'ee	���Z(dS)a
Like described in the :mod:`parso.python.tree` module,
there's a need for an ast like module to represent the states of parsed
modules.

But now there are also structures in Python that need a little bit more than
that. An ``Instance`` for example is only a ``Class`` before it is
instantiated. This class represents these cases.

So, why is there also a ``Class`` class here? Well, there are decorators and
they change classes in Python 3.

Representation modules also define "magic methods". Those methods look like
``py__foo__`` and are typically mappable to the Python equivalents ``__call__``
and others. Here's a list:

====================================== ========================================
**Method**                             **Description**
-------------------------------------- ----------------------------------------
py__call__(arguments: Array)           On callable objects, returns types.
py__bool__()                           Returns True/False/None; None means that
                                       there's no certainty.
py__bases__()                          Returns a list of base classes.
py__iter__()                           Returns a generator of a set of types.
py__class__()                          Returns the class of an instance.
py__simple_getitem__(index: int/str)   Returns a a set of types of the index.
                                       Can raise an IndexError/KeyError.
py__getitem__(indexes: ValueSet)       Returns a a set of types of the index.
py__file__()                           Only on modules. Returns None if does
                                       not exist.
py__package__() -> List[str]           Only on modules. For the import system.
py__path__()                           Only on modules. For the import system.
py__get__(call_object)                 Only on instances. Simulates
                                       descriptors.
py__doc__()                            Returns the docstring for a value.
====================================== ========================================

�)�debug)�get_cached_parent_scope�expr_is_dotted�function_is_property)�inference_state_method_cache�CachedMetaClass�&inference_state_method_generator_cache)�compiled)�LazyKnownValues�
LazyTreeValue)�ParserTreeFilter)�TreeNameDefinition�	ValueName)�unpack_arglist�ValuesArguments)�ValueSet�iterator_to_value_set�	NO_VALUES��ClassContext)�FunctionAndClassBase)�LazyGenericManager�TupleGenericManager)�plugin_managerc�N��eZdZ�fd�Zed���Ze�fd���Z�xZS)�	ClassNamec�h��t���||��||_||_dS�N)�super�__init__�_apply_decorators�_class_value)�self�class_value�	tree_name�name_context�apply_decorators�	__class__s     ��</usr/lib/python3/dist-packages/jedi/inference/value/klass.pyr zClassName.__init__:s3���
������y�1�1�1�!1���'�����c#�K�ddlm}||jj|j|j��}|D]0}|jr#|�d|j���Ed{V���,|V��1dS)Nr)�tree_name_to_values)�instancer$)�jedi.inference.syntax_treer,�parent_context�inference_stater%r!�	py__get__r")r#r,�inferred�result_values    r)�inferzClassName.infer?s�����	C�B�B�B�B�B�&�&���/��1D�d�n�V�V��%�	#�	#�L��%�
#�'�1�1�4�T�M^�1�_�_�_�_�_�_�_�_�_�_�"�"�"�"�"�		#�	#r*c���t��j}|dkr.|j���}|�|St	|��rdS|S)N�function�property)r�api_typer%�get_definitionr)r#�type_�
definitionr(s   �r)r8zClassName.api_typeLsT������ ���J�����6�6�8�8�J��!���#�J�/�/�
"�"�z��r*)	�__name__�
__module__�__qualname__r rr4r7r8�
__classcell__�r(s@r)rr9sy�������(�(�(�(�(�
�
#�
#���
#��
�
�
�
��X�
�
�
�
�
r*rc�@��eZdZ		d�fd�	Zd�Zd�Zd�Z�fd�Z�xZS)	�ClassFilterNFc���t���|���|||���||_||_dS)N)�until_position�origin_scope)rr �
as_contextr"�_is_instance)r#r$�node_contextrDrE�is_instancer(s      �r)r zClassFilter.__init__^sS���
������"�"�$�$�l�)�%�	�	
�	
�	
�
(���'����r*c� ���fd�|D��S)Nc�V��g|]%}t�j|�j�j�����&S))r$r%r&r')rr"�
_node_contextrG��.0�namer#s  �r)�
<listcomp>z.ClassFilter._convert_names.<locals>.<listcomp>isR���
�
�
��
� �-��!�/�%)�%6�!6�	
�
�
�
�
�
r*�)r#�namess` r)�_convert_nameszClassFilter._convert_nameshs0���
�
�
�
� �

�
�
�	
r*c�v�|j}|�/||jks||jkrdSt|j|��}|�/dS)NTF)�
_origin_scope�
_parser_scoper/r�_parso_cache_node)r#�nodes  r)�_equals_origin_scopez ClassFilter._equals_origin_scopersQ���!�����t�)�)�)�T�T�5H�-H�-H��t�*�4�+A�4�H�H�D����ur*c��|j�d��p-|j�d��p|���S)N�__)�value�
startswith�endswithrY)r#rOs  r)�_access_possiblezClassFilter._access_possiblezsH���:�(�(��.�.�.�+�$�*�2E�2E�d�2K�2K�+��(�(�*�*�	+r*c�d���t���|��}�fd�|D��S)Nc�>��g|]}��|���|��SrQ)r_rMs  �r)rPz'ClassFilter._filter.<locals>.<listcomp>�s,���F�F�F��$�*?�*?��*E�*E�F��F�F�Fr*)r�_filter)r#rRr(s` �r)rbzClassFilter._filters3����������&�&��F�F�F�F��F�F�F�Fr*)NNNF)	r<r=r>r rSrYr_rbr?r@s@r)rBrB]s��������FJ�05�(�(�(�(�(�(�
�
�
����+�+�+�
G�G�G�G�G�G�G�G�Gr*rBc���eZdZd�Zd�Zd�Zd�Zed���Zd�Z	e
��d���Z		dd�Zd�Z
d
�Zdd�Zed	���d���Zd�Zd�Zd�ZdS)�
ClassMixinc��dS�NTrQ�r#s r)�is_classzClassMixin.is_class�����tr*c��dSrfrQrgs r)�is_class_mixinzClassMixin.is_class_mixin�rir*c��ddlm}ddlm}|���rt||��g��St||j|j||��g��S)Nr)�TreeInstance)�	TypedDict)�jedi.inference.valuerm�jedi.inference.gradual.typingrn�is_typeddictrr0r/)r#�	argumentsrmrns    r)�
py__call__zClassMixin.py__call__�s|��5�5�5�5�5�5�;�;�;�;�;�;������	/��Y�Y�t�_�_�-�.�.�.����d�&:�D�<O�QU�W`�a�a�b�c�c�cr*c�6�tj|jd��S)N�type)r
�builtin_from_namer0rgs r)�py__class__zClassMixin.py__class__�s���)�$�*>��G�G�Gr*c�6�t||jj��Sr)r�	tree_noderOrgs r)rOzClassMixin.name�s����t�~�2�3�3�3r*c��|jjSr)rO�string_namergs r)�
py__name__zClassMixin.py__name__�s
���y�$�$r*c#�&K�|g}|V�|���D]r}|���D][}	|j}|��D]}||vr|�|��|V�� �5#t$r	tjd||��Y�XwxYw�sdS)Nz$Super class of %s is not a class: %s)�py__bases__r4�	py__mro__�append�AttributeErrorr�warning)r#�mro�lazy_cls�cls�
mro_method�cls_news      r)rzClassMixin.py__mro__�s������f���
�
�
��(�(�*�*�	*�	*�H� �~�~�'�'�
*�
*��*�!$��J�$.�:�<�<�*�*��"�#�-�-��J�J�w�/�/�/�")�M�M�M��*��&�U�U�U�	��M�"H�$�PS�T�T�T�T�T�U����
*�	*�	*s�A)�)!B
�B
NFTc#�K�|r2|���}|r|�||��Ed{V��|���D]Z}|���r|�|���Ed{V���3t||���||���V��[|s�|r�ddlm}||j	d��}t|t��sJ�||krwtg��}	|�
|	��D]T}
|
���}t|d��t|d��t|d��}|�J�|V��OdSdSdSdS)N)rI)rHrErIr)rvru)�get_metaclasses�get_metaclass_filtersr�is_compiled�get_filtersrBrF�jedi.inference.compiledrvr0�
isinstance�
ClassValuerrs�next)
r#rErI�include_metaclasses�include_type_when_class�metaclassesr�rvr:�argsr-�instance_filters�xs
             r)r�zClassMixin.get_filters�s������	P��.�.�0�0�K��
P��5�5�k�;�O�O�O�O�O�O�O�O�O��>�>�#�#�	�	�C���� � �
��?�?�{�?�C�C�C�C�C�C�C�C�C�C�!��s�~�~�'7�'7�!-� +��������
�	�6�	�A�A�A�A�A�A�%�%�d�&:�F�C�C�E��e�Z�0�0�0�0�0���}�}�'�r�*�*�� %� 0� 0�� 6� 6���H�'/�';�';�'=�'=�$��)�4�0�0�0��)�4�0�0�0��-�t�4�4�A��=�=�=��G�G�G�G�!	�	�	�	��}�
�r*c�������}|r��|��}|r|Stg��}��|���d��}�fd�|���D��S)Nr c�:��g|]}|������SrQ)�bind)rN�sigr#s  �r)rPz-ClassMixin.get_signatures.<locals>.<listcomp>�s#���F�F�F�3�������F�F�Fr*)r��get_metaclass_signaturesrrs�py__getattribute__�get_signatures)r#r��sigsr��
init_funcss`    r)r�zClassMixin.get_signatures�s�����*�*�,�,���	��0�0��=�=�D��
����r�"�"���_�_�T�*�*�=�=�j�I�I�
�F�F�F�F�*�*C�*C�*E�*E�F�F�F�Fr*c� �t|��Srrrgs r)�_as_contextzClassMixin._as_context�s���D�!�!�!r*c�\�|rd|���zS|���S)NzType[%s])r|)r#�add_class_infos  r)�
get_type_hintzClassMixin.get_type_hint�s/���	2����� 1� 1�1�1���� � � r*��defaultc�J�ddlm}|���D]�}t|t��sdS|j}t
|��sdS|���D]?}t||��rdS	|j}|��rdS�-#t$rYdSwxYw��dS)Nr)�TypedDictClassFT)
rpr�r~r�r�datarr4rqr�)r#r�r�ryr��methods      r)rqzClassMixin.is_typeddict�s��	A�@�@�@�@�@��(�(�*�*�	$�	$�H��h�
�6�6�
��u�u� �
�I�"�)�,�,�
��u�u��~�~�'�'�
$�
$���c�>�2�2� ��4�4�4�	$� �-�F��v�x�x�$�#�t�t�t�$��
&�!�!�!�!�5�5�5�5�	!����
$��us�9B�
B�Bc�����ddlm�|s$tjd��t	�g��St	���fd�|D����S)Nr��GenericClassz:Class indexes inferred to nothing. Returning class insteadc3�X�K�|]$}��t�j|�����V��%dS))�context_of_index�index_valueN)r�context)rNr�r��contextualized_noder#s  ���r)�	<genexpr>z+ClassMixin.py__getitem__.<locals>.<genexpr>sc�����	
�	
��
�L��"�%8�%@� +����
�
�	
�	
�	
�	
�	
�	
r*)�jedi.inference.gradual.baser�rr�r)r#�index_value_setr�r�s` `@r)�
py__getitem__zClassMixin.py__getitem__s������<�<�<�<�<�<��	$��M�V�W�W�W��T�F�#�#�#��	
�	
�	
�	
�	
�	
� /�	
�	
�	
�	
�	
�		
r*c�@�ddlm}||t|����S)Nrr�)r�r�r)r#�generics_tupler�s   r)�
with_genericszClassMixin.with_generics#s6��<�<�<�<�<�<��|����/�/�
�
�	
r*c����ddlm}��fd�}�r<t|�tt	|��������g��St�h��S)Nrr�c3��K�����D]1}��|���t��V��2dS)aa
            The TypeVars in the resulting classes have sometimes different names
            and we need to check for that, e.g. a signature can be:

            def iter(iterable: Iterable[_T]) -> Iterator[_T]: ...

            However, the iterator is defined as Iterator[_T_co], which means it has
            a different type var name.
            N)�list_type_vars�getr|r)�type_varr#�
type_var_dicts ��r)�remap_type_varsz3ClassMixin.define_generics.<locals>.remap_type_vars-s]�����!�/�/�1�1�
J�
J��#�'�'��(;�(;�(=�(=�y�I�I�I�I�I�I�
J�
Jr*)r�r�rr�tuple)r#r�r�r�s``  r)�define_genericszClassMixin.define_generics*s�����<�<�<�<�<�<�	J�	J�	J�	J�	J�	J��	��\�\��#�E�/�/�*;�*;�$<�$<�=�=������
������r*)NFTT)T)r<r=r>rhrkrsrwr7rOr|r	rr�r�r�r�rrqr�r�r�rQr*r)rdrd�sO������������d�d�d�H�H�H��4�4��X�4�%�%�%�,�+�-�-�*�*�.�-�*�@:?�FJ� � � � �DG�G�G�"�"�"�!�!�!�!�
"�!�%�0�0�0���1�0��:
�
�
� 
�
�
� � � � � r*rdc���eZdZdZe��d���Zd�Zed���d���Zej	��d���Z
ee���d���Zej	��d	���Z
d
S)r��classc���g}|j���}|�gSt|��D];\}}|r�ddlm}||j|��D]}||vr|�|����<|S)Nr)�find_unknown_type_vars)ry�get_super_arglistr�!jedi.inference.gradual.annotationr�r/r�)r#�found�arglist�starsrXr�r�s       r)r�zClassValue.list_type_varsEs������.�2�2�4�4���?��I�)�'�2�2�	+�	+�K�E�4��
��P�P�P�P�P�P�2�2�4�3F��M�M�
+�
+���5�(�(��L�L��*�*�*��
+��r*c��|j���}|r'ddlm}|�|j|j|��SdS)Nr)rr)ryr��jedi.inferencerr�
TreeArgumentsr0r/)r#r�rrs   r)�_get_bases_argumentszClassValue._get_bases_argumentsWsT���.�2�2�4�4���	_�0�0�0�0�0�0��*�*�4�+?��AT�V]�^�^�^��tr*rQr�c�2�|���}|�"d�|���D��}|r|S|���dkr|j���rgSt|jj�d����gS)Nc��g|]	\}}|�|��
SrrQ�rN�keyr\s   r)rPz*ClassValue.py__bases__.<locals>.<listcomp>bs��H�H�H�Z�S�%�C�K�5�K�K�Kr*�object)	r��unpackr|r/�is_builtins_modulerr0�builtins_moduler�)r#r��lsts   r)r~zClassValue.py__bases__^s����(�(�*�*����H�H�4�;�;�=�=�H�H�H�C��
��
��?�?����(�(��'�:�:�<�<�)��I��� �0�C�C�H�M�M�
�
��	r*c�0�tjd|��gS)NzUnprocessed metaclass %s)rr�)r#r�rIs   r)r�z ClassValue.get_metaclass_filtersms��
�
�0�+�>�>�>��	r*c��|���}|�Yd�|���D��}tjd�|D����}td�|D����}|r|S|���D]I}|���D]2}|���r|���}|r|ccS�3�JtS)Nc�$�g|]
\}}|dk�|��S��	metaclassrQr�s   r)rPz.ClassValue.get_metaclasses.<locals>.<listcomp>vs&��M�M�M�:�3��#��:L�:L��:L�:L�:Lr*c3�>K�|]}|���V��dSr)r4)rN�
lazy_values  r)r�z-ClassValue.get_metaclasses.<locals>.<genexpr>ws.����,T�,T�J�Z�-=�-=�-?�-?�,T�,T�,T�,T�,T�,Tr*c3�BK�|]}|����|V��dSr)rh)rN�ms  r)r�z-ClassValue.get_metaclasses.<locals>.<genexpr>xs/����"J�"J��Q�Z�Z�\�\�"J�1�"J�"J�"J�"J�"J�"Jr*)	r�r�r�	from_setsr~r4rhr�r)r#r�r�r��	lazy_baser\�valuess       r)r�zClassValue.get_metaclassesrs����(�(�*�*����M�M������M�M�M�A�"�,�,T�,T�RS�,T�,T�,T�T�T�K�"�"J�"J�k�"J�"J�"J�J�J�K��
#�"�"��)�)�+�+�	&�	&�I�"���*�*�
&�
&���>�>�#�#�&�"�2�2�4�4�F��&�%�
�
�
�
�
��	
&�
�r*c��gSrrQ)r#r�s  r)r�z#ClassValue.get_metaclass_signatures�s���	r*N)r<r=r>r8rr�r�r~r�decorater�rr�r�rQr*r)r�r�Bs��������H�!�!�#�#���$�#��"���"�!�"�-�-�-���.�-���^���������"�!�)�4�4�4���5�4��"�^����������r*r�r�N))�__doc__�jedir�jedi.parser_utilsrrr�jedi.inference.cacherrr	r�r
�jedi.inference.lazy_valuerr�jedi.inference.filtersr
�jedi.inference.namesrr�jedi.inference.argumentsrr�jedi.inference.base_valuerrr�jedi.inference.contextr�jedi.inference.value.functionr�jedi.inference.gradual.genericsrr�jedi.pluginsrrrBrdr�rQr*r)�<module>r�sN��%�%�L����������������+�+�+�+�+�+�+�+�+�+�#�#�#�#�#�#�D�D�D�D�D�D�D�D�3�3�3�3�3�3�>�>�>�>�>�>�>�>�D�D�D�D�D�D�D�D�����������/�/�/�/�/�/�>�>�>�>�>�>�S�S�S�S�S�S�S�S�'�'�'�'�'�'�!�!�!�!�!�"�!�!�!�H$G�$G�$G�$G�$G�"�$G�$G�$G�N{ �{ �{ �{ �{ �{ �{ �{ �|D�D�D�D�D��1�_�D�D�D�D�D�Dr*

Youez - 2016 - github.com/yon3zu
LinuXploit