This would work but I have to say using a class for this feels very Javaish.
Python has closures. If you wanted to have arguments for your callback you could have easily put it inside another function with your arguments.
def make_formstyle(placeholder=True, errors='down'):
def callback(form, fields):
if placeholder:
#do some stuff
....
return callback
And then you would do
SQLFORM(db.table, formstyle=make_formstyle(placeholder=True, errors='down'))
That said, formstyle should definitely accept any callable but I hate all this inspection which is very unpythonic, maybe a better way would be to try to find a smarter way to do the backwards compatibility stuff. Instead of using inspect maybe we could just use a try and except. If it failed to call formstyle using the new 2 arguments way, then use the 4 arguments oldstyle.