Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58734
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'argument': 0.05; 'string.': 0.05; 'subject:Python': 0.06; 'explicit': 0.07; 'granted,': 0.07; 'arguments': 0.09; 'defines': 0.09; 'exception.': 0.09; 'raises': 0.09; 'shifting': 0.09; 'python': 0.11; 'def': 0.12; 'bytecode': 0.16; 'declaration': 0.16; 'exceptions,': 0.16; 'foo():': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; "function's": 0.16; 'here"': 0.16; 'none.': 0.16; 'roy': 0.16; 'sequence,': 0.16; 'statement.': 0.16; 'unreachable': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'print': 0.22; '(by': 0.24; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'possibility': 0.29; 'raise': 0.29; 'thus': 0.29; "doesn't": 0.30; 'statement': 0.30; 'message- id:@mail.gmail.com': 0.30; 'prints': 0.31; 'fri,': 0.33; 'could': 0.34; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'raising': 0.36; 'returning': 0.36; 'possible': 0.36; 'nov': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'that,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'name': 0.63; 'design,': 0.64; 'stand': 0.64; 'more': 0.64; 'smith': 0.68; 'subject:your': 0.76; '1:18': 0.91; '2013': 0.98 |
| 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:to :content-type; bh=JkiP4A4/MpOK6v+iJ++iRi3g9IJGy7Y98PWsMrlbkz4=; b=V2zU4Ps5jnpYz8voEEFvWQageJziuyegfNoFeSMcKrOle6mxWttvpnXVV4OuxmRBcQ r0yUxd020xey9fqMyeBtm4FZOT9tDWnSbxR49kcG+r1AfGFAatgptTaeIArDfWmIxsah vPqpREAu0TVEl0mIp/e4tuVQ1GLXZwAD358vWzwp7coK+Hb2Y/qqtjNf4q+A+0f1hY47 wIQyvv5TejuJemHBKAXU88+D6ItOOjjplCozkCHP+bTiPxGBHSlUWKx1xj9gDhbALoNv 0X3IoFDbXCEXXHPj8gpnulmMTTucSUI6LWc8tsY2ADbjl0xnb/xfDAlLbQewMHc8LUly Lhyw== |
| MIME-Version | 1.0 |
| X-Received | by 10.66.157.165 with SMTP id wn5mr13133147pab.169.1383877581828; Thu, 07 Nov 2013 18:26:21 -0800 (PST) |
| In-Reply-To | <roy-11E1E6.21185807112013@news.panix.com> |
| References | <82328ec8-7178-4a17-abfe-13d444fab9cf@googlegroups.com> <mailman.2107.1383786254.18130.python-list@python.org> <l5eqi0$3ha$1@dont-email.me> <mailman.2114.1383794270.18130.python-list@python.org> <c6a4b69c-51ee-4367-8bf0-aefed08d7bb1@googlegroups.com> <pyReu.25286$ql7.11998@fx33.am4> <roy-E0C307.20020107112013@news.panix.com> <l5hfuj$m2n$1@dont-email.me> <roy-187962.20540507112013@news.panix.com> <l5hh32$qf4$1@dont-email.me> <roy-11E1E6.21185807112013@news.panix.com> |
| Date | Fri, 8 Nov 2013 13:26:21 +1100 |
| Subject | Re: Show off your Python chops and compete with others |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| 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 | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2173.1383877585.18130.python-list@python.org> (permalink) |
| Lines | 34 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1383877585 news.xs4all.nl 15872 [2001:888:2000:d::a6]:50021 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:58734 |
Show key headers only | View raw
On Fri, Nov 8, 2013 at 1:18 PM, Roy Smith <roy@panix.com> wrote:
> It's not a shifting goalpost. My original statement was that:
>
> def foo():
> raise Exception
>
> defines a function which 1) has no explicit return statement and 2) does
> not return None. I stand by that statement. There is no possible
> codepath, no possible calling sequence, no possible execution
> environment, which will cause that function to return None. That fact
> that one particular Python implementation happens to produce unreachable
> bytecode for returning None is meaningless. Would you say that:
>
> def baz():
> return None
> print "I got here"
>
> is a function which prints "I got here"?
Granted, but I would describe this:
def foo(x):
return "Hello, world!\n" + str(x)
as a function which returns a string. Is it? Well, not if str raises
an exception. Even if the only arguments you can give to foo will
result in exceptions, I would still say that, per design, this is a
function that returns a string. The possibility of raising an
exception (and thus not returning anything) doesn't change a
function's return type (by which I mean more than just what C would
use as the declaration - I could just as well say "Returns the name of
an employee", and the same argument would apply).
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Show off your Python chops and compete with others Nathaniel Sokoll-Ward <nathanielsokollward@gmail.com> - 2013-11-06 16:00 -0800
Re: Show off your Python chops and compete with others Andrew Cooper <root@127.0.0.1> - 2013-11-07 00:13 +0000
Re: Show off your Python chops and compete with others Roy Smith <roy@panix.com> - 2013-11-06 19:24 -0500
Re: Show off your Python chops and compete with others Andrew Cooper <root@127.0.0.1> - 2013-11-07 00:28 +0000
Re: Show off your Python chops and compete with others Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-07 00:38 +0000
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-07 11:59 +1100
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-07 12:04 +1100
Re: Show off your Python chops and compete with others John Nagle <nagle@animats.com> - 2013-11-06 17:31 -0800
Re: Show off your Python chops and compete with others Tim Chase <python.list@tim.thechases.com> - 2013-11-06 21:19 -0600
Re: Show off your Python chops and compete with others Nathaniel Sokoll-Ward <nathanielsokollward@gmail.com> - 2013-11-07 10:38 -0800
Re: Show off your Python chops and compete with others Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-07 18:48 +0000
Re: Show off your Python chops and compete with others Alister <alister.ware@ntlworld.com> - 2013-11-07 19:08 +0000
Re: Show off your Python chops and compete with others Roy Smith <roy@panix.com> - 2013-11-07 20:02 -0500
Re: Show off your Python chops and compete with others alex23 <wuwei23@gmail.com> - 2013-11-08 11:49 +1000
Re: Show off your Python chops and compete with others Roy Smith <roy@panix.com> - 2013-11-07 20:54 -0500
Re: Show off your Python chops and compete with others alex23 <wuwei23@gmail.com> - 2013-11-08 12:08 +1000
Re: Show off your Python chops and compete with others Roy Smith <roy@panix.com> - 2013-11-07 21:18 -0500
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-08 13:26 +1100
Re: Show off your Python chops and compete with others Tim Chase <python.list@tim.thechases.com> - 2013-11-07 22:05 -0600
Re: Show off your Python chops and compete with others Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-08 05:26 +0000
Re: Show off your Python chops and compete with others Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-08 09:23 +0000
Re: Show off your Python chops and compete with others Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-08 19:47 +1300
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-08 09:55 +1100
Re: Show off your Python chops and compete with others jskirst@gmail.com - 2013-11-07 11:02 -0800
Re: Show off your Python chops and compete with others Tim Chase <python.list@tim.thechases.com> - 2013-11-07 13:30 -0600
Re: Show off your Python chops and compete with others 88888 Dihedral <dihedral88888@gmail.com> - 2013-11-07 16:19 -0800
Re: Show off your Python chops and compete with others MRAB <python@mrabarnett.plus.com> - 2013-11-07 01:12 +0000
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-07 12:17 +1100
Re: Show off your Python chops and compete with others John Ladasky <john_ladasky@sbcglobal.net> - 2013-11-06 17:55 -0800
Re: Show off your Python chops and compete with others Chris Angelico <rosuav@gmail.com> - 2013-11-07 13:07 +1100
Re: Show off your Python chops and compete with others Omar Abou Mrad <omar.aboumrad@gmail.com> - 2013-11-08 09:09 +0200
Re: Show off your Python chops and compete with others Nathaniel Sokoll-Ward <nathanielsokollward@gmail.com> - 2013-11-12 09:20 -0800
csiph-web