Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98081

Re: UNABLE TO GET IDLE TO RUN

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: UNABLE TO GET IDLE TO RUN
Date Mon, 2 Nov 2015 13:08:10 +1100
Lines 48
Message-ID <mailman.47.1446430094.4463.python-list@python.org> (permalink)
References <1501485483.555358.1445441061800.JavaMail.yahoo@mail.yahoo.com> <n0ccgu$uj9$1@ger.gmane.org> <201510230905.t9N95FPe025528@fido.openend.se> <n0cvev$nhn$1@ger.gmane.org> <n0d0lm$cm3$1@ger.gmane.org> <n0lbd3$pin$1@ger.gmane.org> <n0mb0v$tel$1@ger.gmane.org> <n0nbr7$4jp$1@ger.gmane.org> <n0nmij$k8b$1@ger.gmane.org> <n0qs2l$8t8$1@ger.gmane.org> <56310743.3070708@gmail.com> <n0r3me$e50$1@ger.gmane.org> <563180CB.5080303@gmail.com> <201510290753.t9T7rZqR032272@fido.openend.se> <n0ssmm$adi$1@ger.gmane.org> <5A7F323C-ED4A-4CCA-A392-2C6F64EA6A6F@xs4all.nl> <201510301629.t9UGTY2i013568@fido.openend.se> <n114n1$o4h$1@ger.gmane.org> <n11lcd$snp$1@ger.gmane.org> <mailman.3.1446342360.4463.python-list@python.org> <5636214b$0$1617$c3e8da3$5496439d@news.astraweb.com> <201511011617.tA1GHVKE030820@fido.openend.se> <mailman.43.1446422879.4463.python-list@python.org> <5636ba40$0$1600$c3e8da3$5496439d@news.astraweb.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de O2YmolLo5DQUfYmah8jhbwdEbrjW/V6HMCbvRzmGe21g==
Return-Path <rosuav@gmail.com>
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; 'warnings': 0.03; 'subject:IDLE': 0.04; '*not*': 0.07; 'difference,': 0.07; 'differently': 0.07; 'interpreter.': 0.07; 'run,': 0.07; 'cc:addr :python-list': 0.09; 'behave': 0.09; 'differently.': 0.09; 'ide': 0.09; 'interpreter,': 0.09; 'mode,': 0.09; 'script,': 0.09; 'unexpected': 0.09; 'python': 0.10; 'interpreter': 0.15; '"python': 0.16; '"python",': 0.16; 'accidental': 0.16; 'foo"': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'idle,': 0.16; 'justified': 0.16; 'middle,': 0.16; 'modules,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'reposition': 0.16; 'semantically': 0.16; 'sys.path': 0.16; 'wrote:': 0.16; 'debugging': 0.18; 'module,': 0.18; 'load': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '(the': 0.22; 'exceptions': 0.22; 'code,': 0.23; 'code.': 0.23; 'bit': 0.23; '(or': 0.23; 'consistent': 0.23; 'second': 0.24; 'header:In-Reply- To:1': 0.24; 'all.': 0.24; 'mon,': 0.24; 'module': 0.25; "doesn't": 0.26; 'separate': 0.27; 'least': 0.27; 'message- id:@mail.gmail.com': 0.27; 'interface': 0.29; 'command-line': 0.29; 'loop,': 0.29; 'release.': 0.29; "they'll": 0.29; "i'm": 0.30; 'print': 0.30; "can't": 0.32; 'language.': 0.32; 'point': 0.33; "d'aprano": 0.33; 'idle': 0.33; 'steven': 0.33; "i'll": 0.33; 'editor': 0.34; 'running': 0.34; 'add': 0.34; 'that,': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'ahead': 0.35; 'nov': 0.35; 'returning': 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'lines': 0.36; 'received:209.85': 0.36; 'possible': 0.36; 'modules': 0.36; 'others.': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'expect': 0.37; 'received:209.85.213': 0.37; 'itself': 0.38; 'received:209': 0.38; 'anything': 0.38; 'end': 0.39; 'means': 0.39; 'application': 0.39; 'rather': 0.39; 'where': 0.40; 'some': 0.40; 'waiting': 0.60; 'close': 0.61; 'hope': 0.61; 'avoid': 0.61; 'default': 0.61; 'matter': 0.63; 'differences': 0.66; 'rare': 0.66; "they're": 0.66; 'entitled': 0.70; 'protect': 0.76; '3.6': 0.84; 'chrisa': 0.84; 'etc,': 0.84; 'hassle.': 0.84; 'subject:GET': 0.84; 'window,': 0.84; 'absolutely': 0.88; 'to:none': 0.91; 'recover': 0.91; 'shadow': 0.91; 'technically': 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=cJ6URgLagidOXG2JXEGas9yGonzSH1lgER9GOXa5qXI=; b=M0QhOQj8VHqjbbr0cdf0yky7s6yHUYPDczRkwVWrFrKr/iZGPtcZlDYJsWBqGWAAb7 jHch+eDtruRrWfak4V4HKDgqR2/7owwnYCtdy9QZYRIx2zM2pk4qJe2+il1L7vD4Yqdp JRGndHRw/ET37t6Boe3+AnKrkgrk8posGh75KcyGo38SwtXcJfBv7Gj1osO6rAOEGJxV 5OdMOZqlRuv6vjv6RDitaKaZq5U+OTR8QjznBAJ3wVWQA9rb7n4y0glkvwXd+ISKrVwn SAGQJdP4QYy1L2c3YlHVnK4AHrHChbufoumM+C/9KPOjd0Z0jAYLd/FQSSts9lm12jrx VoBw==
X-Received by 10.50.83.104 with SMTP id p8mr8948855igy.13.1446430090579; Sun, 01 Nov 2015 18:08:10 -0800 (PST)
In-Reply-To <5636ba40$0$1600$c3e8da3$5496439d@news.astraweb.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:98081

Show key headers only | View raw


On Mon, Nov 2, 2015 at 12:19 PM, Steven D'Aprano <steve@pearwood.info> wrote:
> - Python as a whole should move "" from the start of sys.path to the end (or
> at least the middle, after the stdlib) so as to avoid accidental shadowing.
>
> - Even if Python doesn't do this, IDLE could do it, and could do it
> immediately, without waiting for a new point release. IDLE is an
> application, an IDE, not the Python interpreter, and like IPython or any
> other IDE, it is perfectly entitled to behave differently from the vanilla
> Python interpreter.

IDLE consists of two things: its own code, and a means of running user
code. Conceptually, they're entirely separate - it's almost a
coincidence that they happen to be using the same language. If the IDE
wants to protect itself against running unexpected userland modules,
it is absolutely allowed to do that, same as any other application is;
it can remove "" from sys.path, or reposition it, or add traps to see
where some_module.__file__ is, or anything at all.

But when it's running user code, it should be semantically as close as
possible to the command-line interpreter as it can be. If I type
"import foo" into IDLE's interactive mode, or if I type "import foo"
into IDLE's editor and hit Run, or if I type "import foo" into the
standard command-line interactive interpreter, I expect that they'll
all find the same module, and if they don't, it's an extra debugging
hassle. When I'm debugging a script, I'll often try some parts of it
in an interactive interpreter, and it should not matter whether I pick
"python", or Idle, or ipython in a terminal window, or the in-browser
ipython notebook, etc, etc, etc. I want to be able to keep the
differences *in my head*. There are already a few; interactive
interpreters...

* Can't have blank lines in class/function definitions;
* Automatically print non-None expression results;
* Recover from exceptions by returning to the main loop, rather than
bombing the whole module load
* Warnings are enabled by default

AFAIK, all of these are consistent across _all_ interactive Python
interpreters. (The second one is configurable, but it's always the
default.) I do *not* want to have to add "Local modules do not shadow
stdlib modules" as an additional difference, particularly not in one
specific interface and not others.

So yes, technically IDLE is allowed to behave differently. But I would
hope this is extremely rare and VERY solidly justified (eg "Python 3.6
will do it this way, and IDLE is a bit ahead of the curve").

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: UNABLE TO GET IDLE TO RUN Michiel Overtoom <motoom@xs4all.nl> - 2015-11-01 02:45 +0100
  Re: UNABLE TO GET IDLE TO RUN Steven D'Aprano <steve@pearwood.info> - 2015-11-02 01:27 +1100
    Re: UNABLE TO GET IDLE TO RUN Tim Golden <mail@timgolden.me.uk> - 2015-11-01 15:01 +0000
    Re: UNABLE TO GET IDLE TO RUN Laura Creighton <lac@openend.se> - 2015-11-01 17:17 +0100
      Re: UNABLE TO GET IDLE TO RUN Steven D'Aprano <steve@pearwood.info> - 2015-11-02 11:54 +1100
    Re: UNABLE TO GET IDLE TO RUN Terry Reedy <tjreedy@udel.edu> - 2015-11-01 19:07 -0500
      Re: UNABLE TO GET IDLE TO RUN Paul Rubin <no.email@nospam.invalid> - 2015-11-01 16:50 -0800
        Re: UNABLE TO GET IDLE TO RUN Terry Reedy <tjreedy@udel.edu> - 2015-11-02 02:46 -0500
      Re: UNABLE TO GET IDLE TO RUN Steven D'Aprano <steve@pearwood.info> - 2015-11-02 12:19 +1100
        Re: UNABLE TO GET IDLE TO RUN Chris Angelico <rosuav@gmail.com> - 2015-11-02 13:08 +1100

csiph-web