Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'debugging': 0.05; 'decorator': 0.07; 'wrapper': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'subject:not': 0.11; 'mine.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'syntax.': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'decorators': 0.22; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'header:X -Complaints-To:1': 0.28; 'button': 0.30; '(and': 0.32; 'traditional': 0.33; 'to:addr:python-list': 0.33; 'know.': 0.33; 'received:org': 0.36; 'too': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'received:fios.verizon.net': 0.84; 'troubles': 0.84; 'try,': 0.84; 'mistake': 0.91; 'trouble.': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Decorators not worth the effort Date: Fri, 14 Sep 2012 16:37:47 -0400 References: <732807993.849639.1347614902104.JavaMail.root@sequans.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: <732807993.849639.1347614902104.JavaMail.root@sequans.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347655202 news.xs4all.nl 6884 [2001:888:2000:d::a6]:57431 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29186 2nd try, hit send button by mistake before On 9/14/2012 5:28 AM, Jean-Michel Pichavant wrote: > Decorators are very popular so I kinda already know that the fault is > mine. Now to the reason why I have troubles writing them, I don't > know. Every time I did use decorators, I spent way too much time > writing it (and debugging it). You are writing parameterized decorators, which require inverted currying of the wrapper maker. Perhaps that is why you have trouble. As I showed in response to Cameron, it may be easier to avoid that by using a traditional post-def wrapping call instead of decorator syntax. -- Terry Jan Reedy