I’d have to look up the detailed history, but yes, there was a release where tab completion was broken. ROOT.py adds a handler to find ROOT objects that appear lazily. At one point, some of that code was raising a Python exception, breaking the completion silently. So yes, updating would be the ticket, or fixing the local ROOT.py (or just remove the custom handler from there).
o) install lazy ROOT class/variable lookup as appropriate
o) feed gSystem and gInterpreter for display updates
o) add readline completion (if supported by python build)
o) enable some ROOT/CINT style commands
o) handle a few special cases such as gPad, STL, etc.
o) execute rootlogon.py/.C scripts
okay, beats me then; must be an IPython thingy. But this:[quote=“davidsch”] # install the hook
_root.SetRootLazyLookup( caller.dict )[/quote]has nothing to do with the completer and is not even executed in your case. That line will only run in case of “from ROOT import *” and that doesn’t work under IPython (or didn’t last time), b/c IPython will destroy the caller frame and the next time around it will be another.
You’ll find the completer at the beginning of the script, where readline is setup. The class is “RootNameCompleter”, and it is added with this line: readline.set_completer( RootNameCompleter().complete )Dropping that line should do the trick.
Alternatively, if you could add a try/except around the bodies of file_matches, root_global_matches, and attr_matches, and see what exception is raised, we can see if it’s an IPython specific thingy.
It is broken in that a ( shows up after all the methods of the standard python package collections, and the private methods are shown, such as collections.all
It would be nice if a fix for this (leaving tab completion as it was for standard python packages) did not interfere with tab completion for ROOT, I’m sure users will still want to tab complete on ROOT.
if the formatting changed, then that’d be caused by one of these other lines:[code] readline.set_completer_delims(
readline.get_completer_delims().replace( os.sep , ‘’ ) )
readline.parse_and_bind( ‘tab: complete’ )
readline.parse_and_bind( ‘set show-all-if-ambiguous On’ )[/code]
I should make it a configurable option not to setup completion. Still, it’d be nice to figure out what evil IPython is up to in this new version.