Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
See(), an alternative to Python's dir() (github.com/inky)
37 points by ken on Feb 18, 2009 | hide | past | favorite | 11 comments


If you like this, you'll love ipython.

Ipython makes introspection 3.14 times more fun.



ipython rocks with the tab completion, is that what you mean? This is better than ipython's ? and ??.


I use

import readline, rlcompleter; readline.parse_and_bind("tab: complete")

(executed at PYTHONSTARTUP) for tab completion.


Thankyou for this, added to my portable remote node setup.


Installed, I like it. I do a lot of one-off Python with unfamiliar libs and that's just the thing.

Mapped it to der() ... because that just feels better, I guess.


"Help us out here, Computer. This just will not cut it. Blimey!"

I enjoyed their documentation style.


ehh, this is just (questionable) formatting. After you use python for a while, the __methods__ should become pretty common-sensical (and seeing the actual __name__ is more useful if you're trying to reimplement protocols common objects support). That and not being able to manipulate the output of see() makes it pretty useless.

I personally like doing things like [f for f in dir(o) if 'foo' in f] etc.


This was only intended as an alternative, not a replacement -- dir() is still extremely useful. see() was made for quickly inspecting objects interactively, hence "for humans only".


Nice idea. I decided I'd rather see it laid out in columns like 'ls' does, and with the attribute names unchanged. Here's the result: http://github.com/darius/columnize/blob/69d2b1c084ab3fc7c72d...


In case someone else is an Arch Linux user and wants to use this, I uploaded a pkgbuild to AUR.

http://aur.archlinux.org/packages.php?ID=24014




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: