That also seems like a true option, in particular, because of the zero penalty. Do you have an idea how to handle the problem that not citation can be decided at function level (hence using decorators)?
Am Montag, 8. September 2014 19:32:33 UTC+2 schrieb Nils Bruin: > > On Sunday, September 7, 2014 9:24:48 AM UTC-7, Volker Braun wrote: >> >> If you want to cite inside a decision tree then you can't do that with a >> decorator. Instead of *also* having a function call syntax, we should then >> *only* have function call syntax. Nothing good ever came out of having two >> ways of achieving the same outcome. The other reason for why function call >> syntax is better is that, >> > > There is an advantage to a decorator on python-level: If you're happy to > configure sage_citation_enabled at start-up (which means it would have to > be a command line option or an environment variable), you can make it > completely *zero* penalty at runtime, with a little penalty at function > definition ("import") time: > > def cite(<citations>): > if sage_citation_enabled: > def decorator(f): > def wrapper(*args): > <register citations> > return f(*args) > return wrapper > else: > def decorator(f): return f > return decorator > > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.