Skip to content

UP045 fixes Optional[Optional[x]] to x | None | None #19746

@johncassil

Description

@johncassil

Summary

Nesting is not taken care of in the conversion:

Optional[Optional[str]] yields str | None | None

This might be related to #18508

Version

ruff 0.12.1 (32c5418 2025-06-26)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixesRelated to suggested fixes for violationshelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions