mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
[configparser] Add several deprecated attributes (#14487)
This commit is contained in:
@@ -107,7 +107,6 @@ tkinter.Tk.split # Exists at runtime, but missing from stubs
|
||||
# =======
|
||||
|
||||
_?bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set
|
||||
configparser.ParsingError.filename
|
||||
enum.Enum._generate_next_value_
|
||||
importlib.abc.Finder.find_module
|
||||
urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to super, so super args are specified
|
||||
|
||||
@@ -70,7 +70,6 @@ importlib.metadata._meta.SimplePath.__truediv__ # Runtime definition of protoco
|
||||
# =======
|
||||
|
||||
_?bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set
|
||||
configparser.ParsingError.filename
|
||||
enum.Enum._generate_next_value_
|
||||
importlib.abc.Finder.find_module
|
||||
urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to super, so super args are specified
|
||||
|
||||
@@ -54,7 +54,6 @@ typing_extensions.Sentinel.__call__
|
||||
# =======
|
||||
|
||||
_?bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set
|
||||
configparser.ParsingError.filename
|
||||
enum.Enum._generate_next_value_
|
||||
importlib.abc.Finder.find_module
|
||||
urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to super, so super args are specified
|
||||
|
||||
+17
-3
@@ -3,7 +3,7 @@ from _typeshed import MaybeNone, StrOrBytesPath, SupportsWrite
|
||||
from collections.abc import Callable, ItemsView, Iterable, Iterator, Mapping, MutableMapping, Sequence
|
||||
from re import Pattern
|
||||
from typing import Any, ClassVar, Final, Literal, TypeVar, overload, type_check_only
|
||||
from typing_extensions import TypeAlias
|
||||
from typing_extensions import TypeAlias, deprecated
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
__all__ = (
|
||||
@@ -271,6 +271,7 @@ class RawConfigParser(_Parser):
|
||||
def read_string(self, string: str, source: str = "<string>") -> None: ...
|
||||
def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = "<dict>") -> None: ...
|
||||
if sys.version_info < (3, 12):
|
||||
@deprecated("Deprecated since Python 3.2; removed in Python 3.12. Use `parser.read_file()` instead.")
|
||||
def readfp(self, fp: Iterable[str], filename: str | None = None) -> None: ...
|
||||
# These get* methods are partially applied (with the same names) in
|
||||
# SectionProxy; the stubs should be kept updated together
|
||||
@@ -331,7 +332,8 @@ class ConfigParser(RawConfigParser):
|
||||
) -> str | _T: ...
|
||||
|
||||
if sys.version_info < (3, 12):
|
||||
class SafeConfigParser(ConfigParser): ... # deprecated alias
|
||||
@deprecated("Deprecated since Python 3.2; removed in Python 3.12. Use `ConfigParser` instead.")
|
||||
class SafeConfigParser(ConfigParser): ...
|
||||
|
||||
class SectionProxy(MutableMapping[str, str]):
|
||||
def __init__(self, parser: RawConfigParser, name: str) -> None: ...
|
||||
@@ -443,10 +445,22 @@ class ParsingError(Error):
|
||||
elif sys.version_info >= (3, 12):
|
||||
def __init__(self, source: str) -> None: ...
|
||||
else:
|
||||
def __init__(self, source: str | None = None, filename: str | None = None) -> None: ...
|
||||
@overload
|
||||
def __init__(self, source: str, filename: None = None) -> None: ...
|
||||
@overload
|
||||
@deprecated("The `filename` parameter removed in Python 3.12. Use `source` instead.")
|
||||
def __init__(self, source: None = None, filename: str = ...) -> None: ...
|
||||
|
||||
def append(self, lineno: int, line: str) -> None: ...
|
||||
|
||||
if sys.version_info < (3, 12):
|
||||
@property
|
||||
@deprecated("Deprecated since Python 3.2; removed in Python 3.12. Use `source` instead.")
|
||||
def filename(self) -> str: ...
|
||||
@filename.setter
|
||||
@deprecated("Deprecated since Python 3.2; removed in Python 3.12. Use `source` instead.")
|
||||
def filename(self, value: str) -> None: ...
|
||||
|
||||
class MissingSectionHeaderError(ParsingError):
|
||||
lineno: int
|
||||
line: str
|
||||
|
||||
Reference in New Issue
Block a user