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

"x | y" does not work but "Union[x, y]" does #441

Closed
AnthonyZJiang opened this issue Jun 21, 2024 · 4 comments · Fixed by #443
Closed

"x | y" does not work but "Union[x, y]" does #441

AnthonyZJiang opened this issue Jun 21, 2024 · 4 comments · Fixed by #443
Labels
bug Something isn't working

Comments

@AnthonyZJiang
Copy link

e.g. for a method:

def get_val() -> int | str:
    """Get value.

    Returns:
        int | str: the value.
    """
    pass

Expected Behavior

def get_val() ‑> int | str
Get value.

Returns
int | str
The value.

Actual Behavior

def get_val() ‑> int | str
Get value.

Returns
int | None The value.

See more details in the attached picture

Steps to Reproduce

Additional info

  • pdoc version: 0.10.0

Example 1

Here is the example in action, comparing | and Union:
image

Example 2

Here's another example of using | instead of Union:
image

@ERosendo
Copy link
Contributor

@kernc is Anyone working on a fix for this yet? I'd be happy to take a look and see if I can help fix it.

@ERosendo
Copy link
Contributor

@AnthonyZJiang, can you rerun the command and let us know if the problem you encountered earlier is fixed? Any additional details you can give would be helpful if it's still happening.

@kernc kernc closed this as completed Jun 24, 2024
@AnthonyZJiang
Copy link
Author

The issue is solved. The doc was generated correctly. I appreciate your dedication and fast response.

@kernc
Copy link
Member

kernc commented Jun 26, 2024

v0.11.1 released! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants