From 5b7e5316ee412e6a81029c5dacc553427fb0c49c Mon Sep 17 00:00:00 2001 From: Anton Kesy Date: Wed, 11 Oct 2023 13:58:52 +0200 Subject: [PATCH] making optional things Optional (#1182) Signed-off-by: Anton Kesy --- rclpy/rclpy/__init__.py | 2 +- rclpy/rclpy/clock.py | 4 +++- rclpy/rclpy/node.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rclpy/rclpy/__init__.py b/rclpy/rclpy/__init__.py index 269a33352..c14184ec4 100644 --- a/rclpy/rclpy/__init__.py +++ b/rclpy/rclpy/__init__.py @@ -140,7 +140,7 @@ def create_node( node_name: str, *, context: Optional[Context] = None, - cli_args: List[str] = None, + cli_args: Optional[List[str]] = None, namespace: Optional[str] = None, use_global_arguments: bool = True, enable_rosout: bool = True, diff --git a/rclpy/rclpy/clock.py b/rclpy/rclpy/clock.py index 59040e1c0..c99ff6d5d 100644 --- a/rclpy/rclpy/clock.py +++ b/rclpy/rclpy/clock.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Optional + from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy from .context import Context @@ -187,7 +189,7 @@ def callback_shim(jump_dict): clock=self, threshold=threshold, pre_callback=pre_callback, post_callback=post_callback) - def sleep_until(self, until: Time, context: Context = None) -> bool: + def sleep_until(self, until: Time, context: Optional[Context] = None) -> bool: """ Sleep until a specific time on this Clock is reached. diff --git a/rclpy/rclpy/node.py b/rclpy/rclpy/node.py index 9a56548a5..425a7992d 100644 --- a/rclpy/rclpy/node.py +++ b/rclpy/rclpy/node.py @@ -123,7 +123,7 @@ def __init__( node_name: str, *, context: Optional[Context] = None, - cli_args: List[str] = None, + cli_args: Optional[List[str]] = None, namespace: Optional[str] = None, use_global_arguments: bool = True, enable_rosout: bool = True,