Path: csiph.com!usenet.pasdenom.info!gegeweb.org!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'explicitly': 0.05; 'newbie': 0.05; 'compiler': 0.07; 'nested': 0.07; 'friday,': 0.09; 'runtime': 0.09; 'python': 0.11; 'clause.': 0.16; 'none.': 0.16; 'procedure?': 0.16; 'subject:between': 0.16; 'subject:tasks': 0.16; 'tripped': 0.16; 'unexpected': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'result.': 0.19; 'later': 0.20; '>>>': 0.22; 'header:User- Agent:1': 0.23; 'error': 0.23; 'sort': 0.25; 'header:In-Reply- To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'am,': 0.29; 'reporting': 0.29; "doesn't": 0.30; 'code': 0.31; 'getting': 0.31; 'commonly': 0.31; 'languages': 0.32; 'fri,': 0.33; 'style': 0.33; 'subject:the': 0.34; 'there': 0.35; 'belong': 0.36; 'useful': 0.36; 'subject:?': 0.36; 'checks': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'improved': 0.60; 'most': 0.60; 'simply': 0.61; 'such': 0.63; 'stand': 0.64; 'teaching': 0.64; 'more': 0.64; 'different': 0.65; 'charset:windows-1252': 0.65; 'due': 0.66; 'it!': 0.67; 'received:74.208': 0.68; 'therefore': 0.72; 'special': 0.74; '2015': 0.84; 'concept.': 0.84; 'confusing': 0.84; 'detecting': 0.84; 'procedure,': 0.84 Date: Fri, 08 May 2015 07:53:21 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: asyncio: What is the difference between tasks, futures, and coroutines? References: <344fd8f6-75c1-4b7d-888d-c5c9d4498ec3@googlegroups.com> <878ud27waw.fsf@elektro.pacujo.net> <4ea2d5ac-8c19-4a53-9a09-fe6dbe4a52bd@googlegroups.com> <5549ab43$0$11108$c3e8da3@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:of4d3e/MKT+/DJ5ETQWDwFghm35vjcxAr6BsnP4jGQ3Us6RFi6o PoR7Go351EvsYZG6rZeRJ4ek+syOhuldsTqHGgC2FUlQaau0E8x7l9IPnL+IYa9SnPBExfU bvqJQv02gt7K3TQucU0u5pqhWdbN9HLiAVPPzDCBLHLQc8WonAmG831WYLpqUFsI6V+hJIO 4zNy0Qxuh80tm4HoemY7A== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431086016 news.xs4all.nl 2855 [2001:888:2000:d::a6]:41912 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90151 On 05/08/2015 02:42 AM, Chris Angelico wrote: > On Fri, May 8, 2015 at 4:36 PM, Rustom Mody wrote: >> On Friday, May 8, 2015 at 10:39:38 AM UTC+5:30, Chris Angelico wrote: >>> Why have the concept of a procedure? >> >> On Friday, Chris Angelico ALSO wrote: >>> With print(), you have a conceptual procedure... >> >> So which do you want to stand by? > > A procedure, in Python, is simply a function which returns None. > That's all. It's not any sort of special concept. It doesn't need to > be taught. If your students are getting confused by it, stop teaching > it! One thing newbies get tripped up by is having some path through their code that doesn't explicitly return. And in Python that path therefore returns None. It's most commonly confusing when there are nested ifs, and one of the "inner ifs" doesn't have an else clause. Anyway, it's marginally more useful to that newbie if the compiler would produce an error instead of later seeing a runtime error due to an unexpected None result. I don't think Python would be improved by detecting such a condition and reporting on it. That's a job for a linter, or a style guide program. No different than the compile time checks for variable type that most languages impose. They don't belong in Python. -- DaveA