mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
warnings: ignore the type of category when message is a Warning (#3121)
This commit is contained in:
committed by
Sebastian Rittau
parent
0177dedc42
commit
9a7b286c66
@@ -1,11 +1,19 @@
|
||||
# Stubs for warnings
|
||||
|
||||
from typing import Any, Dict, List, NamedTuple, Optional, TextIO, Tuple, Type, Union
|
||||
from typing import Any, Dict, List, NamedTuple, Optional, overload, TextIO, Tuple, Type, Union
|
||||
from types import ModuleType, TracebackType
|
||||
|
||||
def warn(message: Union[str, Warning], category: Optional[Type[Warning]] = ...,
|
||||
stacklevel: int = ...) -> None: ...
|
||||
def warn_explicit(message: Union[str, Warning], category: Type[Warning],
|
||||
@overload
|
||||
def warn(message: str, category: Optional[Type[Warning]] = ..., stacklevel: int = ...) -> None: ...
|
||||
@overload
|
||||
def warn(message: Warning, category: Any = ..., stacklevel: int = ...) -> None: ...
|
||||
@overload
|
||||
def warn_explicit(message: str, category: Type[Warning],
|
||||
filename: str, lineno: int, module: Optional[str] = ...,
|
||||
registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ...,
|
||||
module_globals: Optional[Dict[str, Any]] = ...) -> None: ...
|
||||
@overload
|
||||
def warn_explicit(message: Warning, category: Any,
|
||||
filename: str, lineno: int, module: Optional[str] = ...,
|
||||
registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ...,
|
||||
module_globals: Optional[Dict[str, Any]] = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user