Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Why not allow empty code blocks? Date: Thu, 4 Aug 2016 06:12:17 +1000 Lines: 28 Message-ID: References: <579B1ABB.1070500@rece.vub.ac.be> <28fa2205-5d30-4d00-9ab9-b56c66274dd5@googlegroups.com> <3d96c99b-72fa-439c-93b4-abef2b9fd8a0@googlegroups.com> <579f207f$0$11110$c3e8da3@news.astraweb.com> <01f3d086-ba00-43c6-8f86-712fb940b054@googlegroups.com> <57a0dd53$0$1620$c3e8da3$5496439d@news.astraweb.com> <87a8gv562h.fsf@jester.gateway.pace.com> <57a1b23c$0$11093$c3e8da3@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de tbpkKkWZrxACwEQ8s8RbeQSRjzjzpeXVDYLjLsIP1Dww== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject:code': 0.07; 'sys,': 0.07; 'cc:addr:python-list': 0.09; 'pointers': 0.09; 'subject:Why': 0.09; 'language,': 0.11; 'subject:not': 0.11; 'files.': 0.13; 'wed,': 0.15; 'interpreter': 0.15; 'thu,': 0.15; '.dll': 0.16; '.py': 0.16; '2016': 0.16; 'core.': 0.16; 'example).': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'jython,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:allow': 0.16; 'wrote:': 0.16; 'example.': 0.18; 'language': 0.19; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'aug': 0.20; 'fairly': 0.22; 'java': 0.22; 'am,': 0.23; 'code.': 0.23; 'import': 0.24; 'implemented': 0.24; 'header:In-Reply-To:1': 0.24; 'sort': 0.25; 'module': 0.25; "doesn't": 0.26; 'chris': 0.26; 'external': 0.27; 'message-id:@mail.gmail.com': 0.27; 'dll': 0.27; 'host': 0.28; 'function': 0.28; 'interface': 0.29; 'implement': 0.32; 'common': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'except': 0.34; 'received:google.com': 0.35; 'exist': 0.35; 'possible,': 0.35; 'sometimes': 0.35; 'but': 0.36; 'modules': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'support,': 0.37; 'seem': 0.37; 'means': 0.39; 'some': 0.40; 'suitable': 0.61; "you'll": 0.61; 'provide': 0.61; 'real': 0.62; 'different': 0.63; 'direct': 0.68; 'anywhere.': 0.84; 'chrisa': 0.84; 'etc),': 0.84; 'ultimately,': 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:from:date:message-id:subject:cc; bh=16SWyCFWezWYakIoiHDYUcXJADL3AoYdG4a+Py+JmgA=; b=hMbCm7hCAyRZBcHOSb776lx8GR+6BpbOP05wwB7C2AmW88/kjaemfqmYoPHQm7ox8v sqgBacRnSaMJW+cD678zB4NnUmDXcLIIA3ekxnlZL5EXPz/DdWNudKRH9BCE05Bv2vWz 6AxZOUCAzbmW4zoMAdzBvhY71KUHjnE2KBfyVdudElLcrKy2xlOueovmFdS6IF4PAbMT Ir+m+H8OpgRNbacb8FJOnsZslt505NPPArHY1HWg31dxYnxm0yt9rxCWfG3wmjrjx5HK GRTGfWmq+LaErVr93Gpdod+NADdRWN2LqzubFoagAa+eXUBUMBH+FB6GuQvAClTCOXTS 0XGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=16SWyCFWezWYakIoiHDYUcXJADL3AoYdG4a+Py+JmgA=; b=VZIITNqGyAZlEev759M2W6lTE/fpO1L3BG8yllqtc0Q/aXAcNMvevmbDcyKV7lyPNO R+23gZaui/02WYBWr3cPmekqq7HY8GxHRqFWxyzCWCYWSopvYWrzYgOrkd8m8zY8itHM Sz8yhw6/qBDbI+miTyxfxBixUZ0yQPcLWV5zrkOSVzePF3IagrQCCQP198BMIgEgtfUf UirlfOxnKd+RRJRNWTZf9BfrYInfG6fVMQC1uoFG+Q+Oislmf/5lk0P9gyWsLS0qWVmn 3ZDzZkzwAyhx6akied4Fnoa1ZwwzBnGfXLp/Ck9W5N01Xt8QoRtz7mEC2ijf44SIAi4V 6azw== X-Gm-Message-State: AEkoouvog1Bku8M9GbJccQQnpC4wIRLh9jN1LqKTvuU9HdYpLfKOPiVrCOBe9FCwa/PYvZfy8ZEZYWfU0oZUvw== X-Received: by 10.194.113.105 with SMTP id ix9mr1661247wjb.30.1470255138095; Wed, 03 Aug 2016 13:12:18 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <579B1ABB.1070500@rece.vub.ac.be> <28fa2205-5d30-4d00-9ab9-b56c66274dd5@googlegroups.com> <3d96c99b-72fa-439c-93b4-abef2b9fd8a0@googlegroups.com> <579f207f$0$11110$c3e8da3@news.astraweb.com> <01f3d086-ba00-43c6-8f86-712fb940b054@googlegroups.com> <57a0dd53$0$1620$c3e8da3$5496439d@news.astraweb.com> <87a8gv562h.fsf@jester.gateway.pace.com> <57a1b23c$0$11093$c3e8da3@news.astraweb.com> Xref: csiph.com comp.lang.python:112302 On Thu, Aug 4, 2016 at 4:52 AM, BartC wrote: > On 03/08/2016 14:31, Chris Angelico wrote: >> >> On Wed, Aug 3, 2016 at 11:23 PM, BartC wrote: >>> >>> On 03/08/2016 09:58, Steven D'Aprano wrote: >>> >>> But sometimes you try to find a .py import module and it doesn't seem to >>> exist anywhere. (sys.py for example). >> >> Ultimately, you _cannot_ implement everything in Python, unless you >> create some sort of crazy fudge like having function pointers with >> real language support, in which case you're writing C code. Some >> modules have to be implemented in the host language (C for CPython, >> Java for Jython, etc), in order to provide lower-level functionality. > > The approach I use is to provide direct access, from the language, to > external .dll or .so files. > > Then it is possible, with a suitable interface *written in the byte-code > language*, to directly call C's fopen() for example. Fairly common approach - and it means you'll never find those .py files. So it's no different from looking for sys.py and not finding it, except that in the case of CPython's sys, it's not even a DLL - it's part of the interpreter core. ChrisA