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


Groups > comp.lang.python > #75437

Re: Getting a list of all modules

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'importing': 0.05; 'attribute': 0.07; 'context': 0.07; 'subject:Getting': 0.07; "'.'": 0.09; 'builtin': 0.09; 'filename': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:modules': 0.09; 'jan': 0.12; 'builtins': 0.16; 'filenames,': 0.16; 'globals.': 0.16; 'idle.': 0.16; 'listbox': 0.16; 'mode,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'tab': 0.16; 'url:py': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'module': 0.19; 'typing': 0.19; 'help.': 0.21; 'import': 0.22; 'header:User- Agent:1': 0.23; 'recognize': 0.24; 'math': 0.24; '(or': 0.24; 'this:': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'correct': 0.29; 'am,': 0.29; 'url:code': 0.29; 'relative': 0.30; 'subject:list': 0.30; "i'm": 0.30; 'code': 0.31; 'another.': 0.31; 'context.': 0.31; "d'aprano": 0.31; 'names.': 0.31; 'steven': 0.31; 'anyone': 0.31; 'subject:all': 0.32; 'everyone': 0.33; 'url:source': 0.33; 'but': 0.35; 'idle': 0.36; 'next': 0.36; 'thanks': 0.36; "i'll": 0.36; 'should': 0.36; 'too': 0.37; 'starting': 0.37; 'to:addr:python- list': 0.38; 'expect': 0.39; 'received:71': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'days': 0.60; 'even': 0.60; 'above,': 0.60; 'show': 0.63; 'name': 0.63; 'offering': 0.63; 'url:p': 0.64; 'situation': 0.65; 'within': 0.65; 'mailbox': 0.68; 'completion': 0.78; "'from'": 0.84; 'completes': 0.84; 'received:fios.verizon.net': 0.84; 'working,': 0.84; 'worth,': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Getting a list of all modules
Date Thu, 31 Jul 2014 15:59:13 -0400
References <53d8a20e$0$29977$c3e8da3$5496439d@news.astraweb.com> <mailman.12436.1406726547.18130.python-list@python.org> <53da1d5a$0$29974$c3e8da3$5496439d@news.astraweb.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-71-175-90-87.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To <53da1d5a$0$29974$c3e8da3$5496439d@news.astraweb.com>
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.12485.1406836778.18130.python-list@python.org> (permalink)
Lines 41
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1406836778 news.xs4all.nl 2945 [2001:888:2000:d::a6]:53259
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75437

Show key headers only | View raw


On 7/31/2014 6:41 AM, Steven D'Aprano wrote:

> I'm working on tab completion for module names. I have some alpha-quality
> code working, so if I hit TAB after typing "import ma" I get this:
>
>
> py> import ma
> macpath      macurl2path  mailbox      mailcap      mangle
> markupbase   math

This is an interesting idea for Idle. Idle currently completes names 
from builtins and, in interactive mode, the current globals. So in the 
situation above, Idle offers 'map' and 'max' in a listbox with all 
builtins (and globals). But after '.', it completes attribute names 
instead and within strings, filenames, starting from the current 
directory of the user process for relative names.

It should not be too hard to recognize 'import' and 'from' instead of or 
in addition to '.' as context markers.  Even just offering stdlib name 
(or current directory names or . imports) would be a help.  Builtin 
names can never be correct in this context.

> For what it's worth, importing "mangle" fails with a SyntaxError. But
> that's okay, I don't expect tab completion to only show *valid*
> modules :-)
>
> Over the next few days I'll make an official announcement, but if anyone
> wants a sneak-peek, check out:
>
> http://code.google.com/p/tabhistory/source/browse/tabhistory.py
>
>
> where I have indenting, code completion, filename completion, and module
> completion all working to some degree or another.
>
> Thanks to everyone for their help.


-- 
Terry Jan Reedy

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


Thread

Getting a list of all modules Steven D'Aprano <steve@pearwood.info> - 2014-07-30 07:43 +0000
  Re: Getting a list of all modules Chris Angelico <rosuav@gmail.com> - 2014-07-30 18:33 +1000
  Re: Getting a list of all modules Peter Otten <__peter__@web.de> - 2014-07-30 10:46 +0200
  Re: Getting a list of all modules Robert Kern <robert.kern@gmail.com> - 2014-07-30 11:35 +0100
  Re: Getting a list of all modules Leo Jay <python.leojay@gmail.com> - 2014-07-30 21:22 +0800
    Re: Getting a list of all modules Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-31 10:41 +0000
      Re: Getting a list of all modules Roy Smith <roy@panix.com> - 2014-07-31 07:55 -0400
        Re: Getting a list of all modules Chris Angelico <rosuav@gmail.com> - 2014-07-31 23:13 +1000
      Re: Getting a list of all modules Terry Reedy <tjreedy@udel.edu> - 2014-07-31 15:59 -0400
      Re: Getting a list of all modules Robert Kern <robert.kern@gmail.com> - 2014-08-01 14:39 +0100
        Re: Getting a list of all modules Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-01 15:41 +0000
          Re: Getting a list of all modules jonnicoll11@googlemail.com - 2014-08-02 14:13 -0700
            Re: Getting a list of all modules Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-02 22:22 +0100
          Re: Getting a list of all modules Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-03 14:38 +0100
  Re: Getting a list of all modules Chris Angelico <rosuav@gmail.com> - 2014-07-30 23:27 +1000
  Re: Getting a list of all modules wxjmfauth@gmail.com - 2014-07-30 06:42 -0700
  Re: Getting a list of all modules Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-30 08:29 -0600
  Re: Getting a list of all modules Skip Montanaro <skip@pobox.com> - 2014-07-30 09:45 -0500
  Re: Getting a list of all modules Akira Li <4kir4.1i@gmail.com> - 2014-07-31 22:55 +0400
  Bug with help (was Re: Getting a list of all modules) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-31 20:19 +0100
  Re: Bug with help (was Re: Getting a list of all modules) Terry Reedy <tjreedy@udel.edu> - 2014-07-31 16:15 -0400
  Re: Bug with help (was Re: Getting a list of all modules) Akira Li <4kir4.1i@gmail.com> - 2014-08-02 06:17 +0400
    Re: Bug with help (was Re: Getting a list of all modules) Heinz Schmitz <HeinzSchmitz@gmx.net> - 2014-08-02 10:33 +0200
      Re: Bug with help (was Re: Getting a list of all modules) Robert Kern <robert.kern@gmail.com> - 2014-08-02 13:13 +0100
      Re: Bug with help (was Re: Getting a list of all modules) Terry Reedy <tjreedy@udel.edu> - 2014-08-02 14:17 -0400

csiph-web