Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python.': 0.02; 'subject:error': 0.03; 'function,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'changes': 0.15; 'expression.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'print': 0.22; '(or': 0.24; 'cc:2**0': 0.24; 'certain': 0.27; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'function': 0.29; 'external': 0.29; 'generally': 0.29; 'message-id:@mail.gmail.com': 0.30; '25,': 0.31; 'something': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'pm,': 0.38; 'anything': 0.39; 'future': 0.60; 'most': 0.60; 'numbers': 0.61; 'side': 0.67; 'subject:Lists': 0.91; 'to:none': 0.92; 'state.': 0.95 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:cc :content-type; bh=u5noJWWuKf5aW9yqld2qTkTJVHo9m42DbGPbEzZep5w=; b=dHvOrmiKjzySJVoqAOXsWd4V1hnZmrUsJH+58nCF0QpBDaw/SWsSODFoj5vcWhqc6W qSF/vNBwueYnLGx9JpfKgKKMYymoLdaXyMN0eGptXTHWCT4kky/ZAChwCAk5bUG1vlcN t+AToh/0kZdNGhF0i4LVUtz461RD8GhBVwTm/w+NaUR3WPELjWUdqf1u1zQQEq82Ehz0 fX1sxQwWlQXa4BReY1a2/H2I9C75YkW5VHiNPLf8g2ixzzKKgd/HIzRRGcZkXtdfJ7Qn DsoLOci5tv0dia3nG4+98TkovGlCd4179XFWNqQPtrvm8UEU79dFacqkJeDgmsZaMlfE WJpA== MIME-Version: 1.0 X-Received: by 10.107.163.142 with SMTP id m136mr8576992ioe.32.1414216152522; Fri, 24 Oct 2014 22:49:12 -0700 (PDT) In-Reply-To: <9dd6db37-5568-405e-8af7-3a28195eec4d@googlegroups.com> References: <185ea3d5-71d3-4009-8afe-4f0c2b6bbf30@googlegroups.com> <25c6a468-e596-4a31-856b-bb5fe22c8894@googlegroups.com> <9dd6db37-5568-405e-8af7-3a28195eec4d@googlegroups.com> Date: Sat, 25 Oct 2014 16:49:12 +1100 Subject: Re: I am out of trial and error again Lists From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414216160 news.xs4all.nl 2963 [2001:888:2000:d::a6]:34477 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79657 On Sat, Oct 25, 2014 at 4:40 PM, Rustom Mody wrote: > Its generally accepted that side-effecting functions are not a good idea > -- typically a function that returns something and changes global state. Only in certain circles. Not in Python. There are large numbers of functions with side effects (mutator methods like list.append, anything that needs lots of state like random.random, everything with external effect like I/O, heaps of stuff), and it is most definitely not frowned upon. In Python 3 (or Python 2 with the future directive), print is a function, print() an expression. It's not "semantically a statement". ChrisA