__all__ feature, improvement to dir2, and tests for both #1529

Merged
merged 5 commits into from Apr 15, 2012

Projects

None yet

3 participants

@drtimcouper

The 2 patches (relating to __all__ and dir2) are applied, plus the CBool change and a couple of tests to confirm the correct behaviour of complete with, and without, limit_to__all__ being set

@takluyver
Member

N.B. For background, see discussion on PRs #1497 and #1528.

@fperez
Member
fperez commented Apr 15, 2012

I've realized that this feature is potentially a bit dangerous, as modules don't always keep their __all__ too well. For example, numpy doesn't list float in __all__, presumably b/c it's a builtin. But this means that with this new feature on, users could be mislead into thinking that numpy.float isn't a valid dtype identifier, since they would see other similar ones but not float itself.

In any case, since the feature is off by default, it won't bite anyone by accident. Advanced users can decide to activate it and it will be their responsibility to be aware of what happens. Furthermore, since it can be easily toggled at runtime with %config, I'm not too worried.

The implementation looks clean, and with good tests, so I'm merging it (after review and also interactive testing). Many thanks for the contribution and the persistence of going through 3 PRs :) And also thanks @takluyver for your diligent work on it!

@fperez fperez merged commit 47367a0 into ipython:master Apr 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment