On 2004-08-11, at 17.16, John Marshall wrote: > How about the following, which I am almost positive > has not been suggested: > ----- > class Klass: > def __init__(self, name): > self.name = name > > deco meth0: > staticmethod > def meth0(x): > return x > > deco meth1: > classmethod > def meth1(cls): > return cls > > deco sayhello: > funcattrs(name='GvR', language='python') > log(file='func.log') > def sayhello(self): > print 'hello python world' > > Any comments? There is the problem that you have to repeat the name of the function you define. Repetition of this kind leads to error. It also takes more place and distracts more from the actual function than most of the other syntax. Also, there is the "new keyword" problem, leading to breakage if older code uses the "deco" name. //Simon
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4