mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Make sphinx.util.typing.stringify render optional unions better
Without this change, stringify(Optional[Union[int, str]]) returns 'Union[int, str, None]' rather than the expected 'Optional[...]'. This change fixes that. fixes: #7654
This commit is contained in:
@@ -96,6 +96,10 @@ def f19(*args: int, **kwargs: str):
|
||||
pass
|
||||
|
||||
|
||||
def f20() -> Optional[Union[int, str]]:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
class Node:
|
||||
def __init__(self, parent: Optional['Node']) -> None:
|
||||
|
||||
Reference in New Issue
Block a user