I have a couple of case discriminations to reduce a parameter to the 
tablename. I found that in gluon, this is often done by simply str(table).


But did you know:


>>> x = lambda: str(table)

>>> timeit.Timer(x).timeit()

5.487793207168579

>>> x = lambda: table._tablename if hasattr(table, "_tablename") else table

>>> timeit.Timer(x).timeit()

0.5015690326690674

Regards,

Dominic


-- 



Reply via email to