
Shalabh Chaturvedi wrote:
|paramnames(username='Username', password='Password') |webmethod(username=str, password=str) def login(self, username, password, return_to=None): request = current.request ...
|webmethod() def logout(self, return_to=None): current.request.session.user = None return current.request.redirect(return_to or self._q_location)
Appears accentuated, yet clean, specially for simple/single decorators. Gives an appearance that the decorators are 'connected' to the function.
This looks remarkably nice to me for a syntax before the definition. Astoundingly so. I still prefer list-before-colon, but the above would alleviate much of my distate for @ which is that it doesn't look as though the decorators are connected to the definition. Hmm - perhaps a further variation ... |paramnames(username='Username', password='Password') | |webmethod(username=str, password=str) | def login(self, username, password, return_to=None): request = current.request i.e. the decorators must be connected to the def, but you can use some whitespace to make them look better (for decorators with long parameter lists). Would be hell to parse though ... Tim Delaney

"Delaney, Timothy C (Timothy)" <tdelaney@avaya.com>:
the above would alleviate much of my distate for @ which is that it doesn't look as though the decorators are connected to the definition.
For something which looks more attached to the definition, how about staticmethod... def foo(): ### Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
participants (2)
-
Delaney, Timothy C (Timothy)
-
Greg Ewing