Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'argument': 0.05; 'root': 0.05; 'subject:Python': 0.06; 'arguments': 0.09; 'debugging.': 0.09; 'function,': 0.09; 'http': 0.09; 'parsing': 0.09; 'subject:skip:c 10': 0.09; 'gui': 0.12; 'windows': 0.15; 'command- line': 0.16; 'exceptions;': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject: \n ': 0.16; 'subject:between': 0.16; 'subject:programming': 0.16; 'all.': 0.16; 'wrote:': 0.18; '(not': 0.18; 'library': 0.18; 'wed,': 0.18; 'stefan': 0.19; 'value.': 0.19; 'settings': 0.22; 'saying': 0.22; 'to:name:python-list@python.org': 0.22; 'print': 0.22; 'rid': 0.24; 'settings.': 0.24; "shouldn't": 0.24; 'logging': 0.26; 'certain': 0.27; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'generally': 0.29; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'usually': 0.31; '13,': 0.31; 'credentials': 0.31; 'libraries': 0.31; 'subject:that': 0.31; 'writes:': 0.31; 'probably': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'belong': 0.36; 'library.': 0.36; 'ram': 0.36; 'subject:?': 0.36; 'should': 0.36; 'example,': 0.37; 'application': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'temporarily': 0.60; 'most': 0.60; "you're": 0.61; 'kind': 0.63; 'such': 0.63; 'more': 0.64; 'granted': 0.65; '2015': 0.84; 'functions)': 0.84; 'silently': 0.84; 'subject: *': 0.84; 'subject:Good': 0.91; 'hands': 0.96 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:content-transfer-encoding; bh=uymUXDwG4ju0pIorPq+XJsRSc359FeC8JY5WBoSXLUs=; b=oLTSua9SzI40JGYNYTiR014DmablNsu69JLC3ICpzw4FcdJRhvsp3mL9uJdGM1Kf69 BZ8BZLFYpCH8/zImTmNXaxHMAcdgsDmp3Wpa/U2295k5NoUUevwLvjnorKSxEo7J0WK7 ggawVzh8LjxJgHYj5zqKuA+6gbNwUBB3/dNkljsbz0fPtziblDtLe/5P6FRSTFKislja J+h0hdyjV/OSNlNjJEeDZatb0s7r1L1WrkbIWDW5mkBIeApZh6KlEsBX8RPUgCvRA/nD Ml/3n1DoMXQJq4tv0PvFJyqiysFIwkfDdm5df7HVZ2QHPwPqz2Bit0voV7/XaK2Nel2x ZiZA== MIME-Version: 1.0 X-Received: by 10.107.160.141 with SMTP id j135mr6247403ioe.43.1431446737144; Tue, 12 May 2015 09:05:37 -0700 (PDT) In-Reply-To: References: <02dba7aa-8466-4937-a8d8-82ffd03e5568@googlegroups.com> <87wq0gyvyr.fsf@elektro.pacujo.net> <55515f9d$0$12987$c3e8da3$5496439d@news.astraweb.com> <60c01c07-aef9-4232-92cd-22e6c017fc9c@googlegroups.com> <4628bce6-98d5-44b7-bb3b-bcb796c0df77@googlegroups.com> Date: Wed, 13 May 2015 02:05:37 +1000 Subject: Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea? From: Chris Angelico To: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431446739 news.xs4all.nl 2842 [2001:888:2000:d::a6]:55021 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90462 On Wed, May 13, 2015 at 1:53 AM, Stefan Ram wrote: > zipher writes: >>so what kind of bullshit is saying that you should get rid of PRINT? > > What might be reasonable is to be able to dissect a program > into functions, and have no effects in functions that are > there to calculate some value. > > For example, when one calculates, > > y =3D sin( x ) > > , using a library function =C2=BBsin=C2=AB, one does not want =C2=BBsin= =C2=AB to > print something. > > Such library functions might even be used in code for a GUI > that has no console to print to at all. > > In order to learn how to write such functions, one might > temporarily use the rule that PRINT is allowed only in the > main block (not in functions) or temporarily for debugging. More generally, there are certain things which belong to the application, and not to any library - things like: * The console - print() and input(), and GUI windows * Command-line arguments * Program termination * Working directory and root directory * Credentials (uid/gid, etc) * Logging configuration (destinations etc) There are exceptions; argument parsing libraries often are granted control over the console and program termination in addition to reading sys.argv, but you would be somewhat surprised if having "--no-check-ssl-certs" in sys.argv silently downgraded your HTTP library's security settings. Control over application-wide settings generally has to be in the hands of the application, not any one library. So if you're writing a library function, it probably shouldn't use print()... but your application is most welcome to. You usually know which one you're writing at any given time. ChrisA