tests/cpydiff: Document complex() parsing difference.

In #17384 it was decided that fixing this difference was not worth the code
size increase.  So document it instead.

Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
Jeff Epler
2025-06-10 08:21:14 +02:00
committed by Damien George
parent 841acb9df1
commit 5901b8d149

View File

@@ -0,0 +1,14 @@
"""
categories: Types,complex
description: MicroPython's complex() accepts certain incorrect values that CPython rejects
cause: MicroPython is highly optimized for memory usage.
workaround: Do not use non-standard complex literals as argument to complex()
MicroPython's ``complex()`` function accepts literals that contain a space and
no sign between the real and imaginary parts, and interprets it as a plus.
"""
try:
print(complex("1 1j"))
except ValueError:
print("ValueError")