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


Groups > comp.lang.python > #87576

Re: Auto-completion: why not module name?

References <18705a55-6b0a-4b55-99ab-479c19566e1a@googlegroups.com> <CAPTjJmr3j5Xsf5fB8VipKK+YnL_mH9qWWbr3LNMThw7T_aG47g@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2015-03-16 10:57 -0600
Subject Re: Auto-completion: why not module name?
Newsgroups comp.lang.python
Message-ID <mailman.454.1426525083.21433.python-list@python.org> (permalink)

Show all headers | 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