Skip to content

Commit

Permalink
Fix type annotation for get_parameters_by_prefix. (#964)
Browse files Browse the repository at this point in the history
This makes it match Galactic, Humble, and Rolling.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette authored Jul 8, 2022
1 parent 1bebfa2 commit abbc1b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rclpy/rclpy/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from typing import Iterator
from typing import List
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import TypeVar
from typing import Union
Expand Down Expand Up @@ -528,7 +529,10 @@ def get_parameter_or(

return self._parameters.get(name, alternative_value)

def get_parameters_by_prefix(self, prefix: str) -> List[Parameter]:
def get_parameters_by_prefix(self, prefix: str) -> Dict[str, Optional[Union[
bool, int, float, str, bytes,
Sequence[bool], Sequence[int], Sequence[float], Sequence[str]
]]]:
"""
Get parameters that have a given prefix in their names as a dictionary.
Expand Down

0 comments on commit abbc1b4

Please sign in to comment.