Hacker News new | ask | show | jobs
by anigbrowl 1269 days ago
I don't fully agree with these arguments, but they all have some validity. I really felt his point on the documentation - it's great that it's reference-complete if that's what you're looking for, but it's maddening if you are coming to something to find out what it does.
2 comments

I often find myself typing

  python3
  import some_module
  dir(some_module)
rather than trying to find functionality on the docs sites anymore
Lately i've been using ChatGPT for that instead and it's phenomenal. Previously, I'd just open up my site-packages folder in a dedicated Sublime window and just search the source code for what I wanted to know.
If you haven't already or aren't aware, install IPython, use ipython3 as a replacement REPL and use the '?' or '??' operators to open the docs/definitions of the object you want to inspect.

    ipython3
    import some_module
    some_module?
    # or
    some_module??
You can also type the object's name and hit tab to get a drop-down menu that will list its methods and attributes, like dir() with a better UX. Modules are objects, too.
> If you haven’t already or aren’t aware, install IPython, use ipython3 as a replacement REPL and use the ‘?’ or ‘??’ operators to open the docs/definitions of the object you want to inspect.

you can read the docs in the standard REPL with help(object).

And, of course, IDEs (or editors with decent Python support plugins) will do it on hover.

DevDocs (https://devdocs.io) is a great interface to the existing (content-wise wholly OK) Python docs.