Some objects in ZPUI, such as UI elements, inherit from other elements, and sometimes __init__ keyword arguments have to be passed through. However, not all of the keyword arguments can be used by the parent elements, so we have to filter through **kwargs to avoid TypeErrors. Here's how the filtering is typically done, as of now:
self.catch_exit = kwargs.pop("catch_exit") if "catch_exit" in kwargs else True
However, it seems this construct can actually be shortened to:
self.catch_exit = kwargs.pop("catch_exit", True)
Tasks:
Find all occurences of the first pattern and shorten them as shown
Some objects in ZPUI, such as UI elements, inherit from other elements, and sometimes
__init__
keyword arguments have to be passed through. However, not all of the keyword arguments can be used by the parent elements, so we have to filter through**kwargs
to avoid TypeErrors. Here's how the filtering is typically done, as of now:However, it seems this construct can actually be shortened to:
Tasks: