@@ -27,7 +27,7 @@ if sys.version_info >= (3, 14):
2727 _ActionKind : TypeAlias = Literal ["default" , "error" , "ignore" , "always" , "module" , "once" ]
2828else :
2929 _ActionKind : TypeAlias = Literal ["default" , "error" , "ignore" , "always" , "all" , "module" , "once" ]
30- filters : Sequence [tuple [str , re .Pattern [str ] | None , type [Warning ], re .Pattern [str ] | None , int ]] # undocumented, do not mutate
30+ filters : Sequence [tuple [str , re .Pattern [str ] | None , type [Warning ] | tuple [ type [ Warning ], ...] , re .Pattern [str ] | None , int ]] # undocumented, do not mutate
3131
3232def showwarning (
3333 message : Warning | str ,
@@ -41,9 +41,9 @@ def formatwarning(
4141 message : Warning | str , category : type [Warning ], filename : str , lineno : int , line : str | None = None
4242) -> str : ...
4343def filterwarnings (
44- action : _ActionKind , message : str = "" , category : type [Warning ] = ..., module : str = "" , lineno : int = 0 , append : bool = False
44+ action : _ActionKind , message : str = "" , category : type [Warning ] | tuple [ type [ Warning ], ...] = ..., module : str = "" , lineno : int = 0 , append : bool = False
4545) -> None : ...
46- def simplefilter (action : _ActionKind , category : type [Warning ] = ..., lineno : int = 0 , append : bool = False ) -> None : ...
46+ def simplefilter (action : _ActionKind , category : type [Warning ] | tuple [ type [ Warning ], ...] = ..., lineno : int = 0 , append : bool = False ) -> None : ...
4747def resetwarnings () -> None : ...
4848
4949class _OptionError (Exception ): ...
@@ -92,7 +92,7 @@ class catch_warnings(Generic[_W_co]):
9292 record : Literal [False ] = False ,
9393 module : ModuleType | None = None ,
9494 action : _ActionKind | None = None ,
95- category : type [Warning ] = ...,
95+ category : type [Warning ] | tuple [ type [ Warning ], ...] = ...,
9696 lineno : int = 0 ,
9797 append : bool = False ,
9898 ) -> None : ...
@@ -103,7 +103,7 @@ class catch_warnings(Generic[_W_co]):
103103 record : Literal [True ],
104104 module : ModuleType | None = None ,
105105 action : _ActionKind | None = None ,
106- category : type [Warning ] = ...,
106+ category : type [Warning ] | tuple [ type [ Warning ], ...] = ...,
107107 lineno : int = 0 ,
108108 append : bool = False ,
109109 ) -> None : ...
@@ -114,7 +114,7 @@ class catch_warnings(Generic[_W_co]):
114114 record : bool ,
115115 module : ModuleType | None = None ,
116116 action : _ActionKind | None = None ,
117- category : type [Warning ] = ...,
117+ category : type [Warning ] | tuple [ type [ Warning ], ...] = ...,
118118 lineno : int = 0 ,
119119 append : bool = False ,
120120 ) -> None : ...
0 commit comments