From b3a9bfd5dbd8e47243ef93c678159ca4013c07c3 Mon Sep 17 00:00:00 2001 From: Shantanu Date: Wed, 29 Jan 2020 02:11:56 -0800 Subject: [PATCH] pyexpat: improve ParserCreate, mark positional-only args (#3676) --- stdlib/2and3/pyexpat/__init__.pyi | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/stdlib/2and3/pyexpat/__init__.pyi b/stdlib/2and3/pyexpat/__init__.pyi index 670e56106..2178302da 100644 --- a/stdlib/2and3/pyexpat/__init__.pyi +++ b/stdlib/2and3/pyexpat/__init__.pyi @@ -25,14 +25,14 @@ XML_PARAM_ENTITY_PARSING_ALWAYS: int _Model = Tuple[int, int, Optional[str], tuple] class XMLParserType(object): - def Parse(self, data: Union[Text, bytes], isfinal: bool = ...) -> int: ... - def ParseFile(self, file: _Reader) -> int: ... - def SetBase(self, base: Text) -> None: ... + def Parse(self, __data: Union[Text, bytes], __isfinal: bool = ...) -> int: ... + def ParseFile(self, __file: _Reader) -> int: ... + def SetBase(self, __base: Text) -> None: ... def GetBase(self) -> Optional[str]: ... def GetInputContext(self) -> Optional[bytes]: ... - def ExternalEntityParserCreate(self, context: Optional[Text], encoding: Text = ...) -> XMLParserType: ... - def SetParamEntityParsing(self, flag: int) -> int: ... - def UseForeignDTD(self, flag: bool = ...) -> None: ... + def ExternalEntityParserCreate(self, __context: Optional[Text], __encoding: Text = ...) -> XMLParserType: ... + def SetParamEntityParsing(self, __flag: int) -> int: ... + def UseForeignDTD(self, __flag: bool = ...) -> None: ... buffer_size: int buffer_text: bool buffer_used: int @@ -71,5 +71,6 @@ class XMLParserType(object): NotStandaloneHandler: Optional[Callable[[], int]] ExternalEntityRefHandler: Optional[Callable[[str, Optional[str], Optional[str], Optional[str]], int]] -def ErrorString(errno: int) -> str: ... -def ParserCreate(encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ...) -> XMLParserType: ... +def ErrorString(__code: int) -> str: ... +# intern is undocumented +def ParserCreate(encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ..., intern: Optional[Dict[str, Any]] = ...) -> XMLParserType: ...