[IPython-dev] wildcard patch

Fernando Perez Fernando.Perez at colorado.edu
Sun Nov 13 03:32:50 CST 2005


Jörgen Stenarson wrote:
> Hi,
> 
> I have discovered a problem with the wildcard functionality.
> 
> As it is written now it will only match attributes in an object that are
> present in its __dict__, and only if there is no __dict__ for the object 
> it builds one by calling dir(object). This means inherited attributes 
> will not be visible for objects with a __dict__. Which means there will 
> be a mismatch between the results you get using dir(object) compared to 
> ?object.*

Thanks for the patch.  I'll apply a slightly modified version, because dir() 
can actually return non-strings on rare occasions (nasty as it is).  The 
tab-completion code in ipython in fact guards against this situation, which 
we've seen in the wild with wrapped C++ code.

In addition, I'll make the behavior of * honor the flags regarding the display 
of _ and __ names in tab completion.  I think that ipython's mechanisms should 
all be consistent in this regard.

Cheers,

f




More information about the IPython-dev mailing list