diff options
| author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-07-09 15:04:26 +0300 |
|---|---|---|
| committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-07-09 15:04:26 +0300 |
| commit | ad3abcd324cd841ffddd5d8c2713345eed15f5fd (patch) | |
| tree | 2d4e6daeaffb0f2f4dbf68f9f492e8c161a7a420 /tests/cpydiff | |
| parent | 0c5369a1f02c89b1879f76a9d2045a56ae47243b (diff) | |
tests/cpydiff: Add case for str.ljust/rjust.
Diffstat (limited to 'tests/cpydiff')
| -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 000000000..498596205 --- /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)) |
