Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: using binary in python Date: Tue, 10 Nov 2015 02:17:59 +1100 Lines: 19 Message-ID: References: <20151108212706.GA29701@z-sverige.nu> <87d1vjigqf.fsf@elektro.pacujo.net> <8737wfi9ss.fsf@elektro.pacujo.net> <87si4fgs5f.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Ub85LNH1pqQMv3hrIE4JhQvuyefhq6ie3quinPkrOcTA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'string.': 0.04; 'filenames': 0.07; 'cc:addr:python-list': 0.09; 'subject:using': 0.09; '"this': 0.13; 'subject:python': 0.14; 'server,': 0.15; 'file?': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'why,': 0.16; 'wrote:': 0.16; "shouldn't": 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'along.': 0.22; 'text,': 0.22; 'am,': 0.23; "python's": 0.23; 'header:In-Reply-To:1': 0.24; 'all.': 0.24; 'message-id:@mail.gmail.com': 0.27; 'accepts': 0.29; 'boundary': 0.29; 'objects': 0.29; 'there.': 0.30; 'entry': 0.31; 'getting': 0.33; 'point': 0.33; 'problem': 0.33; 'http': 0.33; 'tue,': 0.34; 'file': 0.34; 'lists': 0.34; 'received:google.com': 0.35; 'text': 0.35; 'nov': 0.35; 'text.': 0.35; 'unicode': 0.35; "isn't": 0.35; 'should': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'things': 0.38; 'received:209': 0.38; 'why': 0.39; 'where': 0.40; 'mark': 0.40; 'field': 0.60; 'between': 0.65; 'chrisa': 0.84; 'hassle?': 0.84; 'os?': 0.84; 'to:none': 0.91 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=lPZH/YexuO1CbQE/SqlYKZHlRTtCmyboDaOdCYM411A=; b=mP1DmhpBGvlNdRk9FM4SLmYHL0P2ekWmrgcKjhopap6d9IqrDQZmFPSTklzvN2smn0 hw39LGUP5Oi4A7N44hkkcZiAqVGlMfgGHnrctWufkhEisYCsN+ILKPHhYTpiXtyXHysE gbGXs3vNCGapjC6tlx1scSIDooA2SxHXoxLgQYNvhnoFX5Q/9NC3vQRONlrVoElvhPRb lVVmcT2pMgTXYNN2ZLlC1ld2/z83JOD7w62sMr+7cFMSUzAVn127s+CqVbTH403SnRRh yL6vROFW8QOFtOtvoBYR9H3JBrDZoyujaJH9jZ5kHYqWL3SclmzHu/Al5EmbOLokzQQg BaHg== X-Received: by 10.107.10.233 with SMTP id 102mr8763567iok.31.1447082279686; Mon, 09 Nov 2015 07:17:59 -0800 (PST) In-Reply-To: <87si4fgs5f.fsf@elektro.pacujo.net> 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: , Xref: csiph.com comp.lang.python:98535 On Tue, Nov 10, 2015 at 1:32 AM, Marko Rauhamaa wrote: > Yes, and lists and dicts and ints and objects and all. No problem there. > > However, when filenames and sys.stdin deal with text, things are getting > iffy. So where do you mark the boundary between the human and the OS? If I create a GUI, I should be able to put an entry field down that accepts Unicode text. And if I make a web form and an HTTP server, a user should be able to type Unicode text into an field and send that along. Either way, my program should get a Unicode string. Why shouldn't I be able to do the same with input()? And why, if a user enters a plausible file name, should that not be able to be opened as a file? At what point do you say "this is for humans, this is for machines"? Isn't it Python's job to spare us that hassle? ChrisA