Better definition for xml/sax/__init__.pyi. (#621)

Also, merge 2.7/xml/sax and 3/xml/sax into 2and3/xml/sax.
This commit is contained in:
Matthias Kramm
2016-10-19 15:30:25 -07:00
committed by Guido van Rossum
parent 8fec896898
commit 7d80824092
7 changed files with 32 additions and 20 deletions

View File

@@ -1,20 +0,0 @@
# Stubs for xml.sax (Python 2.7)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
class SAXException(Exception):
def __init__(self, msg, exception=None): ...
def getMessage(self): ...
def getException(self): ...
def __getitem__(self, ix): ...
class SAXParseException(SAXException):
def __init__(self, msg, exception, locator): ...
def getColumnNumber(self): ...
def getLineNumber(self): ...
def getPublicId(self): ...
def getSystemId(self): ...
class SAXNotRecognizedException(SAXException): ...
class SAXNotSupportedException(SAXException): ...
class SAXReaderNotAvailable(SAXNotSupportedException): ...

View File

@@ -0,0 +1,32 @@
import xml.sax
from xml.sax.xmlreader import InputSource
from xml.sax.handler import ContentHandler, ErrorHandler
class SAXException(Exception):
def __init__(self, msg, exception=None): ...
def getMessage(self): ...
def getException(self): ...
def __getitem__(self, ix): ...
class SAXParseException(SAXException):
def __init__(self, msg, exception, locator): ...
def getColumnNumber(self): ...
def getLineNumber(self): ...
def getPublicId(self): ...
def getSystemId(self): ...
class SAXNotRecognizedException(SAXException): ...
class SAXNotSupportedException(SAXException): ...
class SAXReaderNotAvailable(SAXNotSupportedException): ...
default_parser_list = ... # type: List[str]
def make_parser(parser_list: List[str]) -> xml.sax.xmlreader.XMLReader: ...
def parse(source: str, handler: xml.sax.handler.ContentHandler,
errorHandler: xml.sax.handler.ErrorHandler=...): ...
def parseString(string: str, handler: xml.sax.handler.ContentHandler,
errorHandler: xml.sax.handler.ErrorHandler=...): ...
def _create_parser(parser_name: str) -> xml.sax.xmlreader.XMLReader: ...