-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-101536: [docs] Improve attributes of urllib.error.HTTPError
#101612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Doc/library/urllib.error.rst
Outdated
.. attribute:: url | ||
|
||
Contains the request URL. | ||
Is an alias for *filename* attribute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe more concisely, the 'Is' can be dropped here and below? Not sure which style's better though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a native speaker, so I am fine with any decision, which sounds better :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not English native speaker either, but "Alias for ..." sounds better to me.
My 2 cents: it seems like the shorter property names should be discouraged: the variable names are more cryptic to read in code and might confuse developers/laypeople who don’t know what the shorthand means. |
Yes, this exactly what I was thinking. That's why I went with the longer and more semantic names in the docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Thanks for this work. I added a minor detail here.
Regarding your questions, we need to document everything that is public. I like the approach you took of listing first the "good names", declaring the others as aliases.
Doc/library/urllib.error.rst
Outdated
|
||
.. versionadded:: 3.4 | ||
|
||
.. attribute:: fp | ||
|
||
A file-like object with the HTTP error body. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file like object does not have the body, you can read from it. I'd write something like "A file-like object where the HTTP error body can be read from."
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again Thanks everyone! |
Thanks for making the requested changes! @facundobatista: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful, thanks!
Thank you so very much everyone!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. :) LGTM.
There are several tricky parts:
url
andfilename
,hdrs
andheaders
,code
andstatus
,msg
and readonlyreason
. Which ones should we document? My idea was that we should try to stick to the same names we use in constructor. But, with some exceptions. For example:filename
does not make much sense here: I changed it to beurl
. And the same withmsg
andhdrs
: I usereason
andheaders
msg
andreason
are the same thingCC @facundobatista @orsenthil