I have this guy:
query = 'DELETE FROM boyd.%s WHERE teamid = %s AND id = %s AND year = %s' % (statstype, '%s', '%s', '%s')
self.executequery(query, values[0:3])
Which strikes me as ugly. The first %s is actually supplied by the variable, the other three are bound variables: do I really need to go % (statstype, '%s', '%s', '%s')? Is there a more… pythonic approach here?
If you use double
%%signs, one%will still remain after string interpolation: