Skip to content
Snippets Groups Projects
Commit cc158564 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

added default parameter to `ThreadCollection`

parent 506d71b9
No related branches found
No related tags found
No related merge requests found
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
* deprecated `call_and_return_stdout` * deprecated `call_and_return_stdout`
* deprecated `retry(call_on_failure=)` * deprecated `retry(call_on_failure=)`
* added default parameter to `ThreadCollection`
__version__ = '2.17.16a4' __version__ = '2.17.16a5'
...@@ -72,8 +72,11 @@ class ThreadCollection: ...@@ -72,8 +72,11 @@ class ThreadCollection:
for thread in self.threads: for thread in self.threads:
thread.daemon = v thread.daemon = v
def __init__(self, threads: tp.Sequence[Thread]): def __init__(self, threads: tp.Optional[tp.Sequence[Thread]] = None):
self.threads = list(threads) if threads is None:
self.threads = []
else:
self.threads = list(threads) or []
def append(self, thread: Thread) -> 'ThreadCollection': def append(self, thread: Thread) -> 'ThreadCollection':
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment