diff options
-rw-r--r-- | tests/cpydiff/types_str_ljust_rjust.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/cpydiff/types_str_ljust_rjust.py b/tests/cpydiff/types_str_ljust_rjust.py new file mode 100644 index 0000000000..4985962059 --- /dev/null +++ b/tests/cpydiff/types_str_ljust_rjust.py @@ -0,0 +1,7 @@ +""" +categories: Types,str +description: str.ljust() and str.rjust() not implemented +cause: MicroPython is highly optimized for memory usage. Easy workarounds available. +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)`. +""" +print('abc'.ljust(10)) |