Skip to content

Commit bafbe9c

Browse files
committed
Change return type of ion and ioff to fix unbound variable errors with Pyright
1 parent 879bde7 commit bafbe9c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def isinteractive() -> bool:
556556
return matplotlib.is_interactive()
557557

558558

559-
def ioff() -> ExitStack:
559+
def ioff() -> AbstractContextManager:
560560
"""
561561
Disable interactive mode.
562562
@@ -586,7 +586,7 @@ def ioff() -> ExitStack:
586586
# ...
587587
588588
To enable optional usage as a context manager, this function returns a
589-
`~contextlib.ExitStack` object, which is not intended to be stored or
589+
context manager object, which is not intended to be stored or
590590
accessed by the user.
591591
"""
592592
stack = ExitStack()
@@ -596,7 +596,7 @@ def ioff() -> ExitStack:
596596
return stack
597597

598598

599-
def ion() -> ExitStack:
599+
def ion() -> AbstractContextManager:
600600
"""
601601
Enable interactive mode.
602602
@@ -626,7 +626,7 @@ def ion() -> ExitStack:
626626
# ...
627627
628628
To enable optional usage as a context manager, this function returns a
629-
`~contextlib.ExitStack` object, which is not intended to be stored or
629+
context manager object, which is not intended to be stored or
630630
accessed by the user.
631631
"""
632632
stack = ExitStack()

0 commit comments

Comments
 (0)