Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'decorator': 0.07; 'function,': 0.07; '(instead': 0.09; 'subject:Getting': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'docstring': 0.16; 'wrote:': 0.17; 'solution.': 0.18; 'cc:2**0': 0.23; 'monday,': 0.23; 'cc:no real name:2**0': 0.24; 'command': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'raw': 0.27; 'lines': 0.28; 'josh': 0.29; 'prints': 0.29; 'points': 0.29; 'received:google.com': 0.34; 'received:209.85': 0.35; 'there': 0.35; 'method': 0.36; 'subject:with': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'nothing': 0.38; 'help': 0.40; 'your': 0.60; 'further': 0.61; 'face': 0.61; '(that': 0.62; 'otten': 0.84; 'overlooked': 0.84; 'red.': 0.84 Newsgroups: comp.lang.python Date: Wed, 27 Jun 2012 16:09:51 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.115.184.65; posting-account=yMP7kQoAAAAXsyJyvL-3qYVslbdYOSQP References: <9d0c01f4-4430-4a45-8776-20d8dede9e14@googlegroups.com> <513d25ea-e977-4b84-b388-bfb23c171aae@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 76.115.184.65 MIME-Version: 1.0 Subject: Re: Getting lazy with decorators From: Josh English To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1340838595 news.xs4all.nl 6971 [2001:888:2000:d::a6]:43104 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24558 On Monday, June 25, 2012 11:57:39 PM UTC-7, Peter Otten wrote: > > > > There is nothing in the documentation (that I have found) that points to > > this solution. > > That's because I "invented" it. > Oh bother. The lines I completely overlooked were in your __getattr__ override. Boy is my face red. On further experimentation, adding a do_xxx command without the decorator still works...ish. The undecorated do_xxx is still considered to have a help function, and it prints the raw docstring (instead of using the show_help method to clean it up). Josh