Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from Apr 15, 2012

Conversation

drtimcouper
Copy link
Contributor

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

Signed-off-by: Tim Couper <drtimcouper@gmail.com>
Signed-off-by: Tim Couper <drtimcouper@gmail.com>
… to 0 fix: the doctest to reflect the new limit_to__all__

Signed-off-by: Tim Couper <drtimcouper@gmail.com>
@takluyver
Copy link
Member

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

@fperez
Copy link
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 added a commit that referenced this pull request Apr 15, 2012
Implement new configurable flag to control tab completion on modules that implement the __all__ attribute:

IPCompleter.limit_to__all__= Boolean.
Instruct the completer to use __all__ for the completion
Specifically, when completing on ``object.<tab>``.
When True: only those names in obj.__all__ will be included.
When False [default]: the __all__ attribute is ignored.
@fperez fperez merged commit 47367a0 into ipython:master Apr 15, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Implement new configurable flag to control tab completion on modules that implement the __all__ attribute:

IPCompleter.limit_to__all__= Boolean.
Instruct the completer to use __all__ for the completion
Specifically, when completing on ``object.<tab>``.
When True: only those names in obj.__all__ will be included.
When False [default]: the __all__ attribute is ignored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants