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


Groups > comp.lang.python > #77088

Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
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; 'python,': 0.02; 'subject:IDLE': 0.04; 'yet.': 0.04; 'paths': 0.07; '#include': 0.09; 'builtin': 0.09; 'latter': 0.09; 'skip:/ 10': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'random': 0.14; '(it': 0.16; '3.3,': 0.16; 'directory)': 0.16; 'former,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'idle,': 0.16; 'invokes': 0.16; 'itself).': 0.16; 'modules,': 0.16; 'namespace.': 0.16; 'quick!': 0.16; 'rather,': 0.16; 'subject: \n ': 0.16; 'sys.path': 0.16; 'wrote:': 0.18; 'library': 0.18; 'variable': 0.18; 'wed,': 0.18; 'module': 0.19; 'basically': 0.19; 'starts': 0.20; 'import': 0.22; 'aug': 0.22; 'separate': 0.22; 'cc:addr:python.org': 0.22; 'affects': 0.24; 'directory.': 0.24; 'module,': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'equivalent': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'possibility': 0.29; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'code': 0.31; "d'aprano": 0.31; 'directory,': 0.31; 'idea,': 0.31; 'lot.': 0.31; 'steven': 0.31; 'subject:what': 0.31; 'probably': 0.32; 'stuff': 0.32; 'run': 0.32; 'maybe': 0.34; 'could': 0.34; 'subject:with': 0.35; "can't": 0.35; 'problem.': 0.35; 'something': 0.35; 'one,': 0.35; 'point.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'idle': 0.36; 'library.': 0.36; 'done': 0.36; 'useful': 0.36; 'subject:?': 0.36; 'application': 0.37; 'two': 0.37; 'project': 0.37; 'expected': 0.38; 'files': 0.38; 'sure': 0.39; 'remove': 0.60; "you'll": 0.62; "you've": 0.63; 'name': 0.63; 'more': 0.64; 'chance': 0.65; 'worth': 0.66; 'yourself': 0.78; 'affected.': 0.84; 'to:none': 0.92; '410': 0.95; 'serious': 0.97
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=tcfCqufA0HIvzVgNHoLlFbtlLywyeUle4SFrTbB1F04=; b=lXsxRC2YQbKGsQqyZEDQUCuOxCCTSZ6CnqgNSWID4XItJd7uXApRGGt9nfjeU9dDNv EghF5Gu0n+qpxdUkKSX8mVu6FV21Us6CHWywBMrS/hMt885ZogtqqA9HT2OTZjNecGMp lQAA99573UcyhhHfrcI30XFSW8GXSx4KsbXCH3ZBZyhfIdfsYME3/CaUEQlgt4Yxyx0J VkeTJ5nb1OUdLwe7g1HAppOvWv2NlXVVQ3JZnKeKoH8bv7EexyFvKbYUdD8mVIjGIJiu mk6Y1ZfXi8pq8OFaDVoMe8quti8kzH51tbd2EGxq0M0Gzg1SrBix5tz6sdul8d31fP0B nO+w==
MIME-Version 1.0
X-Received by 10.43.94.73 with SMTP id bx9mr31606782icc.19.1409098737479; Tue, 26 Aug 2014 17:18:57 -0700 (PDT)
In-Reply-To <53fd1fd3$0$30001$c3e8da3$5496439d@news.astraweb.com>
References <4eec9365-4103-4474-a47f-ea665b265b1e@googlegroups.com> <mailman.13475.1409078833.18130.python-list@python.org> <5a9b5715-382b-4a6b-be90-c535ad14740a@googlegroups.com> <b92274f5-6ed8-451a-b01a-0874a1048b54@googlegroups.com> <c64eh8F4jkuU1@mid.individual.net> <53fd1fd3$0$30001$c3e8da3$5496439d@news.astraweb.com>
Date Wed, 27 Aug 2014 10:18:57 +1000
Subject Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <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 <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>
Newsgroups comp.lang.python
Message-ID <mailman.13482.1409098740.18130.python-list@python.org> (permalink)
Lines 46
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1409098740 news.xs4all.nl 2936 [2001:888:2000:d::a6]:35433
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77088

