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


Groups > comp.lang.python > #15003

Re: logging: warn() methods and function to be deprecated.

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'deprecated': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'method.': 0.15; '2to3': 0.16; 'deprecation': 0.16; 'from:addr:vinay_sajip': 0.16; 'message-id:@post.gmane.org': 0.16; 'more:': 0.16; 'pydoc': 0.16; 'sajip': 0.16; 'subject:() ': 0.16; 'subject:function': 0.16; 'subject:logging': 0.16; 'vinay': 0.16; "wouldn't": 0.17; 'sound': 0.21; "doesn't": 0.22; "shouldn't": 0.23; 'writes:': 0.25; 'all,': 0.28; 'pass': 0.29; 'around.': 0.29; 'bound': 0.29; 'pattern': 0.30; 'undocumented': 0.30; 'shows': 0.32; 'generally': 0.32; 'there': 0.33; 'to:addr:python-list': 0.33; 'calling': 0.33; 'header:User-Agent:1': 0.34; 'header:X-Complaints-To:1': 0.35; 'rather': 0.35; 'entry': 0.35; 'regular': 0.35; 'charset:us- ascii': 0.36; 'doing': 0.36; 'but': 0.37; 'especially': 0.37; 'received:org': 0.38; 'mike': 0.38; 'subject:: ': 0.39; 'from:addr:yahoo.co.uk': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'show': 0.67
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Vinay Sajip <vinay_sajip@yahoo.co.uk>
Subject Re: logging: warn() methods and function to be deprecated.
Date Wed, 26 Oct 2011 14:51:21 +0000 (UTC)
References <loom.20111022T135016-802@post.gmane.org> <4EA4A65F.2090205@gmail.com> <1319444908.73851.YahooMailNeo@web25801.mail.ukl.yahoo.com> <4EA5787F.1050906@vrplumber.com> <loom.20111026T110624-94@post.gmane.org> <4EA80497.9050600@vrplumber.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host sea.gmane.org
User-Agent Loom/3.14 (http://gmane.org/)
X-Loom-IP 82.152.15.113 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23)
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>
Newsgroups comp.lang.python
Message-ID <mailman.2230.1319640702.27778.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1319640702 news.xs4all.nl 6931 [2001:888:2000:d::a6]:43798
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:15003

Show key headers only | View raw


Mike C. Fletcher <mcfletch <at> vrplumber.com> writes:

> More: an undocumented entry point is not "deprecated" because, after
> all, it shows up in PyDoc as a regular method.

Deprecated methods also show up in PyDoc. Of course, if the deprecation is
mentioned in the docstring, users would see this - but if it isn't, they
wouldn't know until they got a DeprecationWarning.

> auto-translation via 2to3 (because you generally are calling log.warn()
> rather than logging.warning, but sometimes you are doing getattr( log,
> log_level ) and then passing that method around a few times), and it

That doesn't sound like a good usage pattern to me, especially as loggers have a
log method which takes the logging level. There shouldn't be any need to pass a
bound method around.

Regards,

Vinay Sajip

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


Thread

Re: logging: warn() methods and function to be deprecated. Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2011-10-26 14:51 +0000

csiph-web