I've wrapper class around some sql statements and I'm trying to add a
method that does:
if my_cursor is a sqlite cursor, then run "select
else if it's a psycopg2 cursor, then run "select
currval( 'my_sequence' )"
The best I can come up with is import both psycopg2 and sqlite and
if isinstance( self._curs, sqlite.Cursor ) : ...
elif isinstance( self._curs, psycopg2._psycopg.cursor ) : ...
and I can't help thinking there has to be another way to find out what
kind of thing self._curs is. Is there a better way?