Remove obsolete "type: ignore" comments

This commit is contained in:
Isaiah Odhner 2023-09-16 22:51:56 -04:00
parent 0791b1c080
commit 7f9243167c
3 changed files with 4 additions and 8 deletions

View File

@ -125,7 +125,7 @@ class EnhancedDirectoryTree(DirectoryTree):
if node.data.path.is_dir():
sliced_parts = remaining_parts[1:]
# print("recursing with sliced_parts", sliced_parts)
_expand_matching_child(node, sliced_parts, callback) # type: ignore
_expand_matching_child(node, sliced_parts, callback)
_add_to_load_queue(node)
# else:
# print("Found a file, not as last part of path:", node.data.path, "remaining_parts:", remaining_parts)

View File

@ -944,11 +944,7 @@ class NodeInfo(Container):
ancestor.css_identifier_styled, # TODO: link to DOM node in tree; link to source code where binding is defined
]
for (ancestor, binding) in nodes_and_bindings
] # type: ignore
# Pyright v1.1.315 introduced `error: Argument of type "list[list[str]]" cannot be assigned to parameter "rows" of type "Iterable[Iterable[CellType@DataTable]]" in function "add_rows" (reportGeneralTypeIssues)`
# It doesn't seem to understand the specific type of key_bindings_data_table, even though it's annotated.
# A workaround might be to store the DataTable in an attribute in __init__.
# This bug may be related: https://github.com/microsoft/pyright/issues/5455
]
)
# For events, look for class properties that are subclasses of Message
@ -1299,7 +1295,7 @@ class Inspector(Container):
# expand_icon = "+" # Alternatives: + ⨁ 🪜 🎊 🐡 🔬 (↕️ arrow emoji unreliable)
yield Button(f"{inspect_icon} Inspect Element", classes="inspect_button")
# yield Button(f"{expand_icon} Expand All Visible", classes="expand_all_button")
yield DOMTree(self.app) # type: ignore
yield DOMTree(self.app)
yield NodeInfo()
yield ResizeHandle(self, "left")

View File

@ -169,7 +169,7 @@ class Window(Container):
border_h = self.outer_size.height - self.size.height - 1 # bottom border isn't applicable, subtract 1
bottom_margin = self.title_bar.outer_size.height + border_h
try:
screen = self.screen # type: ignore
screen = self.screen
except NoScreen:
# I got when hitting Ctrl+O rapidly.
# Any old Open dialog is closed when opening the Open dialog.