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

type hints in methods using PEP 604 result in horizontal line #8671

Closed
cybercyber123 opened this issue May 9, 2023 · 2 comments · Fixed by #8988 or #9093
Closed

type hints in methods using PEP 604 result in horizontal line #8671

cybercyber123 opened this issue May 9, 2023 · 2 comments · Fixed by #8988 or #9093
Labels
Bug 🪲 pyreverse Related to pyreverse component

Comments

@cybercyber123
Copy link

Bug description

The following type hints cause unwanted horizontal lines, because of un-escaped pipe-symbols.

class FailingClass:
    def __init__(
        self,
        with_default: str | None = None,
    ) -> None:
        self._bar = with_default

    def the_failing_method(
        self,
        the_arg: str | None = None,
    ) -> None:
        pass

Configuration

No response

Command used

pyreverse --filter ALL --output-directory output --output dot ./main.py

Pylint output

digraph "classes" {
rankdir=BT
charset="utf-8"
"main.FailingClass" [color="black", fontcolor="black", label=<{FailingClass|_bar : Optional[str \| None]<br ALIGN="LEFT"/>|__init__(with_default: str | None): None<br ALIGN="LEFT"/><I>the_failing_method</I>(the_arg: str | None): None<br ALIGN="LEFT"/>}>, shape="record", style="solid"];
}

Expected behavior

i would expect proper handling of those type hints.

Pylint version

pylint==2.17.4

OS / Environment

No response

Additional dependencies

No response

@cybercyber123 cybercyber123 added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label May 9, 2023
@DanielNoord
Copy link
Collaborator

I don't understand this issue. What do you mean with horizontal lines?

@mbyrnepr2 mbyrnepr2 added the pyreverse Related to pyreverse component label May 9, 2023
@cybercyber123
Copy link
Author

cybercyber123 commented May 9, 2023

classes

@DanielNoord
i am referring to the additional lines following init in provided svg

@mbyrnepr2 mbyrnepr2 added Bug 🪲 and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels May 9, 2023
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
Development

Successfully merging a pull request may close this issue.

3 participants