diff --git a/releasenotes/notes/fix-graphviz-draw-return-type-6b1d3f9c2a7e8f01.yaml b/releasenotes/notes/fix-graphviz-draw-return-type-6b1d3f9c2a7e8f01.yaml new file mode 100644 index 0000000000..23e4ffee79 --- /dev/null +++ b/releasenotes/notes/fix-graphviz-draw-return-type-6b1d3f9c2a7e8f01.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixed the return type annotation of + :func:`~rustworkx.visualization.graphviz_draw` to use ``PIL.Image.Image`` + instead of ``PIL.Image``. diff --git a/rustworkx/visualization/graphviz.py b/rustworkx/visualization/graphviz.py index d4d5d5bba9..ed3b6de781 100644 --- a/rustworkx/visualization/graphviz.py +++ b/rustworkx/visualization/graphviz.py @@ -82,7 +82,7 @@ def graphviz_draw( filename: str | None = None, image_type: str | None = None, method: str | None = None, -) -> Image | None: +) -> Image.Image | None: """Draw a :class:`~rustworkx.PyGraph` or :class:`~rustworkx.PyDiGraph` object using graphviz @@ -133,11 +133,11 @@ def graphviz_draw( more details on the different layout methods. By default ``'dot'`` is used. - :returns: A ``PIL.Image`` object of the generated visualization, if + :returns: A ``PIL.Image.Image`` object of the generated visualization, if ``filename`` is not specified. If ``filename`` is specified then ``None`` will be returned as the visualization was written to the path specified in ``filename`` - :rtype: PIL.Image + :rtype: PIL.Image.Image .. jupyter-execute::