[Tutor] test <type 'DbiDate'>

Magnus Lycka magnus@thinkware.se
Mon Feb 3 15:54:14 2003


At 16:53 2003-02-03 +0100, janos.juhasz@VELUX.com wrote:
>how can I test if an object is <type 'DbiDate'> or not ?

Instanciate another DbiDate and compare their types.

import dbi

if type(object) == type(dbi.DbiDate(0)):
     print "It's a dbi.DbiDate"

Works with all versions of Python I think...


-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se