5 ms·
See(), an alternative to Python's dir()
- timf 18y agoInstalled, 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.
- mjtokelly 18y ago"Help us out here, Computer. This just will not cut it. Blimey!" I enjoyed their documentation style.
- illumen 18y agoIf you like this, you'll love ipython. Ipython makes introspection 3.14 times more fun.
- mattj 18y agoehh, 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.
- inky 18y agoThis 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".
- meqif 18y agoIn 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 http://aur.archlinux.org/packages.php?ID=24014
- abecedarius 18y agoNice 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/69d2b1c084ab3fc7c72d1809e511661e2677d995/columnize.py http://github.com/darius/columnize/blob/69d2b1c084ab3fc7c72d...