Content-Length: 278005 | pFad | https://github.com/adafruit/circuitpython/pull/10463

76 py/parsenum: Fix parsing complex literals with negative real part by dhalbert · Pull Request #10463 · adafruit/circuitpython · GitHub
Skip to content

py/parsenum: Fix parsing complex literals with negative real part #10463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2025

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Jul 8, 2025

This is the fix from #10297 (thanks @ComplexSymbol) as submitted to MicroPython (2ce63b1) (thanks @jepler) and merged by them. 2ce63b1 was cherry-picked.

So this supersedes #10297.

If a complex literal had a negative real part and a positive imaginary
part, it was not parsed properly because the imaginary part also came out
negative.

Includes a test of complex parsing, which fails without this fix.

Co-authored-by: ComplexSymbol <141301057+ComplexSymbol@users.noreply.github.com>
Signed-off-by: Jeff Epler <jepler@gmail.com>
Copy link

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm :)

@dhalbert dhalbert requested a review from FoamyGuy July 8, 2025 18:46
Copy link
Collaborator

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dhalbert dhalbert merged commit e0e7c82 into adafruit:main Jul 8, 2025
620 checks passed
@dhalbert dhalbert deleted the complex-parsing-fix branch July 8, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/adafruit/circuitpython/pull/10463

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy