Re:Show HN: Wat – Deep inspection of Python objects
by alkh on Thursday July 25, 2024 @03:37PM
(#41072519)
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
[ Parent
| on HN ]
Re:Show HN: Wat – Deep inspection of Python objects
by fuzztester on Thursday July 25, 2024 @04:07PM
(#41072812)
and the dir() built-in Python function.
Re:Show HN: Wat – Deep inspection of Python objects
by guruparan18 on Thursday July 25, 2024 @04:37PM
(#41073113)
Also most advanced IDE's do this better and lot more to troubleshoot/debug.
Re:Show HN: Wat – Deep inspection of Python objects
by igrek51 on Thursday July 25, 2024 @06:11PM
(#41073921)
You'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.
Re:Show HN: Wat – Deep inspection of Python objects
by fuzztester on Friday July 26, 2024 @12:59AM
(#41075880)
even just
print(name.__doc__)
works for many kinds of names in Python.
Re:Show HN: Wat – Deep inspection of Python objects
by orbisvicis on Thursday July 25, 2024 @08:40PM
(#41074933)
And vars().