Skip to content

Commit dc3eccd

Browse files
Release note for rclpy Time and Duration comparison fix (ros2#3422)
* Release note for rclpy Time and Duration comparison fix Signed-off-by: Erki Suurjaak <erki@lap> Co-authored-by: Chris Lalancette <[email protected]>
1 parent e594149 commit dc3eccd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

source/Releases/Release-Iron-Irwini.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,19 @@ Specifying a QoS of KEEP_LAST with a depth of 0 is a nonsensical arrangement, si
448448

449449
See https://github.com/ros2/rclpy/pull/1048 for more information.
450450

451+
Time and Duration no longer raise exception when compared to another type
452+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
453+
454+
It is now possible to compare ``rclpy.time.Time`` and ``rclpy.duration.Duration`` to other types without getting exceptions.
455+
If the types are not comparable, the comparison returns ``False``.
456+
Note that this is a behavior change from previous releases.
457+
458+
.. code-block:: Python
459+
460+
print(None in [rclpy.time.Time(), rclpy.duration.Duration()]) # Prints "False" instead of raising TypeError
461+
462+
See https://github.com/ros2/rclpy/pull/1007 for more information.
463+
451464
``rcutils``
452465
^^^^^^^^^^^
453466

0 commit comments

Comments
 (0)