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

Redundant Optional in Pyreverse #9014

Closed
nickdrozd opened this issue Sep 6, 2023 · 0 comments · Fixed by #9016 or #9093
Closed

Redundant Optional in Pyreverse #9014

nickdrozd opened this issue Sep 6, 2023 · 0 comments · Fixed by #9016 or #9093
Labels
Bug 🪲 pyreverse Related to pyreverse component
Milestone

Comments

@nickdrozd
Copy link
Contributor

Bug description

class A:
    q: int | None = None

Pyreverse generates:

classDiagram
  class A {
    q : Optional[int | None]
  }

Optional[int | None] is redundant. It should just be int | None.

Configuration

No response

Command used

pyreverse -o mmd

Pylint output

classDiagram
  class A {
    q : Optional[int | None]
  }

Expected behavior

classDiagram
class A {
q : int | None
}

Pylint version

pylint 3.0.0a8-dev0
astroid 3.0.0a10-dev0

OS / Environment

No response

Additional dependencies

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 pyreverse Related to pyreverse component
Projects
None yet
2 participants