@@ -5,7 +5,31 @@ from re import Pattern
5
5
from typing import Any , ClassVar , Literal , TypeVar , overload
6
6
from typing_extensions import TypeAlias
7
7
8
- if sys .version_info >= (3 , 12 ):
8
+ if sys .version_info >= (3 , 13 ):
9
+ __all__ = (
10
+ "NoSectionError" ,
11
+ "DuplicateOptionError" ,
12
+ "DuplicateSectionError" ,
13
+ "NoOptionError" ,
14
+ "InterpolationError" ,
15
+ "InterpolationDepthError" ,
16
+ "InterpolationMissingOptionError" ,
17
+ "InterpolationSyntaxError" ,
18
+ "ParsingError" ,
19
+ "MissingSectionHeaderError" ,
20
+ "ConfigParser" ,
21
+ "RawConfigParser" ,
22
+ "Interpolation" ,
23
+ "BasicInterpolation" ,
24
+ "ExtendedInterpolation" ,
25
+ "SectionProxy" ,
26
+ "ConverterMapping" ,
27
+ "DEFAULTSECT" ,
28
+ "MAX_INTERPOLATION_DEPTH" ,
29
+ "UNNAMED_SECTION" ,
30
+ "MultilineContinuationError" ,
31
+ )
32
+ elif sys .version_info >= (3 , 12 ):
9
33
__all__ = (
10
34
"NoSectionError" ,
11
35
"DuplicateOptionError" ,
@@ -71,8 +95,9 @@ class Interpolation:
71
95
class BasicInterpolation (Interpolation ): ...
72
96
class ExtendedInterpolation (Interpolation ): ...
73
97
74
- class LegacyInterpolation (Interpolation ):
75
- def before_get (self , parser : _Parser , section : str , option : str , value : str , vars : _Section ) -> str : ...
98
+ if sys .version_info < (3 , 13 ):
99
+ class LegacyInterpolation (Interpolation ):
100
+ def before_get (self , parser : _Parser , section : str , option : str , value : str , vars : _Section ) -> str : ...
76
101
77
102
class RawConfigParser (_Parser ):
78
103
_SECT_TMPL : ClassVar [str ] # undocumented
@@ -101,6 +126,7 @@ class RawConfigParser(_Parser):
101
126
default_section : str = "DEFAULT" ,
102
127
interpolation : Interpolation | None = ...,
103
128
converters : _ConvertersMap = ...,
129
+ allow_unnamed_section : bool = False ,
104
130
) -> None : ...
105
131
@overload
106
132
def __init__ (
@@ -117,6 +143,7 @@ class RawConfigParser(_Parser):
117
143
default_section : str = "DEFAULT" ,
118
144
interpolation : Interpolation | None = ...,
119
145
converters : _ConvertersMap = ...,
146
+ allow_unnamed_section : bool = False ,
120
147
) -> None : ...
121
148
@overload
122
149
def __init__ (
@@ -133,6 +160,7 @@ class RawConfigParser(_Parser):
133
160
default_section : str = "DEFAULT" ,
134
161
interpolation : Interpolation | None = ...,
135
162
converters : _ConvertersMap = ...,
163
+ allow_unnamed_section : bool = False ,
136
164
) -> None : ...
137
165
def __len__ (self ) -> int : ...
138
166
def __getitem__ (self , key : str ) -> SectionProxy : ...
@@ -300,7 +328,10 @@ class InterpolationSyntaxError(InterpolationError): ...
300
328
class ParsingError (Error ):
301
329
source : str
302
330
errors : list [tuple [int , str ]]
303
- if sys .version_info >= (3 , 12 ):
331
+ if sys .version_info >= (3 , 13 ):
332
+ def __init__ (self , source : str , * args : object ) -> None : ...
333
+ def combine (self , others : Sequence [ParsingError ]) -> ParsingError : ...
334
+ elif sys .version_info >= (3 , 12 ):
304
335
def __init__ (self , source : str ) -> None : ...
305
336
else :
306
337
def __init__ (self , source : str | None = None , filename : str | None = None ) -> None : ...
@@ -311,3 +342,11 @@ class MissingSectionHeaderError(ParsingError):
311
342
lineno : int
312
343
line : str
313
344
def __init__ (self , filename : str , lineno : int , line : str ) -> None : ...
345
+
346
+ if sys .version_info >= (3 , 13 ):
347
+ class _UNNAMED_SECTION : ...
348
+ UNNAMED_SECTION : _UNNAMED_SECTION
349
+ class MultilineContinuationError (ParsingError ):
350
+ lineno : int
351
+ line : str
352
+ def __init__ (self , filename : str , lineno : int , line : str ) -> None : ...
0 commit comments