Skip to content

FURB157 misses decimal.Decimal("_-1") #21186

@dscorbett

Description

@dscorbett

Summary

verbose-decimal-constructor (FURB157) has a false negative when the sign character follows an underscore. Example:

$ cat >furb157.py <<'# EOF'
from decimal import Decimal
Decimal("_-1")
# EOF

$ ruff --isolated check furb157.py --select FURB157
All checks passed!

This was a true positive in version 0.14.2.

Version

ruff 0.14.3 (8737a2d 2025-10-30)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions