Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #35271
| 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 | <msirenef@lightbird.net> |
| 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 <msirenef@lightbird.net> |
| 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 <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.1137.1356068710.29569.python-list@python.org> (permalink) |
| 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 |
Show key headers only | View raw
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/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Pass and return iMath <redstone-cold@163.com> - 2012-12-20 21:23 -0800
Re: Pass and return Mitya Sirenef <msirenef@lightbird.net> - 2012-12-21 00:40 -0500
Re: Pass and return Mitya Sirenef <msirenef@lightbird.net> - 2012-12-21 00:45 -0500
Re: Pass and return Duncan Booth <duncan.booth@invalid.invalid> - 2012-12-21 08:52 +0000
Re: Pass and return Mitya Sirenef <msirenef@lightbird.net> - 2012-12-21 12:15 -0500
Re: Pass and return Chris Angelico <rosuav@gmail.com> - 2012-12-21 17:19 +1100
Re: Pass and return Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-21 08:27 +0000
Re: Pass and return iMath <redstone-cold@163.com> - 2012-12-22 07:11 -0800
csiph-web