[Types-sig] Another declaration file
Tony Lownds
tony@adam12.metanet.com
Tue, 20 Mar 2001 08:27:12 -0800
How do these declarations become real run-time checks? Does it appear
in the XMLParser.py file or a separate file? Do you still need to add
__paramcheck__() and __rccheck__() calls to the functions?
Can you post your latest code?
-Tony
>===================================================
>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
>
>_______________________________________________
>Types-SIG mailing list
>Types-SIG@python.org
>http://mail.python.org/mailman/listinfo/types-sig