Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!rt.uk.eu.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.nosignal.org!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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python:': 0.09; 'def': 0.10; 'mistake.': 0.16; 'no-op': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'return,': 0.16; 'test():': 0.16; 'wrote:': 0.17; 'define': 0.20; 'latter': 0.22; 'pass': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'looks': 0.26; 'am,': 0.27; 'point': 0.31; 'function.': 0.33; 'to:addr:python-list': 0.33; 'add': 0.36; 'two': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'idiomatic': 0.84; 'forgotten': 0.91 Date: Fri, 21 Dec 2012 00:45:05 -0500 From: Mitya Sirenef User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Pass and return References: <02b7f61c-6eef-4301-a0bc-6cf8473b6fa1@googlegroups.com> In-Reply-To: <02b7f61c-6eef-4301-a0bc-6cf8473b6fa1@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356068710 news.xs4all.nl 6915 [2001:888:2000:d::a6]:49650 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35271 On 12/21/2012 12:23 AM, iMath wrote: > Pass and return > Are these two functions the same ? > > def test(): > return > > def test(): > pass From the point of style, of course, the latter is much better because that's the idiomatic way to define a no-op function. With a return, it looks like you might have forgotten to add the value to return or deleted it by mistake. -m -- Lark's Tongue Guide to Python: http://lightbird.net/larks/