ipython/ipython — pull request #1497 by drtimcouper (2012-03-15 16:18:01+00:00)
Title: __all__ functionality added to dir2(obj)

I spoke to Fernando at PyCon about adding the __all__ functionality to give consistent views of modules and classes in code and ipython. Here's the simple mod, with tests for dir2. Original tests also showed dir2(x) returns duplicates in even the simple class case, so I've used sets in a manner which should not slow down the processing in the non-__all__ case. Hope this is OK .. well I suppose you can always improve it :-)

Tim