File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1000,9 +1000,24 @@ def gcf() -> Figure:
1000
1000
return figure ()
1001
1001
1002
1002
1003
- def fignum_exists (num : int ) -> bool :
1004
- """Return whether the figure with the given id exists."""
1005
- return _pylab_helpers .Gcf .has_fignum (num ) or num in get_figlabels ()
1003
+ def fignum_exists (num : int | str ) -> bool :
1004
+ """Return whether the figure with the given id exists.
1005
+
1006
+ Parameters
1007
+ ----------
1008
+ num : int or str
1009
+ A figure identifier.
1010
+
1011
+ Returns
1012
+ -------
1013
+ bool
1014
+ Whether or not a figure with id *num* exists.
1015
+ """
1016
+ return (
1017
+ _pylab_helpers .Gcf .has_fignum (num )
1018
+ if isinstance (num , int )
1019
+ else num in get_figlabels ()
1020
+ )
1006
1021
1007
1022
1008
1023
def get_fignums () -> list [int ]:
You can’t perform that action at this time.
0 commit comments