
nas at arctrix
Aug 24, 2004, 12:33 PM
Views: 915
Permalink
|
|
Re: [Python-checkins] python/nondist/peps pep-0318.txt, 1.25, 1.26
|
|
On Tue, Aug 24, 2004 at 11:56:13AM -0700, montanaro[at]users.sourceforge.net wrote: > Modified Files: > pep-0318.txt > Log Message: > List some possible reasons why arriving at consensus about > decorators has been so hard (or impossible) to acheive. There are > certainly more. Perhaps you could add my reservation (objection is too strong a word). I think decorators are not powerful enough given their high syntactic profile. This could be rephrased as "if we are going the use the @ sign then it should be able to do really cool things". One idea is to have the compiler pass the AST for the function body to the decorator function. The decorator could create new nodes in the AST or modify existing ones. That would allow decorators to do things like adding a try/except without introducing another function call. The output of the decorator would be passed to the code generator. Neil _______________________________________________ Python-Dev mailing list Python-Dev[at]python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com
|