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


Groups > comp.lang.python > #83480

Re: class-based class decorator

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!ecngs!feeder2.ecngs.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'parameters': 0.04; '__init__': 0.09; 'arguments': 0.09; 'decorator': 0.09; 'deprecated': 0.09; 'used.': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'non-default': 0.16; 'subject:based': 0.16; 'subject:class': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'trying': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'parameters.': 0.31; 'class': 0.32; 'received:google.com': 0.35; 'checks': 0.38; 'rather': 0.38; "you're": 0.61; 'here:': 0.62; 'complete': 0.62; 'more': 0.64; '2015': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=1H7Syu+EkTFCFTGnJq6H2Ze94uZcU2hZtjWlltaI0BY=; b=GPFAmcEEdnhsB70RDQukq1F0bK9hrDjp/q7sL4CRzexFfzfOeU/k8ZjftkOOI4PBzQ ym5ssA5nQ0yYu79Hm6M0kLVcGXkGjIosv1Wqe8q/Qkv3xX+9Zj+pjit9koUcwrjjm2vH OIq6koaT8ibVXzeT/REesEF+ps/lwTX2C0vGwmwje8h8hLRQXZ61mRbU11QOQngMRzKO PnCYGzkjXT2WyKBglf19dZ6Jfw4lmAJjzNSKyQM1toI0l2CCf9OwHccQA4jEK1WClUFl 2EoszN5+wwKEfRRYe/hv43Z12iNeQi8xrCgDQMXI8q19SDUZTTEvN2/1VrH36vmI9Eq4 6cpA==
MIME-Version 1.0
X-Received by 10.42.94.14 with SMTP id z14mr15115080icm.59.1420852064493; Fri, 09 Jan 2015 17:07:44 -0800 (PST)
In-Reply-To <879539503.1660445.1420838812525.JavaMail.yahoo@jws10784.mail.gq1.yahoo.com>
References <879539503.1660445.1420838812525.JavaMail.yahoo@jws10784.mail.gq1.yahoo.com>
Date Sat, 10 Jan 2015 12:07:44 +1100
Subject Re: class-based class decorator
From Chris Angelico <rosuav@gmail.com>
Cc Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17547.1420852068.18130.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1420852068 news.xs4all.nl 2882 [2001:888:2000:d::a6]:51688
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:83480

Show key headers only | View raw


On Sat, Jan 10, 2015 at 8:26 AM, Albert-Jan Roskam
<fomcl@yahoo.com.dmarc.invalid> wrote:
> I am trying to write a class decorator that checks whether deprecated parameters with non-default
>
> arguments are used. More complete code is here: http://pastebin.com/ZqnMis6M. In the code below,
>

Any particular reason to make this a class decorator, rather than a
function decorator on __init__? After all, __init__ is where you're
defining the deprecated parameters.

ChrisA

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


Thread

Re: class-based class decorator Chris Angelico <rosuav@gmail.com> - 2015-01-10 12:07 +1100

csiph-web