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


Groups > comp.lang.python > #87576

Re: Auto-completion: why not module name?

Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'subject:not': 0.03; '16,': 0.03; 'completeness': 0.07; 'imported': 0.09; 'subject:module': 0.09; 'api': 0.11; 'python': 0.11; '.py': 0.16; 'finder': 0.16; 'finders': 0.16; 'foo.': 0.16; 'other)': 0.16; 'statement.': 0.16; 'think.': 0.16; 'wrote:': 0.18; 'module': 0.19; 'packages.': 0.19; 'input': 0.22; 'import': 0.22; 'issue.': 0.22; 'network,': 0.22; 'mon,': 0.24; 'looks': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'feature': 0.29; 'am,': 0.29; 'generally': 0.29; 'message-id:@mail.gmail.com': 0.30; 'request,': 0.31; 'search.': 0.31; 'file': 0.32; 'another': 0.32; 'could': 0.34; "can't": 0.35; 'requirement': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'disk': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'entire': 0.61; "you're": 0.61; "you've": 0.63; 'talking': 0.65; 'here': 0.66; 'mar': 0.68; 'difficulty': 0.68; 'special': 0.74; '2015': 0.84; 'costly': 0.84; 'request:': 0.91; 'subject:Auto': 0.93
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:to :content-type; bh=v992ySqwv12y4r7sAwXa6a1hpzZ8Kiv9UuLrChzB8po=; b=TqeBX7kc/hJ+p0/+ojrtuhoKYwiZ07jR5EyVjWntUvM50lEhCARqwiV/piTtXvWspF +XReu1NtDmxuNin/jMjSajs4bdCP+pJG54eadI+WhE9oW7vbSQaAp5CFcFGspq6eqlgS uB0JrGyXtOz3it+qV1SGi/yMKuhYamhqXor+tALNGtdRV8jKen2REKh6AeFU0X4ptL2l WVifHqGIzfXJPz5RYsctikrTOVjC2R+yw5YlU2BGmfL7OHGoxIkZO1F4WmgAhydwluXA I9xCwH3LuNF1R3rlnKbeRIeG2buGjzTkI4xrPy2mNAjHFIziPtjOS8NKw0t+++XOwyMN fjHw==
X-Received by 10.66.136.48 with SMTP id px16mr103408263pab.89.1426525080585; Mon, 16 Mar 2015 09:58:00 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <CAPTjJmr3j5Xsf5fB8VipKK+YnL_mH9qWWbr3LNMThw7T_aG47g@mail.gmail.com>
References <18705a55-6b0a-4b55-99ab-479c19566e1a@googlegroups.com> <CAPTjJmr3j5Xsf5fB8VipKK+YnL_mH9qWWbr3LNMThw7T_aG47g@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Mon, 16 Mar 2015 10:57:20 -0600
Subject Re: Auto-completion: why not module name?
To Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.19
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.454.1426525083.21433.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1426525083 news.xs4all.nl 2892 [2001:888:2000:d::a6]:46682
X-Complaints-To abuse@xs4all.nl
Path csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Xref csiph.com comp.lang.python:87576

Show key headers only | View raw


On Mon, Mar 16, 2015 at 10:40 AM, Chris Angelico <rosuav@gmail.com> wrote:
> Looks to me like it's just doing the normal tab-completion of globals,
> rather than having a special case for the 'import' statement. So what
> you're talking about here is a feature request:
>
> When the input begins "import ", please can tab-completion enumerate
> available modules?
>
> This is a very plausible feature request, but be aware that it will
> involve a very costly disk search. Figuring out what modules could be
> imported means going through the entire Python module search path,
> enumerating .py (and other) files, and that could be a lot slower than
> you think.

Completeness would also be an issue. There is no general requirement
that module finders use the file system at all (one could write a
finder and loader to import modules from the network, for instance),
nor is there any API for enumerating the modules available.

Another difficulty would be packages. You can't generally know whether
foo.bar is a module until you've already imported foo.

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


Thread

Auto-completion: why not module name? candide <c.candide@laposte.net> - 2015-03-16 09:23 -0700
  Re: Auto-completion: why not module name? Chris Angelico <rosuav@gmail.com> - 2015-03-17 03:40 +1100
  Re: Auto-completion: why not module name? Jonas Wielicki <jonas@wielicki.name> - 2015-03-16 17:54 +0100
  Re: Auto-completion: why not module name? Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-16 10:57 -0600
  Re: Auto-completion: why not module name? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-17 19:10 +1100
    Re: Auto-completion: why not module name? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-03-17 12:22 +0000
      Re: Auto-completion: why not module name? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-18 09:54 +1100
  Auto-completion of Unicode names [was why not module name?] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-18 10:29 +1100
    Re: Auto-completion of Unicode names [was why not module name?] Chris Angelico <rosuav@gmail.com> - 2015-03-18 11:06 +1100
    Re: Auto-completion of Unicode names [was why not module name?] Dan Sommers <dan@tombstonezero.net> - 2015-03-18 01:07 +0000

csiph-web