8000 tests/cpydiff: Add case for str.ljust/rjust. · lable/micropython@ad3abcd · GitHub
[go: up one dir, main page]

Skip to content

Commit ad3abcd

Browse files
committed
tests/cpydiff: Add case for str.ljust/rjust.
1 parent 0c5369a commit ad3abcd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""
2+
categories: Types,str
3+
description: str.ljust() and str.rjust() not implemented
4+
cause: MicroPython is highly optimized for memory usage. Easy workarounds available.
5+
workaround: Instead of `s.ljust(10)` use `"%-10s" % s`, instead of `s.rjust(10)` use `"% 10s" % s`. Alternatively, `"{:<10}".format(s)` or `"{:>10}".format(s)`.
6+
"""
7+
print('abc'.ljust(10))

0 commit comments

Comments
 (0)
0