mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-22 14:18:46 +00:00
remove useless uses of type: ignore
This commit is contained in:
parent
1065dfe10b
commit
16618d73de
|
@ -319,7 +319,7 @@ class Chain(ContextModule):
|
||||||
return parent
|
return parent
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def insert(self, index: int, module: Module) -> None: # type: ignore
|
def insert(self, index: int, module: Module) -> None:
|
||||||
if index < 0:
|
if index < 0:
|
||||||
index = max(0, len(self._modules) + index + 1)
|
index = max(0, len(self._modules) + index + 1)
|
||||||
modules = list(self)
|
modules = list(self)
|
||||||
|
@ -336,7 +336,7 @@ class Chain(ContextModule):
|
||||||
return
|
return
|
||||||
raise ValueError(f"No module of type {module_type.__name__} found in the chain.")
|
raise ValueError(f"No module of type {module_type.__name__} found in the chain.")
|
||||||
|
|
||||||
def append(self, module: Module) -> None: # type: ignore
|
def append(self, module: Module) -> None:
|
||||||
modules = list(self)
|
modules = list(self)
|
||||||
modules.append(module)
|
modules.append(module)
|
||||||
self._regenerate_keys(modules)
|
self._regenerate_keys(modules)
|
||||||
|
@ -344,7 +344,7 @@ class Chain(ContextModule):
|
||||||
module._set_parent(self)
|
module._set_parent(self)
|
||||||
self._register_provider()
|
self._register_provider()
|
||||||
|
|
||||||
def pop(self, index: int = -1) -> Module | tuple[Module]: # type: ignore
|
def pop(self, index: int = -1) -> Module | tuple[Module]:
|
||||||
modules = list(self)
|
modules = list(self)
|
||||||
if index < 0:
|
if index < 0:
|
||||||
index = len(modules) + index
|
index = len(modules) + index
|
||||||
|
|
Loading…
Reference in a new issue