You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unless I'm misreading, it looks like code at the end of Tab.active_blocks cannot be reached. I'm not entirely sure what it's trying to do, but I thought I'd note it so you can take a look.
A style point: it is atypical in python to check is True or is False directly. Preferred is typically if item and if not item. The code below could be doing something tricky with a non-boolean result when getting display_tab, I suppose.
defactive_blocks(self) ->List["Block"]:
"""Get active blocks list enabled in options."""active_blocks= []
display_tab=self.handler.options.get(f"handlers.{self.id}", True)
ifdisplay_tabisFalse:
returnactive_blockselifdisplay_tabisTrue:
returnself.blocks.values()
# --- I believe if/elif block and returns above make this unreachable! - Tim forblockinself.blocks.values():
display_block=display_tab.get(block.id, True)
ifdisplay_blockisFalse:
continueactive_blocks.append(block)
returnactive_blocks
I was reading the code to try and figure out how to configure the blocks visible on the Context tab.
The text was updated successfully, but these errors were encountered:
Unless I'm misreading, it looks like code at the end of Tab.active_blocks cannot be reached. I'm not entirely sure what it's trying to do, but I thought I'd note it so you can take a look.
A style point: it is atypical in python to check
is True
oris False
directly. Preferred is typicallyif item
andif not item
. The code below could be doing something tricky with a non-boolean result when getting display_tab, I suppose.I was reading the code to try and figure out how to configure the blocks visible on the Context tab.
The text was updated successfully, but these errors were encountered: