From d99da6c9154e6dfb04808cd5631b5346c3f9e902 Mon Sep 17 00:00:00 2001 From: Hasan Date: Sun, 27 Sep 2020 02:22:42 +0400 Subject: [PATCH] Update futures.py Changed if else statement code block to ternary operator --- Lib/asyncio/futures.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py index bed4da52fd4d98..5ae2fc79b6ee39 100644 --- a/Lib/asyncio/futures.py +++ b/Lib/asyncio/futures.py @@ -75,10 +75,8 @@ def __init__(self, *, loop=None): loop object used by the future. If it's not provided, the future uses the default event loop. """ - if loop is None: - self._loop = events.get_event_loop() - else: - self._loop = loop + self._loop = events.get_event_loop() if loop is None else loop + self._callbacks = [] if self._loop.get_debug(): self._source_traceback = format_helpers.extract_stack(