I'm converting some code from cx_Oracle to MSSQL via Adodbapi.
Some of the data has come from an XML file so is in "lxml.etree._ElementStringResult" variables. With cx_Oracle this wasn't a problem but Adodbapi crashes as it thinks it's an unknown variable type.
In my situation I've added
try: import lxml typeMap[lxml.etree._ElementStringResult] = adc.adBSTR except: pass
To apibase.py to fix this but does having to do this go against Duck Typing?
I have added code to try introspecting the object itself when the type of the object is not recognized. It should work now if the object returns "True" to any of:
isinstance(d, StringTypes)
isinstance(d, number.Integral)
isinstance(d, number.Float)
Fixed in 2.6.1.0