Re: Strange tab completion oddity with enums?

2019-10-08 Thread Peter Otten
Piet van Oostrum wrote: > Chris Angelico writes: > >> I'm not sure what's going on here, and it's probably not actually >> enum-specific, but that's where I saw it. >> >> If you create a plain class and have an attribute with an annotation, >> you can see that: >> > class Foo: >> ... spa

Re: Strange tab completion oddity with enums?

2019-10-07 Thread Piet van Oostrum
Chris Angelico writes: > I'm not sure what's going on here, and it's probably not actually > enum-specific, but that's where I saw it. > > If you create a plain class and have an attribute with an annotation, > you can see that: > class Foo: > ... spam: "ham" = 1 > ... Foo.__a > Foo

Re: Strange tab completion oddity with enums?

2019-10-07 Thread Peter Otten
Chris Angelico wrote: >> Looks like everything starting with an underscore (except class, doc, and >> module) is suppressed, probably to suppress some noise... >> > > That's why dir() shows what it does, but tab completion seems to have > some other source, as

Re: Strange tab completion oddity with enums?

2019-10-07 Thread Chris Angelico
, '__delattr__', '__dict__', '__dir__', > > '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', > > '__gt__', '__hash__', '__init__', '__init_subclass__', '_

Re: Strange tab completion oddity with enums?

2019-10-07 Thread Peter Otten
ct__', '__dir__', > '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', > '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', > '__lt__',

Strange tab completion oddity with enums?

2019-10-06 Thread Chris Angelico
27;__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'spam'] &g

Re: Configuring the REPL's tab completion

2019-03-11 Thread Chris Angelico
a file. Sure, not every quoted string is a file > > name (in fact, very few are), but I don't know of anything else that > > would feel natural. (Also, Pike's REPL behaves this way, so presumably > > it's of use to more people than me.) > > > > Where would I

Re: Configuring the REPL's tab completion

2019-03-11 Thread Thomas Jollans
mably > it's of use to more people than me.) > > Where would I start looking to try to make this happen? Doesn't > necessarily have to be pushed upstream as a core Python feature; I'm > guessing this can probably be done in sitecustomize.py. Anyone have > tutorials

Configuring the REPL's tab completion

2019-03-10 Thread Chris Angelico
I don't know of anything else that would feel natural. (Also, Pike's REPL behaves this way, so presumably it's of use to more people than me.) Where would I start looking to try to make this happen? Doesn't necessarily have to be pushed upstream as a core Python feature; I'm

Re: readline and TAB-completion?

