Format: application/x-python-code
1 o
2
3 ;'hF � @ sh d dl mZ d dlmZmZ d dlmZmZ ddlm Z G dd� d�Z
4 dd d
5 �Zddd
6 �Zddd�Z
7 dS )� )�annotations)� Awaitable� Generator)�Any�cast� )�get_async_backendc @ sF e Zd ZdZdZddd�Zddd�Zddd�Zddd�Zddd�Z dS ) �TaskInfoaI
8 Represents an asynchronous task.
9
10 :ivar int id: the unique identifier of the task
11 :ivar parent_id: the identifier of the parent task, if any
12 :vartype parent_id: Optional[int]
13 :ivar str name: the description of the task (if any)
14 :ivar ~collections.abc.Coroutine coro: the coroutine object of the task
15 )�_name�id� parent_id�name�coror �intr �
16 int | Noner
17 �
18 str | Noner �)Generator[Any, Any, Any] | Awaitable[Any]c C s4 t }|j� d|j� �| _|| _|| _|| _|| _d S )N�.)�get_current_task�
19 __module__�__qualname__r
20 r r r
21 r )�selfr r r
22 r �func� r �JC:\Users\shubh\Videos\agent\nova\Lib\site-packages\anyio/_core/_testing.py�__init__ s
23 zTaskInfo.__init__�other�object�return�boolc C s t |t�r| j|jkS tS �N)�
24 isinstancer r �NotImplemented)r r r r r �__eq__$ s
25 zTaskInfo.__eq__c C s
26 t | j�S r )�hashr �r r r r �__hash__* s
27 zTaskInfo.__hash__�strc C s | j j� d| j�d| j�d�S )Nz(id=z, name=�))� __class__�__name__r r
28 r% r r r �__repr__- s zTaskInfo.__repr__c C s dS )z_
29 Return ``True`` if the task has a cancellation pending, ``False`` otherwise.
30
31 Fr r% r r r �has_pending_cancellation0 s z!TaskInfo.has_pending_cancellationN)r r r r r
32 r r r )r r r r )r r )r r'