2018-09-21 20:13:50 -04:00
|
|
|
"""
|
|
|
|
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.
|
|
|
|
"""
|
2021-04-20 01:22:44 -04:00
|
|
|
print(b"{}".format(1))
|