Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Meta decorator with parameters, defined in explicit functions Date: Mon, 4 Jul 2016 10:06:06 +1000 Lines: 16 Message-ID: References: <85mvm5vrbw.fsf@benfinney.id.au> <21916e7b-9e19-4cef-94e0-bac331540ca2@googlegroups.com> <46690e10-1534-4f99-a40f-a148b4a21a27@googlegroups.com> <62b43f29-e6ea-4d19-9e9f-1becb3988bd3@googlegroups.com> <0b85cc58-0552-41b3-8729-0f037e33c183@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de h1Ddn1HsNEcSOPKNRIxhIQZtv5UJr+eNSgzgLtBH3m5w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'before.': 0.09; '2016': 0.16; 'docstring': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:parameters': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'lawrence': 0.22; 'am,': 0.23; 'bit': 0.23; 'ignored.': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'message-id:@mail.gmail.com': 0.27; 'about.': 0.29; "we're": 0.30; 'received:google.com': 0.35; '(and': 0.36; 'subject:: ': 0.37; 'doing': 0.38; 'stuff': 0.38; 'does': 0.39; 'subject:with': 0.40; 'your': 0.60; 'more': 0.63; 'talking': 0.67; 'jul': 0.72; 'chrisa': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc :content-transfer-encoding; bh=mlKf//OXwGW+ymO3kx00D53U1fYPP4GbQlL05m+nV8A=; b=kXZANJT+JSubtWL0D7177Iwp70Gg026AOtGI4D4Kc2tCxvt3ybQNs82tcDvOgeVLvT x9QijE63oNKMAAMyemX2FfywxIOJ2F5cvFvIrX8lfrzLX0EVF227rCX3k+PiPL5JJS7O wrMe3hGwGKMWYwwJiF8NeCuvBJj2ti6PQlT/n9DIWUuwVOs8AUEYvL/T3WtqeVcsm9c+ IkYndhzdWI9Udk7y6nDJqhTgj5TzaLRCb84v1RXCM824gTpEigThhATu0s8F+gAKR2bm CBFzlvrEDm2JnnqVWDO6DbRiZ/EnwrvYitqqt/G8couy/XBSPGIRqdB4npknSqDXN4ND nwqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc:content-transfer-encoding; bh=mlKf//OXwGW+ymO3kx00D53U1fYPP4GbQlL05m+nV8A=; b=mgZbDu8UB0TCU/cWU0+4pRLWSsMtXmB2XG8Y440YVgbjaJt2oCm8aOF6kRokgdGG7n 9C8VZoiHz3TKk42uICSwU5X66wfNm5+H8TjujaHOkbxKIaP37Q3NP7HNEkS5xtsK9Wns 7l7RByys1M0qFZpJnxBvdwK61kwmJ4qKhVrEzJPfapyvBvWZWhcs4R2VjPdW1XA3eD2U zUvDqkiWW3HxW1ArNnQK8eoVg/PTrHPI+IC7g8VzDEFWQuqNwubr4VPTzMZiYt4c6ffE D7XosR27uqK+fZRVg1WWl8loAo5Vcso/IWlkHfUHqTzx4SEoT+kn04xg82Tk+4b2cvrK /anw== X-Gm-Message-State: ALyK8tLor4AJBBrlip7jq2CmmHw7j5t7UZ67GyrlU5cAWr7J7jVtmBBygPAV2gB7+O+CB7gYEMcK1yqGAyO6Vg== X-Received: by 10.194.139.50 with SMTP id qv18mr3069980wjb.47.1467590767023; Sun, 03 Jul 2016 17:06:07 -0700 (PDT) In-Reply-To: <0b85cc58-0552-41b3-8729-0f037e33c183@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <85mvm5vrbw.fsf@benfinney.id.au> <21916e7b-9e19-4cef-94e0-bac331540ca2@googlegroups.com> <46690e10-1534-4f99-a40f-a148b4a21a27@googlegroups.com> <62b43f29-e6ea-4d19-9e9f-1becb3988bd3@googlegroups.com> <0b85cc58-0552-41b3-8729-0f037e33c183@googlegroups.com> Xref: csiph.com comp.lang.python:111026 On Mon, Jul 4, 2016 at 9:59 AM, Lawrence D=E2=80=99Oliveiro wrote: > #begin try_func > result.__name__ =3D func.__name__ > result.__doc__ =3D func.__doc__ > return \ > result > #end try_func This is the bit we're talking about. You're doing manually what functools.wraps does for you (and it does other stuff too, to make help() more useful), and you weren't doing this before. Your original docstring on result() is completely ignored. ChrisA