[IPython-dev] Flat is better than nested

Aaron Meurer asmeurer at gmail.com
Mon May 20 17:23:37 EDT 2013


It doesn't seem to work. I have a file with __all__ defined, but doing
"from file import <TAB>" still lists all the names in that file.

Aaron Meurer

On Mon, May 20, 2013 at 3:13 PM, Thomas Kluyver <takowl at gmail.com> wrote:
>
> On 20 May 2013 18:11, Aaron Meurer <asmeurer at gmail.com> wrote:
>>
>> On a somewhat unrelated note, if __all__ is supposed to represent
>> those things in a module that are public API, would it make sense for
>> IPython's tab completer to respect this, so that
>>
>> from module import <TAB>
>>
>> only showed those things in module.__all__, if module.__all__ is
>> defined?  To me, that would go a long way to solidifying this
>> definition of __all__ in people's minds, or at least people like me
>> who use IPython to prototype code that uses library code.
>
>
> There's an option for this (c.IPCompleter.limit_to__all__), but it defaults
> to False - I think the rationale is that you may want to use 'from foo
> import bar' to explicitly import something that isn't included in __all__.
>
> Thomas
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



More information about the IPython-dev mailing list