classification
Title: rlcompleter add "(" to callables feature
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: facundobatista Nosy List: dieresys, facundobatista, georg.brandl, gpolo, pitrou, rnd0110
Priority: normal Keywords: easy, patch

Created on 2001-08-08 18:04 by rnd0110, last changed 2008-07-17 20:42 by pitrou. This issue is now closed.

Files
File name Uploaded Description Edit
rlcompleter.diff rnd0110, 2001-08-08 18:47 patch to rlcompleter which does almost as described
rlcompleter.py rnd0110, 2006-11-09 07:53 rlcompleter.py which does it for Python2.5
rlcompleter2.6.diff dieresys, 2008-06-24 18:42 rlcompleter adds "(" to callables in 2.6 and documentation
Messages (13)
msg53224 - (view) Author: Roman Suzi (rnd0110) Date: 2001-08-08 18:04
I use rlcompleter extensively in interactive Python
mode.
I think it could be cool if callable objects were added
"("
when completed. This way it will be much faster to 
program, without looking-up __doc__. For example:

>>> f.fil<TAB>
will give:
>>> f.fileno(_
("_" is to mark cursor position)
and:

>>> f.so<TAB>
will (as before) give:
>>> f.softspace _

msg53225 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-07-17 13:15
Logged In: YES 
user_id=1188172

Any comments on this one? Sounds reasonable to me.
msg53226 - (view) Author: Roman Suzi (rnd0110) Date: 2006-11-09 06:58
Logged In: YES 
user_id=287815

Perhaps one needs to propose a patch. Otherwise it will not
advance...
msg53227 - (view) Author: Roman Suzi (rnd0110) Date: 2006-11-09 07:01
Logged In: YES 
user_id=287815

Wow! The patch is here! Why isn't is accepted into the
distribution???
msg53228 - (view) Author: Roman Suzi (rnd0110) Date: 2006-11-09 07:57
Logged In: YES 
user_id=287815

One more illustration:

>>> f = open("myfile", "w")
>>> f.
f.__class__(         f.__repr__(          f.next(
f.__delattr__(       f.__setattr__(       f.read(
f.__doc__            f.__str__(           f.readinto(
f.__enter__(         f.close(             f.readline(
f.__exit__(          f.closed             f.readlines(
f.__getattribute__(  f.encoding           f.seek(
f.__hash__(          f.fileno(            f.softspace
f.__init__(          f.flush(             f.tell(
f.__iter__(          f.isatty(            f.truncate(
f.__new__(           f.mode               f.write(
f.__reduce__(        f.name               f.writelines(
f.__reduce_ex__(     f.newlines           f.xreadlines(
>>> f.


- nice to remember which attributes are methods and which
aren't.
msg68547 - (view) Author: Manuel Muradás (dieresys) Date: 2008-06-21 21:15
Here is a new patch against 2.6.
msg68646 - (view) Author: Manuel Muradás (dieresys) Date: 2008-06-23 20:29
I have also updated the rlcompleter documentation. Here is the complete
patch.
rlcompleterAndDoc2.6.diff
msg68695 - (view) Author: Roman Suzi (rnd0110) Date: 2008-06-24 17:35
Thanks for the patch!

However, I do not understand if it ever gets included into Python or
remains always for those who find it? (I do not believe this small
change is somehow PEPable, but how it gets included then?)
msg68696 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-06-24 17:56
This is nearly good. 
But I have some notes: you don't need to import operator here, just use
the built-in callable; stick to <80 columns; leave a space after a comma.
msg68697 - (view) Author: Manuel Muradás (dieresys) Date: 2008-06-24 18:42
Guilherme,
Thanks a lot for taking some time to review my patch.
Here is a new version.

Please take another look and tell me what do you think about it.
Thanks again
msg68698 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-06-24 18:53
On Tue, Jun 24, 2008 at 3:42 PM, Manuel Muradás <report@bugs.python.org> wrote:
>
> Manuel Muradás <mmuradas@dieresys.com.ar> added the comment:
>
> Guilherme,
> Thanks a lot for taking some time to review my patch.
> Here is a new version.
>
> Please take another look and tell me what do you think about it.
> Thanks again

That is good to be applied now.

>
> Added file: http://bugs.python.org/file10721/rlcompleter2.6.diff
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue449227>
> _______________________________________
>
msg69107 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-07-02 16:53
Fixed in 64664.

Thank you everybody!
msg69906 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-07-17 20:42
This issue caused a regression in #3396.
History
Date User Action Args
2008-07-17 20:42:35pitrousetnosy: + pitrou
messages: + msg69906
2008-07-02 16:53:46facundobatistasetstatus: open -> closed
resolution: fixed
messages: + msg69107
2008-06-24 18:53:07gpolosetmessages: + msg68698
2008-06-24 18:43:07dieresyssetfiles: - rlcompleterAndDoc2.6.diff
2008-06-24 18:42:43dieresyssetfiles: + rlcompleter2.6.diff
messages: + msg68697
2008-06-24 17:56:30gpolosetnosy: + gpolo
messages: + msg68696
2008-06-24 17:35:40rnd0110setmessages: + msg68695
2008-06-24 04:33:49dieresyssetfiles: - rlcompleter2.6.diff
2008-06-23 23:08:16facundobatistasetassignee: facundobatista
2008-06-23 20:29:49dieresyssetfiles: + rlcompleterAndDoc2.6.diff
nosy: + facundobatista
messages: + msg68646
2008-06-21 21:15:15dieresyssetfiles: + rlcompleter2.6.diff
nosy: + dieresys
messages: + msg68547
2008-02-19 23:14:59akuchlingsetkeywords: + easy
2008-02-19 23:14:13akuchlingsetkeywords: + patch
2001-08-08 18:04:32rnd0110create