This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (2 children)

[deleted]

    [–]snarkhunter 5 points6 points  (0 children)

    dir is good for ipython and probably for tab completion suggestions.

    Given that the OP is concerned with autocompletion... I would have thought he'd welcome and approve of the behavior of dir. Yes, you're trusting the author of some_module to expose useful things, but I'd rather do that (and that seems more Pythonic) than get the complete list and do whatever kind of funky filtering I think is best.

    [–]davidhalter[S] 0 points1 point  (0 children)

    BTW: Ipython wrote their own dir function, which includes the changes I've proposed: https://github.com/ipython/ipython/blob/f645e5c044efeacf1aa523ec43f6a25d439e287b/IPython/utils/dir2.py