[Home] [By Thread] [By Date] [Recent Entries]
On Mon, 2005-01-03 at 11:20 -0500, Alan Gutierrez wrote: > Let's say, rather than simply raise, pass, or log, you want to > give the person who constructed this object a chance to fix. > > A chance to select a different enocoding, or some such. > > So, in addition to raise, pass, or log, how do you provide a > means to fix. I would choose to do so by passing in a "fix_error" function of some sort from the parse-caller to the handler. Functions are first-class objects in Python, so passing them around is a very common way of configuring complex behavior in that way. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Use CSS to display XML - http://www.ibm.com/developerworks/edu/x-dw-x-xmlcss-i.html Full XML Indexes with Gnosis - http://www.xml.com/pub/a/2004/12/08/py-xml.html Be humble, not imperial (in design) - http://www.adtmag.com/article.asp?id=10286 UBL 1.0 - http://www-106.ibm.com/developerworks/xml/library/x-think28.html Use Universal Feed Parser to tame RSS - http://www.ibm.com/developerworks/xml/library/x-tipufp.html Default and error handling in XSLT lookup tables - http://www.ibm.com/developerworks/xml/library/x-tiplook.html A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/ The State of Python-XML in 2004 - http://www.xml.com/pub/a/2004/10/13/py-xml.html
|

Cart



