diff --git a/dynamic_stack_decider/dynamic_stack_decider/dsd.py b/dynamic_stack_decider/dynamic_stack_decider/dsd.py index 870194f..b4743b6 100644 --- a/dynamic_stack_decider/dynamic_stack_decider/dsd.py +++ b/dynamic_stack_decider/dynamic_stack_decider/dsd.py @@ -5,7 +5,7 @@ import sys import traceback from pathlib import Path -from typing import Dict, List, Optional, Tuple +from typing import Optional from rclpy.node import Node from rclpy.qos import DurabilityPolicy, QoSProfile @@ -26,7 +26,7 @@ ) -def discover_elements(path: str) -> Dict[str, AbstractStackElement]: +def discover_elements(path: str) -> dict[str, AbstractStackElement]: """ Extract all the classes from the files in the given path and return a dictionary containing them @@ -122,10 +122,10 @@ def __init__(self, blackboard, debug_topic: str = None, node: Optional[Node] = N self.tree: Optional[Tree] = None # The stack is implemented as a list of tuples consisting of the tree element # and the actual module instance - self.stack: List[Tuple[AbstractTreeElement, AbstractStackElement]] = [] + self.stack: list[tuple[AbstractTreeElement, AbstractStackElement]] = [] - self.actions: Dict[str, AbstractActionElement] = {} - self.decisions: Dict[str, AbstractDecisionElement] = {} + self.actions: dict[str, AbstractActionElement] = {} + self.decisions: dict[str, AbstractDecisionElement] = {} # Check if debugging is active self.debug_active = debug_topic is not None diff --git a/dynamic_stack_decider/dynamic_stack_decider/parser.py b/dynamic_stack_decider/dynamic_stack_decider/parser.py index 9b0c18a..bddd4c4 100644 --- a/dynamic_stack_decider/dynamic_stack_decider/parser.py +++ b/dynamic_stack_decider/dynamic_stack_decider/parser.py @@ -242,7 +242,7 @@ def _create_sequence_element(self, actions, parent, lnr): Create a new sequence element :param actions: The names of actions in the sequence - :type actions: List[str] + :type actions: list[str] :param parent: The parent element of the sequence :type parent: AbstractDecisionElement :param lnr: Line number of the current line (used for error messages)