In article <mailman.1321.1236340190.11746.python-l...@python.org>, andrew cooke <and...@acooke.org> wrote: >Terry Reedy wrote: >> >> @alias('justAsFantastic') >> def someFantasticMethod(args): ... > >does this exist? i read the previous post and thought "i think a >decorator could do that", but i haven't written one. > >the reason i ask is that for 3->2 backwards compatability i need to do >this in a couple of places. it would be nice to have: > > @alias('__nonzero__') > def __bool__(self): > >and even better(?) if it could depend on python version!
How about using a class decorator? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "Programming language design is not a rational science. Most reasoning about it is at best rationalization of gut feelings, and at worst plain wrong." --GvR, python-ideas, 2009-3-1 -- http://mail.python.org/mailman/listinfo/python-list