Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #24558

Re: Getting lazy with decorators

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 <Joshua.R.English@gmail.com>
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 <mailman.1510.1340693868.4697.python-list@python.org>
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> <mailman.1442.1340525279.4697.python-list@python.org> <513d25ea-e977-4b84-b388-bfb23c171aae@googlegroups.com> <mailman.1510.1340693868.4697.python-list@python.org>
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 <Joshua.R.English@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.1572.1340838595.4697.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Getting lazy with decorators Josh English <Joshua.R.English@gmail.com> - 2012-06-23 18:58 -0700
  Re: Getting lazy with decorators Peter Otten <__peter__@web.de> - 2012-06-24 10:07 +0200
    Re: Getting lazy with decorators Josh English <Joshua.R.English@gmail.com> - 2012-06-25 13:04 -0700
      Re: Getting lazy with decorators Peter Otten <__peter__@web.de> - 2012-06-26 08:57 +0200
        Re: Getting lazy with decorators Josh English <Joshua.R.English@gmail.com> - 2012-06-27 16:09 -0700
        Re: Getting lazy with decorators Josh English <Joshua.R.English@gmail.com> - 2012-06-27 16:09 -0700
      Re: Getting lazy with decorators Peter Otten <__peter__@web.de> - 2012-06-26 09:03 +0200
    Re: Getting lazy with decorators Josh English <Joshua.R.English@gmail.com> - 2012-06-25 13:04 -0700
  Re: Getting lazy with decorators "Stefan H. Holek" <stefan@epy.co.at> - 2012-06-24 12:44 +0200

csiph-web