5 ms·
It important to remind everyone that you can already do something similar via the build-in function help(). For example, if I run help({1}) I get the documentat
by alkh 2y ago
It important to remind everyone that you can already do something similar via the build-in function help(). For example, if I run help({1}) I get the documentation for a set, running help(set.add) gives the documentation for the add() method, etc. You can even preview objects that you haven't imported by using strings(ex. running help('numpy.ndarray') will correctly give you the documentation, provided numpy is installed in your current python environment). It's pretty helpful and doesn't require installing anything extra
- fuzztester 2y agoand the dir() built-in Python function.
- guruparan18 2y agoAlso most advanced IDE's do this better and lot more to troubleshoot/debug.
- deleted 2y ago[deleted]
- igrek51 2y agoYou're completely right. `dir()` does the same in terms of functionality. In fact, my tool makes use of `dir` under the hood. I just wanted to make it more readable, and to combine `dir`, `type`, `repr`, `len`, `inspect`, etc. into one easily accessible place.
- fuzztester 2y agoeven just print(name.__doc__) works for many kinds of names in Python.
- orbisvicis 2y agoAnd vars().
- agumonkey 2y agohelp says too much, usually you'd like a quick overview slightly formatted and well classified, which is what wat seems to afford here