laike9m / pdir2

Pretty dir() printing with joy:beer:
MIT License
1.32k stars 47 forks source link

Better way to get oneline doc #63

Closed iamgodot closed 2 years ago

iamgodot commented 2 years ago

The current approach is to pick first item from splitted doc, which is not applicable since many docstrings break first line without finishing the sentence(or overcovering it). This makes the doc part of pdir's output hard to follow.

This is what I get from pdir(requests.Response):

...

function:
    __nonzero__: Returns True if :attr:`status_code` is less than 400.
    close: Releases the connection back to the pool. Once this method has been
    iter_content: Iterates over the response data.  When stream=True is set on the
    iter_lines: Iterates over the response data, one line at a time.  When
    json: Returns the json-encoded content of a response, if any.
    raise_for_status: Raises :class:`HTTPError`, if one occurred.

Maybe it's time to find another way, e.g. parsing by looking for the first dot. Or just use the whole content, but with better formatting.

laike9m commented 2 years ago

Yeah, I think that's good idea.

iamgodot commented 2 years ago

@laike9m Pull request for this.