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


Groups > comp.lang.python > #87574

Re: Auto-completion: why not module name?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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.048
X-Spam-Evidence '*H*': 0.90; '*S*': 0.00; 'subject:not': 0.03; 'imported': 0.09; 'subject:module': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '.py': 0.16; 'expecting': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'other)': 0.16; 'statement.': 0.16; 'tab': 0.16; 'think.': 0.16; 'wrote:': 0.18; 'module': 0.19; 'command': 0.22; 'input': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'instance,': 0.24; 'math': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'feature': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; '>>>>': 0.31; 'apparently': 0.31; 'disabled': 0.31; 'facility': 0.31; 'request,': 0.31; 'search.': 0.31; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'disk': 0.36; 'ubuntu': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'expected': 0.38; 'rather': 0.38; 'embedded': 0.39; 'even': 0.60; 'entire': 0.61; "you're": 0.61; 'complete': 0.62; 'talking': 0.65; 'within': 0.65; 'here': 0.66; 'mar': 0.68; 'default': 0.69; 'special': 0.74; '2015': 0.84; '3.4': 0.84; 'cost).': 0.84; 'costly': 0.84; 'request:': 0.91; 'to:none': 0.92; '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:date:message-id:subject:from:cc :content-type; bh=7I/Xth+VaOFm7TutvfYc6Kc4kRNnqIt2mSHpK7sSuIA=; b=pYbNpKVKvAmm3NqRtn+Hd0v0fF5f4IRFiXnwJ2LUQChAatmmq1HkOiScJ1GgKechBt YGFDo+bk0xoaOmVsZM0geO0kvCGaANjqTH30nheS6CwiU5QIve224jP5BOxM+oki5mYN URWN4QOch5grPHCVdBPsBqLUPb4noRLmpIuHS2w09NoD9f9IO+FbqlTxNDWimfejKfYA Mx1dWKO1hBpc9U9DO3t/q7CnL7vtJLP/9gPbVoYiv3zR65no8L68sCXUWx9+LGladLLV Pf4GQNqrJWBkT/ZTi8j8U8hftYy6ZejKtTqB87YI6JJiqZbawWZa3RkUewyWf72/1dgu 2itA==
MIME-Version 1.0
X-Received by 10.107.160.212 with SMTP id j203mr112514102ioe.43.1426524032929; Mon, 16 Mar 2015 09:40:32 -0700 (PDT)
In-Reply-To <18705a55-6b0a-4b55-99ab-479c19566e1a@googlegroups.com>
References <18705a55-6b0a-4b55-99ab-479c19566e1a@googlegroups.com>
Date Tue, 17 Mar 2015 03:40:32 +1100
Subject Re: Auto-completion: why not module name?
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.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.451.1426524036.21433.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1426524036 news.xs4all.nl 2891 [2001:888:2000:d::a6]:38307
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:87574

Show key headers only | View raw


On Tue, Mar 17, 2015 at 3:23 AM, candide <c.candide@laposte.net> wrote:
> Python 3.4 provides auto-completion facility within a Python console embedded in a command line terminal.
>
>
> But apparently this facility doesn't allow the user to complete with standard module name. For instance, editing the following :
>
>>>> import ma
>
> and hitting the TAB key doesn't generate
>
> math
>
> as I was expecting but the following strings :
>
> map( max(
>
> [tested on Ubuntu 12.10]
>
> Is it the expected behaviour ?

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.

It might even already be available, but disabled by default (because
of that cost). But someone other than me will be better placed to
answer that.

ChrisA

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