diff options
| author | Paul Sokolovsky | 2018-09-21 17:13:50 -0700 |
|---|---|---|
| committer | Damien George | 2018-09-26 15:31:10 +1000 |
| commit | 8181ec04a45826ac33ea3247fbc36bef98236123 (patch) | |
| tree | 4b56295f9878dd5860ad67036b97ee221aa4fcc3 | |
| parent | a135bca4a10b99e80a2732cff1a53c6a4734c145 (diff) | |
tests/cpydiff: Add case for difference in behaviour of bytes.format().
| -rw-r--r-- | tests/cpydiff/types_bytes_format.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/cpydiff/types_bytes_format.py b/tests/cpydiff/types_bytes_format.py new file mode 100644 index 000000000..697ee5269 --- /dev/null +++ b/tests/cpydiff/types_bytes_format.py @@ -0,0 +1,7 @@ +""" +categories: Types,bytes +description: bytes objects support .format() method +cause: MicroPython strives to be a more regular implementation, so if both `str` and `bytes` support ``__mod__()`` (the % operator), it makes sense to support ``format()`` for both too. Support for ``__mod__`` can also be compiled out, which leaves only ``format()`` for bytes formatting. +workaround: If you are interested in CPython compatibility, don't use ``.format()`` on bytes objects. +""" +print(b'{}'.format(1)) |
