Skip to content

Commit b3a9bfd

Browse files
authored
pyexpat: improve ParserCreate, mark positional-only args (#3676)
1 parent 119547b commit b3a9bfd

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

stdlib/2and3/pyexpat/__init__.pyi

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ XML_PARAM_ENTITY_PARSING_ALWAYS: int
2525
_Model = Tuple[int, int, Optional[str], tuple]
2626

2727
class XMLParserType(object):
28-
def Parse(self, data: Union[Text, bytes], isfinal: bool = ...) -> int: ...
29-
def ParseFile(self, file: _Reader) -> int: ...
30-
def SetBase(self, base: Text) -> None: ...
28+
def Parse(self, __data: Union[Text, bytes], __isfinal: bool = ...) -> int: ...
29+
def ParseFile(self, __file: _Reader) -> int: ...
30+
def SetBase(self, __base: Text) -> None: ...
3131
def GetBase(self) -> Optional[str]: ...
3232
def GetInputContext(self) -> Optional[bytes]: ...
33-
def ExternalEntityParserCreate(self, context: Optional[Text], encoding: Text = ...) -> XMLParserType: ...
34-
def SetParamEntityParsing(self, flag: int) -> int: ...
35-
def UseForeignDTD(self, flag: bool = ...) -> None: ...
33+
def ExternalEntityParserCreate(self, __context: Optional[Text], __encoding: Text = ...) -> XMLParserType: ...
34+
def SetParamEntityParsing(self, __flag: int) -> int: ...
35+
def UseForeignDTD(self, __flag: bool = ...) -> None: ...
3636
buffer_size: int
3737
buffer_text: bool
3838
buffer_used: int
@@ -71,5 +71,6 @@ class XMLParserType(object):
7171
NotStandaloneHandler: Optional[Callable[[], int]]
7272
ExternalEntityRefHandler: Optional[Callable[[str, Optional[str], Optional[str], Optional[str]], int]]
7373

74-
def ErrorString(errno: int) -> str: ...
75-
def ParserCreate(encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ...) -> XMLParserType: ...
74+
def ErrorString(__code: int) -> str: ...
75+
# intern is undocumented
76+
def ParserCreate(encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ..., intern: Optional[Dict[str, Any]] = ...) -> XMLParserType: ...

0 commit comments

Comments
 (0)