Skip to content

Commit

Permalink
Change AwaitComplete _instances class attr to a set from a list
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Oct 17, 2023
1 parent 1a7feec commit b8428dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/textual/await_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class AwaitComplete:
"""An 'optionally-awaitable' object."""

_instances: list["AwaitComplete"] = []
_instances: set["AwaitComplete"] = []
"""Track all active instances of AwaitComplete."""

def __init__(self, *coroutine: Coroutine) -> None:
Expand All @@ -17,7 +17,7 @@ def __init__(self, *coroutine: Coroutine) -> None:
coroutine: One or more coroutines to execute.
"""
self.coroutine = coroutine
AwaitComplete._instances.append(self)
AwaitComplete._instances.add(self)
self._future: Future = gather(*[coroutine for coroutine in self.coroutine])
self._future.add_done_callback(self._on_done)

Expand Down

0 comments on commit b8428dd

Please sign in to comment.