Skip to content

Commit 81d509a

Browse files
committed
printline() method returns a string
1 parent e7b9404 commit 81d509a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎spatialmath/baseposematrix.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,12 @@ def printline(self, *args, **kwargs):
579579
:type unit: str
580580
:param file: file to write formatted string to. [default, stdout]
581581
:type file: file object
582+
:return: the formatted value as a string
583+
:rtype: str
582584
583585
- ``X.printline()`` print ``X`` in single-line format
584-
- ``X.printline(file=None)`` is a string representing the pose ``X`` in single-line format
586+
- ``X.printline(file=None)`` is a string representing the pose ``X`` in
587+
single-line format
585588
586589
If ``X`` has multiple values, print one per line.
587590
@@ -606,10 +609,10 @@ def printline(self, *args, **kwargs):
606609
"""
607610
if self.N == 2:
608611
for x in self.data:
609-
base.trprint2(x, *args, **kwargs)
612+
return base.trprint2(x, *args, **kwargs)
610613
else:
611614
for x in self.data:
612-
base.trprint(x, *args, **kwargs)
615+
return base.trprint(x, *args, **kwargs)
613616

614617
def __repr__(self):
615618
"""

0 commit comments

Comments
 (0)