File tree 1 file changed +10
-8
lines changed 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 9
9
from . import exceptions
10
10
from . import tasks
11
11
12
+
12
13
class TaskGroup :
13
14
14
15
def __init__ (self ):
@@ -25,19 +26,20 @@ def __init__(self):
25
26
self ._on_completed_fut = None
26
27
27
28
def __repr__ (self ):
28
- msg = f'<TaskGroup'
29
+ info = [ '' ]
29
30
if self ._tasks :
30
- msg += f' tasks: { len (self ._tasks )} '
31
+ info . append ( f' tasks= { len (self ._tasks )} ')
31
32
if self ._unfinished_tasks :
32
- msg += f' unfinished: { self ._unfinished_tasks } '
33
+ info . append ( f' unfinished= { self ._unfinished_tasks } ')
33
34
if self ._errors :
34
- msg += f' errors: { len (self ._errors )} '
35
+ info . append ( f' errors= { len (self ._errors )} ')
35
36
if self ._aborting :
36
- msg += ' cancelling'
37
+ info . append ( ' cancelling')
37
38
elif self ._entered :
38
- msg += ' entered'
39
- msg += '>'
40
- return msg
39
+ info .append ('entered' )
40
+
41
+ info_str = ' ' .join (info )
42
+ return f'<TaskGroup{ info_str } >'
41
43
42
44
async def __aenter__ (self ):
43
45
if self ._entered :
You can’t perform that action at this time.
0 commit comments