[DB-SIG] dbiDate - help urgently needed

Jeff Sacksteder jeff at jdfiles.org
Mon Jun 2 19:23:38 EDT 2003

> Do print `type(known_dbiDate_object)`, and that will print enough 
> information to figure out what type it actually is. If you're having 
> difficulty with type and isinstance, then there's a good chance you're 
> not really looking at dbiDate objects. 

for item in my_list:
    print type(item)

returns the following-

<type 'float'>
<type 'string'>
<type 'DbiDate'>

I want to do something like-

for item in my_list:
    if type(item) is StringType:
       print 'Foo'
    elif type(item) is DbiDate:
       print 'Bar'
       print 'Baz'

But DbiDate is an object, not a type. I thought is instance might be the 
ticket, since it can compare classes _and_ types. No luck so far. 
Apparently I am the first person in the history of DBI to want to do this.

More information about the DB-SIG mailing list