-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Closed
Copy link
Labels
stubs: false positiveType checkers report false errorsType checkers report false errors
Description
configparser.UNNAMED_SECTION
has been introduced in Python 3.13. It is "A special object representing a section name used to reference the unnamed section".
A specific example of usage is given in the documentation:
import configparser
config = """
option = value
[ Section 2 ]
another = val
"""
unnamed = configparser.ConfigParser(allow_unnamed_section=True)
unnamed.read_string(config)
unnamed.get(configparser.UNNAMED_SECTION, 'option')
This currently fails to typecheck since as all section
arguments are typed as str
. However, UNNAMED_SECTION
is not an str
. See for example here and here.
See also this example in the Pyright Playground giving:
Argument of type "_UNNAMED_SECTION" cannot be assigned to parameter "section" of type "str" in function "get"
"_UNNAMED_SECTION" is not assignable to "str" (reportArgumentType).
Metadata
Metadata
Assignees
Labels
stubs: false positiveType checkers report false errorsType checkers report false errors