[Types-sig] Another declaration file

Paul Prescod paulp@ActiveState.com
Mon, 19 Mar 2001 06:35:17 -0800


This one is for xmllib. It's funny how doing this shows the extent to
which people write code with the expectation that parameter names are
private (even though they aren't in Python). For instance
xmllib.XMLParser uses keyword arguments instead of bothing to enumerate
its arguments. And it has parameters named "i" and "j".

===================================================
from typecheck import __declare__
from  sre import IMatch

__declare__("""

# xmllib has a funny way of doing its init...
#def XMLParser.__init__(self, 
#            accept_unquoted_attributes: IStrictBoolean,
#            accept_missing_endtag_name: IStrictBoolean,
#            map_case: IStrictBoolean,
#            accept_utf8: IString,
#            translate_attribute_references: IStrictBoolean )

def XMLParser.reset(self) -> rc: INone

def XMLParser.setnomoretags(self) -> rc: INone

def XMLParser.setliteral(self) -> rc: INone

def XMLParser.feed(self, data: IString) -> rc: INone

def XMLParser.close(self) -> rc: INone

def XMLParser.translate_references(self, 
            data:IString, all: IStrictBoolean) 
                -> unknown: (IString | INone)

def XMLParser.getnamespace(self) -> namespace: IMapping

def XMLParser.goahead(self, end: IStrictBoolean) -> rc: INone

def XMLParser.parse_comment(self, i: IInt) -> length_or_no_end : IInt

def XMLParser.parse_doctype(self, res: IMatch) 
				-> length_or_no_end : IInt

def XMLParser.parse_cdata(self, i: IInt) -> length_or_no_end : IInt

def XMLparser.parse_starttag(self, i: IInt) 
					-> length_or_no_end : IInt

def XMLParser.parse_endtag(self, i: IInt) -> length_or_no_end : IInt

def XMLParser.finish_starttag(self, tagname: IString,
                attrdict: IMapping, method: (ICallable | INone) )
         -> length_or_no_end : IInt

def XMLParser.finish_endtag(self, tag: IString) -> rc: INone

def XMLParser.handle_charref(self, name: IString) -> rc: INone


def XMLparser.parse_proc(self, i: IInt) -> length_or_no_end : IInt

def XMLParser.parse_attributes(self, tag: IString, 
                                i: IInt, j: IInt) 
           -> (attrdict: IMapping, namespace: IMapping, i: IInt)
                   
""")
-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.activestate.com/pythoncookbook