TaskContext now calls Task.__init__()
This commit is contained in:
parent
f3ff5fcec5
commit
ca1e8a157b
|
@ -28,8 +28,6 @@ class TaskContext(Task):
|
||||||
inside the event loop
|
inside the event loop
|
||||||
"""
|
"""
|
||||||
|
|
||||||
name: str = ""
|
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""
|
"""
|
||||||
Object constructor
|
Object constructor
|
||||||
|
@ -39,10 +37,10 @@ class TaskContext(Task):
|
||||||
# includes any inner contexts contained within this
|
# includes any inner contexts contained within this
|
||||||
# one
|
# one
|
||||||
self.tasks: list[Task | "TaskContext"] = []
|
self.tasks: list[Task | "TaskContext"] = []
|
||||||
self.name = object.__repr__(self)
|
|
||||||
# Whether we have been cancelled or not
|
# Whether we have been cancelled or not
|
||||||
self.cancelled: bool = False
|
self.cancelled: bool = False
|
||||||
|
super().__init__(f"TaskContext object at {hex(id(self))}", None)
|
||||||
|
|
||||||
async def spawn(
|
async def spawn(
|
||||||
self, func: Callable[..., Coroutine[Any, Any, Any]], *args, **kwargs
|
self, func: Callable[..., Coroutine[Any, Any, Any]], *args, **kwargs
|
||||||
) -> Task:
|
) -> Task:
|
||||||
|
@ -111,4 +109,4 @@ class TaskContext(Task):
|
||||||
Implements repr(self)
|
Implements repr(self)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return object.__repr__(self)
|
return f"TaskContext({self.tasks})"
|
||||||
|
|
Reference in New Issue