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: 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 Cc: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Sat, Jan 10, 2015 at 8:26 AM, Albert-Jan Roskam 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