Show key headers only | View raw


On Wed, Aug 27, 2014 at 10:01 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Gregory Ewing wrote:
>
>> Although shadowing builtin module names is never a good
>> idea, either!
>
> /s/builtin/standard library/
>
> Quick! Name all the standard library modules, stat!
>
> In Python 3.3, there are something like 410 modules in the standard library.
> There's a reasonable chance that you've shadowed at least one but never
> noticed. Yet.

Not sure about that figure; any that are namespaced away in packages
don't count (or rather, they count as just one, for the package
itself). But yes, there are a lot.

> I think it is a serious design flaw that the standard library and user code
> co-exist in a single namespace.

There are two concerns here. One is that if you create a "random.py",
you can't yourself import the normal random module; and the other is
the possibility that some unrelated application like Idle can be
affected. I think the latter is far more serious than the former,
which is basically equivalent to using "id" as a variable name and
then finding you've shadowed a builtin (it affects only your current
module, so it's pretty safe). But if I can create stuff that breaks
Idle, that's a problem. And I think the solution to that is simply:
never put your files onto the module search path, always just use the
current directory. It might also be worth having some tools like Idle
remove "" from sys.path, in case someone invokes it from a project
directory, but that's an arguable point. (That's probably more useful
for something like 2to3, where it's expected that you'll run it from a
project directory. And maybe that already happens.)

The only other way to separate them would be to do something like C's
include paths - you have the user include path (which starts with the
current directory) and the system include path (which doesn't), and
then you can #include "local_file.h" and #include <system_file.h> to
get the one you want. In Python, that could be done as "import random
from system", which would then look up sys.systempath instead of
sys.path - but do we really need that functionality?

ChrisA

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


Thread

IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 11:01 -0700
  Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Terry Reedy <tjreedy@udel.edu> - 2014-08-26 14:46 -0400
    Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 12:20 -0700
      Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 12:44 -0700
        Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 12:58 -0700
          Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-26 21:15 +0100
        Re: IDLE has suddenly become FAWLTY - so should I be hitting it with   a big stick, or what? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-08-27 10:03 +1200
          Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 15:55 -0700
            Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-27 08:25 -0700
          Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-27 10:01 +1000
            Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 17:06 -0700
            Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Chris Angelico <rosuav@gmail.com> - 2014-08-27 10:18 +1000
        Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-27 00:20 +0100
          Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 16:29 -0700
            Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Terry Reedy <tjreedy@udel.edu> - 2014-08-26 20:51 -0400
              Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 18:11 -0700
                Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Terry Reedy <tjreedy@udel.edu> - 2014-08-27 00:03 -0400
                Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-27 02:12 -0700
    Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 12:26 -0700
      Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-08-26 14:46 -0500
  Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Grant Edwards <invalid@invalid.invalid> - 2014-08-26 18:59 +0000
  Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Chris Angelico <rosuav@gmail.com> - 2014-08-27 09:07 +1000
    Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 16:25 -0700
      Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Chris Angelico <rosuav@gmail.com> - 2014-08-27 09:42 +1000
      Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-27 10:04 +1000
        Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 17:08 -0700
          Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Chris Angelico <rosuav@gmail.com> - 2014-08-27 10:21 +1000
            Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 17:58 -0700
              Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 18:06 -0700
              Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Chris Angelico <rosuav@gmail.com> - 2014-08-27 12:36 +1000
                Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Rustom Mody <rustompmody@gmail.com> - 2014-08-26 20:13 -0700
                Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Chris Angelico <rosuav@gmail.com> - 2014-08-27 14:55 +1000
                Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Twirlip2 <ahrodg@googlemail.com> - 2014-08-27 01:50 -0700
              Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2014-08-27 10:12 +0200
                Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Twirlip2 <ahrodg@googlemail.com> - 2014-08-27 02:04 -0700

csiph-web