Content-Length: 259536 | pFad | http://github.com/astral-sh/ruff/pull/16777

70 [`refurb`] Avoid panicking `unwrap` in `verbose-decimal-constructor` (`FURB157`) by dylwil3 · Pull Request #16777 · astral-sh/ruff · GitHub
Skip to content
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

[refurb] Avoid panicking unwrap in verbose-decimal-constructor (FURB157) #16777

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Mar 16, 2025

Removes find/unwrap in creating fix for verbose-decimal-constructor (FURB157).

Previously, we tried to maintain trivia such as whitespace, implicitly concatenated strings, etc. when replacing something that parses to the value "-nan". This requires too much complexity when the user has unicode escape sequences such as "\N{character tabulation}\N{hyphen-minus}nan". So in this case we just replace the string literal with exactly "nan".

Closes #16771

@dylwil3 dylwil3 added bug Something isn't working fixes Related to suggested fixes for violations labels Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FURB157 fix panics on Decimal(float("\x2dnan"))
2 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: http://github.com/astral-sh/ruff/pull/16777

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy