File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 99from . import exceptions
1010from . import tasks
1111
12+
1213class TaskGroup :
1314
1415 def __init__ (self ):
@@ -25,19 +26,20 @@ def __init__(self):
2526 self ._on_completed_fut = None
2627
2728 def __repr__ (self ):
28- msg = f'<TaskGroup'
29+ info = [ '' ]
2930 if self ._tasks :
30- msg += f' tasks: { len (self ._tasks )} '
31+ info . append ( f' tasks= { len (self ._tasks )} ')
3132 if self ._unfinished_tasks :
32- msg += f' unfinished: { self ._unfinished_tasks } '
33+ info . append ( f' unfinished= { self ._unfinished_tasks } ')
3334 if self ._errors :
34- msg += f' errors: { len (self ._errors )} '
35+ info . append ( f' errors= { len (self ._errors )} ')
3536 if self ._aborting :
36- msg += ' cancelling'
37+ info . append ( ' cancelling')
3738 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 } >'
4143
4244 async def __aenter__ (self ):
4345 if self ._entered :
You can’t perform that action at this time.
0 commit comments