From 35388038ecad85203063b2234e6fd6a7e464bc85 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Thu, 29 Feb 2024 19:37:10 -0500 Subject: [PATCH] update type alias name --- rclpy/rclpy/duration.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rclpy/rclpy/duration.py b/rclpy/rclpy/duration.py index da8c885d5..0f8193f9e 100644 --- a/rclpy/rclpy/duration.py +++ b/rclpy/rclpy/duration.py @@ -18,11 +18,10 @@ from rclpy.constants import S_TO_NS from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy -RCLDuration = _rclpy.rcl_duration_t -class RCLDurationType: - """Object Alias of _rclpy.rcl_duration_t.""" +class DurationType: + """Type alias of _rclpy.rcl_duration_t.""" nanoseconds: int @@ -43,7 +42,7 @@ def __init__(self, *, seconds: Union[int, float] = 0, nanoseconds: int = 0): # pybind11 would raise TypeError, but we want OverflowError raise OverflowError( 'Total nanoseconds value is too large to store in C duration.') - self._duration_handle: RCLDurationType = RCLDuration(total_nanoseconds) + self._duration_handle: DurationType = _rclpy.rcl_duration_t(total_nanoseconds) @property def nanoseconds(self) -> int: @@ -108,7 +107,7 @@ def from_msg(cls, msg: builtin_interfaces.msg.Duration) -> 'Duration': raise TypeError('Must pass a builtin_interfaces.msg.Duration object') return cls(seconds=msg.sec, nanoseconds=msg.nanosec) - def get_c_duration(self) -> RCLDurationType: + def get_c_duration(self) -> DurationType: return self._duration_handle