diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2021-07-13 18:01:12 +1000 |
|---|---|---|
| committer | Jim Mussared <jim.mussared@gmail.com> | 2022-08-12 12:44:30 +1000 |
| commit | 28aaab95909aab092cc8c16188fec157142f18a9 (patch) | |
| tree | 7792fc4fa68f9641da91fac41e824b78e17c2273 /py/mpconfig.h | |
| parent | 6c67fbc280625c59fff7cdf93f16d5e2ad0bad8a (diff) | |
py/objstr: Add hex/fromhex to bytes/memoryview/bytearray.
These were added in Python 3.5.
Enabled via MICROPY_PY_BUILTINS_BYTES_HEX, and enabled by default for all
ports that currently have ubinascii.
Rework ubinascii to use the implementation of these methods.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/mpconfig.h')
| -rw-r--r-- | py/mpconfig.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 25f37ff8b..1ed34bb6f 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -987,6 +987,11 @@ typedef double mp_float_t; #define MICROPY_PY_STR_BYTES_CMP_WARN (0) #endif +// Add bytes.hex and bytes.fromhex +#ifndef MICROPY_PY_BUILTINS_BYTES_HEX +#define MICROPY_PY_BUILTINS_BYTES_HEX (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES) +#endif + // Whether str object is proper unicode #ifndef MICROPY_PY_BUILTINS_STR_UNICODE #define MICROPY_PY_BUILTINS_STR_UNICODE (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES) |
