This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urllib.urlopen() return type
Type: enhancement Stage:
Components: Documentation Versions: Python 2.5
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: ThomasH, benjamin.peterson, georg.brandl, orsenthil
Priority: normal Keywords:

Created on 2008-07-22 17:17 by ThomasH, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg70156 - (view) Author: (ThomasH) Date: 2008-07-22 17:17
The file-like object returned by urllib.urlopen() should be documented
like a proper class. The textual description under the urlopen() method
is less approachable and breaks the usual format of a class documentation.

Maybe the return type should be changed to be a httplib.HTTPResponse
object (but that's a separate issue).
msg70159 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-07-22 17:34
I'll let Georg make the final determination about this, but IMO this is
unneeded. File-like objects are so common in Python code, that just
telling what methods are supported should be fine.
msg70870 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2008-08-08 00:04
I agree with Benjamin on this issue, describing what is a "File like Object" is
so much un-needed in Python and especially at urlopen function. Users have been
able to understand and use it properly from a long time.
msg70883 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-08-08 06:43
Agreed.
msg70888 - (view) Author: (ThomasH) Date: 2008-08-08 07:18
On Fri, Aug 8, 2008 at 2:04 AM, Senthil <report@bugs.python.org> wrote:
>
> Senthil <orsenthil@gmail.com> added the comment:
>
> I agree with Benjamin on this issue, describing what is a "File like Object" is
> so much un-needed in Python and especially at urlopen function. Users have been
> able to understand and use it properly from a long time.

If only it were more file-like. But, oh, it adds info() and geturl()
methods which you have to string-search for to find the proper
description in the prose. And, ah, the size argument of the read()
method doesn't quite behave like on other file-like objects, but there
you go. And, uh, by the way, you really can't use it in places "where
a true built-in file object is required" (and I'm sure everybody knows
what that means). - So much for file-like.

I have no doubt that people can get along with the description as it
is, because that's what they always try. My main point was that it is
"less approachable and breaks the usual format of a class
documentation". But I see there is much agreement in keeping the
status quo.
msg70889 - (view) Author: (ThomasH) Date: 2008-08-08 07:39
Georg,

you seem like a dedicated person. I'm sure you guys have thought about
documenting return types of methods and functions in a standardized
way, documenting classes so that you could fade in and out inherited
features, and such. Where do you guys discuss general documentation
issues? Is there a mailing list dedicated to Python documentation?!

On Fri, Aug 8, 2008 at 8:43 AM, Georg Brandl <report@bugs.python.org> wrote:
>
> Georg Brandl <georg@python.org> added the comment:
>
> Agreed.
>
> ----------
> resolution:  -> works for me
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue3429>
> _______________________________________
>
History
Date User Action Args
2022-04-11 14:56:36adminsetgithub: 47679
2008-08-08 07:39:54ThomasHsetmessages: + msg70889
2008-08-08 07:18:20ThomasHsetmessages: + msg70888
2008-08-08 06:43:01georg.brandlsetstatus: open -> closed
resolution: works for me
messages: + msg70883
2008-08-08 00:04:30orsenthilsetnosy: + orsenthil
messages: + msg70870
2008-07-22 17:34:40benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg70159
2008-07-22 17:17:08ThomasHcreate