2015-11-25 Thread Ulli Horlacher
Peter Otten <__pete...@web.de> wrote: > > Is there a way to make TAB-completion work for other directories, too? > > Remove "/" from the set of delimiters: > > readline.set_completer_delims( > "".join(c for c in readline.get_completer_del

Re: readline and TAB-completion?

2015-11-25 Thread Peter Otten
Ulli Horlacher wrote: > I need an input function with GNU readline support. So far I have: > > import readline > readline.parse_and_bind("tab: complete") > > file = raw_input('File to send: ') > > > Cursor keys are working, but TAB-c

readline and TAB-completion?

2015-11-24 Thread Ulli Horlacher
I need an input function with GNU readline support. So far I have: import readline readline.parse_and_bind("tab: complete") file = raw_input('File to send: ') Cursor keys are working, but TAB-completion works only in the current directory. Example: Fil

Re: How do I get the currently installed tab completion function?

2015-06-22 Thread Steven D'Aprano
On Tue, 23 Jun 2015 12:02 pm, Chris Angelico wrote: > On Tue, Jun 23, 2015 at 11:41 AM, Steven D'Aprano > wrote: >> On Tue, 23 Jun 2015 11:23 am, Chris Angelico wrote: >> >>> On Tue, Jun 23, 2015 at 11:02 AM, Steven D'Aprano >>> wrote: How do I get the currently installed completer? >>

Re: How do I get the currently installed tab completion function?

2015-06-22 Thread Chris Angelico
On Tue, Jun 23, 2015 at 11:41 AM, Steven D'Aprano wrote: > On Tue, 23 Jun 2015 11:23 am, Chris Angelico wrote: > >> On Tue, Jun 23, 2015 at 11:02 AM, Steven D'Aprano >> wrote: >>> How do I get the currently installed completer? >>> >>> Solutions for any version of Python acceptable, but if they w

Re: How do I get the currently installed tab completion function?

2015-06-22 Thread Steven D'Aprano
On Tue, 23 Jun 2015 11:23 am, Chris Angelico wrote: > On Tue, Jun 23, 2015 at 11:02 AM, Steven D'Aprano > wrote: >> How do I get the currently installed completer? >> >> Solutions for any version of Python acceptable, but if they work all the >> way back to 2.4 or older, even better. > > Whether

Re: How do I get the currently installed tab completion function?

2015-06-22 Thread Chris Angelico
On Tue, Jun 23, 2015 at 11:02 AM, Steven D'Aprano wrote: > How do I get the currently installed completer? > > Solutions for any version of Python acceptable, but if they work all the way > back to 2.4 or older, even better. Whether there's a way to avoid the whole try/finally I can't say, but I

How do I get the currently installed tab completion function?

2015-06-22 Thread Steven D'Aprano
I have two (or more) different types of tab completion, and I want one to apply under certain circumstances, and the other to apply at others. For example, let's say I want one to apply inside a function which uses raw_input (or input in Python 3), and the other to apply the rest of the time

[Announce] tabhistory - tab completion and command history

2014-09-01 Thread Steven D'Aprano
I am happy to announce an upgrade to the tabhistory module, which brings advanced tab completion and command history to Python 2.4 through 3.3 and beyond. Features Tab completion -- * At the beginning of lines, pressing the TAB key indents the line. * Inside

Re: Tab completion in Python3.4

2013-09-30 Thread Steven D'Aprano
On Mon, 30 Sep 2013 08:50:01 +, Antoine Pitrou wrote: > Steven D'Aprano pearwood.info> writes: >> >> I don't consider either of these solutions to be satisfactory. If you >> agree, I urge you to try it out for yourself, and then leave a comment &g

Re: Tab completion in Python3.4

2013-09-30 Thread Antoine Pitrou
Steven D'Aprano pearwood.info> writes: > > I don't consider either of these solutions to be satisfactory. If you > agree, I urge you to try it out for yourself, and then leave a comment on > the bug tracker asking for tab completion to still insert tabs at the > be

Tab completion in Python3.4

2013-09-29 Thread Steven D'Aprano
By default, Python 3.4 will ship with tab completion turned on. When you hit the tab key, Python will try to complete the current function, method, variable or other name, if necessary displaying the alternatives is there are more than one: py> d = {} py> d.pop d.pop( d.popitem(

Re: Tab-completion in tutorial

2012-01-21 Thread Peter Otten
Steven D'Aprano wrote: > I'm reading the part of the tutorial that talks about tab-completion, and > I think the docs are wrong. > > http://docs.python.org/tutorial/interactive.html#key-bindings > > The "more capable startup file" example given claims: &

Tab-completion in tutorial

2012-01-21 Thread Steven D'Aprano
I'm reading the part of the tutorial that talks about tab-completion, and I think the docs are wrong. http://docs.python.org/tutorial/interactive.html#key-bindings The "more capable startup file" example given claims: # Add auto-completion and a stored history file of commands

tab completion

2011-07-21 Thread Chess Club
Could someone help me change the tab completion setting in iPython on a Windows machine? I would like it to cycle through the available completions Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tab completion

2009-04-05 Thread Miles
On Thu, Apr 2, 2009 at 10:59 AM, Steven D'Aprano wrote: > Does anyone use the tab-completion recipe in the docs? > > http://docs.python.org/library/rlcompleter.html#module-rlcompleter > > suggests using this to enable tab-completion: > > try: >    import readline >

pyreadline, InteractiveConsole, and tab completion on Windows

2009-04-03 Thread Thomas Heller
I have installed pyreadline, and get nice tab completion in the normal interactive interpreter: Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. &g

Re: Tab completion

2009-04-02 Thread Steven D'Aprano
On Fri, 03 Apr 2009 13:41:50 +1100, Ben Finney wrote: > Steven D'Aprano writes: > >> I do not wish to type four literal spaces to indent the 'return' line, >> or backspace four times to remove it, but with tab-completion I am >> forced to. I'm used t

Re: Tab completion

2009-04-02 Thread Ben Finney
Steven D'Aprano writes: > I do not wish to type four literal spaces to indent the 'return' > line, or backspace four times to remove it, but with tab-completion > I am forced to. I'm used to pressing the TAB key once to get an > indent. Within the interpreter, I

Re: Tab completion

2009-04-02 Thread Steven D'Aprano
On Fri, 03 Apr 2009 08:51:47 +1100, Ben Finney wrote: > Steven D'Aprano writes: > >> I like tab-completion, but I'd rather not be reduced to typing spaces >> for indents in the interpreter. What do other people do? > > Acknowledge that using U+0009 for indenta

Re: Tab completion

2009-04-02 Thread Robert Kern
On 2009-04-02 09:59, Steven D'Aprano wrote: I like tab-completion, but I'd rather not be reduced to typing spaces for indents in the interpreter. What do other people do? Any other suggestions or hints? I use IPython. The completion is set up (I don't know how) such t

Re: Tab completion

2009-04-02 Thread Ben Finney
Steven D'Aprano writes: > I like tab-completion, but I'd rather not be reduced to typing > spaces for indents in the interpreter. What do other people do? Acknowledge that using U+0009 for indentation is wrong, and use beautiful U+0020 always. > The GNU readline librar

Re: Tab completion

2009-04-02 Thread Chris Jones
On Thu, Apr 02, 2009 at 10:59:29AM EDT, Steven D'Aprano wrote: > Does anyone use the tab-completion recipe in the docs? > > http://docs.python.org/library/rlcompleter.html#module-rlcompleter > > suggests using this to enable tab-completion: > > try: > import

Re: Tab completion

2009-04-02 Thread sjbrown
readline.parse_and_bind('\C-n: complete') Makes it Ctrl-n do the completion, like vim. On Apr 2, 7:59 am, Steven D'Aprano wrote: > Does anyone use the tab-completion recipe in the docs? > > http://docs.python.org/library/rlcompleter.html#module-rlcompleter > > sug

Re: Tab completion

2009-04-02 Thread Chris Rebert
On Thu, Apr 2, 2009 at 7:59 AM, Steven D'Aprano wrote: > Does anyone use the tab-completion recipe in the docs? > > http://docs.python.org/library/rlcompleter.html#module-rlcompleter > > suggests using this to enable tab-completion: > > try: >    import readline >

Tab completion

2009-04-02 Thread Steven D'Aprano
Does anyone use the tab-completion recipe in the docs? http://docs.python.org/library/rlcompleter.html#module-rlcompleter suggests using this to enable tab-completion: try: import readline except ImportError: print "Module readline not available." else: import r

Re: Allow tab completion when inputing filepath?

2008-07-10 Thread Sion Arrowsmith
Keith Hughitt <[EMAIL PROTECTED]> wrote: >> Keith Hughitt wrote: >> > [ ... ] I have >> > found some ways to enable tab completion for program-related commands, >> > but not for system filepaths. >Currently Unix/Console. What's wrong with the rea

Re: Allow tab completion when inputing filepath?

2008-07-10 Thread Tim Golden
Keith Hughitt wrote: On Jul 9, 10:18 am, Tim Golden <[EMAIL PROTECTED]> wrote: Keith Hughitt wrote: I've been looking around on the web for a way to do this, but so far have not come across anything for this particular application. I have found some ways to enable tab completion

Re: Allow tab completion when inputing filepath?

2008-07-09 Thread Keith Hughitt
On Jul 9, 10:18 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Keith Hughitt wrote: > > I've been looking around on the web for a way to do this, but so far > > have not come across anything for this particular application. I have > > found some ways to enable ta

Re: Allow tab completion when inputing filepath?

2008-07-09 Thread Tim Golden
Keith Hughitt wrote: I've been looking around on the web for a way to do this, but so far have not come across anything for this particular application. I have found some ways to enable tab completion for program-related commands, but not for system filepaths. This would be nice to have

Allow tab completion when inputing filepath?

2008-07-09 Thread Keith Hughitt
Hi all, I've been looking around on the web for a way to do this, but so far have not come across anything for this particular application. I have found some ways to enable tab completion for program-related commands, but not for system filepaths. This would be nice to have when promptin

Re: implementing tab completion using python

2008-03-22 Thread Christian Heimes
Siddhant schrieb: > Hi. > How can I implement a tab-completing code using Python? > Like for example, I want to design a simple shell (using Python, of > course), which could support tab completion as well. How do I go about > it? http://docs.python.org/lib/module-rlcompleter.

implementing tab completion using python

2008-03-22 Thread Siddhant
Hi. How can I implement a tab-completing code using Python? Like for example, I want to design a simple shell (using Python, of course), which could support tab completion as well. How do I go about it? Thanks. Siddhant -- http://mail.python.org/mailman/listinfo/python-list

Re: tab completion?

2008-03-04 Thread Siddhant
Yes. Almost what I wanted. Thanks. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: tab completion?

2008-03-04 Thread [EMAIL PROTECTED]
On Mar 4, 10:44 am, Ron DuPlain <[EMAIL PROTECTED]> wrote: > On Mar 4, 10:13 am, Siddhant <[EMAIL PROTECTED]> wrote: > > > Hi people. > > I was just wondering if a tab-completion feature in python command > > line interface would be helpful? > > If ye

Re: tab completion?

2008-03-04 Thread Ron DuPlain
On Mar 4, 10:13 am, Siddhant <[EMAIL PROTECTED]> wrote: > Hi people. > I was just wondering if a tab-completion feature in python command > line interface would be helpful? > If yes, then how can I implement it? > Thanks, > Siddhant ipython provides auto tab completion.

Re: tab completion?

2008-03-04 Thread james . pye
On Mar 4, 8:13 am, Siddhant <[EMAIL PROTECTED]> wrote: > Hi people. > I was just wondering if a tab-completion feature in python command > line interface would be helpful? > If yes, then how can I implement it? > Thanks, > Siddhant Is this what you are looking for? ht

tab completion?

2008-03-04 Thread Siddhant
Hi people. I was just wondering if a tab-completion feature in python command line interface would be helpful? If yes, then how can I implement it? Thanks, Siddhant -- http://mail.python.org/mailman/listinfo/python-list

Re: No tab completion if sys.stdout is redirected

2007-12-19 Thread Bjoern Schliessmann
Dirk Loss wrote: > Bjoern Schliessmann wrote: >> readline module applies its autocompletion functions to (and only >> to) sys.stdout. > > I see. Then I guess I'll have to avoid redirecting sys.stdout and > come up with some kind of workaround instead. Just use a "central" function for printing o

Re: No tab completion if sys.stdout is redirected

2007-12-19 Thread Dirk Loss
Bjoern Schliessmann wrote: > readline module applies its autocompletion functions to (and only > to) sys.stdout. I see. Then I guess I'll have to avoid redirecting sys.stdout and come up with some kind of workaround instead. Nevertheless, thanks for the info. Regards Dirk -- http://mail.python.o

Re: No tab completion if sys.stdout is redirected

2007-12-18 Thread Bjoern Schliessmann
Dirk Loss wrote: > I want to have tab completion in my program for interactive input. > Using readline and rlcompleter this works nicely. But I also have > to catch and modify all "print" output, so I redirect sys.stdout > to a custom file-like object. The problem is: A

No tab completion if sys.stdout is redirected

2007-12-18 Thread Dirk Loss
Hi, I want to have tab completion in my program for interactive input. Using readline and rlcompleter this works nicely. But I also have to catch and modify all "print" output, so I redirect sys.stdout to a custom file-like object. The problem is: After the redirection, readline sup

Re: python-mode tab completion problem

2005-02-03 Thread Fernando Perez
s not really intended to be used as an interactive session with all > sorts of bells and whistles. Or he can use ipython, which with the special ipython.el companion file and a recent (CVS) python-mode, will give him true tab completion (with options listed in an emacs *completions* buffer) for

Re: python-mode tab completion problem

2005-02-03 Thread Skip Montanaro
h all sorts of bells and whistles. If you want a true terminal emulator within Emacs, try M-x terminal-emulator RET You can do tab completion and command recall just like a normal terminal. (In fact, you can run Emacs within Emacs using terminal-emulator.) Skip -- http://mail.python.org/ma

python-mode tab completion problem

2005-02-03 Thread test1dellboy3
Hi, I am exploring python-mode on emacs. When I open foo.py in emacs and hit C-!, it starts the python interpreter in another window. Next, I execute - import rlcompleter, readline readline.parse_and_bind('tab: complete') Now I will test the completion by trying to complete sys.v (which could be