parameters: (self, change)
docstring: validate the db, since it can be an Instance of two different types
docstring_summary: validate the db, since it can be an Instance of two different types
docstring_tokens: validate the db since it can be an Instance of two different types
function: def _db_changed(self, change):
          """validate the db, since it can be an Instance of two different types"""
          new = change['new']
          connection_types = (DummyDB,)
          if sqlite3 is not None:
              connection_types = (DummyDB, sqlite3.Connection)
          if not isinstance(new, connection_types):
              msg = "%s.db must be sqlite3 Connection or DummyDB, not %r" % \
                      (self.__class__.__name__, new)
              raise TraitError(msg)
function_tokens: def _db_changed ( self , change ) : new = change [ 'new' ] connection_types = ( DummyDB , ) if sqlite3 is not None : connection_types = ( DummyDB , sqlite3 . Connection ) if not isinstance ( new , connection_types ) : msg = "%s.db must be sqlite3 Connection or DummyDB, not %r" % ( self . __class__ . __name__ , new ) raise TraitError ( msg )