[IPython-dev] [IPython-user] IPython tab-completion behaviour in Linux

Gökhan SEVER gokhansever at gmail.com
Mon Jun 29 12:25:45 EDT 2009


On Mon, Jun 29, 2009 at 9:04 AM, Jeff Kaufman<jeff at alum.swarthmore.edu> wrote:
> G??khan SEVER wrote:
>>
>> See the examples below:
>>
>> [gsever at ccn ~]$ ipython
>>  Logging to /home/gsever/.ipython/2009-06-29.py
>>
>> Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38)
>> Type "copyright", "credits" or "license" for more information.
>>
>> IPython 0.10.bzr.r1174 -- An enhanced Interactive Python.
>> ...
>>
>> In [1]: "".
>> Display all 104 possibilities? (y or n)
>>
>> In [1]: "".s
>> .sage             .serverauth.5593  .subversion
>> .scribus          .ssh
>>
>> In [1]: [].
>> Display all 104 possibilities? (y or n)
>>
>> In [1]: [].sort()
>>
>> In [2]: [].sort?
>> Type:         list
>> Base Class:   <type 'list'>
>> String Form:  []
>> Namespace:    Interactive
>> Length:               0
>> Docstring:
>>     list() -> new list
>>     list(sequence) -> new list initialized from sequence's items
>>
>
> Note that some of this does work for strings:
>
>  In [1]: ''.join?
> Type:           str
> Base Class:     <type 'str'>
> String Form:
> Namespace:      Interactive
> Length:         0
> Docstring:
>    str(object) -> string
>
>    Return a nice string representation of the object.
>    If the argument is a string, the return value is the same object.
>
>  In [2]: "".join?
> Type:           str
> Base Class:     <type 'str'>
> String Form:
> Namespace:      Interactive
> Length:         0
> Docstring:
>    str(object) -> string
>
>    Return a nice string representation of the object.
>    If the argument is a string, the return value is the same object.
>
> And the issues are not limited to empty strings:
>
>  In [3]: "test".<tab>
> .svn/entries    .svn/prop-base  .svn/text-base
> .svn/format     .svn/props      .svn/tmp
>
>  In [3]: "test".svn/
>
> (In this case, .svn is the only dotfile in the curdir)
>
> Spaces change the matter:
>
>  In [4]: "this is a test".<tab>
>
> Does nothing.
>
> The problem has something to do with the interaction of tab completion
> and quote marks, and the current behavior doesn't make much sense.
>
> Jeff
>

I am pinging the devel list, just in case someone might say something
about this issue. If not, I will post a bug at
https://bugs.launchpad.net/ipython/

>From my IPy shell, as also Jeff noted, empty or non-empty objects
cannot list their associated methods and attributes without assigning
them to names.

Some additional information, I use:

Linux ccn 2.6.27.19-170.2.35.fc10.i686.PAE (Fedora 10)
Python 2.5.2
IPython 0.10.bzr.r1174
GNU bash, version 3.2.39

In [1]: [1,2,3].
Display all 104 possibilities? (y or n)

In [1]: {1:'a', 2:'b'}.
Display all 104 possibilities? (y or n)

In [2]: a = {1:'a', 2:'b'}

In [3]: a.
a.__class__         a.__le__            a.get
a.__cmp__           a.__len__           a.has_key
a.__contains__      a.__lt__            a.items
a.__delattr__       a.__ne__            a.iteritems
a.__delitem__       a.__new__           a.iterkeys
a.__doc__           a.__reduce__        a.itervalues
a.__eq__            a.__reduce_ex__     a.keys
a.__ge__            a.__repr__          a.pop
a.__getattribute__  a.__setattr__       a.popitem
a.__getitem__       a.__setitem__       a.setdefault
a.__gt__            a.__str__           a.update
a.__hash__          a.clear             a.values
a.__init__          a.copy
a.__iter__          a.fromkeys



More information about the IPython-dev mailing list