Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.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.056 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'users,': 0.05; 'rename': 0.09; 'subject:create': 0.09; 'received:80.91': 0.16; 'received:80.91.229': 0.16; 'received:gmane.org': 0.16; 'received:list': 0.16; 'subject: \n ': 0.16; 'warn': 0.16; 'mon,': 0.18; 'wrote:': 0.21; 'header:In-Reply-To:1': 0.22; 'header:User- Agent:1': 0.23; '+0200': 0.23; 'quite': 0.26; 'pm,': 0.28; 'dan': 0.29; 'subject:new': 0.35; 'force': 0.35; 'header:X-Complaints- To:1': 0.36; 'some': 0.37; 'skip:l 20': 0.38; 'received:org': 0.38; 'to:addr:python-list': 0.39; 'to:addr:python.org': 0.40; 'mar': 0.61; 'call': 0.62; 'yes,': 0.63; '2012': 0.69; 'everybody': 0.72; 'idea.': 0.72; '11:24': 0.84; 'gelonida': 0.84; 'subject:warning': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Gelonida N Subject: Re: best way to create warning for obsolete functions and call new one Date: Wed, 28 Mar 2012 09:31:09 +0200 References: <20120326172440.4705444d@particle> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: unicorn.dungeon.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Lightning/1.0b2 "" In-Reply-To: <20120326172440.4705444d@particle> 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: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332919885 news.xs4all.nl 6928 [2001:888:2000:d::a6]:50388 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:22263 Hi Dan, On 03/26/2012 11:24 PM, Dan Sommers wrote: > On Mon, 26 Mar 2012 22:26:11 +0200 > Gelonida N wrote: > >> As these modules are used by quite some projects and as I do not want >> to force everybody to rename immediately I just want to warn users, >> that they call functions, that have been renamed and that will be >> obsoleted. > > You want a DeprecationWarning. Yes, this is a good idea. In my case I had to combine it with logging.captureWarnings()