-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-12707: deprecate info(), geturl(), getcode() methods in favor of headers, url, and status properties for HTTPResponse and addinfourl #11447
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
Changes from 1 commit
18a7eac
2e93da4
2db7e1f
beadb34
2a16f9b
f07f456
5640148
51cd8ad
c199098
58ced25
13d373f
357c8b4
b99fb9f
1cf719c
2c3a63f
c57eb8c
2174ea5
47f1656
10d4720
1a36dfc
c0e78bc
febc206
73a5a9a
1f8b27b
ac31a4a
c9e8110
61385d8
2ee88dd
d7575f0
628c2f0
5f5b2f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1571,16 +1571,16 @@ The typical response object is a :class:`urllib.response.addinfourl` instance: | |||||
|
||||||
.. attribute:: addinfourl.status | ||||||
|
||||||
Status code returned by server. Recommended to use *addinfourl.status* instead. | ||||||
Status code returned by server. Recommended to use :attr:`~addinfourl.status` instead. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ha this is recursive! Was probably copied from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, that was a typo. Added a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
.. method:: addinfourl.geturl() | ||||||
|
||||||
Returns the URL of the resource retrieved. Recommended to use *addinfourl.url* instead. | ||||||
Returns the URL of the resource retrieved. Recommended to use :attr:`~addinfourl.status` instead. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think of:
Suggested change
|
||||||
|
||||||
.. method:: addinfourl.info() | ||||||
|
||||||
Returns the response headers. Recommended to use *addinfourl.headers* instead. | ||||||
Returns the response headers. Recommended to use :attr:`~addinfourl.status` instead. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. headers not status! |
||||||
|
||||||
.. method:: addinfourl.getstatus() | ||||||
|
||||||
Returns the status. Recommended to use *addinfourl.status* instead. | ||||||
Returns the status. Recommended to use :attr:`~addinfourl.status` instead. |
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 this could be condensed to:
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.
Is that okay to call it "deprecated" even when it doesn't return any DeprecationWarnings when used?
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.
Yes, we name that «doc-deprecated», it’s a useful degree of deprecation.
(i.e. don’t break code that is fine, don’t annoy with warnings, just recommend the obvious way to do it in docs for people who want that)
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.
Okay, I've went ahead and called it "deprecated" in the documentation. How do you keep track of which things mentioned in the documentation are deprecated and which are doc-deprecated?