Correction: Nifty unnecessary hack. Why not just write a function which returns another function that performs the SQL statement? That is almost but not quite exactly what the decorators do and it would accomplish exactly the same goal without clobbering python syntax. An even better solution would just be a function that executes an arbitrary SQL query. That also has the benefit that it can be easily wrapped and easily debugged unlike the current mess.
examples:
create_sql_function(query): return a function that executes query.
execute_sql(query): execute a query.
Usage:
foo = create_sql_function('SELECT a, b FROM bar;')
zzz(self, c, d):
execute_sql('INSERT INTO ...')
These were my thoughts, too. Using functions instead of decorators would have many more benefits. I guess they could argue that some of the runtime performance moves to instantiation in the decorator approach.
Still, warn the new coders against it, but don't stone the guy. Let people explore. I'm probably one of the few people who didn't want decorators added at all (I think they're ugly and feel less pythonic than decorating after declaration), but I like seeing people experiment.
examples:
create_sql_function(query): return a function that executes query.
execute_sql(query): execute a query.
Usage:
foo = create_sql_function('SELECT a, b FROM bar;') zzz(self, c, d): execute_sql('INSERT INTO ...')