Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!rt.uk.eu.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '16,': 0.03; 'encoding': 0.05; 'subject:Python': 0.06; 'defaults': 0.07; 'bytes,': 0.09; 'may,': 0.09; 'option,': 0.09; 'sure,': 0.09; 'cc:addr:python- list': 0.11; 'python': 0.11; 'expects': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'statistics.': 0.16; 'sys.stdout': 0.16; 'utf-8)': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'cc:addr:python.org': 0.22; 'text,': 0.24; 'text.': 0.24; 'unicode': 0.24; 'connected': 0.24; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; 'usually': 0.31; '(usually': 0.31; 'run': 0.32; 'text': 0.33; 'common': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'consistent': 0.36; 'useful': 0.36; 'should': 0.36; 'experience,': 0.37; 'displays': 0.38; 'writes': 0.38; 'pm,': 0.38; 'does': 0.39; 'most': 0.60; 'deliver': 0.61; 'simply': 0.61; 'personal': 0.63; 'myself': 0.63; 'detail.': 0.68; 'frequently': 0.68; 'default': 0.69; 'receive': 0.70; 'jul': 0.74; 'console,': 0.84; '4:44': 0.91; 'to:none': 0.92 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=ItgcSrxzxjQAg+Q0cS07MppIS07fc1d/L9YE2JlSYYs=; b=S2/Ev//RhC7CNyDn2fRnXnisfaZExFTSCp14GaOJOwZsVlq4Z4fH55C0eifntm/Hqw FI7kTmI+tNUxcFz0/os1TDV8+mfBzv3613mMsUfS4D919eGuOnMX5WmLP4DYczTa7qMg oPrg0rHb9Q/x98Kbu4VMyWu+v/3chLM52R0TDEzatFoDZqQwuXN7XlS3jrUFLvfO+00M 2rwLMVS+9ubn9iQln7Zpr9S4cp8Ks7fwLep/i5QvtchzrsGSk9ICKJVlPVjj2eeMjWzg NucKd1RjlGi0+8A+IniyGh62njLDdCGzND7HXAO4wMcyxyKlTELumV+mmylHhTHm749v HYww== MIME-Version: 1.0 X-Received: by 10.221.56.132 with SMTP id wc4mr5427836vcb.38.1405493426826; Tue, 15 Jul 2014 23:50:26 -0700 (PDT) In-Reply-To: <87a9894xbc.fsf@elektro.pacujo.net> References: <57ajo9poljjre4c4ig0n0ss8kph8k78lp0@4ax.com> <5389cb53$0$29978$c3e8da3$5496439d@news.astraweb.com> <99b7b2a2-7521-42d7-a5a0-1a35d4d5b922@googlegroups.com> <53C4A454.9010600@gmail.com> <87zjga4j4v.fsf@elektro.pacujo.net> <53c57bae$0$9505$c3e8da3$5496439d@news.astraweb.com> <87iomy4ciy.fsf@elektro.pacujo.net> <53c5f6dc$0$9505$c3e8da3$5496439d@news.astraweb.com> <87egxl4zq8.fsf@elektro.pacujo.net> <87a9894xbc.fsf@elektro.pacujo.net> Date: Wed, 16 Jul 2014 16:50:26 +1000 Subject: Re: Python 3 is killing Python 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1405493435 news.xs4all.nl 2907 [2001:888:2000:d::a6]:35101 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74536 On Wed, Jul 16, 2014 at 4:44 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> Python defaults to the most common case, where they're connected to a >> console, and does its best to allow print() to write Unicode to any >> console. > > I don't know where you pull your statistics. Heaps and HEAPS of personal experience, of myself and many other people. I frequently run programs that manipulate text and work with a console that displays text, which means that a consistent encoding (usually UTF-8) can be hidden away as an implementation detail. As long as the console correctly announces the encoding it expects and the program correctly writes in that encoding, all is well, and the program can simply "write text to the console". > Be that as it may, the main purpose of sys.stdin is to receive the > workload and sys.stdout to deliver the goods. Yes, but is that workload text or bytes? To be sure, there are programs whose stdin is usually or always bytes, but most use text. The default should be the most common and most useful option, and the alternative should be available when you want it. ChrisA